Clean up ebuild and fix building on x86 #110457 by Justin Guyett.
authorMike Frysinger <vapier@gentoo.org>
Wed, 26 Oct 2005 00:41:38 +0000 (00:41 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 26 Oct 2005 00:41:38 +0000 (00:41 +0000)
Package-Manager: portage-2.0.53_rc6

dev-libs/openssl/ChangeLog
dev-libs/openssl/Manifest
dev-libs/openssl/files/gentoo.config-0.9.8 [new file with mode: 0755]
dev-libs/openssl/files/openssl-0.9.8-toolchain.patch [new file with mode: 0644]
dev-libs/openssl/openssl-0.9.8a.ebuild

index 3b7e6d85161e08a079d49fba27ff7a142190198a..fa73419a4b400f5def4c20f9e021adbc7003761c 100644 (file)
@@ -1,6 +1,11 @@
 # ChangeLog for dev-libs/openssl
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.139 2005/10/16 02:21:10 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/ChangeLog,v 1.140 2005/10/26 00:41:37 vapier Exp $
+
+  26 Oct 2005; Mike Frysinger <vapier@gentoo.org>
+  +files/gentoo.config-0.9.8, +files/openssl-0.9.8-toolchain.patch,
+  openssl-0.9.8a.ebuild:
+  Clean up ebuild and fix building on x86 #110457 by Justin Guyett.
 
 *openssl-0.9.7i (16 Oct 2005)
 
index eb60623c82a68e871fc0cbd593e468c2aca7caca..28139833a11586dd9cb3de13c3f0dfe74197a91d 100644 (file)
@@ -1,19 +1,14 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 68894c130cee089df8439579c018953b ChangeLog 22521
+MD5 f6f90d84b06fbd06b6f4671807ee492b ChangeLog 22733
 MD5 744b358cd3b68b2ca6561c214c541fc0 files/addppc64support.diff 1327
 MD5 2e6ed24d513a8f2b1b6f03709ab5ba18 files/digest-openssl-0.9.6m 67
-MD5 acab4ad88a6c249a7cde0511a0961a2c files/digest-openssl-0.9.7e-r1 134
 MD5 acab4ad88a6c249a7cde0511a0961a2c files/digest-openssl-0.9.7e-r2 134
-MD5 1a7aabb860415c7be612863579d67b4d files/digest-openssl-0.9.7g 67
 MD5 1a7aabb860415c7be612863579d67b4d files/digest-openssl-0.9.7g-r1 67
 MD5 0b87439b95b8ecda7b7cd59c336625cd files/digest-openssl-0.9.7h 67
 MD5 275256f0f0c2a035cbc2b9ede7a1e21a files/digest-openssl-0.9.7i 67
-MD5 592d5a5b643b835123af4a44caffc75e files/digest-openssl-0.9.8 66
 MD5 592d5a5b643b835123af4a44caffc75e files/digest-openssl-0.9.8-r1 66
 MD5 b8f72a6ed636d44f938a026b12abc7e2 files/digest-openssl-0.9.8a 67
 MD5 fd8c9447dfd4b64c49d44dfc52e4e221 files/gentoo.config-0.9.7g 3319
+MD5 3337c3fab1b8bce26ea8c8319726dd74 files/gentoo.config-0.9.8 3316
 MD5 b901850df9952252974316e78775673b files/openssl-0.9.6-mips.diff 1487
 MD5 cebd09d1819c07b0fab14ad90b0da884 files/openssl-0.9.6m-gentoo.diff 1591
 MD5 24c7fa75a1a2ecbc73d0964525d22299 files/openssl-0.9.7-CAN-2005-2969.patch 2173
@@ -41,21 +36,12 @@ MD5 f402ee8807a8a089d1b53d0e4101bcab files/openssl-0.9.8-hppa-fix-detection.patc
 MD5 8c5ab963e60bc0744408eebf48596981 files/openssl-0.9.8-make-engines-dir.patch 461
 MD5 e476b45b7b15df41a0e3f06c187201ee files/openssl-0.9.8-parallel-build.patch 649
 MD5 4a170a962292bdd019fe303ba981e3ab files/openssl-0.9.8-ppc64.patch 1463
+MD5 933bb8d7ab02ba7e55a104ec9030c51a files/openssl-0.9.8-toolchain.patch 991
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
 MD5 685c33f8a3f1980105944ab3c23a346c openssl-0.9.6m.ebuild 3074
-MD5 ee44884b82b96b48d7e33effbbc88230 openssl-0.9.7e-r1.ebuild 8736
 MD5 8d0cc3c95e7be6bd21e6ea68e1e55971 openssl-0.9.7e-r2.ebuild 8797
 MD5 4a6626d9417b73b3cf097f2c7b088e2c openssl-0.9.7g-r1.ebuild 5534
-MD5 4ce0d905b32bf15f4fec2b83a07ade33 openssl-0.9.7g.ebuild 5470
 MD5 5529efcdf1ed36de4ad475f2c7e29ed8 openssl-0.9.7h.ebuild 5354
 MD5 4a35fa4f00af0e7983e25fe2ff52bea8 openssl-0.9.7i.ebuild 5354
 MD5 46e37d3c5d41a3350216b1ebc83b3238 openssl-0.9.8-r1.ebuild 5389
-MD5 4a74cf1db0fb48d5569d3903fb4701fd openssl-0.9.8.ebuild 5333
-MD5 2232fa718d2c1d6e39af4a343a5b5abb openssl-0.9.8a.ebuild 5333
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFDUbmfgIKl8Uu19MoRAnRyAJ95Y63e2B7hsgB59BRkvIkIUL/KygCZASk7
-6CNpN9WzLw08dFKy3qAa7GA=
-=73sl
------END PGP SIGNATURE-----
+MD5 f82f8ac87f99859031f6c7d34ec9a26d openssl-0.9.8a.ebuild 4562
diff --git a/dev-libs/openssl/files/gentoo.config-0.9.8 b/dev-libs/openssl/files/gentoo.config-0.9.8
new file mode 100755 (executable)
index 0000000..128bb97
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/bash
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/files/gentoo.config-0.9.8,v 1.1 2005/10/26 00:41:38 vapier Exp $
+#
+# Openssl doesn't play along nicely with cross-compiling 
+# like autotools based projects, so let's teach it new tricks.
+#
+# Review the bundled 'config' script to see why kind of targets 
+# we can pass to the 'Configure' script.
+
+
+# Testing routines
+if [[ $1 == "test" ]] ; then
+       for c in \
+               "arm-gentoo-linux-uclibc      |linux-elf-arm -DL_ENDIAN" \
+               "armv5b-linux-gnu             |linux-elf-arm -DB_ENDIAN" \
+               "x86_64-pc-linux-gnu          |linux-x86_64" \
+               "alphaev56-unknown-linux-gnu  |linux-alpha+bwx-gcc" \
+               "whatever-gentoo-freebsdX.Y   |FreeBSD-elf" \
+               "sparc64-alpha-freebsdX.Y     |FreeBSD-sparc64" \
+               "ia64-gentoo-freebsd5.99234   |FreeBSD-ia64" \
+               "x86_64-gentoo-freebsdX.Y     |FreeBSD-amd64" \
+               "hppa64-aldsF-linux-gnu5.3    |linux-parisc" \
+               "powerpc-gentOO-linux-uclibc  |linux-ppc" \
+               "powerpc64-unk-linux-gnu      |linux-ppc64" \
+       ;do
+               CHOST=${c/|*}
+               ret_want=${c/*|}
+               ret_got=$(CHOST=${CHOST} "$0")
+
+               if [[ ${ret_want} == "${ret_got}" ]] ; then
+                       echo "PASS: ${CHOST}"
+               else
+                       echo "FAIL: ${CHOST}"
+                       echo -e "\twanted: ${ret_want}"
+                       echo -e "\twe got: ${ret_got}"
+               fi
+       done
+       exit 0
+fi
+
+
+# Detect the operating system
+case ${CHOST} in
+       *-linux*)    system="linux";;
+       *-freebsd*)  system="FreeBSD";;
+       *)           exit 0;;
+esac
+
+
+# Compiler munging
+compiler="gcc"
+if [[ ${CC} == "ccc" ]] ; then
+       compiler=${CC}
+fi
+
+
+# Detect target arch
+machine=""
+chost_machine=${CHOST%%-*}
+case ${system} in
+linux)
+       case ${chost_machine} in
+               alphaev56*)   machine=alpha+bwx-${compiler};;
+               alphaev[67]*) machine=alpha+bwx-${compiler};;
+               alpha*)
+                       # this pretty hack is because we have to make sure we
+                       # maintain ABI on the system or things like ssh break
+                       currmachine=""
+                       if [[ ${ROOT} == "/" ]] && [[ -e /usr/lib/libcrypto.so ]] ; then
+                               currmachine=$(strings /usr/lib/libcrypto.so | grep ^linux-alpha | sed -e s:linux-::)
+                       fi
+                       machine=${currmachine:-alpha-${compiler}}
+
+                       # NOTE: drop this crap next time SSL changes ABI #'s
+                       [[ ${PV:0:5} != "0.9.7" ]] && machine="plzupdatemekthxbye"
+                       ;;
+
+               arm*b*)       machine="elf-arm -DB_ENDIAN";;
+               arm*)         machine="elf-arm -DL_ENDIAN";;
+       #       hppa64*)      machine=parisc64;;
+               hppa*)        machine=parisc;;
+               i[0-5]86*)    machine=elf;;
+               i[6-9]86*)    machine=generic32;;
+               ia64*)        machine=ia64;;
+               m68*)         machine=m68k;;
+               mips*el*)     machine=mipsel;;
+               mips*)        machine=mips;;
+               powerpc64*)   machine=ppc64;;
+               powerpc*)     machine=ppc;;
+               sh64*)        machine=elf;;
+               sh*b*)        machine="elf-sh -DB_ENDIAN";;
+               sh*)          machine="elf-sh -DL_ENDIAN";;
+               sparc*v7*)    machine=sparcv7;;
+               sparc64*)     machine=sparcv9;;
+               sparc*)       machine=sparcv8;;
+               s390x*)       machine=s390x;;
+               s390*)        machine=s390;;
+               x86_64*)      machine=x86_64;;
+       esac
+       ;;
+FreeBSD)
+       case ${chost_machine} in
+               sparc64*)     machine=sparc64;;
+               ia64*)        machine=ia64;;
+               alpha*)       machine=alpha;;
+               x86_64*)      machine=amd64;;
+               *)            machine=elf;;
+       esac
+       ;;
+esac
+
+
+# If we have something, show it
+[[ -n ${machine} ]] && echo ${system}-${machine}
diff --git a/dev-libs/openssl/files/openssl-0.9.8-toolchain.patch b/dev-libs/openssl/files/openssl-0.9.8-toolchain.patch
new file mode 100644 (file)
index 0000000..b6773e9
--- /dev/null
@@ -0,0 +1,29 @@
+--- Configure
++++ Configure
+@@ -928,7 +928,8 @@
+ print "IsMK1MF=$IsMK1MF\n";
+ 
+ my @fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
+-my $cc = $fields[$idx_cc];
++my $cc = $ENV{'CC'} || $fields[$idx_cc];
++my $ar = $ENV{'AR'} || "ar";
+ my $cflags = $fields[$idx_cflags];
+ my $unistd = $fields[$idx_unistd];
+ my $thread_cflag = $fields[$idx_thread_cflag];
+@@ -951,7 +951,7 @@
+ my $shared_cflag = $fields[$idx_shared_cflag];
+ my $shared_ldflag = $fields[$idx_shared_ldflag];
+ my $shared_extension = $fields[$idx_shared_extension];
+-my $ranlib = $fields[$idx_ranlib];
++my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib];
+ my $arflags = $fields[$idx_arflags];
+ 
+ my $no_shared_warn=0;
+@@ -1292,6 +1292,7 @@
+       s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
+       s/^PROCESSOR=.*/PROCESSOR= $processor/;
+       s/^RANLIB=.*/RANLIB= $ranlib/;
++      s/^AR=ar /AR= $ar /;
+       s/^ARFLAGS=.*/ARFLAGS= $arflags/;
+       s/^PERL=.*/PERL= $perl/;
+       s/^KRB5_INCLUDES=.*/KRB5_INCLUDES=$withargs{"krb5-include"}/;
index 9f6d74d6563ce5560a73f6fb11678a3dd042a93f..45bace035d5630ef6671aec7c6a833391a1582a9 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.8a.ebuild,v 1.1 2005/10/12 05:20:02 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.8a.ebuild,v 1.2 2005/10/26 00:41:37 vapier Exp $
 
 inherit eutils flag-o-matic toolchain-funcs
 
@@ -30,64 +30,50 @@ src_unpack() {
        epatch "${FILESDIR}"/${PN}-0.9.7-alpha-default-gcc.patch
        epatch "${FILESDIR}"/${PN}-0.9.8-parallel-build.patch
        epatch "${FILESDIR}"/${PN}-0.9.8-make-engines-dir.patch
+       epatch "${FILESDIR}"/${PN}-0.9.8-toolchain.patch
 
        # allow openssl to be cross-compiled
-       cp "${FILESDIR}"/gentoo.config-0.9.7g gentoo.config || die "cp cross-compile failed"
+       cp "${FILESDIR}"/gentoo.config-0.9.8 gentoo.config || die "cp cross-compile failed"
        chmod a+rx gentoo.config
 
        # Don't build manpages if we don't want them
-       has noman FEATURES && sed -i '/^install:/s:install_docs::' Makefile.org
-
-       case $(gcc-version) in
-               3.2)
-                       filter-flags -fprefetch-loop-arrays -freduce-all-givs -funroll-loop
-               ;;
-               3.4 | 3.3 )
-                       filter-flags -fprefetch-loop-arrays -freduce-all-givs -funroll-loops
-                       [[ ${ARCH} == "ppc" ||  ${ARCH} == "ppc64" ]] && append-flags -fno-strict-aliasing
-               ;;
-       esac
+       has noman FEATURES \
+               && sed -i '/^install:/s:install_docs::' Makefile.org \
+               || sed -i '/^MANDIR=/s:=.*:=/usr/share/man:' Makefile.org
+
+       # Try to derice users
+       [[ $(gcc-major-version) == "3" ]] \
+               && filter-flags -fprefetch-loop-arrays -freduce-all-givs -funroll-loops
+       [[ $(tc-arch) == ppc* ]] && append-flags -fno-strict-aliasing
        append-flags -Wa,--noexecstack
 
-       # replace CFLAGS
-       OLDIFS=$IFS
-       IFS=$'\n'
-       for a in $( grep -n -e "^\"linux-" Configure ); do
-               LINE=$( echo $a | awk -F: '{print $1}' )
-               CUR_CFLAGS=$( echo $a | awk -F: '{print $3}' )
-               NEW_CFLAGS=$(echo $CUR_CFLAGS | sed -r -e "s|-O[23]||" -e "s:-fomit-frame-pointer::" -e "s:-mcpu=[-a-z0-9]+::" -e "s:-m486::")
-               # ppc64's current toolchain sucks at optimization and will break this package
-               [[ $(tc-arch) != "ppc64" ]] && NEW_CFLAGS="${NEW_CFLAGS} ${CFLAGS}"
-
-               sed -i "${LINE}s:$CUR_CFLAGS:$NEW_CFLAGS:" Configure || die "sed failed"
-       done
-       IFS=$OLDIFS
-
-       if [ "$(get_libdir)" != "lib" ] ; then
-               # using a library directory other than lib requires some magic
-               sed -i \
-                       -e "s+\(\$(INSTALL_PREFIX)\$(INSTALLTOP)\)/lib+\1/$(get_libdir)+g" \
-                       -e "s+libdir=\$\${exec_prefix}/lib+libdir=\$\${exec_prefix}/$(get_libdir)+g" \
-                       Makefile.org engines/Makefile \
-                       || die "sed failed"
-               ./config --test-sanity || die "sanity failed"
-       fi
+       # using a library directory other than lib requires some magic
+       sed -i \
+               -e "s+\(\$(INSTALL_PREFIX)\$(INSTALLTOP)\)/lib+\1/$(get_libdir)+g" \
+               -e "s+libdir=\$\${exec_prefix}/lib+libdir=\$\${exec_prefix}/$(get_libdir)+g" \
+               Makefile.org engines/Makefile \
+               || die "sed failed"
+       ./config --test-sanity || die "I AM NOT SANE"
 }
 
 src_compile() {
-       # Clean out patent-or-otherwise-encumbered code.
+       tc-export CC AR RANLIB
+
+       # Clean out patent-or-otherwise-encumbered code
        # MDC-2: 4,908,861 13/03/2007
        # IDEA:  5,214,703 25/05/2010
        # RC5:   5,724,428 03/03/2015
        # EC:    ????????? ??/??/2015
        local confopts=""
-       use bindist && confopts="no-idea no-rc5 no-mdc2 -no-ec"
-
+       if use bindist ; then
+               confopts="no-idea no-rc5 no-mdc2 no-ec"
+       else
+               confopts="enable-idea enable-rc5 enable-mdc2 enable-ec"
+       fi
        use zlib && confopts="${confopts} zlib-dynamic"
 
        local sslout=$(./gentoo.config)
-       einfo "Use configuration ${sslout}"
-
+       einfo "Use configuration ${sslout:-(openssl knows best)}"
        local config="Configure"
        [[ -z ${sslout} ]] && config="config"
        ./${config} \
@@ -98,17 +84,29 @@ src_compile() {
                shared threads \
                || die "Configure failed"
 
-       emake \
-               CC="$(tc-getCC)" MAKEDEPPROG="$(tc-getCC)" \
-               AR="$(tc-getAR) r" \
-               RANLIB="$(tc-getRANLIB)" \
-               all || die "make all failed"
+       # Clean out hardcoded flags that openssl uses
+       local CFLAG=$(grep ^CFLAG= Makefile | sed \
+               -e 's:^CFLAG=::' \
+               -e 's:-fomit-frame-pointer ::g' \
+               -e 's:-O[0-9] ::g' \
+               -e 's:-march=[-a-z0-9]* ::g' \
+               -e 's:-mcpu=[-a-z0-9]* ::g' \
+               -e 's:-m[a-z0-9]* ::g' \
+       )
+       sed -i -e "/^CFLAG/s:=.*:=${CFLAG} ${CFLAGS}:" Makefile || die
+
+       # depend is needed to use $confopts
+       # rehash is needed to prep the certs/ dir
+       emake -j1 depend || die "depend failed"
+       emake all rehash || die "make all failed"
 
        # force until we get all the gentoo.config kinks worked out
-       tc-is-cross-compiler || src_test
+       src_test
 }
 
 src_test() {
+       tc-is-cross-compiler && return 0
+
        # make sure sandbox doesnt die on *BSD
        add_predict /dev/crypto
 
@@ -116,7 +114,7 @@ src_test() {
 }
 
 src_install() {
-       make INSTALL_PREFIX="${D}" MANDIR=/usr/share/man install || die
+       make INSTALL_PREFIX="${D}" install || die
        dodoc CHANGES* FAQ NEWS README
        dodoc doc/*.txt
        dohtml doc/*
@@ -126,24 +124,18 @@ src_install() {
                doins doc/c-indentation.el
        fi
 
-       # create the certs directory.  Previous openssl builds
-       # would need to create /usr/lib/ssl/certs but this looks
-       # to be the more FHS compliant setup... -raker
-       insinto /etc/ssl/certs
-       doins certs/*.pem
-       LD_LIBRARY_PATH="${D}"/usr/$(get_libdir)/ \
-       OPENSSL="${D}"/usr/bin/openssl /usr/bin/perl tools/c_rehash \
-               "${D}"/etc/ssl/certs
+       # create the certs directory
+       dodir /etc/ssl/certs
+       cp -RP certs/* "${D}"/etc/ssl/certs/ || die "failed to install certs"
+       rm -r "${D}"/etc/ssl/certs/{demo,expired}
 
-       # These man pages with other packages so rename them
+       # These man pages conflict with other packages so rename them
        cd "${D}"/usr/share/man
        for m in man1/passwd.1 man3/rand.3 man3/err.3 ; do
                d=${m%%/*} ; m=${m##*/}
                mv -f ${d}/{,ssl-}${m}
                ln -snf ssl-${m} ${d}/openssl-${m}
        done
-
-       fperms a+x /usr/$(get_libdir)/pkgconfig #34088
 }
 
 pkg_preinst() {
@@ -153,16 +145,6 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       local BN_H="${ROOT}$(gcc-config -L)/include/openssl/bn.h"
-       # Breaks things one some boxen, bug #13795.  The problem is that
-       # if we have a 'gcc fixed' version in $(gcc-config -L) from 0.9.6,
-       # then breaks as it was defined as 'int BN_mod(...)' and in 0.9.7 it
-       # is a define with BN_div(...) - <azarah@gentoo.org> (24 Sep 2003)
-       if [ -f "${BN_H}" ] && [ -n "$(grep '^int[[:space:]]*BN_mod(' "${BN_H}")" ]
-       then
-               rm -f "${BN_H}"
-       fi
-
        if [[ -e ${ROOT}/usr/$(get_libdir)/libcrypto.so.0.9.7 ]] ; then
                ewarn "You must re-compile all packages that are linked against"
                ewarn "OpenSSL 0.9.7 by using revdep-rebuild from gentoolkit:"