| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-libs/apr/apr-1.4.6-r1.ebuild,v 1.1 2012/11/28 04:40:54 ottxor Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
|
| 7 |
inherit autotools eutils libtool multilib |
| 8 |
|
| 9 |
DESCRIPTION="Apache Portable Runtime Library" |
| 10 |
HOMEPAGE="http://apr.apache.org/" |
| 11 |
SRC_URI="mirror://apache/apr/${P}.tar.bz2" |
| 12 |
|
| 13 |
LICENSE="Apache-2.0" |
| 14 |
SLOT="1" |
| 15 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-aix ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
| 16 |
IUSE="doc elibc_FreeBSD older-kernels-compatibility static-libs +urandom +uuid" |
| 17 |
|
| 18 |
RDEPEND="uuid? ( |
| 19 |
elibc_glibc? ( >=sys-apps/util-linux-2.16 ) |
| 20 |
elibc_mintlib? ( >=sys-apps/util-linux-2.18 ) |
| 21 |
)" |
| 22 |
DEPEND="${RDEPEND} |
| 23 |
doc? ( app-doc/doxygen )" |
| 24 |
|
| 25 |
DOCS=(CHANGES NOTICE README) |
| 26 |
|
| 27 |
src_prepare() { |
| 28 |
epatch "${FILESDIR}"/${P}-mint.patch |
| 29 |
|
| 30 |
# Ensure that system libtool is used. |
| 31 |
local g= |
| 32 |
[[ ${CHOST} == *-darwin* ]] && g=g |
| 33 |
sed -e 's:${installbuilddir}/libtool:'"${EPREFIX}/usr/bin/${g}libtool"':' -i apr-config.in || die "sed failed" |
| 34 |
sed -e 's:@LIBTOOL@:$(SHELL) '"${EPREFIX}/usr/bin/${g}libtool"':' -i build/apr_rules.mk.in || die "sed failed" |
| 35 |
|
| 36 |
# Apply user patches, bug #449048 |
| 37 |
epatch_user |
| 38 |
|
| 39 |
AT_M4DIR="build" eautoreconf |
| 40 |
elibtoolize |
| 41 |
|
| 42 |
epatch "${FILESDIR}/config.layout.patch" |
| 43 |
} |
| 44 |
|
| 45 |
src_configure() { |
| 46 |
local myconf |
| 47 |
|
| 48 |
[[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no |
| 49 |
|
| 50 |
if use older-kernels-compatibility; then |
| 51 |
local apr_cv_accept4 apr_cv_dup3 apr_cv_epoll_create1 apr_cv_sock_cloexec |
| 52 |
export apr_cv_accept4="no" |
| 53 |
export apr_cv_dup3="no" |
| 54 |
export apr_cv_epoll_create1="no" |
| 55 |
export apr_cv_sock_cloexec="no" |
| 56 |
fi |
| 57 |
|
| 58 |
if use urandom; then |
| 59 |
myconf+=" --with-devrandom=/dev/urandom" |
| 60 |
elif (( ${CHOST#*-hpux11.} <= 11 )); then |
| 61 |
: # no /dev/*random on hpux11.11 and before, $PN detects this. |
| 62 |
else |
| 63 |
myconf+=" --with-devrandom=/dev/random" |
| 64 |
fi |
| 65 |
|
| 66 |
if [[ ${CHOST} == *-mint* ]] ; then |
| 67 |
myconf+=" --disable-dso" |
| 68 |
fi |
| 69 |
|
| 70 |
# shl_load does not search runpath, but hpux11 supports dlopen |
| 71 |
[[ ${CHOST} == *-hpux11* ]] && myconf="${myconf} --enable-dso=dlfcn" |
| 72 |
|
| 73 |
if [[ ${CHOST} == *-solaris2.10 ]]; then |
| 74 |
case $(<$([[ ${CHOST} != ${CBUILD} ]] && echo "${EPREFIX}/usr/${CHOST}")/usr/include/atomic.h) in |
| 75 |
*atomic_cas_ptr*) ;; |
| 76 |
*) |
| 77 |
elog "You do not have Solaris Patch ID "$( |
| 78 |
[[ ${CHOST} == sparc* ]] && echo 118884 || echo 118885 |
| 79 |
)" (Problem 4954703) installed on your host ($(hostname))," |
| 80 |
elog "using generic atomic operations instead." |
| 81 |
myconf="${myconf} --disable-nonportable-atomics" |
| 82 |
;; |
| 83 |
esac |
| 84 |
fi |
| 85 |
|
| 86 |
if ! use uuid; then |
| 87 |
local apr_cv_osuuid |
| 88 |
export apr_cv_osuuid="no" |
| 89 |
fi |
| 90 |
|
| 91 |
CONFIG_SHELL="${EPREFIX}"/bin/bash econf \ |
| 92 |
--enable-layout=gentoo \ |
| 93 |
--enable-nonportable-atomics \ |
| 94 |
--enable-threads \ |
| 95 |
${myconf} |
| 96 |
|
| 97 |
rm -f libtool |
| 98 |
} |
| 99 |
|
| 100 |
src_compile() { |
| 101 |
emake |
| 102 |
|
| 103 |
if use doc; then |
| 104 |
emake dox |
| 105 |
fi |
| 106 |
} |
| 107 |
|
| 108 |
src_install() { |
| 109 |
default |
| 110 |
|
| 111 |
find "${ED}" -name "*.la" -exec rm -f {} + |
| 112 |
|
| 113 |
if use doc; then |
| 114 |
dohtml -r docs/dox/html/* |
| 115 |
fi |
| 116 |
|
| 117 |
if ! use static-libs; then |
| 118 |
find "${ED}" -name "*.a" -exec rm -f {} + |
| 119 |
fi |
| 120 |
|
| 121 |
# This file is only used on AIX systems, which Gentoo is not, |
| 122 |
# and causes collisions between the SLOTs, so remove it. |
| 123 |
# Even in Prefix, we don't need this on AIX. |
| 124 |
rm -f "${ED}usr/$(get_libdir)/apr.exp" |
| 125 |
} |