Home | History | Annotate | Line # | Download | only in sets
makesrctars revision 1.12
      1 #! /bin/sh
      2 #
      3 #	$NetBSD: makesrctars,v 1.12 2001/12/18 10:19:14 wiz Exp $
      4 #
      5 # Make source code tarballs.
      6 
      7 GZIP=--best
      8 export GZIP
      9 
     10 if [ -z "$SRCDIR" ]; then
     11 	echo SRCDIR must be set
     12 	exit 1
     13 fi
     14 
     15 if [ -z "$DESTDIR" ]; then
     16 	echo DESTDIR must be set
     17 	exit 1
     18 fi
     19 
     20 if [ -d ${DESTDIR} ]; then
     21 	echo "DESTDIR exists."
     22 #	exit 1
     23 fi
     24 
     25 cd $SRCDIR
     26 
     27 mkdir ${DESTDIR}
     28 
     29 mkdir ${DESTDIR}/sets
     30 
     31 find -s . \
     32     \! \( \( -path ./gnu -o -path ./share \) -prune \) \
     33     \! \( -path ./sys -prune \) \
     34     \! \( -path ./usr.sbin/config -prune \) \
     35     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
     36 	-print | \
     37 	pax -w -d -s'|^\.|usr/src|' | gzip \
     38 	> ${DESTDIR}/sets/src.tgz
     39 
     40 find -s gnu \
     41     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
     42 	-print | \
     43 	pax -w -d -s'|^|usr/src/|' | gzip \
     44 	> ${DESTDIR}/sets/gnusrc.tgz
     45 
     46 find -s sys usr.sbin/config \
     47     \( \
     48 	-path 'sys/arch/*/compile/CVS' -o \
     49 	-name .keep_me -o \
     50 	! \( -path 'sys/arch/*/compile/*' -prune \) \
     51     \) \
     52     ! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
     53 	-print | \
     54 	pax -w -d -s'|^|usr/src/|' | gzip \
     55 	> ${DESTDIR}/sets/syssrc.tgz
     56 
     57 find -s share \
     58     \! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
     59 	-print | \
     60 	pax -w -d -s'|^|usr/src/|' | gzip \
     61 	> ${DESTDIR}/sets/sharesrc.tgz
     62 
     63 (cd ${DESTDIR}/sets
     64  cksum -o1 *.tgz > BSDSUM
     65  cksum *.tgz > CKSUM
     66  cksum -o2 *.tgz > SYSVSUM
     67  md5 *.tgz > MD5)
     68 chmod 444 ${DESTDIR}/sets/*
     69