blob: 877dd274c1ebce16b7f6d5633cb65fd8f646bbbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openldap
pkgver=2.4.45
pkgrel=0
pkgdesc="LDAP Server"
url="http://www.openldap.org/"
arch="all"
license="custom"
depends=
pkgusers="ldap"
pkggroups="ldap"
depends_dev="libressl-dev cyrus-sasl-dev util-linux-dev"
makedepends="$depends_dev db-dev groff unixodbc-dev libtool mosquitto-dev
autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc libldap $pkgname-back-sql:sql
$pkgname-back-bdb:bdb $pkgname-back-hdb:hdb $pkgname-back-ldap:ldap
$pkgname-back-meta:meta $pkgname-back-monitor:monitor $pkgname-clients
$pkgname-mqtt
$pkgname-passwd-pbkdf2:passwd_pbkdf2
"
install="$pkgname.pre-install"
source="ftp://ftp.$pkgname.org/pub/OpenLDAP/$pkgname-release/$pkgname-$pkgver.tgz
openldap-2.4-ppolicy.patch
openldap-2.4.11-libldap_r.patch
bdb-enabled-by-default.patch
openldap-mqtt-overlay.patch
libressl.patch
slapd.initd
slapd.confd
slurpd.initd
"
# secfixes:
# 2.4.44-r5:
# - CVE-2017-9287
prepare() {
cd "$srcdir"/$pkgname-$pkgver
update_config_sub || return 1
default_prepare || return 1
sed -e '/^STRIP/s,-s,,g' \
-i build/top.mk || return 1
libtoolize --force && aclocal && autoconf || return 1
}
build () {
cd "$srcdir"/$pkgname-$pkgver
./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-bdb=mod \
--enable-hdb=mod \
--enable-dnssrv=mod \
--enable-ldap=mod \
--enable-meta=mod \
--enable-monitor=mod \
--enable-null=mod \
--enable-passwd=mod \
--enable-relay=mod \
--enable-shell=mod \
--enable-sock=mod \
--enable-sql=mod \
--enable-overlays=mod \
--with-tls=openssl \
--with-cyrus-sasl \
|| return 1
make || return 1
# build mqtt overlay
make prefix=/usr libexec=/usr/lib \
-C contrib/slapd-modules/mqtt || return 1
# build passwd pbkdf2
make prefix=/usr libexecdir=/usr/lib \
-C contrib/slapd-modules/passwd/pbkdf2 || return 1
}
package() {
cd "$srcdir"/$pkgname-$pkgver
make DESTDIR="$pkgdir" install || return 1
install -d -o ldap -g ldap "$pkgdir"/var/run/openldap \
"$pkgdir"/var/lib/openldap
sed -i -e 's:/var/lib/openldap/run:/var/run/openldap:g' \
-e 's:back_bdb.la:back_bdb.so:' \
-e 's:back_hdb.la:back_hdb.so:' \
-e 's:back_ldap.la:back_ldap.so:' \
"$pkgdir"/etc/openldap/slapd.conf || return 1
mv "$pkgdir"/usr/lib/slapd "$pkgdir"/usr/sbin/ || reteurn 1
chgrp ldap "$pkgdir"/etc/openldap/slapd.conf
chmod g+r "$pkgdir"/etc/openldap/slapd.conf
chown -R ldap.ldap "$pkgdir"/var/lib/openldap/openldap-data
chmod 700 "$pkgdir"/var/lib/openldap \
"$pkgdir"/var/lib/openldap/openldap-data
chown -R ldap.ldap "$pkgdir"/var/lib/openldap/openldap-data
install -Dm755 "$srcdir"/slapd.initd "$pkgdir"/etc/init.d/slapd
install -Dm755 "$srcdir"/slapd.confd "$pkgdir"/etc/conf.d/slapd
install -Dm755 "$srcdir"/slurpd.initd "$pkgdir"/etc/init.d/slurpd
# FIXME: symlinks in sbin are symlinked to /usr/lib/slapd
ln -s /usr/sbin/slapd "$pkgdir"/usr/lib/slapd
# install mqtt overlay
make DESTDIR="$pkgdir" prefix=/usr libexec=/usr/lib \
-C contrib/slapd-modules/mqtt install || return 1
# install passwd pbkdf2
make DESTDIR="$pkgdir" prefix=/usr libexecdir=/usr/lib \
-C contrib/slapd-modules/passwd/pbkdf2 install || return 1
}
libldap() {
pkgdesc="OpenLDAP libraries"
depends=
install=
mkdir -p "$subpkgdir"/usr/lib "$subpkgdir"/etc/openldap
mv "$pkgdir"/usr/lib/*.so* "$subpkgdir"/usr/lib/
mv "$pkgdir"/etc/openldap/ldap.conf "$subpkgdir"/etc/openldap/
}
_backend() {
pkgdesc="OpenLDAP ${2:-$1} backend"
mkdir -p "$subpkgdir"/usr/lib/openldap
mv "$pkgdir"/usr/lib/openldap/back_$1* "$subpkgdir"/usr/lib/openldap/
}
bdb() { _backend bdb ; }
hdb() { _backend hdb ; }
sql() { _backend sql ODBC; }
ldap() { _backend ldap LDAP; }
meta() { _backend meta; }
monitor() { _backend monitor; }
clients() {
pkgdesc="LDAP client utilities"
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}
mqtt() {
pkgdesc="OpenLDAP MQTT overlay"
depends=$pkgname
mkdir -p "$subpkgdir"/usr/lib/openldap
mv "$pkgdir"/usr/lib/openldap/mqtt.* "$subpkgdir"/usr/lib/openldap || return 1
}
passwd_pbkdf2() {
pkgdesc="PBKDF2 OpenLDAP support"
depends=$pkgname
mkdir -p "$subpkgdir"/usr/lib/openldap
mv "$pkgdir"/usr/lib/openldap/pw-pbkdf2.* "$subpkgdir"/usr/lib/openldap || return 1
}
sha512sums="1c9fc84efed8998f107ce6e1c6be3f5466388241afdca0cb3847720c9def0bc263a2dbc15bf0f9112d1b4c391fd01e8531a4fb08c5532c30fb86924c08daedab openldap-2.4.45.tgz
5d34d49eabe7cb66cf8284cc3bd9730fa23df4932df68549e242d250ee50d40c434ae074ebc720d5fbcd9d16587c9333c5598d30a5f1177caa61461ab7771f38 openldap-2.4-ppolicy.patch
44d97efb25d4f39ab10cd5571db43f3bfa7c617a5bb087085ae16c0298aca899b55c8742a502121ba743a73e6d77cd2056bc96cee63d6d0862dabc8fb5574357 openldap-2.4.11-libldap_r.patch
d94f791ff3d10f1fe244a6a071331d6dd5933ed859e1cf9465654e650ff7223eedad5f054ad77de2ad4dbbd0b4a2cfda970ad733baaa833183aee996216bdbf1 bdb-enabled-by-default.patch
9c7f41279e91ed995c91e9a8c543c797d9294a93cf260afdc03ab5777e45ed045a4d6a4d4d0180b5dc387dc04babca01d818fbfa8168309df44f4500d2a430a4 openldap-mqtt-overlay.patch
cbfd573139e6b0c51d0f1f1337d74d5c07813509754758df240b09bc2ba559127f656580eef88f1db1c1322d7cb05042b1926e046e24c19889759647aee7aec6 libressl.patch
1a5490a29a2be8382a64d3d07a36906d2189571f4c44d8ad96b769db58d91a33b2eee24fe10343ec26440fa61cfd406c4e95153dce29c2f315d1f13f5b0f47e8 slapd.initd
8290769b63b3a5863622de2deb9269a0711ba5f4a225eb230d7c5097937b9d4e8cf5a998ee99232824e2335ae1b6e0114357b61c9611bc2460ebd195d12eabae slapd.confd
c8bffecdbd09583bec7720b5f6a5b9680b0eae055fd63f10736cf2fe25378b95acddf910e60f6408c9637a3fe48050299cfb500a6bc9a95a0ef135d5a4c4d5f9 slurpd.initd"
|