summaryrefslogblamecommitdiff
path: root/user/openldap/APKBUILD
blob: 0aef3baa790e72c40f8e0ea7f53fbe524ce7d058 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                 

           

                      


                      
           

                      
              
                     

                
            
        
                     
                               
          
                   
          
                                                       
                                                             



                                                              

                
                                                                          
                                                                                                 

                          

                     
                    



                   


                
                                                        














                                                                       
         











                                                   
                                     


                                   


                                     
                                   


                                       
                   







                                                      



                  










                                                                

                                                  






















                                                                
















































                                                                     
                            




                                                           
                                                                                                                                                                



                                                                                                                                                    
                                                                                                                                              

                                                                                                                                              
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
#
# secfixes:
#   2.4.50-r0:
#     - CVE-2020-12243
#   2.4.48-r0:
#     - CVE-2019-13057
#     - CVE-2019-13565
#   2.4.46:
#     - CVE-2017-14159
#     - CVE-2017-17740
#   2.4.44-r5:
#     - CVE-2017-9287
#
pkgname=openldap
pkgver=2.6.3
pkgrel=2
pkgdesc="LDAP Server"
url="https://www.openldap.org/"
arch="all"
license="OLDAP-2.8"
depends=""
depends_dev="openssl-dev cyrus-sasl-dev util-linux-dev"
makedepends="$depends_dev groff icu-dev unixodbc-dev libtool"
subpackages="$pkgname-dev $pkgname-doc libldap $pkgname-openrc
	$pkgname-clients $pkgname-passwd-pbkdf2:passwd_pbkdf2
	$pkgname-backend-all:_backend_all:noarch
	$pkgname-overlay-all:_overlay_all:noarch"
pkgusers="ldap"
pkggroups="ldap"
install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
source="https://www.$pkgname.org/software/download/OpenLDAP/$pkgname-release/$pkgname-$pkgver.tgz
	fix-manpages.patch
	configs.patch
	test063.patch
	test079.patch
	time64.patch

	slapd.initd
	slapd.confd
	"

# SLAPD backends
_backends=""
for _name in dnssrv ldap mdb meta null passwd relay sock
do
	subpackages="$subpackages $pkgname-back-$_name:_backend"
	_backends="$_backends $pkgname-back-$_name"
done

# SLAPD overlays
_overlays=""
for _name in accesslog auditlog collect constraint dds deref dyngroup \
	dynlist memberof ppolicy proxycache refint retcode rwm seqmod \
	sssvlv syncprov translucent unique valsort
do
	subpackages="$subpackages $pkgname-overlay-$_name:_overlay"
	_overlays="$_overlays $pkgname-overlay-$_name"
