Rev | Line | |
---|
[9] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | PI=.postinstall
|
---|
| 4 | INFO=.minixpackage
|
---|
| 5 |
|
---|
| 6 | set -e
|
---|
| 7 |
|
---|
| 8 | # No trailing slashes in the directory, because we want to base the
|
---|
| 9 | # package filename on it.
|
---|
| 10 | dir=`echo "$1" | sed 's/\/*$//'`
|
---|
| 11 |
|
---|
| 12 | if [ $# -ne 2 ]
|
---|
| 13 | then echo "Usage: $0 sourcedir packagedir"
|
---|
| 14 | exit 1
|
---|
| 15 | fi
|
---|
| 16 |
|
---|
| 17 | if [ ! -d "$dir" ]
|
---|
| 18 | then echo "Error: $dir isn't a directory."
|
---|
| 19 | exit 1
|
---|
| 20 | fi
|
---|
| 21 |
|
---|
| 22 | here=`pwd`
|
---|
| 23 |
|
---|
| 24 | case "$dir" in
|
---|
| 25 | /*) srcdir="$dir" ;;
|
---|
| 26 | *) srcdir="$here/$dir" ;;
|
---|
| 27 | esac
|
---|
| 28 |
|
---|
| 29 | case $2 in
|
---|
| 30 | /*) pdir="$2" ;;
|
---|
| 31 | *) pdir="$here/$2" ;;
|
---|
| 32 | esac
|
---|
| 33 |
|
---|
| 34 | packagestart=$srcdir/now
|
---|
| 35 | findlist=$srcdir/findlist
|
---|
| 36 | tar=$srcdir/"`basename ${dir}`".tar
|
---|
| 37 | tarbz=$tar.bz2
|
---|
| 38 |
|
---|
| 39 | mkdir $pdir 2>/dev/null || true
|
---|
| 40 | binsizes=big
|
---|
| 41 | rc=$dir/.binpackage
|
---|
| 42 | if [ -f $rc ]
|
---|
| 43 | then . $rc
|
---|
| 44 | fi
|
---|
| 45 | binsizes $binsizes
|
---|
| 46 | touch $packagestart
|
---|
| 47 | sleep 1
|
---|
| 48 | cd $dir
|
---|
| 49 |
|
---|
| 50 | if [ ! -f build -a ! -f build.minix ]
|
---|
| 51 | then echo "Error: No build or build.minix script in $dir."
|
---|
| 52 | exit 1
|
---|
| 53 | fi
|
---|
| 54 |
|
---|
| 55 | if [ -f build.minix ]
|
---|
| 56 | then sh -e build.minix
|
---|
| 57 | else sh -e build
|
---|
| 58 | fi
|
---|
| 59 |
|
---|
| 60 | echo " * Building package"
|
---|
| 61 | echo "Minix package $dir built `date`." >$INFO
|
---|
| 62 | ( echo $INFO ; if [ -f $PI ]; then echo $PI; fi; find / -cnewer $packagestart | egrep -v "^($srcdir|/(dev|tmp)|/usr/(tmp|log|adm|run)|/etc/utmp|/var/run)" ) | pax -w -d | bzip2 >$tarbz
|
---|
| 63 | rm -f $packagestart $findlist $tarcmd
|
---|
| 64 | binsizes normal
|
---|
| 65 | mv $tarbz $pdir
|
---|
| 66 | exit 0
|
---|
Note:
See
TracBrowser
for help on using the repository browser.