source: trunk/minix/commands/scripts/binpackage.sh@ 21

Last change on this file since 21 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

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