Gentoo Archives: gentoo-commits

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