archrelease: copy trunk to extra-x86_64
[arch-packages.git] / cyrus-sasl / trunk / PKGBUILD
blob9b58d4026a4ddef42c3bc2efae7bb242d3aa90c9
1 # Maintainer: Jan de Groot <jgc@archlinux.org>
3 # This package spans multiple repositories.
4 # Always build from cyrus-sasl/trunk and merge changes to libsasl/trunk.
6 pkgbase='cyrus-sasl'
7 pkgname=('cyrus-sasl' 'cyrus-sasl-gssapi' 'cyrus-sasl-ldap' 'cyrus-sasl-sql')
8 #pkgname=libsasl
9 pkgver=2.1.27
10 pkgrel=6
11 pkgdesc="Cyrus Simple Authentication Service Layer (SASL) library"
12 arch=('x86_64')
13 url="https://www.cyrusimap.org/sasl/"
14 license=('custom')
15 options=('!makeflags')
16 makedepends=('postgresql-libs' 'mariadb-libs' 'libldap' 'krb5' 'openssl' 'sqlite')
17 source=(https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-${pkgver}/cyrus-sasl-${pkgver}.tar.gz{,.sig}
18         0003-Update-saslauthd.conf-location-in-documentation.patch
19         0006-Enable-autoconf-maintainer-mode.patch
20         0010-Update-required-libraries-when-ld-as-needed-is-used.patch
21         0013-Don-t-use-la-files-for-opening-plugins.patch
22         0020-Restore-LIBS-after-checking-gss_inquire_sec_context_.patch
23         0022-Fix-keytab-option-for-MIT-Kerberos.patch
24         0032-Add-with_pgsql-include-postgresql-to-include-path.patch
25         gdbm-errno.patch
26         autoconf-2.70.patch
27         saslauthd.service
28         saslauthd.conf.d
29         tmpfiles.conf)
30 sha256sums=('26866b1549b00ffd020f188a43c258017fa1c382b3ddadd8201536f72efb05d5'
31             'SKIP'
32             '9919c81196701d11a3a77e2573a541489ad9ab42a4c50eb7d19edfb37713c604'
33             '7bd2b2af36c061e92f69944a18e2c122aea0d2b21773f5ea47bb6209f13d0812'
34             '8e22cb6ac58208f191b1eb19aac602c1bf49708f2a3b2e3de5f5b2c1e2467906'
35             'bbee401c01dc6942710e0c1285091fcd98588bf636b52f24ed0e3b04039b748b'
36             'a953c79c585d579f25135de0fe807d6da1fddccbd5b66a9606fb6390c12c7e31'
37             '1a0ae7bd722d57feb6fab12c05eb1922982c68bd9be1c165d405954012e6634f'
38             '3c375f8755fdbd98a21c4ee195bebbd2a146901fee327e4dd6cfde7a4dcba7c3'
39             '03a57cbcec85602fb8e39b7c8a3ff1a22d2c20a28e771b8b326a570d733bf432'
40             '91cb2026e7f41374ec181809c862bbfaf4e4b3346dc8294285718d2dd17101a5'
41             '5c6453050a5f594ca1d53baf3a6188d8f3cdc7a28467ad7c844ad51f663dae9a'
42             'fa57b4f374ae633633091b1c8b44e1e0be814e4fddbfa75f16eb3dd1f16b8640'
43             '16ca1a4185847b0c6c70ef6c7c314cb466f698d3ed02185a5f50e8179822f024')
44 validpgpkeys=('829F339F8C296FE80F409D93E3D7C118C7B9F46A')
46 prepare() {
47   cd cyrus-sasl-$pkgver
48   patch -Np1 -i ../0003-Update-saslauthd.conf-location-in-documentation.patch
49   patch -Np1 -i ../0006-Enable-autoconf-maintainer-mode.patch
50   patch -Np1 -i ../0010-Update-required-libraries-when-ld-as-needed-is-used.patch
51   patch -Np1 -i ../0013-Don-t-use-la-files-for-opening-plugins.patch
52   patch -Np1 -i ../0020-Restore-LIBS-after-checking-gss_inquire_sec_context_.patch
53   patch -Np1 -i ../0022-Fix-keytab-option-for-MIT-Kerberos.patch
54   patch -Np1 -i ../0032-Add-with_pgsql-include-postgresql-to-include-path.patch
55   patch -Np1 -i ../gdbm-errno.patch
56   patch -p1 -i ../autoconf-2.70.patch # Fix GCC-SPNEGO build with recent autoconf
57   cp -a saslauthd/saslauthd.mdoc saslauthd/saslauthd.8
60 build() {
61   export CFLAGS="$CFLAGS -fPIC"
62   cd cyrus-sasl-$pkgver
64   rm -f config/config.guess config/config.sub 
65   rm -f config/ltconfig config/ltmain.sh config/libtool.m4
66   rm -fr autom4te.cache
67   libtoolize -c
68   aclocal -I config
69   automake -a -c
70   autoheader
71   autoconf
73   ./configure --prefix=/usr \
74       --sbin=/usr/bin \
75       --mandir=/usr/share/man \
76       --infodir=/usr/share/info \
77       --disable-static \
78       --enable-shared \
79       --enable-alwaystrue \
80       --enable-checkapop \
81       --enable-cram \
82       --enable-digest \
83       --disable-otp \
84       --disable-srp \
85       --disable-srp-setpass \
86       --disable-krb4 \
87       --enable-gssapi \
88       --enable-auth-sasldb \
89       --enable-plain \
90       --enable-anon \
91       --enable-login \
92       --enable-ntlm \
93       --disable-passdss \
94       --enable-sql \
95       --with-mysql=/usr \
96       --with-pgsql=/usr/lib \
97       --with-sqlite3=/usr/lib \
98       --enable-ldapdb \
99       --disable-macos-framework \
100       --with-pam \
101       --with-saslauthd=/var/run/saslauthd \
102       --with-ldap \
103       --with-dblib=gdbm \
104       --with-configdir=/etc/sasl2:/etc/sasl:/usr/lib/sasl2 \
105       --sysconfdir=/etc \
106       --with-devrandom=/dev/urandom
107   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
108   make
111 package_libsasl() {
112   pkgdesc="Cyrus Simple Authentication Service Layer (SASL) Library"
113   depends=('openssl')
114   conflicts=('cyrus-sasl-plugins')
116   cd cyrus-sasl-$pkgver
117   make DESTDIR="$pkgdir" install-pkgconfigDATA
118   for dir in include lib sasldb plugins utils; do
119     pushd ${dir}
120     make DESTDIR="${pkgdir}" install
121     popd
122   done
123   rm -f "${pkgdir}"/usr/lib/sasl2/libsql.so*
124   rm -f "${pkgdir}"/usr/lib/sasl2/libgssapiv2.so*
125   rm -f "${pkgdir}"/usr/lib/sasl2/libldapdb.so*
126   rm -f "${pkgdir}"/usr/lib/sasl2/libgs2.so*
127   install -m755 -d "${pkgdir}/usr/share/licenses/libsasl"
128   install -m644 COPYING "${pkgdir}/usr/share/licenses/libsasl/"
131 package_cyrus-sasl() {
132   depends=("libsasl=${pkgver}" 'krb5' 'pam' 'gdbm')
133   pkgdesc="Cyrus saslauthd SASL authentication daemon"
134   backup=('etc/conf.d/saslauthd')
136   cd cyrus-sasl-$pkgver/saslauthd
137   make DESTDIR="${pkgdir}" install
138   install -Dm644 "${srcdir}/saslauthd.conf.d" "${pkgdir}/etc/conf.d/saslauthd"
139   install -Dm644 "${srcdir}/saslauthd.service" "${pkgdir}/usr/lib/systemd/system/saslauthd.service"
140   install -Dm644 "${srcdir}/tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/saslauthd.conf"
142   install -m755 -d "${pkgdir}/usr/share/licenses/cyrus-sasl"
143   ln -sf ../libsasl/COPYING "${pkgdir}/usr/share/licenses/cyrus-sasl/"
146 package_cyrus-sasl-gssapi() {
147   pkgdesc="GSSAPI authentication mechanism for Cyrus SASL"
148   depends=("libsasl=${pkgver}" 'krb5')
149   replaces=('cyrus-sasl-plugins')
151   cd cyrus-sasl-$pkgver/plugins
152   install -m755 -d "${pkgdir}/usr/lib/sasl2"
153   cp -a .libs/libgssapiv2.so* "${pkgdir}/usr/lib/sasl2/"
154   cp -a .libs/libgs2.so* "${pkgdir}/usr/lib/sasl2/"
156   install -m755 -d "${pkgdir}/usr/share/licenses/cyrus-sasl-gssapi"
157   ln -sf ../libsasl/COPYING "${pkgdir}/usr/share/licenses/cyrus-sasl-gssapi/"
160 package_cyrus-sasl-ldap() {
161   pkgdesc="ldapdb auxprop module for Cyrus SASL"
162   depends=("libsasl=${pkgver}" 'libldap')
163   replaces=('cyrus-sasl-plugins')
165   cd cyrus-sasl-$pkgver/plugins
166   install -m755 -d "${pkgdir}/usr/lib/sasl2"
167   cp -a .libs/libldapdb.so* "${pkgdir}/usr/lib/sasl2/"
169   install -m755 -d "${pkgdir}/usr/share/licenses/cyrus-sasl-ldap"
170   ln -sf ../libsasl/COPYING "${pkgdir}/usr/share/licenses/cyrus-sasl-ldap/"
173 package_cyrus-sasl-sql() {
174   pkgdesc="SQL auxprop module for Cyrus SASL"
175   depends=("libsasl=${pkgver}" 'postgresql-libs' 'mariadb-libs' 'sqlite')
176   replaces=('cyrus-sasl-plugins')
178   cd cyrus-sasl-$pkgver/plugins
179   install -m755 -d "${pkgdir}/usr/lib/sasl2"
180   cp -a .libs/libsql.so* "${pkgdir}/usr/lib/sasl2/"
182   install -m755 -d "${pkgdir}/usr/share/licenses/cyrus-sasl-sql"
183   ln -sf ../libsasl/COPYING "${pkgdir}/usr/share/licenses/cyrus-sasl-sql/"