2006-01-23 13:22:06 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2006-02-16 16:43:37 +01:00
|
|
|
PI=.postinstall
|
|
|
|
|
2006-01-23 13:22:06 +01:00
|
|
|
set -e
|
|
|
|
|
2006-02-02 18:12:16 +01:00
|
|
|
# No trailing slashes in the directory, because we want to base the
|
|
|
|
# package filename on it.
|
|
|
|
dir=`echo "$1" | sed 's/\/*$//'`
|
2006-01-23 13:22:06 +01:00
|
|
|
|
2006-02-02 18:12:16 +01:00
|
|
|
if [ $# -ne 2 ]
|
|
|
|
then echo "Usage: $0 sourcedir packagedir"
|
2006-01-27 14:57:18 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-01-23 13:22:06 +01:00
|
|
|
if [ ! -d "$dir" ]
|
|
|
|
then echo "Error: $dir isn't a directory."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
here=`pwd`
|
|
|
|
srcdir=$here/$dir
|
|
|
|
packagestart=$srcdir/now
|
|
|
|
findlist=$srcdir/findlist
|
|
|
|
tarfile=${dir}.tar
|
|
|
|
tar=$srcdir/$tarfile
|
2006-02-02 18:12:16 +01:00
|
|
|
tarbz=$tar.bz
|
|
|
|
pdir="$2"
|
2006-01-23 13:22:06 +01:00
|
|
|
|
2006-02-02 18:12:16 +01:00
|
|
|
mkdir $pdir 2>/dev/null || true
|
2006-01-23 13:22:06 +01:00
|
|
|
binsizes big
|
|
|
|
touch $packagestart
|
|
|
|
sleep 1
|
|
|
|
cd $dir
|
2006-01-27 14:57:18 +01:00
|
|
|
|
|
|
|
if [ ! -f build ]
|
|
|
|
then echo "Error: No build script in $dir."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-02-02 18:12:16 +01:00
|
|
|
sh -e build
|
|
|
|
echo " * Building package"
|
2006-02-20 17:00:24 +01:00
|
|
|
( if [ -f $PI ]; then echo $PI; fi; find / -cnewer $packagestart | egrep -v "^($srcdir|/(dev|tmp)|/usr/(tmp|log|adm|run|src)|/etc/utmp|/var/run)" ) | pax -w -d | bzip2 >$tarbz
|
2006-01-23 13:22:06 +01:00
|
|
|
rm -f $packagestart $findlist $tarcmd
|
|
|
|
binsizes normal
|
2006-02-02 18:12:16 +01:00
|
|
|
mv $tarbz $here/$pdir
|
2006-01-23 13:22:06 +01:00
|
|
|
exit 0
|