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