"Upgrade" to the new build structure

This commit is contained in:
Tom G. Christensen 2003-08-11 13:25:42 +00:00 committed by tgc
parent 7f38ca705b
commit 0d68c91641
2 changed files with 107 additions and 48 deletions

107
openssl/build.sh Executable file
View File

@ -0,0 +1,107 @@
#!/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=openssl
version=0.9.6j
pkgver=1
source[0]=$topdir-$version.tar.gz
# If there are no patches, simply comment this
#patch[0]=
# Source function library
. ${BUILDPKG_BASE}/scripts/buildpkg.functions
# Fill in pkginfo values if necessary
# using pkgname,name,pkgcat,pkgvendor & pkgdesc
pkgname=SBossl
name="OpenSSL - Secure Socket Layer"
pkgcat="library"
pkgvendor="http://www.openssl.org"
pkgdesc="Toolkit implementing SSL v2/v3 and TLS v1"
# Define script functions and register them
METHODS=""
reg() {
METHODS="$METHODS $1"
}
reg prep
prep()
{
generic_prep
}
reg build
build()
{
setdir source
./config
$MAKE_PROG
}
reg install
install()
{
generic_install INSTALL_PREFIX
}
reg pack
pack()
{
generic_pack
}
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,48 +0,0 @@
#!/bin/bash
# Create a SSH package from a pre-built sourcedir
# - Filelist was updated for 3.1p1 release
#
PKGVER=0.9.7
PKGMK=/usr/bin/pkgmk
PKGTRANS=/usr/bin/pkgtrans
STRIP=/usr/ccs/bin/strip
DESTBASE=/export/home/tgc/buildpkg/openssl/build
BUILDBASE=/export/home/tgc/buildpkg/openssl/src/openssl-$PKGVER
PKGBASE=/export/home/tgc/buildpkg/openssl
PROTOTYPE=/export/home/tgc/buildpkg/openssl/meta/prototype
PKGOUT=openssl-$PKGVER-sol8-sparcv9-localssl
PKGNAME=SBossl
sed -e "s#%%pkg%%#$PKGNAME#g" \
-e "s#%%version%%#$PKGVER#g" $PKGBASE/meta/pkginfo.in > $PKGBASE/meta/pkginfo
echo "Assembling files for $PKGNAME package"
# Clean out any old files
rm -rf $DESTBASE
# Goto $BUILDBASE and do a make INSTALL_PREFIX=$DESTBASE install
cd $BUILDBASE
make INSTALL_PREFIX=$DESTBASE install
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/usr/local
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/usr/local
$PKGMK -r $DESTBASE/usr/local -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"