1 #!/bin/sh 2 # 3 # $NetBSD: maketars,v 1.14 2000/10/01 22:49:05 thorpej Exp $ 4 # 5 # Make release tar files for some or all lists. Usage: 6 # maketars [-b] [-x] [-a arch] [-m machine] [-s setsdir] [-d destdir] \ 7 # [-t tardir] [setname ...] 8 # 9 10 # set defaults 11 : ${MAKE=make} 12 machine=${MACHINE:-`printf 'xxx:\n\techo ${MACHINE}' | $MAKE -s -f-`} 13 arch=${MACHINE_ARCH:-`printf 'xxx:\n\techo ${MACHINE_ARCH}' | $MAKE -s -f-`} 14 setd=`pwd` 15 nlists="base comp etc games man misc text" 16 xlists="xbase xcomp xcontrib xfont xserver xmisc" 17 lists=$nlists 18 tars=$RELEASEDIR 19 dest=$DESTDIR 20 21 # handle args 22 while : ; do 23 case $1 in 24 -b*) 25 lists="$xlists $nlists" 26 ;; 27 -x*) 28 lists=$xlists 29 ;; 30 -a*) 31 arch=$2; shift 32 ;; 33 -m*) 34 machine=$2; shift 35 ;; 36 -s*) 37 setd=$2; shift 38 ;; 39 -d*) 40 dest=$2; shift 41 ;; 42 -t*) 43 tars=$2; shift 44 ;; 45 -*) 46 cat 1>&2 <<USAGE 47 Usage: $0 [-b] [-x] [-a arch] [-m machine] [-s setsdir] 48 [-d dest] [-t tars] [setname ...] 49 -b make netbsd + x11 lists 50 -x only make x11 lists 51 -a arch set arch (e.g, m68k, mips, powerpc) [$arch] 52 -m machine set machine (e.g, amiga, i386, macppc) [$machine] 53 -s setsdir directory to find sets [$setd] 54 -d dest \$DESTDIR [$dest] 55 -t tars \$RELEASEDIR [$tars] 56 [setname ...] sets to build [$lists] 57 USAGE 58 exit 1 59 ;; 60 *) 61 break 62 ;; 63 esac 64 shift 65 done 66 if [ -n "$*" ]; then 67 lists="$*" 68 fi 69 70 if [ -z "$tars" ]; then 71 echo \$RELEASEDIR must be set 72 exit 1 73 fi 74 75 if [ -z "$dest" ]; then 76 echo \$DESTDIR must be set 77 exit 1 78 fi 79 80 for setname in $lists; do 81 out=$setname.tgz 82 echo "making $out" 83 sh $setd/makeflist -a $arch -m $machine -s $setd $setname | 84 (cd $dest ; pax -w -d) | 85 gzip -9 > ${tars}/$out 86 done 87