updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / openldap-sql / PKGBUILD
blob6df94fa6a8deff91de95e07005f6da09bdba39fc
1 # $Id: PKGBUILD 109957 2011-02-14 13:18:22Z andrea $
2 # Maintainer:
3 # Contributor: Judd Vinet <jvinet@zeroflux.org>
4 # Contributor: Ian Armstrong <ian@openmail.cc>
6 pkgname=openldap-sql
7 pkgver=2.4.24
8 pkgrel=1
9 pkgdesc="LDAP Server with SQL support"
10 arch=('i686' 'x86_64')
11 license=('custom')
12 url="http://www.openldap.org/"
13 backup=('etc/openldap/slapd.conf' 'etc/default/slapd' 'etc/conf.d/slapd')
14 depends=("libldap>=${pkgver}" 'db' 'tcp_wrappers' 'libfetch' 'util-linux-ng' 'unixodbc')
15 provides=('openldap-clients')
16 replaces=('openldap-clients')
17 source=("ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${pkgver}.tgz"
18         'slapd'
19         'slapd.default')
20 md5sums=('116fe1e23a7b67686d5e62274367e6c0'
21          '832354417c495f29affd2c772808959d'
22          '6be69f6b7e522cb64cce8703da81ed32')
24 build() {
25   cd ${srcdir}/openldap-${pkgver}
26    
27   export LIBS=-ldb
28   ./configure --prefix=/usr \
29               --mandir=/usr/share/man \
30               --libexecdir=/usr/sbin \
31               --sysconfdir=/etc \
32               --includedir=/usr/include \
33               --localstatedir=/var/lib/openldap \
34               --enable-bdb \
35               --enable-crypt \
36               --enable-dynamic \
37               --with-threads \
38               --enable-wrappers \
39               --enable-spasswd \
40               --with-cyrus-sasl \
41               --enable-sql
42   
43   find . -name 'Makefile' -exec \
44         sed -e 's|$(LDAP_LIBDIR)/liblber/liblber.la|/usr/lib/liblber-2.4.so.2|g' \
45             -e 's|$(LDAP_LIBDIR)/libldap/libldap.la|/usr/lib/libldap-2.4.so.2|g' \
46             -e 's|$(LDAP_LIBDIR)/libldap_r/libldap_r.la|/usr/lib/libldap_r-2.4.so.2|g' \
47             -i {} \;
49   cd include
50   make
52   cd ../libraries
53   for dir in liblutil librewrite liblunicode; do
54     pushd ${dir}
55     make depend
56     make
57     popd
58   done
60   cd ../servers
61   make depend
62   make
64   cd ../clients
65   make depend
66   make
68   cd ../doc/man
69   for dir in man{1,5,8}; do
70     pushd ${dir}
71     make
72     popd
73   done
76 package() {
77   cd ${srcdir}/openldap-${pkgver}
78   
79   cd servers
80   make DESTDIR=${pkgdir} install
82   cd ../clients
83   make DESTDIR=${pkgdir} install
85   cd ../doc/man
86   for dir in man{1,5,8}; do
87     pushd ${dir}
88     make DESTDIR=${pkgdir} install
89     popd
90   done
91   rm ${pkgdir}/usr/share/man/man5/ldap.conf.5
93   cd ../..
95   install -dm700 ${pkgdir}/etc/openldap/slapd.d
96   install -Dm755 ${srcdir}/slapd ${pkgdir}/etc/rc.d/slapd
97   install -Dm644 ${srcdir}/slapd.default ${pkgdir}/etc/conf.d/slapd
98   install -dm700 ${pkgdir}/var/lib/openldap
99   
100   # get rid of duplicate default conf files
101   rm ${pkgdir}/etc/openldap/*.default
103   # hack to fix screwed up dirs
104   sed -e 's|^pidfile[[:space:]].*$|pidfile   /var/run/slapd.pid|g' \
105       -e 's|^argsfile[[:space:]].*$|argsfile  /var/run/slapd.args|g' \
106       -i ${pkgdir}/etc/openldap/slapd.conf
107       
108   install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/openldap/LICENSE