/[gentoo-x86]/net-libs/courier-authlib/courier-authlib-0.66.3.ebuild
Gentoo

Contents of /net-libs/courier-authlib/courier-authlib-0.66.3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Fri Jul 31 10:26:29 2015 UTC (5 years, 3 months ago) by zlogene
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +2 -2 lines
ia64 stable wrt bug #553660

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0x1BDC0E5AC42EB5D6)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-libs/courier-authlib/courier-authlib-0.66.3.ebuild,v 1.9 2015/07/23 09:34:19 ago Exp $
4
5 EAPI=5
6 inherit eutils flag-o-matic multilib user
7
8 KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
9
10 DESCRIPTION="Courier authentication library"
11 SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
12 HOMEPAGE="http://www.courier-mta.org/"
13 LICENSE="GPL-3"
14 SLOT="0"
15 IUSE="berkdb crypt debug gdbm ldap mysql pam postgres sqlite static-libs vpopmail"
16
17 RESTRICT="userpriv
18 !berkdb? ( test )"
19
20 DEPEND="net-mail/mailbase
21 =net-libs/courier-unicode-1.3
22 gdbm? ( sys-libs/gdbm )
23 !gdbm? ( sys-libs/db:= )
24 dev-libs/openssl:=
25 ldap? ( >=net-nds/openldap-1.2.11 )
26 mysql? ( virtual/mysql )
27 pam? ( virtual/pam )
28 postgres? ( dev-db/postgresql:= )
29 sqlite? ( dev-db/sqlite:3 )"
30
31 RDEPEND="${DEPEND}"
32
33 pkg_setup() {
34 if ! has_version 'dev-tcltk/expect' ; then
35 ewarn 'The dev-tcltk/expect package is not installed.'
36 ewarn 'Without it, you will not be able to change system login passwords.'
37 ewarn 'However non-system authentication modules (LDAP, MySQL, PostgreSQL,'
38 ewarn 'and others) will work just fine.'
39 fi
40 }
41
42 src_configure() {
43 filter-flags -fomit-frame-pointer
44 local myconf
45 if use berkdb ; then
46 if use gdbm ; then
47 ewarn "Both gdbm and berkdb selected. Using gdbm."
48 else
49 myconf="--with-db=db"
50 fi
51 fi
52 use gdbm && myconf="--with-db=gdbm"
53 use debug && myconf+=" debug=true"
54 use sqlite && myconf+=" --with-sqlite-libs"
55
56 econf \
57 --sysconfdir=/etc/courier \
58 --datadir=/usr/share/courier \
59 --libexecdir=/usr/$(get_libdir)/courier \
60 --localstatedir=/var/lib/courier \
61 --sharedstatedir=/var/lib/courier/com \
62 --with-authdaemonvar=/var/lib/courier/authdaemon \
63 --with-authshadow \
64 --without-redhat \
65 --with-mailuser=mail \
66 --with-mailgroup=mail \
67 --cache-file="${S}/configuring.cache" \
68 $(use_with pam authpam) \
69 $(use_with ldap authldap) \
70 $(use_with mysql authmysql) \
71 $(use_with postgres authpgsql) \
72 $(use_with sqlite authsqlite) \
73 ${myconf}
74 }
75
76 orderfirst() {
77 file="${D}/etc/courier/authlib/${1}" ; option="${2}" ; param="${3}"
78 if [[ -e "${file}" ]] ; then
79 orig="$(grep ^${option}= ${file} | cut -d\" -f 2)"
80 new="${option}=\"${param} `echo ${orig} | sed -e\"s/${param}//g\" -e\"s/ / /g\"`\""
81 sed -i -e "s/^${option}=.*$/${new}/" "${file}" || die
82 fi
83 }
84
85 finduserdb() {
86 for dir in \
87 /etc/courier/authlib /etc/courier /etc/courier-imap \
88 /usr/lib/courier/etc /usr/lib/courier-imap/etc \
89 /usr/local/etc /usr/local/etc/courier /usr/local/courier/etc \
90 /usr/local/lib/courier/etc /usr/local/lib/courier-imap/etc \
91 /usr/local/share/sqwebmail /usr/local/etc/courier-imap ; do
92 if [[ -e "${dir}/userdb" ]] ; then
93 einfo "Found userdb at: ${dir}/userdb"
94 cp -fR "${dir}/userdb" "${D}/etc/courier/authlib/" || die
95 chmod go-rwx "${D}/etc/courier/authlib/userdb" || die
96 continue
97 fi
98 done
99 }
100
101 src_install() {
102 diropts -o mail -g mail
103 dodir /etc/courier
104 keepdir /var/lib/courier/authdaemon
105 keepdir /etc/courier/authlib
106 emake DESTDIR="${D}" install
107 [[ ! -e "${D}/etc/courier/authlib/userdb" ]] && finduserdb
108 emake DESTDIR="${D}" install-configure
109 rm -f "${D}"/etc/courier/authlib/*.bak
110 chown mail:mail "${D}"/etc/courier/authlib/* || die
111 for y in "${D}"/etc/courier/authlib/*.dist ; do
112 [[ ! -e "${y%%.dist}" ]] && cp -f "${y}" "${y%%.dist}"
113 done
114 use pam && orderfirst authdaemonrc authmodulelist authpam
115 use ldap && orderfirst authdaemonrc authmodulelist authldap
116 use sqlite && orderfirst authdaemonrc authmodulelist authsqlite
117 use postgres && orderfirst authdaemonrc authmodulelist authpgsql
118 use mysql && orderfirst authdaemonrc authmodulelist authmysql
119 dodoc AUTHORS ChangeLog* INSTALL NEWS README
120 dohtml README.html README_authlib.html NEWS.html INSTALL.html README.authdebug.html
121 if use mysql ; then
122 dodoc README.authmysql.myownquery
123 dohtml README.authmysql.html
124 fi
125 if use postgres ; then
126 dohtml README.authpostgres.html README.authmysql.html
127 fi
128 if use ldap ; then
129 dodoc README.ldap
130 dodir /etc/openldap/schema
131 cp -f authldap.schema "${D}/etc/openldap/schema/" || die
132 fi
133 if use sqlite ; then
134 dohtml README.authsqlite.html README.authmysql.html
135 fi
136 newinitd "${FILESDIR}/${PN}-r1" "${PN}"
137
138 use static-libs || find "${D}" -name "*.a" -delete
139 }
140
141 pkg_postinst() {
142 if [[ -e /etc/courier/authlib/userdb ]] ; then
143 einfo "Running makeuserdb ..."
144 chmod go-rwx /etc/courier/authlib/userdb || die
145 makeuserdb
146 fi
147 }

  ViewVC Help
Powered by ViewVC 1.1.20