/[gentoo-alt]/trunk/prefix/dev-libs/openssl/openssl-0.9.8c-r1.ebuild
Gentoo

Contents of /trunk/prefix/dev-libs/openssl/openssl-0.9.8c-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1512 - (show annotations) (download)
Sun Sep 17 19:50:38 2006 UTC (11 years, 7 months ago) by grobian
File size: 5191 byte(s)
prune unused patches
auto sync with main tree
add ~x86-macos keyword


1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/openssl-0.9.8c-r1.ebuild,v 1.1 2006/09/16 21:41:17 vapier Exp $
4
5 EAPI="prefix"
6
7 inherit eutils flag-o-matic toolchain-funcs
8
9 DESCRIPTION="Toolkit for SSL v2/v3 and TLS v1"
10 HOMEPAGE="http://www.openssl.org/"
11 SRC_URI="mirror://openssl/source/${P}.tar.gz"
12
13 LICENSE="openssl"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc-macos ~x86 ~x86-macos"
16 IUSE="bindist emacs test zlib"
17 # This breaks ABI so we will wait until next ABI change to enable: sse2
18
19 RDEPEND=""
20 DEPEND="${RDEPEND}
21 sys-apps/diffutils
22 >=dev-lang/perl-5
23 test? ( sys-devel/bc )"
24 PDEPEND="app-misc/ca-certificates"
25
26 src_unpack() {
27 unpack ${A}
28
29 cd "${S}"
30
31 epatch "${FILESDIR}"/${PN}-0.9.8-ppc64.patch
32 epatch "${FILESDIR}"/${PN}-0.9.7e-gentoo.patch
33 epatch "${FILESDIR}"/${PN}-0.9.8-hppa-fix-detection.patch
34 epatch "${FILESDIR}"/${PN}-0.9.7-alpha-default-gcc.patch
35 epatch "${FILESDIR}"/${PN}-0.9.8b-parallel-build.patch
36 epatch "${FILESDIR}"/${PN}-0.9.8-make-engines-dir.patch
37 epatch "${FILESDIR}"/${PN}-0.9.8-toolchain.patch
38 epatch "${FILESDIR}"/${PN}-0.9.8b-doc-updates.patch
39
40 # allow openssl to be cross-compiled
41 cp "${FILESDIR}"/gentoo.config-0.9.8 gentoo.config || die "cp cross-compile failed"
42 chmod a+rx gentoo.config
43
44 # Don't build manpages if we don't want them
45 has noman FEATURES \
46 && sed -i '/^install:/s:install_docs::' Makefile.org \
47 || sed -i '/^MANDIR=/s:=.*:='"${EPREFIX}"'/usr/share/man:' Makefile.org
48
49 # Try to derice users
50 [[ $(gcc-major-version) == "3" ]] \
51 && filter-flags -fprefetch-loop-arrays -freduce-all-givs -funroll-loops
52 [[ $(tc-arch) == ppc* ]] && append-flags -fno-strict-aliasing
53 use userland_Darwin || append-flags -Wa,--noexecstack
54
55 # using a library directory other than lib requires some magic
56 sed -i \
57 -e "s+\(\$(INSTALL_PREFIX)\$(INSTALLTOP)\)/lib+\1/$(get_libdir)+g" \
58 -e "s+libdir=\$\${exec_prefix}/lib+libdir=\$\${exec_prefix}/$(get_libdir)+g" \
59 Makefile.org engines/Makefile \
60 || die "sed failed"
61 ./config --test-sanity || die "I AM NOT SANE"
62 }
63
64 src_compile() {
65 tc-export CC AR RANLIB
66
67 # Clean out patent-or-otherwise-encumbered code
68 # MDC-2: 4,908,861 13/03/2007
69 # IDEA: 5,214,703 25/05/2010
70 # RC5: 5,724,428 03/03/2015
71 # EC: ????????? ??/??/2015
72 local confopts=""
73 if use bindist ; then
74 confopts="no-idea no-rc5 no-mdc2 no-ec"
75 else
76 confopts="enable-idea enable-rc5 enable-mdc2 enable-ec"
77 fi
78 use zlib && confopts="${confopts} zlib-dynamic"
79 #use sse2 || confopts="${confopts} no-sse2"
80
81 local sslout=$(./gentoo.config)
82 einfo "Use configuration ${sslout:-(openssl knows best)}"
83 local config="Configure"
84 [[ -z ${sslout} ]] && config="config"
85 ./${config} \
86 ${sslout} \
87 ${confopts} \
88 --prefix=${EPREFIX}/usr \
89 --openssldir=${EPREFIX}/etc/ssl \
90 shared threads \
91 || die "Configure failed"
92
93 # Clean out hardcoded flags that openssl uses
94 local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
95 -e 's:^CFLAG=::' \
96 -e 's:-fomit-frame-pointer ::g' \
97 -e 's:-O[0-9] ::g' \
98 -e 's:-march=[-a-z0-9]* ::g' \
99 -e 's:-mcpu=[-a-z0-9]* ::g' \
100 -e 's:-m[a-z0-9]* ::g' \
101 )
102 sed -i -e "/^CFLAG/s:=.*:=${CFLAG} ${CFLAGS}:" Makefile || die
103
104 # depend is needed to use $confopts
105 # rehash is needed to prep the certs/ dir
106 emake -j1 depend || die "depend failed"
107 emake all rehash || die "make all failed"
108
109 # force until we get all the gentoo.config kinks worked out
110 if has test ${FEATURES} && ! tc-is-cross-compiler ; then
111 src_test
112 fi
113 }
114
115 src_test() {
116 # make sure sandbox doesnt die on *BSD
117 addpredict /dev/crypto
118
119 make test || die "make test failed"
120 }
121
122 src_install() {
123 make INSTALL_PREFIX="${EDEST}" install || die
124 dodoc CHANGES* FAQ NEWS README doc/*.txt
125 dohtml doc/*
126
127 if use emacs ; then
128 insinto /usr/share/emacs/site-lisp
129 doins doc/c-indentation.el
130 fi
131
132 # create the certs directory
133 dodir /etc/ssl/certs
134 cp -RP certs/* "${D}"/etc/ssl/certs/ || die "failed to install certs"
135 rm -r "${D}"/etc/ssl/certs/{demo,expired}
136
137 # Namespace openssl programs to prevent conflicts with other man pages
138 cd "${D}"/usr/share/man
139 local m d s
140 for m in $(find . -type f -printf '%P ' | xargs grep -L '#include') ; do
141 d=${m%/*} ; m=${m##*/}
142 mv ${d}/{,ssl-}${m}
143 ln -s ssl-${m} ${d}/openssl-${m}
144 # locate any symlinks that point to this man page
145 for s in $(find ${d} -lname ${m}) ; do
146 s=${s##*/}
147 rm -f ${d}/${s}
148 ln -s ssl-${m} ${d}/ssl-${s}
149 ln -s ssl-${s} ${d}/openssl-${s}
150 done
151 done
152
153 diropts -m0700
154 keepdir /etc/ssl/private
155 }
156
157 pkg_preinst() {
158 if [[ -e ${ROOT}/usr/$(get_libdir)/libcrypto.so.0.9.7 ]] ; then
159 cp -pPR "${ROOT}"/usr/$(get_libdir)/lib{crypto,ssl}.so.0.9.7 "${IMAGE}"/usr/$(get_libdir)/
160 fi
161 }
162
163 pkg_postinst() {
164 if [[ -e ${ROOT}/usr/$(get_libdir)/libcrypto.so.0.9.7 ]] ; then
165 ewarn "You must re-compile all packages that are linked against"
166 ewarn "OpenSSL 0.9.7 by using revdep-rebuild from gentoolkit:"
167 ewarn "# revdep-rebuild --library libssl.so.0.9.7"
168 ewarn "# revdep-rebuild --library libcrypto.so.0.9.7"
169 ewarn "After this, you can delete /usr/$(get_libdir)/libssl.so.0.9.7"
170 ewarn "and /usr/$(get_libdir)/libcrypto.so.0.9.7"
171 fi
172 }

  ViewVC Help
Powered by ViewVC 1.1.20