2002-12-20 12:42:02 +00:00

61 lines
1.8 KiB
Bash
Executable File

#!/bin/sh
# Create a PRNGD package from a pre-built sourcedir
#
PKGVER=0.9.24
PKGMK=/usr/bin/pkgmk
PKGTRANS=/usr/bin/pkgtrans
STRIP=/usr/ccs/bin/strip
PKGBASE=/export/home/tgc/buildpkg/prngd
DESTBASE=$PKGBASE/build-prngd
BUILDBASE=$PKGBASE/prngd-$PKGVER
PROTOTYPE=$PKGBASE/meta/prototype
PKGOUT=prngd-$PKGVER-sol8-sparc-local
PKGNAME=SBprngd
sed -e "s#%%pkg%%#$PKGNAME#g" \
-e "s#%%version%%#$PKGVER#g" $PKGBASE/meta/pkginfo.in > $PKGBASE/meta/pkginfo
echo "Assembling files for PRNGD package"
# Clean out any old files
rm -rf $DESTBASE
mkdir -p $DESTBASE/etc
mkdir -p $DESTBASE/sbin
mkdir -p $DESTBASE/man/cat1
list="prngd"
for i in $list; do cp -p $BUILDBASE/$i $DESTBASE/sbin; $STRIP $DESTBASE/sbin/$i; done
cp -p $BUILDBASE/prngd.cat $DESTBASE/man/cat1/prngd.1
cp -p $PKGBASE/meta/prngd.init $DESTBASE/etc
# Try to be smart an figure out if we should use the 2.6 entropy gathering script
if [ `uname -r` = "5.6" ]; then
echo "Using Solaris 2.6 entropy gathering script..."
cp -p $BUILDBASE/contrib/Solaris-2.6/prngd.conf.solaris-26 $DESTBASE/etc/prngd.conf
else
echo "Using Solaris 7+ entropy gathering script..."
cp -p $BUILDBASE/contrib/Solaris-7/prngd.conf.solaris-7 $DESTBASE/etc/prngd.conf
fi
# move the seed file in place
if [ -r $PKGBASE/meta/prngd-seed ]; then
cp -p $PKGBASE/meta/prngd-seed $DESTBASE/etc;
else
echo "Please prepare a seed file in $PKGBASE/meta/prngd-seed"
exit 1
fi
echo "Building package"
# Create a package-instance ready for installation or transfer to a data-stream
# Ideally we would fixup the prototype file to have the right paths to the install-scripts
# but I'm lazy...
cd $DESTBASE
$PKGMK -r $DESTBASE -d $PKGBASE -o -f $PROTOTYPE
echo "Translating package into data-stream format"
# Transfer the package to data-stream format
$PKGTRANS -o -s $PKGBASE $PKGBASE/$PKGOUT $PKGNAME
echo "Done. Package is in $PKGBASE/$PKGOUT"