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