pkgname=(openldap libldap) pkgbase=openldap pkgver=2.6.9 pkgrel=1 arch=('x86_64') url="https://www.openldap.org/" license=('OLDAP-2.7' 'OLDAP-2.8') makedepends=('cyrus-sasl' 'libtool' 'groff' 'perl' 'util-linux') options=('!makeflags' 'emptydirs' '!lto') source=(https://www.openldap.org/software/download/OpenLDAP/openldap-release/${pkgbase}-${pkgver}.tgz https://www.linuxfromscratch.org/patches/downloads/${pkgbase}/${pkgbase}-${pkgver}-consolidated-1.patch slapd slapd.conf slapd.service) sha256sums=(2cb7dc73e9c8340dff0d99357fbaa578abf30cc6619f0521972c555681e6b2ff ee96840f2235bdd810e41e8cbc2faf4d46b83c0c15be937701c147b099d0232d 8ced5f3361e3867e1da7235f8e70aac9beb44185be03f917d7650ef6170972e8 a3bb2eb535f80f746ec674a1b91b305a3806ea05a60b9bf16cdbd7e3a85e43ad f35deae2b75c553de397272991f7b2ccebf854497a74413abfc82e10c7c871b1) prepare() { cd ${pkgbase}-${pkgver} patch -Np1 -i ${srcdir}/${pkgbase}-${pkgver}-consolidated-1.patch autoconf } build() { cd ${pkgbase}-${pkgver} local configure_args=( --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib --disable-static --disable-debug --with-tls=openssl --with-cyrus-sasl --without-systemd --enable-dynamic --enable-crypt --enable-spasswd --enable-slapd --enable-modules --enable-rlookups --enable-backends=mod --disable-sql --disable-wt --enable-overlays=mod ${configure_options} ) ./configure ${configure_args[@]} make depend make } package_openldap() { pkgdesc="Lightweight Directory Access Protocol (LDAP) client and server" depends=("libldap>=${pkgver}" 'libtool' 'perl' 'systemd') backup=(etc/openldap/ldap.conf etc/openldap/slapd.conf etc/openldap/slapd.ldif) install=${pkgbase}.install cd ${pkgbase}-${pkgver} make DESTDIR=${pkgdir} install rm -r ${pkgdir}/var/run sed -e "s/\.la/.so/" -i ${pkgdir}/etc/openldap/slapd.{conf,ldif}{,.default} install -v -dm700 -o 83 -g 83 ${pkgdir}/var/lib/openldap install -v -dm700 -o 83 -g 83 ${pkgdir}/etc/openldap/slapd.d chmod 640 ${pkgdir}/etc/openldap/slapd.{conf,ldif} chown root:83 ${pkgdir}/etc/openldap/slapd.{conf,ldif} install -vdm755 ${pkgdir}/usr/share/doc/${pkgbase}-${pkgver} cp -vfr doc/{drafts,rfc,guide} ${pkgdir}/usr/share/doc/${pkgbase}-${pkgver} install -vDm644 ${srcdir}/slapd -t ${pkgdir}/etc/default/ install -vDm644 ${srcdir}/slapd.conf -t ${pkgdir}/usr/lib/tmpfiles.d/ install -vDm644 ${srcdir}/slapd.service -t ${pkgdir}/usr/lib/systemd/system/ _pick libldap ${pkgdir}/usr/include _pick libldap ${pkgdir}/usr/lib64 _pick libldap ${pkgdir}/usr/share/man/man3 } package_libldap() { pkgdesc="Lightweight Directory Access Protocol (LDAP) client libraries" depends=('cyrus-sasl') mv libldap/* ${pkgdir} }