e6d0f1e6c4b4c01ac523d12c4a8eda05e47ca372
[gentoo.git] / app-admin / apache-tools / apache-tools-2.2.31.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="4"
6 inherit flag-o-matic eutils
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"
15 IUSE="ssl"
16 RESTRICT="test"
17
18 RDEPEND="=dev-libs/apr-1*
19         =dev-libs/apr-util-1*
20         dev-libs/expat
21         dev-libs/libpcre
22         kernel_linux? ( sys-apps/util-linux )
23         ssl? ( dev-libs/openssl )
24         !<www-servers/apache-2.2.4"
25
26 DEPEND="${RDEPEND}
27         sys-devel/libtool"
28
29 S="${WORKDIR}/httpd-${PV}"
30
31 src_prepare() {
32         # Apply these patches:
33         # (1)   apache-tools-2.2.20-Makefile.patch:
34         #               - fix up the `make install' for support/
35         #               - remove envvars from `make install'
36         epatch "${FILESDIR}"/${PN}-2.2.20-Makefile.patch
37 }
38
39 src_configure() {
40         # Brain dead check.
41         tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
42
43         # Instead of filtering --as-needed (bug #128505), append --no-as-needed
44         append-ldflags $(no-as-needed)
45
46         # econf overwrites the stuff from config.layout.
47         econf \
48                 --sbindir=/usr/sbin \
49                 --with-z=/usr \
50                 --with-apr=/usr \
51                 --with-apr-util=/usr \
52                 --with-pcre=/usr \
53                 $(use_enable ssl) \
54                 $(usex ssl '--with-ssl=/usr' '')
55 }
56
57 src_compile() {
58         cd support || die
59         emake
60 }
61
62 src_install () {
63         cd support || die
64
65         make DESTDIR="${D}" install || die
66
67         # install manpages
68         doman "${S}"/docs/man/{dbmmanage,htdigest,htpasswd,htdbm}.1 \
69                 "${S}"/docs/man/{htcacheclean,rotatelogs,ab,logresolve}.8
70
71         # Providing compatiblity symlinks for #177697 (which we'll stop to install
72         # at some point).
73         pushd "${D}"/usr/sbin/ >/dev/null || die
74         for i in *; do
75                 dosym /usr/sbin/${i} /usr/sbin/${i}2
76         done
77         popd >/dev/null || die
78
79         # Provide a symlink for ab-ssl
80         if use ssl; then
81                 dosym /usr/sbin/ab /usr/sbin/ab-ssl
82                 dosym /usr/sbin/ab /usr/sbin/ab2-ssl
83         fi
84
85         # make htpasswd accessible for non-root users
86         dosym /usr/sbin/htpasswd /usr/bin/htpasswd
87         dosym /usr/sbin/htdigest /usr/bin/htdigest
88
89         dodoc "${S}"/CHANGES
90 }