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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Aug 10 20:48:20 2014 UTC (2 months, 2 weeks ago) by slyfox
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +3 -3 lines
QA: drop trailing '.' from DESCRIPTION

(Portage version: 2.2.11_p9/cvs/Linux x86_64, signed Manifest commit with key 611FF3AA)

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

  ViewVC Help
Powered by ViewVC 1.1.20