#!/bin/sh # # Put the $BUILD script and the $SRC archive in a working directory # and run the script # # Define the SRC file and work directory for building the extension PKG=vblade VERSION=1 SRC=$PKG-$VERSION.tar.gz SUBMIT=$PKG.tar.gz BUILD=build-$PKG-$VERSION.sh WORK=$PKG-work DIR=`dirname $0` ; cd $DIR ; DIR=`pwd` TMP=$DIR/$WORK/tmp BINDIR=$TMP/usr/local/bin/ export CFLAGS="-march=i486 -mtune=i686 -Os -pipe" export CXXFLAGS="-march=i486 -mtune=i686 -Os -pipe" export LDFLAGS="-Wl,-O1" # Load the necessary tools - make sure you have downloaded them. for PROG in compiletc squashfs-tools-4.x zsync do tce-load -i $PROG || tce-load -w $PROG && tce-load -i $PROG || exit done # Make work directory sudo rm -rf $WORK ; mkdir -p $WORK # cp $BUILD $SRC $WORK cd $WORK # Extract the TARFILE and patch tar -xvzf ../$SRC sed -i "s/ETH_P_EDP2/ETH_P_AOE/" $PKG-$VERSION/linux.c # Build it ( cd $PKG-$VERSION ; ./configure ; make clean vblade ; strip vblade ) # Build work directories mkdir -p $BINDIR ; cp $PKG-$VERSION/vb* $BINDIR # Create extension sudo mksquashfs $TMP $PKG.tcz # Create md5sum file md5sum $PKG.tcz > $PKG.tcz.md5.txt # Create zcync file zsyncmake $PKG.tcz # Create file list mkdir mnt sudo mount -o loop $PKG.tcz ./mnt ( cd mnt ; find `ls` -not -type d ) > $PKG.tcz.list sudo umount ./mnt # Create Info Files echo -ne "Title: vblade.tcz Description: ATA over Ethernet server Version: Alpha Author: Free Software Foundation Original-site: http://sourceforge.net/projects/aoetools/files/vblade/01/vblade-1.tar.gz Copying-policy: GPL Size: 8K Extension_by: gerald_clark Tags: AOE ATAOE server vblade Comments: To start server: /usr/local/bin/vblade Ex: /usr/local/bin/vblade 2 3 eth0 /dev/sdb3 Change-log: 09/06/12 Original Current: 09/06/12 " > $PKG.tcz.info # Tar everything up tar -cvzf ../$SUBMIT ../$BUILD ../$SRC \ $PKG.tcz $PKG.tcz.info $PKG.tcz.list $PKG.tcz.md5.txt $PKG.tcz.zsync # Encrypt it for transfer #bcrypt $SUBMIT