add app-admin/apache-toos-2.4.18
[portage-squeep] / app-admin / apache-tools / apache-tools-2.4.18.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit flag-o-matic eutils multilib toolchain-funcs
7
8 DESCRIPTION="Useful Apache tools - htdigest, htpasswd, ab, htdbm"
9 HOMEPAGE="http://httpd.apache.org/"
10 SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2"
11
12 LICENSE="Apache-2.0"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
15 IUSE="libressl ssl"
16 RESTRICT="test"
17
18 RDEPEND=">=dev-libs/apr-1.5.0:1
19 dev-libs/apr-util:1
20 dev-libs/expat
21 dev-libs/libpcre
22 kernel_linux? ( sys-apps/util-linux )
23 ssl? (
24 !libressl? ( dev-libs/openssl:0= )
25 libressl? ( dev-libs/libressl:= )
26 )"
27
28 DEPEND="${RDEPEND}
29 sys-devel/libtool"
30
31 S="${WORKDIR}/httpd-${PV}"
32
33 src_prepare() {
34 epatch "${FILESDIR}"/${PN}-2.4.7-Makefile.patch #459446
35
36 # This package really should upgrade to using pcre's .pc file.
37 cat <<-\EOF >"${T}"/pcre-config
38 #!/bin/sh
39 [ "${flag}" = "--version" ] && set -- --modversion
40 exec ${PKG_CONFIG} libpcre "$@"
41 EOF
42 chmod a+x "${T}"/pcre-config
43 }
44
45 src_configure() {
46 # Brain dead check.
47 tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
48
49 tc-export PKG_CONFIG
50
51 # Instead of filtering --as-needed (bug #128505), append --no-as-needed
52 append-ldflags $(no-as-needed)
53
54 # econf overwrites the stuff from config.layout.
55 ac_cv_path_PKGCONFIG=${PKG_CONFIG} \
56 econf \
57 --libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules \
58 --sbindir="${EPREFIX}"/usr/sbin \
59 --with-perl="${EPREFIX}"/usr/bin/perl \
60 --with-expat="${EPREFIX}"/usr \
61 --with-z="${EPREFIX}"/usr \
62 --with-apr="${SYSROOT}${EPREFIX}"/usr \
63 --with-apr-util="${SYSROOT}${EPREFIX}"/usr \
64 --with-pcre="${T}"/pcre-config \
65 $(use_enable ssl) \
66 $(usex ssl '--with-ssl="${EPREFIX}"/usr' '')
67 sed -i \
68 -e '/^LTFLAGS/s:--silent::' \
69 build/rules.mk build/config_vars.mk || die
70 }
71
72 src_compile() {
73 emake -C support
74 }
75
76 src_install() {
77 emake -C support DESTDIR="${D}" install
78 dodoc CHANGES
79 doman docs/man/{dbmmanage,htdigest,htpasswd,htdbm,ab,logresolve}.1 \
80 docs/man/{htcacheclean,rotatelogs}.8
81
82 # Providing compatiblity symlinks for #177697 (which we'll stop to install
83 # at some point).
84 pushd "${ED}"/usr/sbin >/dev/null || die
85 local i
86 for i in *; do
87 dosym ${i} /usr/sbin/${i}2
88 done
89 popd >/dev/null || die
90
91 # Provide a symlink for ab-ssl
92 if use ssl; then
93 dosym ab /usr/bin/ab-ssl
94 dosym ab /usr/bin/ab2-ssl
95 fi
96 }
97