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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1372 - (show annotations) (download)
Thu Sep 7 12:27:29 2006 UTC (7 years, 10 months ago) by grobian
File size: 5054 byte(s)
Force manpath dir being prefixed


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

  ViewVC Help
Powered by ViewVC 1.1.20