summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-10-26 00:41:38 +0000
committerMike Frysinger <vapier@gentoo.org>2005-10-26 00:41:38 +0000
commit9b17f0f97ec3a08e7205bbd76c16c9041ce3252b (patch)
tree1c93f0ac82d2b24eb5521e52163bee1ebc16f3b6 /dev-libs/openssl
parentold (diff)
downloadgentoo-2-9b17f0f97ec3a08e7205bbd76c16c9041ce3252b.tar.gz
gentoo-2-9b17f0f97ec3a08e7205bbd76c16c9041ce3252b.tar.bz2
gentoo-2-9b17f0f97ec3a08e7205bbd76c16c9041ce3252b.zip
Clean up ebuild and fix building on x86 #110457 by Justin Guyett.
(Portage version: 2.0.53_rc6)
Diffstat (limited to 'dev-libs/openssl')
-rw-r--r--dev-libs/openssl/ChangeLog7
-rwxr-xr-xdev-libs/openssl/files/gentoo.config-0.9.8116
-rw-r--r--dev-libs/openssl/files/openssl-0.9.8-toolchain.patch29
-rw-r--r--dev-libs/openssl/openssl-0.9.8a.ebuild120
4 files changed, 202 insertions, 70 deletions
diff --git a/dev-libs/openssl/ChangeLog b/dev-libs/openssl/ChangeLog
index 3b7e6d85161e..fa73419a4b40 100644
--- a/dev-libs/openssl/ChangeLog
+++ b/dev-libs/openssl/ChangeLog
@@ -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)
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
index 000000000000..128bb97959f4
--- /dev/null
+++ b/dev-libs/openssl/files/gentoo.config-0.9.8
@@ -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
index 000000000000..b6773e92fd86
--- /dev/null
+++ b/dev-libs/openssl/files/openssl-0.9.8-toolchain.patch
@@ -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"}/;
diff --git a/dev-libs/openssl/openssl-0.9.8a.ebuild b/dev-libs/openssl/openssl-0.9.8a.ebuild
index 9f6d74d6563c..45bace035d56 100644
--- a/dev-libs/openssl/openssl-0.9.8a.ebuild
+++ b/dev-libs/openssl/openssl-0.9.8a.ebuild
@@ -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:"