Gentoo Archives: gentoo-commits

From: Julian Ospald <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/cyrus-sasl/
Date: Sun, 20 Sep 2015 16:39:52
Message-Id: 1442767071.724334d32a4fdf54561dce645fecf6c28c3b4f53.hasufell@gentoo
1 commit: 724334d32a4fdf54561dce645fecf6c28c3b4f53
2 Author: Julian Ospald <hasufell <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 20 14:05:39 2015 +0000
4 Commit: Julian Ospald <hasufell <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 20 16:37:51 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=724334d3
7
8 dev-libs/cyrus-sasl: add libressl support
9
10 dev-libs/cyrus-sasl/cyrus-sasl-2.1.26-r10.ebuild | 246 +++++++++++++++++++++++
11 1 file changed, 246 insertions(+)
12
13 diff --git a/dev-libs/cyrus-sasl/cyrus-sasl-2.1.26-r10.ebuild b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.26-r10.ebuild
14 new file mode 100644
15 index 0000000..76132c2
16 --- /dev/null
17 +++ b/dev-libs/cyrus-sasl/cyrus-sasl-2.1.26-r10.ebuild
18 @@ -0,0 +1,246 @@
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 +
25 +inherit eutils flag-o-matic multilib multilib-minimal autotools pam java-pkg-opt-2 db-use systemd
26 +
27 +SASLAUTHD_CONF_VER="2.1.26"
28 +
29 +DESCRIPTION="The Cyrus SASL (Simple Authentication and Security Layer)"
30 +HOMEPAGE="http://cyrusimap.web.cmu.edu/"
31 +SRC_URI="ftp://ftp.cyrusimap.org/cyrus-sasl/${P}.tar.gz"
32 +
33 +LICENSE="BSD-with-attribution"
34 +SLOT="2"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
36 +IUSE="authdaemond berkdb gdbm kerberos ldapdb libressl openldap mysql pam postgres sample selinux sqlite
37 +srp ssl static-libs urandom"
38 +
39 +DEPEND="net-mail/mailbase
40 + authdaemond? ( || ( net-mail/courier-imap mail-mta/courier ) )
41 + berkdb? ( >=sys-libs/db-4.8.30-r1:=[${MULTILIB_USEDEP}] )
42 + gdbm? ( >=sys-libs/gdbm-1.10-r1[${MULTILIB_USEDEP}] )
43 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
44 + openldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
45 + mysql? ( virtual/mysql )
46 + pam? ( >=virtual/pam-0-r1[${MULTILIB_USEDEP}] )
47 + postgres? ( dev-db/postgresql:= )
48 + sqlite? ( >=dev-db/sqlite-3.8.2:3[${MULTILIB_USEDEP}] )
49 + ssl? (
50 + !libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
51 + libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
52 + )
53 + java? ( >=virtual/jdk-1.4:= )"
54 +RDEPEND="${DEPEND}
55 + selinux? ( sec-policy/selinux-sasl )"
56 +
57 +MULTILIB_WRAPPED_HEADERS=(
58 + /usr/include/sasl/md5global.h
59 +)
60 +
61 +pkg_setup() {
62 + java-pkg-opt-2_pkg_setup
63 +}
64 +
65 +src_prepare() {
66 + epatch "${FILESDIR}"/${PN}-2.1.25-sasldb_al.patch
67 + epatch "${FILESDIR}"/${PN}-2.1.25-saslauthd_libtool.patch
68 + epatch "${FILESDIR}"/${PN}-2.1.25-avoid_pic_overwrite.patch
69 + epatch "${FILESDIR}"/${PN}-2.1.25-autotools_fixes.patch
70 + epatch "${FILESDIR}"/${PN}-2.1.25-as_needed.patch
71 + epatch "${FILESDIR}"/${PN}-2.1.25-missing_header.patch
72 + epatch "${FILESDIR}"/${PN}-2.1.25-fix_heimdal.patch
73 + epatch "${FILESDIR}"/${PN}-2.1.25-auxprop.patch
74 + epatch "${FILESDIR}"/${PN}-2.1.23-gss_c_nt_hostbased_service.patch
75 + epatch "${FILESDIR}"/${PN}-2.1.25-service_keytabs.patch
76 + epatch "${FILESDIR}"/${PN}-2.1.26-missing-size_t.patch
77 + epatch "${FILESDIR}"/${PN}-2.1.26-CVE-2013-4122.patch
78 + epatch "${FILESDIR}"/${PN}-2.1.26-send-imap-logout.patch
79 + epatch "${FILESDIR}"/${PN}-2.1.26-canonuser-ldapdb-garbage-in-out-buffer.patch
80 + epatch "${FILESDIR}"/${PN}-2.1.26-fix_dovecot_authentication.patch
81 +
82 + # Get rid of the -R switch (runpath_switch for Sun)
83 + # >=gcc-4.6 errors out with unknown option
84 + sed -i -e '/LIB_SQLITE.*-R/s/ -R[^"]*//' \
85 + configure.in || die
86 +
87 + # Use plugindir for sasldir
88 + sed -i '/^sasldir =/s:=.*:= $(plugindir):' \
89 + "${S}"/plugins/Makefile.{am,in} || die "sed failed"
90 +
91 + # #486740 #468556
92 + sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:g' \
93 + -e 's:AC_CONFIG_MACRO_DIR:AC_CONFIG_MACRO_DIRS:g' \
94 + configure.in || die
95 + sed -i -e 's:AC_CONFIG_MACRO_DIR:AC_CONFIG_MACRO_DIRS:g' \
96 + saslauthd/configure.in || die
97 +
98 + eautoreconf
99 +}
100 +
101 +src_configure() {
102 + append-flags -fno-strict-aliasing
103 + append-cppflags -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_BSD_SOURCE -DLDAP_DEPRECATED
104 +
105 + multilib-minimal_src_configure
106 +}
107 +
108 +multilib_src_configure() {
109 + # Java support.
110 + multilib_is_native_abi && use java && export JAVAC="${JAVAC} ${JAVACFLAGS}"
111 +
112 + local myconf=()
113 +
114 + # Add authdaemond support (bug #56523).
115 + if use authdaemond ; then
116 + myconf+=( --with-authdaemond=/var/lib/courier/authdaemon/socket )
117 + fi
118 +
119 + # Fix for bug #59634.
120 + if ! use ssl ; then
121 + myconf+=( --without-des )
122 + fi
123 +
124 + if use sqlite || { multilib_is_native_abi && { use mysql || use postgres; }; } ; then
125 + myconf+=( --enable-sql )
126 + else
127 + myconf+=( --disable-sql )
128 + fi
129 +
130 + # Default to GDBM if both 'gdbm' and 'berkdb' are present.
131 + if use gdbm ; then
132 + einfo "Building with GNU DB as database backend for your SASLdb"
133 + myconf+=( --with-dblib=gdbm )
134 + elif use berkdb ; then
135 + einfo "Building with BerkeleyDB as database backend for your SASLdb"
136 + myconf+=(
137 + --with-dblib=berkeley
138 + --with-bdb-incdir="$(db_includedir)"
139 + )
140 + else
141 + einfo "Building without SASLdb support"
142 + myconf+=( --with-dblib=none )
143 + fi
144 +
145 + # Use /dev/urandom instead of /dev/random (bug #46038).
146 + if use urandom ; then
147 + myconf+=( --with-devrandom=/dev/urandom )
148 + fi
149 +
150 + ECONF_SOURCE=${S} \
151 + econf \
152 + --enable-login \
153 + --enable-ntlm \
154 + --enable-auth-sasldb \
155 + --disable-cmulocal \
156 + --disable-krb4 \
157 + --enable-otp \
158 + --without-sqlite \
159 + --with-saslauthd=/run/saslauthd \
160 + --with-pwcheck=/run/saslauthd \
161 + --with-configdir=/etc/sasl2 \
162 + --with-plugindir=/usr/$(get_libdir)/sasl2 \
163 + --with-dbpath=/etc/sasl2/sasldb2 \
164 + $(use_with ssl openssl) \
165 + $(use_with pam) \
166 + $(use_with openldap ldap) \
167 + $(use_enable ldapdb) \
168 + $(multilib_native_use_enable sample) \
169 + $(use_enable kerberos gssapi) \
170 + $(multilib_native_use_enable java) \
171 + $(multilib_native_use_with java javahome ${JAVA_HOME}) \
172 + $(multilib_native_use_with mysql mysql /usr) \
173 + $(multilib_native_use_with postgres pgsql) \
174 + $(use_with sqlite sqlite3 /usr/$(get_libdir)) \
175 + $(use_enable srp) \
176 + $(use_enable static-libs static) \
177 + "${myconf[@]}"
178 +}
179 +
180 +multilib_src_compile() {
181 + emake
182 +
183 + # Default location for java classes breaks OpenOffice (bug #60769).
184 + # Thanks to axxo@g.o for the solution.
185 + if multilib_is_native_abi && use java ; then
186 + jar -cvf ${PN}.jar -C java $(find java -name "*.class")
187 + fi
188 +}
189 +
190 +multilib_src_install() {
191 + default
192 +
193 + if multilib_is_native_abi; then
194 + if use sample ; then
195 + docinto sample
196 + dodoc "${S}"/sample/*.c
197 + exeinto /usr/share/doc/${P}/sample
198 + doexe sample/client sample/server
199 + fi
200 +
201 + # Default location for java classes breaks OpenOffice (bug #60769).
202 + if use java ; then
203 + java-pkg_dojar ${PN}.jar
204 + java-pkg_regso "${D}/usr/$(get_libdir)/libjavasasl.so"
205 + # hackish, don't wanna dig through makefile
206 + rm -Rf "${D}/usr/$(get_libdir)/java"
207 + docinto "java"
208 + dodoc "${S}/java/README" "${FILESDIR}/java.README.gentoo" "${S}"/java/doc/*
209 + dodir "/usr/share/doc/${PF}/java/Test"
210 + insinto "/usr/share/doc/${PF}/java/Test"
211 + doins "${S}"/java/Test/*.java
212 + fi
213 +
214 + dosbin saslauthd/testsaslauthd
215 + fi
216 +}
217 +
218 +multilib_src_install_all() {
219 + keepdir /etc/sasl2
220 +
221 + dodoc AUTHORS ChangeLog NEWS README doc/TODO doc/*.txt
222 + newdoc pwcheck/README README.pwcheck
223 + dohtml doc/*.html
224 +
225 + docinto "saslauthd"
226 + dodoc saslauthd/{AUTHORS,ChangeLog,LDAP_SASLAUTHD,NEWS,README}
227 +
228 + newpamd "${FILESDIR}/saslauthd.pam-include" saslauthd
229 +
230 + newinitd "${FILESDIR}/pwcheck.rc6" pwcheck
231 + systemd_dounit "${FILESDIR}/pwcheck.service"
232 +
233 + newinitd "${FILESDIR}/saslauthd2.rc7" saslauthd
234 + newconfd "${FILESDIR}/saslauthd-${SASLAUTHD_CONF_VER}.conf" saslauthd
235 + systemd_dounit "${FILESDIR}/saslauthd.service"
236 + systemd_dotmpfilesd "${FILESDIR}/${PN}.conf"
237 +
238 + prune_libtool_files --modules
239 +}
240 +
241 +pkg_postinst () {
242 + # Generate an empty sasldb2 with correct permissions.
243 + if ( use berkdb || use gdbm ) && [[ ! -f "${ROOT}/etc/sasl2/sasldb2" ]] ; then
244 + einfo "Generating an empty sasldb2 with correct permissions ..."
245 + echo "p" | "${ROOT}/usr/sbin/saslpasswd2" -f "${ROOT}/etc/sasl2/sasldb2" -p login \
246 + || die "Failed to generate sasldb2"
247 + "${ROOT}/usr/sbin/saslpasswd2" -f "${ROOT}/etc/sasl2/sasldb2" -d login \
248 + || die "Failed to delete temp user"
249 + chown root:mail "${ROOT}/etc/sasl2/sasldb2" \
250 + || die "Failed to chown ${ROOT}/etc/sasl2/sasldb2"
251 + chmod 0640 "${ROOT}/etc/sasl2/sasldb2" \
252 + || die "Failed to chmod ${ROOT}/etc/sasl2/sasldb2"
253 + fi
254 +
255 + if use authdaemond ; then
256 + elog "You need to add a user running a service using Courier's"
257 + elog "authdaemon to the 'mail' group. For example, do:"
258 + elog " gpasswd -a postfix mail"
259 + elog "to add the 'postfix' user to the 'mail' group."
260 + fi
261 +
262 + elog "pwcheck and saslauthd home directories have moved to:"
263 + elog " /run/saslauthd, using tmpfiles.d"
264 +}