| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/sys-auth/nss-pam-ldapd/nss-pam-ldapd-0.8.10-r1.ebuild,v 1.1 2012/07/24 21:32:13 prometheanfire Exp $ |
| 4 |
|
| 5 |
EAPI=4 |
| 6 |
|
| 7 |
inherit multilib user |
| 8 |
|
| 9 |
DESCRIPTION="NSS module for name lookups using LDAP" |
| 10 |
HOMEPAGE="http://arthurdejong.org/nss-pam-ldapd/" |
| 11 |
SRC_URI="http://arthurdejong.org/nss-pam-ldapd/${P}.tar.gz" |
| 12 |
|
| 13 |
LICENSE="LGPL-2.1" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="~x86 ~amd64" |
| 16 |
IUSE="debug kerberos sasl +pam" |
| 17 |
|
| 18 |
DEPEND="net-nds/openldap |
| 19 |
sasl? ( dev-libs/cyrus-sasl ) |
| 20 |
kerberos? ( virtual/krb5 ) |
| 21 |
pam? ( virtual/pam ) |
| 22 |
!sys-auth/nss_ldap |
| 23 |
!sys-auth/pam_ldap" |
| 24 |
RDEPEND="${DEPEND}" |
| 25 |
|
| 26 |
pkg_setup() { |
| 27 |
enewgroup nslcd |
| 28 |
enewuser nslcd -1 -1 -1 nslcd |
| 29 |
} |
| 30 |
|
| 31 |
src_configure() { |
| 32 |
# nss libraries always go in /lib on Gentoo |
| 33 |
myconf="--enable-warnings |
| 34 |
--with-ldap-lib=openldap |
| 35 |
--with-ldap-conf-file=/etc/nslcd.conf |
| 36 |
--with-nslcd-pidfile=/var/run/nslcd/nslcd.pid |
| 37 |
--with-nslcd-socket=/var/run/nslcd/socket |
| 38 |
--libdir=/$(get_libdir) |
| 39 |
$(use_enable debug) |
| 40 |
$(use_enable kerberos) |
| 41 |
$(use_enable pam)" |
| 42 |
|
| 43 |
if use x86-fbsd; then |
| 44 |
myconf+=" --with-nss-flavour=freebsd" |
| 45 |
else |
| 46 |
myconf+=" --with-nss-flavour=glibc" |
| 47 |
fi |
| 48 |
|
| 49 |
econf ${myconf} |
| 50 |
} |
| 51 |
|
| 52 |
src_install() { |
| 53 |
emake DESTDIR="${D}" install |
| 54 |
|
| 55 |
dodoc NEWS ChangeLog AUTHORS README |
| 56 |
|
| 57 |
# for socket and pid file |
| 58 |
keepdir /var/run/nslcd |
| 59 |
|
| 60 |
# init script |
| 61 |
newinitd "${FILESDIR}"/nslcd-init nslcd |
| 62 |
|
| 63 |
# make an example copy |
| 64 |
insinto /usr/share/nss-pam-ldapd |
| 65 |
doins nslcd.conf |
| 66 |
|
| 67 |
fperms o-r /etc/nslcd.conf |
| 68 |
} |
| 69 |
|
| 70 |
pkg_postinst() { |
| 71 |
elog |
| 72 |
elog "For this to work you must configure /etc/nslcd.conf" |
| 73 |
elog "This configuration is similar to pam_ldap's /etc/ldap.conf" |
| 74 |
elog |
| 75 |
elog "In order to use nss-pam-ldapd, nslcd needs to be running. You can" |
| 76 |
elog "start it like this:" |
| 77 |
elog " # /etc/init.d/nslcd start" |
| 78 |
elog |
| 79 |
elog "You can add it to the default runlevel like so:" |
| 80 |
elog " # rc-update add nslcd default" |
| 81 |
elog |
| 82 |
elog "If you are upgrading, keep in mind that /etc/nss-ldapd.conf" |
| 83 |
elog " is now named /etc/nslcd.conf" |
| 84 |
elog |
| 85 |
} |