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