Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/cyrus-sasl/
Date: Wed, 02 Jan 2019 08:22:58
Message-Id: 1546416470.388691f2b3c01e22ba8389524218b32c94fb8096.polynomial-c@gentoo
1 commit: 388691f2b3c01e22ba8389524218b32c94fb8096
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jan 2 03:06:18 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 2 08:07:50 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=388691f2
7
8 dev-libs/cyrus-sasl: revbump, use tarball manpages
9
10 And remove dep on sphinx and unnecessary manpage generation
11
12 Package-Manager: Portage-2.3.53, Repoman-2.3.12
13 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
14 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
15
16 dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild | 253 ++++++++++++++++++++++++
17 1 file changed, 253 insertions(+)
18
19 diff --git a/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild
20 new file mode 100644
21 index 00000000000..ee2789f0acc
22 --- /dev/null
23 +++ b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.27-r1.ebuild
24 @@ -0,0 +1,253 @@
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=6
29 +
30 +inherit flag-o-matic multilib multilib-minimal autotools pam java-pkg-opt-2 db-use systemd eapi7-ver
31 +
32 +SASLAUTHD_CONF_VER="2.1.26"
33 +
34 +DESCRIPTION="The Cyrus SASL (Simple Authentication and Security Layer)"
35 +HOMEPAGE="https://www.cyrusimap.org/sasl/"
36 +SRC_URI="ftp://ftp.cyrusimap.org/cyrus-sasl/${P}.tar.gz"
37 +
38 +LICENSE="BSD-with-attribution"
39 +SLOT="2"
40 +KEYWORDS="~amd64 ~x86"
41 +IUSE="authdaemond berkdb gdbm kerberos ldapdb libressl openldap mysql pam postgres sample selinux sqlite srp ssl static-libs urandom"
42 +
43 +CDEPEND="
44 + net-mail/mailbase
45 + authdaemond? ( || ( net-mail/courier-imap mail-mta/courier ) )
46 + berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
47 + gdbm? ( >=sys-libs/gdbm-1.10-r1:=[${MULTILIB_USEDEP}] )
48 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
49 + openldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
50 + mysql? ( virtual/mysql )
51 + pam? ( >=virtual/pam-0-r1[${MULTILIB_USEDEP}] )
52 + postgres? ( dev-db/postgresql:* )
53 + sqlite? ( >=dev-db/sqlite-3.8.2:3[${MULTILIB_USEDEP}] )
54 + ssl? (
55 + !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
56 + libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
57 + )
58 + java? ( >=virtual/jdk-1.6:= )"
59 +
60 +RDEPEND="
61 + ${CDEPEND}
62 + selinux? ( sec-policy/selinux-sasl )"
63 +
64 +DEPEND="${CDEPEND}"
65 +
66 +MULTILIB_WRAPPED_HEADERS=(
67 + /usr/include/sasl/md5global.h
68 +)
69 +
70 +PATCHES=(
71 + "${FILESDIR}/${PN}-2.1.27-avoid_pic_overwrite.patch"
72 + "${FILESDIR}/${PN}-2.1.27-autotools_fixes.patch"
73 + "${FILESDIR}/${PN}-2.1.27-as_needed.patch"
74 + "${FILESDIR}/${PN}-2.1.25-auxprop.patch"
75 + "${FILESDIR}/${PN}-2.1.27-gss_c_nt_hostbased_service.patch"
76 + "${FILESDIR}/${PN}-2.1.26-missing-size_t.patch"
77 + "${FILESDIR}/${PN}-2.1.27-doc_build_fix.patch"
78 +)
79 +
80 +pkg_setup() {
81 + java-pkg-opt-2_pkg_setup
82 +}
83 +
84 +src_prepare() {
85 + default
86 +
87 + # Get rid of the -R switch (runpath_switch for Sun)
88 + # >=gcc-4.6 errors out with unknown option
89 + sed -i -e '/LIB_SQLITE.*-R/s/ -R[^"]*//' \
90 + configure.ac || die
91 +
92 + # Use plugindir for sasldir
93 + sed -i '/^sasldir =/s:=.*:= $(plugindir):' \
94 + "${S}"/plugins/Makefile.{am,in} || die "sed failed"
95 +
96 + # #486740 #468556
97 + sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:g' \
98 + -e 's:AC_CONFIG_MACRO_DIR:AC_CONFIG_MACRO_DIRS:g' \
99 + configure.ac || die
100 +
101 + eautoreconf
102 +}
103 +
104 +src_configure() {
105 + append-flags -fno-strict-aliasing
106 + if [[ ${CHOST} == *-solaris* ]] ; then
107 + # getpassphrase is defined in /usr/include/stdlib.h
108 + append-cppflags -DHAVE_GETPASSPHRASE
109 + else
110 + # this horrendously breaks things on Solaris
111 + append-cppflags -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -DLDAP_DEPRECATED
112 + fi
113 +
114 + multilib-minimal_src_configure
115 +}
116 +
117 +multilib_src_configure() {
118 + # Java support.
119 + multilib_is_native_abi && use java && export JAVAC="${JAVAC} ${JAVACFLAGS}"
120 +
121 + local myeconfargs=(
122 + --enable-login
123 + --enable-ntlm
124 + --enable-auth-sasldb
125 + --disable-cmulocal
126 + --disable-krb4
127 + --disable-macos-framework
128 + --enable-otp
129 + --without-sqlite
130 + --with-saslauthd="${EPREFIX}"/run/saslauthd
131 + --with-pwcheck="${EPREFIX}"/run/saslauthd
132 + --with-configdir="${EPREFIX}"/etc/sasl2
133 + --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sasl2
134 + --with-dbpath="${EPREFIX}"/etc/sasl2/sasldb2
135 + --with-sphinx-build=no
136 + $(use_with ssl openssl)
137 + $(use_with pam)
138 + $(use_with openldap ldap)
139 + $(use_enable ldapdb)
140 + $(multilib_native_use_enable sample)
141 + $(use_enable kerberos gssapi)
142 + $(multilib_native_use_enable java)
143 + $(multilib_native_use_with mysql mysql "${EPREFIX}"/usr)
144 + $(multilib_native_use_with postgres pgsql "${EPREFIX}"/usr/$(get_libdir)/postgresql)
145 + $(use_with sqlite sqlite3 "${EPREFIX}"/usr/$(get_libdir))
146 + $(use_enable srp)
147 + $(use_enable static-libs static)
148 +
149 + # Add authdaemond support (bug #56523).
150 + $(usex authdaemond --with-authdaemond="${EPREFIX}"/var/lib/courier/authdaemon/socket '')
151 +
152 + # Fix for bug #59634.
153 + $(usex ssl '' --without-des)
154 +
155 + # Use /dev/urandom instead of /dev/random (bug #46038).
156 + $(usex urandom --with-devrandom=/dev/urandom '')
157 + )
158 +
159 + if use sqlite || { multilib_is_native_abi && { use mysql || use postgres; }; } ; then
160 + myeconfargs+=( --enable-sql )
161 + else
162 + myeconfargs+=( --disable-sql )
163 + fi
164 +
165 + # Default to GDBM if both 'gdbm' and 'berkdb' are present.
166 + if use gdbm ; then
167 + einfo "Building with GNU DB as database backend for your SASLdb"
168 + myeconfargs+=( --with-dblib=gdbm )
169 + elif use berkdb ; then
170 + einfo "Building with BerkeleyDB as database backend for your SASLdb"
171 + myeconfargs+=(
172 + --with-dblib=berkeley
173 + --with-bdb-incdir="$(db_includedir)"
174 + )
175 + else
176 + einfo "Building without SASLdb support"
177 + myeconfargs+=( --with-dblib=none )
178 + fi
179 +
180 + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
181 +}
182 +
183 +multilib_src_compile() {
184 + emake
185 +
186 + # Default location for java classes breaks OpenOffice (bug #60769).
187 + # Thanks to axxo@g.o for the solution.
188 + if multilib_is_native_abi && use java ; then
189 + jar -cvf ${PN}.jar -C java $(find java -name "*.class")
190 + fi
191 +}
192 +
193 +multilib_src_install() {
194 + default
195 +
196 + if multilib_is_native_abi; then
197 + if use sample ; then
198 + docinto sample
199 + dodoc "${S}"/sample/*.c
200 + exeinto /usr/share/doc/${P}/sample
201 + doexe sample/client sample/server
202 + fi
203 +
204 + # Default location for java classes breaks OpenOffice (bug #60769).
205 + if use java; then
206 + java-pkg_dojar ${PN}.jar
207 + java-pkg_regso "${ED}/usr/$(get_libdir)/libjavasasl$(get_libname)"
208 + # hackish, don't wanna dig through makefile
209 + rm -rf "${ED}/usr/$(get_libdir)/java" || die
210 + docinto "java"
211 + dodoc "${S}/java/README" "${FILESDIR}/java.README.gentoo" "${S}"/java/doc/*
212 + dodir "/usr/share/doc/${PF}/java/Test"
213 + insinto "/usr/share/doc/${PF}/java/Test"
214 + doins "${S}"/java/Test/*.java
215 + fi
216 +
217 + dosbin saslauthd/testsaslauthd
218 + fi
219 +}
220 +
221 +multilib_src_install_all() {
222 +
223 + doman man/*
224 +
225 + keepdir /etc/sasl2
226 +
227 + dodoc AUTHORS ChangeLog doc/legacy/TODO
228 + newdoc pwcheck/README README.pwcheck
229 +
230 + newdoc docsrc/sasl/release-notes/$(ver_cut 1-2)/index.rst release-notes
231 + edos2unix ${ED%/}/usr/share/doc/${PF}/release-notes
232 +
233 + docinto html
234 + dodoc doc/html/*.html
235 +
236 + newpamd "${FILESDIR}/saslauthd.pam-include" saslauthd
237 +
238 + newinitd "${FILESDIR}/pwcheck.rc6" pwcheck
239 + systemd_dounit "${FILESDIR}/pwcheck.service"
240 +
241 + newinitd "${FILESDIR}/saslauthd2.rc7" saslauthd
242 + newconfd "${FILESDIR}/saslauthd-${SASLAUTHD_CONF_VER}.conf" saslauthd
243 + systemd_dounit "${FILESDIR}/saslauthd.service"
244 + systemd_dotmpfilesd "${FILESDIR}/${PN}.conf"
245 +
246 + # The get_modname bit is important: do not remove the .la files on
247 + # platforms where the lib isn't called .so for cyrus searches the .la to
248 + # figure out what the name is supposed to be instead
249 + if ! use static-libs && [[ $(get_modname) == .so ]] ; then
250 + find "${ED}" -name "*.la" -delete || die
251 + fi
252 +}
253 +
254 +pkg_postinst () {
255 + # Generate an empty sasldb2 with correct permissions.
256 + if ( use berkdb || use gdbm ) && [[ ! -f "${EROOT}/etc/sasl2/sasldb2" ]] ; then
257 + einfo "Generating an empty sasldb2 with correct permissions ..."
258 + echo "p" | "${EROOT}/usr/sbin/saslpasswd2" -f "${EROOT}/etc/sasl2/sasldb2" -p login \
259 + || die "Failed to generate sasldb2"
260 + "${EROOT}/usr/sbin/saslpasswd2" -f "${EROOT}/etc/sasl2/sasldb2" -d login \
261 + || die "Failed to delete temp user"
262 + chown root:mail "${EROOT}/etc/sasl2/sasldb2" \
263 + || die "Failed to chown ${EROOT}/etc/sasl2/sasldb2"
264 + chmod 0640 "${EROOT}/etc/sasl2/sasldb2" \
265 + || die "Failed to chmod ${EROOT}/etc/sasl2/sasldb2"
266 + fi
267 +
268 + if use authdaemond ; then
269 + elog "You need to add a user running a service using Courier's"
270 + elog "authdaemon to the 'mail' group. For example, do:"
271 + elog " gpasswd -a postfix mail"
272 + elog "to add the 'postfix' user to the 'mail' group."
273 + fi
274 +
275 + elog "pwcheck and saslauthd home directories have moved to:"
276 + elog " /run/saslauthd, using tmpfiles.d"
277 +}