diff options
author | Nathan Scott <nathans@sgi.com> | 2001-01-15 03:18:30 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2001-01-15 03:18:30 +0000 |
commit | 02f43564629f54847c04cc32f77cb1b6ba3b89c2 (patch) | |
tree | ae1217c94a5d2659dcf985e1385941e20ef2f60f /Makepkgs | |
parent | 82129da6af3a2cddad3334623cfe415058036e4c (diff) | |
download | attr-02f43564629f54847c04cc32f77cb1b6ba3b89c2.tar.gz |
initial version for reworked extended attributes build environment.
Diffstat (limited to 'Makepkgs')
-rwxr-xr-x | Makepkgs | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/Makepkgs b/Makepkgs new file mode 100755 index 0000000..9f7bfa1 --- /dev/null +++ b/Makepkgs @@ -0,0 +1,110 @@ +#! /bin/sh +# +# Make whichever packages the system supports +# +LOGDIR=Logs + +clean=false +debian=false +verbose=false + +MAKE=${MAKE:-make} +test ! -z "$MAKE" && make=$MAKE + +for opt in $* +do + case "$opt" in + clean) + clean=true + ;; + debian) + debian=true + ;; + verbose) + verbose=true + ;; + *) + echo "Usage: Makepkgs [clean] [verbose] [debian]" + exit 1 + ;; + esac +done + +# start with a clean manifest +test -f files.rpm && rm -f files.rpm +test -f filesdevel.rpm && rm -f filesdevel.rpm + +test ! -d $LOGDIR && mkdir $LOGDIR +rm -rf $LOGDIR/* > /dev/null 2>&1 + +if $clean ; then + echo "== clean, log is $LOGDIR/clean" + if $verbose ; then + $MAKE clean 2>&1 | tee $LOGDIR/clean + else + $MAKE clean > $LOGDIR/clean 2>&1 + fi + if [ $? -ne 0 ] ; then + echo \"$MAKE clean\" failed, see log in $LOGDIR/clean + tail $LOGDIR/clean + exit 1 + fi +fi + +SUDO=${SUDO:-sudo} +test ! -z "$SUDO" && sudo=$SUDO +if $debian ; then + echo + echo "== Debian build, log is $LOGDIR/debian" + if $verbose ; then + exec dpkg-buildpackage -r$SUDO | tee $LOGDIR/debian + else + exec dpkg-buildpackage -r$SUDO > $LOGDIR/debian + fi +fi + +echo +echo "== configure, log is $LOGDIR/configure" +if $verbose ; then + autoconf 2>&1 | tee $LOGDIR/configure + ./configure 2>&1 | tee -a $LOGDIR/configure +else + autoconf > $LOGDIR/configure 2>&1 + ./configure >> $LOGDIR/configure 2>&1 +fi +if [ $? -ne 0 ] ; then + echo \"configure\" failed, see log in $LOGDIR/configure + tail $LOGDIR/configure + exit 1 +fi + +echo +echo "== default, log is $LOGDIR/default" +if $verbose ; then + $MAKE default 2>&1 | tee $LOGDIR/default +else + $MAKE default > $LOGDIR/default 2>&1 +fi +if [ $? -ne 0 ] ; then + echo \"$MAKE default\" failed, see log in $LOGDIR/default + tail $LOGDIR/default + exit 1 +fi + +echo +echo "== dist, log is $LOGDIR/dist" +[ ! -f .census ] && touch .census +if $verbose ; then + $MAKE -C build dist 2>&1 | tee $LOGDIR/dist +else + $MAKE -C build dist > $LOGDIR/dist 2>&1 +fi +if [ $? -ne 0 ] ; then + echo $MAKE dist failed, see log in $LOGDIR/dist + tail $LOGDIR/dist + exit 1 +else + grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///' +fi + +exit 0 |