3 # Copyright (C) 2001, 2002, 2003 Silicon Graphics, Inc. All rights reserved.
5 # This program is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Make whichever packages have been requested.
27 test ! -z "$MAKE" && make=$MAKE
33 ;; # ignored, kept for backward compatibility
41 echo "Usage: Makepkgs [verbose] [debian|rpm]"; exit 1 ;;
45 # start with a clean manifest
46 test -f files.rpm && rm -f files.rpm
47 test -f filesdevel.rpm && rm -f filesdevel.rpm
48 test -f fileslib.rpm && rm -f fileslib.rpm
50 test ! -d $LOGDIR && mkdir $LOGDIR
51 rm -rf $LOGDIR/* > /dev/null 2>&1
53 # build Debian packages, cleans itself before starting
55 test ! -z "$SUDO" && sudo=$SUDO
56 if [ $type = debian ] ; then
58 LOGDEB=../`basename $LOGDEB`.log
59 echo "== Debian build, log is $LOGDEB"; echo
61 dpkg-buildpackage -r$SUDO | tee $LOGDEB
63 dpkg-buildpackage -r$SUDO > $LOGDEB || exit 1
68 # build RPM packages - manual clean before starting
69 echo "== clean, log is $LOGDIR/clean"
71 $MAKE clean 2>&1 | tee $LOGDIR/clean
73 $MAKE clean > $LOGDIR/clean 2>&1 || exit 1
77 echo "== configure, log is $LOGDIR/configure"
78 rm -f .census # force configure to run here
80 $MAKE configure 2>&1 | tee $LOGDIR/configure
82 $MAKE configure > $LOGDIR/configure 2>&1 || exit 1
86 echo "== default, log is $LOGDIR/default"
88 $MAKE default 2>&1 | tee $LOGDIR/default
90 $MAKE default > $LOGDIR/default 2>&1 || exit 1
94 echo "== dist, log is $LOGDIR/dist"
95 [ ! -f .census ] && touch .census
97 $MAKE -C package dist 2>&1 | tee $LOGDIR/dist
99 $MAKE -C package dist > $LOGDIR/dist 2>&1 || exit 1
100 grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///'