From bd03d96c0d0d4573cc33cb5d0c4e789137bce5ec Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Wed, 7 Jan 2004 09:26:15 +0000 Subject: [PATCH] Completely redid the shared library approach. I've ditched the Redhat way since the original makefiles are good to go with only small tweaks. The major difference will be that the shared libraries will have an soname which explicitly spells out the OpenSSL version ie. instead of libssl.so.3 we'll use libssl.so.0.9.7.3 No problems with having to identify if a newer version is binary compatible and should be given the same soname. *All* packages which use a shared libssl should have a depend on the SBossllib package. Different SBossllib packages can be installed at the same time since it will *only* contain the shared libraries. --- openssl/build.sh | 74 ++++++++++------------ openssl/src/openssl-0.9.7c-soversion.patch | 21 ------ 2 files changed, 33 insertions(+), 62 deletions(-) delete mode 100644 openssl/src/openssl-0.9.7c-soversion.patch diff --git a/openssl/build.sh b/openssl/build.sh index 6ddc1d8..962c37b 100755 --- a/openssl/build.sh +++ b/openssl/build.sh @@ -8,49 +8,39 @@ # # Check the following 4 variables before running the script topdir=openssl -version=0.9.6k -pkgver=1 +version=0.9.7c +pkgver=4 source[0]=$topdir-$version.tar.gz # If there are no patches, simply comment this -patch[0]=openssl-0.9.6k-soversion.patch -patch[1]=openssl-0.9.6k-Configure.patch +patch[0]=openssl-0.9.7c-shlib.patch +patch[1]=openssl-0.9.7c-Configure.patch +patch[2]=openssl-0.9.7c-doc.patch # Source function library . ${BUILDPKG_BASE}/scripts/buildpkg.functions -abbrev_ver=$(echo $version|sed -e 's/\.//g') +# shared library binary compatibility is not guaranteed +# Play it safe and up the soversion with each release +sover=3 # c = 3 +abbrev_ver=$(echo $version|$SED -e 's/\.//g') +baseversion=$(echo $version|$SED -e 's/[a-zA-Z]//g') # Fill in pkginfo values if necessary # using pkgname,name,pkgcat,pkgvendor & pkgdesc -pkgname=SBossl$abbrev_ver +pkgname="$pkgprefix""ossl""$abbrev_ver" name="OpenSSL - Secure Socket Layer" pkgcat="application" pkgvendor="http://www.openssl.org" pkgdesc="Toolkit implementing SSL v2/v3 and TLS v1" -pkgname_lib=SBossl$abbrev_ver"lib" +pkgname_lib="$pkgprefix""ossl""$abbrev_ver""lib" name_lib="OpenSSL - Secure Socket Layer" pkgcat_lib="library" pkgvendor_lib="http://www.openssl.org" pkgdesc_lib="Toolkit implementing SSL v2/v3 and TLS v1" -# shared library binary compatibility is not guaranteed -# Play it safe and up the soversion with each release -# 0.9.6(a-b) is sover 2 (RH) -# 0.9.6c-j was never built at SB with sh libs -# 0.9.6k is sover 3 (RH uses this for 0.9.6c) -# 0.9.7a is sover 4 (on RH, never built with sh libs on SB) -# 0.9.7b is sover 5 (never built at SB) -# 0.9.7c is sover 6 - -baseversion=0.9.6 -sover=2 -liblist="libssl libcrypto" - lib_stage=$BUILDPKG_BASE/$topdir/stage.lib -MV=mv - # Define script functions and register them METHODS="" reg() { @@ -61,17 +51,27 @@ reg prep prep() { generic_prep - # Set correct sover in Makefile.org - perl -i -pe "s/SHLIB_SOVER\=/SHLIB_SOVER\=$sover/g" $srcdir/$topsrcdir/Makefile.org } reg build build() { setdir source + $SED -e "s;@LIBDIR@;${prefix}/lib;g" Makefile.org > Makefile.new + $MV -f Makefile.new Makefile.org + ./config --prefix=$prefix --openssldir=$prefix/ssl shared - $MAKE_PROG -# $MAKE_PROG -C test apps tests + + major=$(grep ^SHLIB_MAJOR Makefile) + minor=$(grep ^SHLIB_MINOR Makefile) + $SED -e "s;${major};SHLIB_MAJOR=${baseversion};g" \ + -e "s;${minor};SHLIB_MINOR=${sover};g" Makefile > Makefile.new + $MV Makefile.new Makefile + $SED -e "s;${major};SHLIB_MAJOR=${baseversion};g" \ + -e "s;${minor};SHLIB_MINOR=${sover};g" Makefile.ssl > Makefile.new + $MV Makefile.new Makefile.ssl + $MAKE_PROG LIBSSL="-Wl,-R,$prefix/lib -L.. -lssl" LIBCRYPTO="-Wl,-R,$prefix/lib -L.. -lcrypto" all build-shared + $MAKE_PROG LIBSSL="-Wl,-R,$prefix/lib -L.. -lssl" LIBCRYPTO="-Wl,-R,$prefix/lib -L.. -lcrypto" all link-shared do_solaris-shared } reg install @@ -79,17 +79,9 @@ install() { setdir source clean stage - $MAKE_PROG INSTALL_PREFIX=$stagedir install build-shared + $MAKE_PROG INSTALL_PREFIX=$stagedir LIBSSL="-Wl,-R,$prefix/lib -L.. -lssl" LIBCRYPTO="-Wl,-R,$prefix/lib -L.. -lcrypto" install setdir $stagedir$prefix/lib chmod a+x pkgconfig - for i in $liblist - do - $MV $i.so.$baseversion $i.so.$version - rm -f $i.so.$sover - rm -f $i.so - ln -s $i.so.$version $i.so.$sover - ln -s $i.so.$sover $i.so - done rmdir $stagedir$prefix/ssl/lib $MV $stagedir$prefix/ssl/man $stagedir$prefix setdir $stagedir$prefix/man @@ -109,11 +101,11 @@ install() cd .. done # A few stupid manpages left that pkgproto can't deal with - #setdir $stagedir$prefix/man/man3 - #mv "EVP_MD_CTX_copy_ex EVP_MD_CTX_copy.3ssl" "EVP_MD_CTX_copy_ex_EVP_MD_CTX_copy.3ssl" - #mv "UI_construct_prompt UI_add_user_data.3ssl" "UI_construct_prompt_UI_add_user_data.3ssl" - #setdir $stagedir$prefix/man/man7 - #mv "Modes of DES.7ssl" "Modes_of_DES.7ssl" + setdir $stagedir$prefix/man/man3 + mv "EVP_MD_CTX_copy_ex EVP_MD_CTX_copy.3ssl" "EVP_MD_CTX_copy_ex_EVP_MD_CTX_copy.3ssl" + mv "UI_construct_prompt UI_add_user_data.3ssl" "UI_construct_prompt_UI_add_user_data.3ssl" + setdir $stagedir$prefix/man/man7 + mv "Modes of DES.7ssl" "Modes_of_DES.7ssl" } reg pack @@ -123,7 +115,7 @@ pack() # The bare .so and .a used for development should only be available # if the matching headers etc. is installed so they're not put in the lib package mkdir -p $lib_stage$prefix/lib - $MV $stagedir$prefix/lib/*.so.* $lib_stage$prefix + $MV $stagedir$prefix/lib/*.so.* $lib_stage$prefix/lib # Create runtime package echo "P $pkgname_lib $name_lib" > $metadir/depend diff --git a/openssl/src/openssl-0.9.7c-soversion.patch b/openssl/src/openssl-0.9.7c-soversion.patch deleted file mode 100644 index d8cffca..0000000 --- a/openssl/src/openssl-0.9.7c-soversion.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- openssl-0.9.7c/Makefile.org.orig 2003-10-16 12:29:55.227462000 +0200 -+++ openssl-0.9.7c/Makefile.org 2003-10-16 12:33:36.449814000 +0200 -@@ -10,6 +10,7 @@ - SHLIB_MAJOR= - SHLIB_MINOR= - SHLIB_EXT= -+SHLIB_SOVER= - PLATFORM=dist - OPTIONS= - CONFIGURE_ARGS= -@@ -390,8 +391,9 @@ - MINUSZ='-z '; \ - (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \ - set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \ -+ -R${INSTALLTOP}/lib \ - -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -- -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ -+ -h lib$$i.so.${SHLIB_SOVER}} \ - $${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \ - $$libs ${EX_LIBS} -lc ) || exit 1; \ - libs="-l$$i $$libs"; \