]> Pileus Git - ~andy/sunrise/blob - net-www/mod_auth_nufw/mod_auth_nufw-2.2.0.ebuild
media-sound/chuck: In portage now
[~andy/sunrise] / net-www / mod_auth_nufw / mod_auth_nufw-2.2.0.ebuild
1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 WANT_AUTOCONF="latest"
6 WANT_AUTOMAKE="latest"
7 inherit eutils apache-module autotools
8
9 DESCRIPTION="mod_auth_nufw A NuFW authentication module for apache"
10 HOMEPAGE="http://www.inl.fr/mod-auth-nufw.html"
11 SRC_URI="http://software.inl.fr/releases/${PN}/${P}.tar.gz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~x86"
16 IUSE="apache2 mysql postgres ldap"
17
18 DEPEND="dev-libs/apr
19         mysql? ( virtual/mysql )
20         postgres? ( dev-db/postgresql )
21         ldap? ( net-nds/openldap )"
22 RDEPEND=""
23
24 APACHE2_MOD_FILE="mod_auth_nufw.so"
25
26 APACHE1_MOD_CONF="50_${PN}"
27 APACHE1_MOD_DEFINE="AUTH_NUFW"
28
29 APACHE2_MOD_CONF="50_${PN}"
30 APACHE2_MOD_DEFINE="AUTH_NUFW"
31
32 DOCFILES="doc/mod_auth_nufw.html"
33
34 need_apache
35
36 pkg_setup() {
37         local cnt=0
38         use mysql && cnt="$((${cnt} + 1))"
39         use postgres && cnt="$((${cnt} + 1))"
40         if [[ "${cnt}" -ne 1 ]] ; then
41                 eerror "You have set ${P} to use multiple sql engine."
42                 eerror "I don't know which to use!"
43                 eerror "You can use /etc/portage/package.use to set per-package USE flags"
44                 eerror "Set it so only one sql engine type mysql, postgres"
45                 die "Please set only one sql engine type"
46         fi
47 }
48
49 src_unpack() {
50         unpack ${A}
51         cd "${S}"
52
53         epatch "${FILESDIR}/${P}-configure_in.patch"
54 }
55
56 src_compile() {
57         cd "${S}"
58
59         local apx
60         if [ ${APACHE_VERSION} -eq '1' ]; then
61                 apx=${APXS1}
62         else
63                 apx=${APXS2}
64         fi
65
66         APR_INCLUDE="-I`apr-config --includedir`"
67
68         eautoreconf
69         econf \
70                 $(use_with apache2 apache20) \
71                 $(use_with mysql) \
72                 $(use_with ldap ldap-uids) \
73                 --with-apxs=${apx} \
74                 CPPFLAGS="${APR_INCLUDE} ${CPPFLAGS}" \
75                 || die "econf failed"
76         emake || die "emake failed"
77 }