done

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var/lib/openldap \
		--enable-slapd \
		--enable-crypt \
		--enable-modules \
		--enable-dynamic \
		--enable-dnssrv=mod \
		--enable-ldap=mod \
		--enable-mdb=mod \
		--enable-meta=mod \
		--enable-null=mod \
		--enable-passwd=mod \
		--enable-relay=mod \
		--enable-sock=mod \
		--enable-overlays=mod \
		--with-tls=openssl \
		--with-cyrus-sasl
	make depend
	make

	# Build passwd pbkdf2.
	make prefix=/usr libexecdir=/usr/lib \
		-C contrib/slapd-modules/passwd/pbkdf2
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	# Install passwd pbkdf2.
	make DESTDIR="$pkgdir" prefix=/usr libexecdir=/usr/lib \
		-C contrib/slapd-modules/passwd/pbkdf2 install

	cd "$pkgdir"

	rmdir var/lib/openldap/run

	# Fix tools symlinks to slapd.
	for _path in $(find usr/sbin/ -type l); do
		ln -sf slapd $_path
	done

	# Move executable from lib to sbin.
	mv usr/lib/slapd usr/sbin/

	# Move *.default configs to docs.
	mkdir -p usr/share/doc/$pkgname
	mv etc/openldap/*.default usr/share/doc/$pkgname/

	chgrp ldap etc/openldap/slapd.*
	chmod g+r etc/openldap/slapd.*

	install -d -m 700 -o ldap -g ldap \
		var/lib/openldap \
		var/lib/openldap/openldap-data

	install -D -m 755 "$srcdir"/slapd.initd etc/init.d/slapd
	install -D -m 644 "$srcdir"/slapd.confd etc/conf.d/slapd
}

libldap() {
	pkgdesc="OpenLDAP libraries"
	depends=""

	_submv "usr/lib/*.so*" etc/openldap/ldap.conf
}

clients() {
	pkgdesc="LDAP client utilities"

	_submv usr/bin
}

passwd_pbkdf2() {
	pkgdesc="PBKDF2 OpenLDAP support"
	depends="$pkgname"

	_submv "usr/lib/openldap/pw-pbkdf2.*"
}

_backend_all() {
	pkgdesc="Virtual package that installs all OpenLDAP backends"
	depends="$_backends"

	mkdir -p "$subpkgdir"
}

_overlay_all() {
	pkgdesc="Virtual package that installs all OpenLDAP overlays"
	depends="$_overlays"

	mkdir -p "$subpkgdir"
}

_backend() {
	backend_name="${subpkgname#openldap-back-}"
	pkgdesc="OpenLDAP $backend_name backend"

	_submv "usr/lib/openldap/back_$backend_name*"
}

_overlay() {
	overlay_name="${subpkgname#openldap-overlay-}"
	pkgdesc="OpenLDAP $backend_name overlay"

	case "$overlay_name" in
		proxycache) overlay_name=pcache;;
	esac
	_submv "usr/lib/openldap/$overlay_name*"
}

_submv() {
	for path in "$@"; do
		mkdir -p "$subpkgdir"/${path%/*}
		mv "$pkgdir"/$path "$subpkgdir"/${path%/*}/
	done
}

sha512sums="56efbbfc68779ad635d2c25228eb9c4f1553b107b96e8a438029b1c5d2f2647cf4d437770554392b436718ea44a4813e17f5195049f67fc09d063a981096cd85  openldap-2.6.3.tgz
0c026a5c8790ebb7d6784514363f1403c693d61defbeaacae574267c3b7833f198919d31604da1f49db3000c9a561cb6d36d95e021f7906761e45d1434cef15b  fix-manpages.patch
1a1f669db968061eb8c9fb5e42768d0f12075d4eb4d8ae7085533276775027c56760c2f7413494deebec4d78b053f674661236e6e1506ecffadf510985c393c0  configs.patch
26fbe3fa2182d80ee98e6885972f803d03ac45a72cb8478c31e76a6f07f45565e6fdcdbf528fcf61e77fd4f9e2068e4f82d9c9c178df7da103d4e9b714bf204e  test063.patch
c7f2b32f2643d6b7ea5dbee6c1baad7cae53ea9d511cfae6c976edb8f8f85ae14351f612f02e560d15c6b577676804fd7b0a6f45f79cc1cdbe11f117e61ad088  test079.patch
a3d2ce7cbfd8a24605efef47550833e0a2e0f7aa426a46342e5f7bf2ef082b1640c31cd33eb246c225cc4cdc011ed4a640763158111e62f9e76e3530c3fa786e  time64.patch
0c3606e4dad1b32f1c4b62f2bc1990a4c9f7ccd10c7b50e623309ba9df98064e68fc42a7242450f32fb6e5fa2203609d3d069871b5ae994cd4b227a078c93532  slapd.initd
64dc4c0aa0abe3d9f7d2aef25fe4c8e23c53df2421067947ac4d096c9e942b26356cb8577ebc41b52d88d0b0a03b2a3e435fe86242671f9b36555a5f82ee0e3a  slapd.confd"