Converted cvs to the new buildpkg structure and upgraded to 1.11.6 at the same time

This commit is contained in:
Tom G. Christensen 2003-07-10 09:59:02 +00:00 committed by tgc
parent 8d9d2d617a
commit 461765ee46
2 changed files with 110 additions and 52 deletions

110
cvs/build.sh Executable file
View File

@ -0,0 +1,110 @@
#!/bin/bash
#
# This is a generic build.sh script
# It can be used nearly unmodified with many packages
#
# The concept of "method" registering and the logic that implements it was shamelessly
# stolen from jhlj's Compile.sh script :)
#
# Check the following 4 variables before running the script
topdir=cvs
version=1.11.6
pkgver=1
source[0]=$topdir-$version.tar.bz2
# If there are no patches, simply comment this
#patch[0]=
# Source function library
. ${HOME}/buildpkg/scripts/buildpkg.functions
# Fill in pkginfo values if necessary
# using pkgname,name,pkgcat,pkgvendor & pkgdesc
name="CVS - Version control system"
pkgvendor="http://www.cvshome.org"
pkgdesc="Lets you record the history of source files and documents."
# Define script functions and register them
METHODS=""
reg() {
METHODS="$METHODS $1"
}
reg prep
prep()
{
generic_prep
}
reg build
build()
{
export LDFLAGS="-R/usr/local/lib"
generic_build
}
reg install
install()
{
generic_install prefix
setdir source
mkdir -p $stagedir/doc/$topdir-$version
for file in "FAQ README NEWS doc/*.ps"
do
cp $file $stagedir/doc/$topdir-$version
done
}
reg pack
pack()
{
generic_pack shortroot
}
reg distclean
distclean()
{
clean distclean
}
###################################################
# No need to look below here
###################################################
reg all
all()
{
for METHOD in $METHODS
do
case $METHOD in
all*|*clean) ;;
*) $METHOD
;;
esac
done
}
reg
usage() {
echo Usage $0 "{"$(echo $METHODS | tr " " "|")"}"
exit 1
}
OK=0
for METHOD in $*
do
METHOD=" $METHOD *"
if [ "${METHODS%$METHOD}" == "$METHODS" ] ; then
usage
fi
OK=1
done
if [ $OK = 0 ] ; then
usage;
fi
for METHOD in $*
do
( $METHOD )
done

View File

@ -1,52 +0,0 @@
#!/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"