maketars revision 1.14
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}
12machine=${MACHINE:-`printf 'xxx:\n\techo ${MACHINE}' | $MAKE -s -f-`}
13arch=${MACHINE_ARCH:-`printf 'xxx:\n\techo ${MACHINE_ARCH}' | $MAKE -s -f-`}
14setd=`pwd`
15nlists="base comp etc games man misc text"
16xlists="xbase xcomp xcontrib xfont xserver xmisc"
17lists=$nlists
18tars=$RELEASEDIR
19dest=$DESTDIR
20
21# handle args
22while : ; 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
47Usage: $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]
57USAGE
58		exit 1
59		;;
60	*)
61		break
62		;;
63	esac
64	shift
65done
66if [ -n "$*" ]; then
67	lists="$*"
68fi
69
70if [ -z "$tars" ]; then
71	echo \$RELEASEDIR must be set
72	exit 1
73fi
74
75if [ -z "$dest" ]; then
76	echo \$DESTDIR must be set
77	exit 1
78fi
79
80for 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
86done
87