NetBSD/distrib/sets/makesrctars

72 lines
1.5 KiB
Bash
Executable File

#! /bin/sh
#
# $NetBSD: makesrctars,v 1.14 2002/04/12 07:08:37 lukem Exp $
#
# Make source code tarballs.
: ${CKSUM=cksum}
GZIP=-9
export GZIP
if [ -z "$SRCDIR" ]; then
echo SRCDIR must be set
exit 1
fi
if [ -z "$DESTDIR" ]; then
echo DESTDIR must be set
exit 1
fi
if [ -d ${DESTDIR} ]; then
echo "DESTDIR exists."
# exit 1
fi
cd $SRCDIR
mkdir ${DESTDIR}
mkdir ${DESTDIR}/sets
find -s . \
\! \( \( -path ./gnu -o -path ./share \) -prune \) \
\! \( -path ./sys -prune \) \
\! \( -path ./usr.sbin/config -prune \) \
\! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
-print | \
pax -w -d -s'|^\.|usr/src|' | gzip \
> ${DESTDIR}/sets/src.tgz
find -s gnu \
\! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
-print | \
pax -w -d -s'|^|usr/src/|' | gzip \
> ${DESTDIR}/sets/gnusrc.tgz
find -s sys usr.sbin/config \
\( \
-path 'sys/arch/*/compile/CVS' -o \
-name .keep_me -o \
! \( -path 'sys/arch/*/compile/*' -prune \) \
\) \
! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
-print | \
pax -w -d -s'|^|usr/src/|' | gzip \
> ${DESTDIR}/sets/syssrc.tgz
find -s share \
\! \( \( -type l -o -type d \) \( -name obj -o -name 'obj.*' \) \) \
-print | \
pax -w -d -s'|^|usr/src/|' | gzip \
> ${DESTDIR}/sets/sharesrc.tgz
(cd ${DESTDIR}/sets
${CKSUM} -o1 *.tgz > BSDSUM
${CKSUM} *.tgz > CKSUM
${CKSUM} -m *.tgz > MD5
${CKSUM} -o2 *.tgz > SYSVSUM
)
chmod 444 ${DESTDIR}/sets/*