53 lines
1.5 KiB
Bash
Executable File
53 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Create a cvs package from a pre-built sourcedir
|
|
#
|
|
PKGVER=1.11.5
|
|
PKGMK=/usr/bin/pkgmk
|
|
PKGTRANS=/usr/bin/pkgtrans
|
|
STRIP=/usr/ccs/bin/strip
|
|
DESTBASE=/export/home/tgc/buildpkg/cvs/build
|
|
BUILDBASE=/export/home/tgc/buildpkg/cvs/src/cvs-$PKGVER
|
|
PKGBASE=/export/home/tgc/buildpkg/cvs
|
|
PROTOTYPE=/export/home/tgc/buildpkg/cvs/meta/prototype
|
|
PKGOUT=cvs-$PKGVER-sol8-sparc-local
|
|
PKGNAME=SBcvs
|
|
|
|
sed -e "s#%%pkg%%#$PKGNAME#g" \
|
|
-e "s#%%version%%#$PKGVER#g" $PKGBASE/meta/pkginfo.in > $PKGBASE/meta/pkginfo
|
|
|
|
echo "Assembling files for cvs package"
|
|
# Clean out any old files
|
|
rm -rf $DESTBASE
|
|
|
|
# Goto $BUILDBASE and do a make prefix=$DESTBASE install
|
|
cd $BUILDBASE
|
|
make prefix=$DESTBASE install
|
|
mkdir -p $DESTBASE/doc/cvs-$PKGVER
|
|
for file in "FAQ README NEWS doc/*.ps"
|
|
do
|
|
cp $file $DESTBASE/doc/cvs-$PKGVER
|
|
done
|
|
cd ..
|
|
|
|
# strip binaries
|
|
cd $DESTBASE
|
|
find . -type f -perm +x |xargs $STRIP
|
|
|
|
echo "Building package"
|
|
# Create a package-instance ready for installation or transfer to a data-stream
|
|
|
|
# Create prototype file...
|
|
cd $DESTBASE
|
|
find . -print|pkgproto > $PKGBASE/meta/prototype.in
|
|
cat $PKGBASE/meta/prototype.in | awk 'BEGIN { print "i pkginfo=../meta/pkginfo";} \
|
|
{ $5="root"; $6="bin"; print; }' > $PKGBASE/meta/prototype
|
|
|
|
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/dist/$PKGOUT $PKGNAME
|
|
|
|
echo "Done. Package is in $PKGBASE/dist/$PKGOUT"
|