#!/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 SUBMIT=nbd.tar.gz PKG=nbd VERSION=3.2 SRC=$PKG-$VERSION.tar.bz2 BUILD=build-$PKG-$VERSION.sh WORK=$PKG-work DIR=`dirname $0` ; cd $DIR ; DIR=`pwd` TMP=$DIR/$WORK/tmp 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 glib2-dev 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 $TMP cd $WORK # Extract the TARFILE tar -xvjf ../$SRC # Build the application ( cd $PKG-$VERSION ./configure make sudo DESTDIR=$TMP make install-strip ) sudo rm $PKG.tcz $PKG-doc.tcz sudo mksquashfs $TMP $PKG.tcz -e usr/local/share sudo mksquashfs $TMP $PKG-doc.tcz -e usr/local/bin -e usr/local/sbin # Create md5sum files md5sum $PKG.tcz > $PKG.tcz.md5.txt md5sum $PKG-doc.tcz > $PKG-doc.tcz.md5.txt # Create zsync files zsyncmake $PKG.tcz zsyncmake $PKG-doc.tcz # Create File Lists mkdir mnt for TCZ in $PKG.tcz $PKG-doc.tcz do sudo mount -o loop $TCZ ./mnt ( cd mnt ; find `ls` -not -type d ) > $TCZ.list sudo umount ./mnt done # Create Info Files echo -ne "Title: nbd.tcz Description: Network Block Device server and client TESTING Version: 3.2 Author: Pavel Machek Original-site: http://nbd.sourceforge.net/ Copying-policy: GPL Size: 28K Extension_by: gerald_clark Tags: nbd server client Comments: For help run: nbd-client -h or nbd-server -h don't forget to modprobe nbd Manuals are in nbd-3.2-doc.tcz Change-log: 09/06/12 Original Current: 09/06/12 " > $PKG.tcz.info echo -ne "Title: nbd-doc.tcz Description: Network Block Device server and client manuals TESTING Version: 3.2 Author: Pavel Machek Original-site: http://nbd.sourceforge.net/ Copying-policy: GPL Size: 16K Extension_by: gerald_clark Tags: nbd server client doc Comments: Manuals for nbd-3.2 Change-log: 09/06/12 Original Current: 09/06/12 " > $PKG-doc.tcz.info # Create dep files echo "man.tcz" > $PKG-doc.tcz.dep # Tar everything up tar -cvzf ../$SUBMIT ../$SRC ../$BUILD \ $PKG.tcz $PKG.tcz.info \ $PKG.tcz.list $PKG.tcz.md5.txt $PKG.tcz.zsync \ $PKG-doc.tcz $PKG-doc.tcz.info \ $PKG-doc.tcz.list $PKG-doc.tcz.md5.txt \ $PKG-doc.tcz.dep $PKG-doc.tcz.zsync # Encrypt it for transfer #bcrypt $SUBMIT