Magellan Linux

Contents of /smage/trunk/extras/openldap/openldap-2.4.53-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15640 - (show annotations) (download)
Thu Oct 8 11:26:24 2020 UTC (3 years, 5 months ago) by niro
File size: 4651 byte(s)
auto added: ver bump to 2.4.53-r1
1 # $Id$
2
3 PNAME="openldap"
4 PVER="2.4.53"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="libldap libldap-dev openldap"
8
9 PCAT="net-nds"
10 HOMEPAGE="http://www.openldap.org/"
11
12 # enable features or not (0|1)
13 ENABLE_SASL=0
14 ENABLE_TCPWRAPPERS=0
15
16 LIB_DEPEND=">= dev-libs/openssl-1.1"
17
18 if [[ ${ENABLE_SASL} = 1 ]]
19 then
20 LIB_DEPEND="${LIB_DEPEND}
21 >= dev-libs/cyrus-sasl-2.1.26"
22 fi
23 if [[ ${ENABLE_TCPWRAPPERS} = 1 ]]
24 then
25 LIB_DEPEND="${LIB_DEPEND}
26 >= sys-apps/tcp-wrappers-7"
27 fi
28
29 # requires libltdl.so.7 from libtool package
30 LDAP_DEPEND=">= dev-db/db-6.2
31 >= sys-libs/libuuid-2.34
32 >= sys-libs/libltdl-2.4"
33
34 ALX_DEV_DEPEND=">= dev-db/db-dev-6.2
35 >= sys-libs/libuuid-dev-2.34
36 >= dev-libs/openssl-dev-1.1"
37
38 SDEPEND="${LIB_DEPEND}
39 ${LDAP_DEPEND}
40 >= sys-apps/util-linux-2.34
41 >= sys-dev/libtool-2.4
42 ${ALX_DEV_DEPEND}"
43
44 SRCFILE="${PNAME}-${PVER}.tgz"
45 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
46
47 sminclude multilib mtools systemd rpath
48 msetfeature "!check"
49
50 SRC_URI=(
51 http://www.openldap.org/software/download/OpenLDAP/openldap-release/${SRCFILE}
52 mirror://${PNAME}/${SRCFILE}
53 mirror://${PNAME}/slapd.service
54 mirror://${PNAME}/slapd.confd
55 mirror://${PNAME}/slapd.tmpfile
56 )
57
58 UP2DATE="updatecmd http://www.openldap.org/software/download/ | grep 'currently avail' | sed 's/.*OpenLDAP-\(.*\)\ is.*/\1/'"
59
60 split_info_libldap()
61 {
62 DESCRIPTION="Lightweight Directory Access Protocol client libraries."
63 DEPEND="${LIB_DEPEND}"
64 }
65
66 split_info_libldap-dev()
67 {
68 DESCRIPTION="Development files for libldap."
69 DEPEND="== net-nds/libldap-dev-${PVER}"
70 }
71
72 split_info_openldap()
73 {
74 DESCRIPTION="OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol."
75 DEPEND="== net-nds/libldap-${PVER}
76 ${LDAP_DEPEND}"
77 }
78
79 pkg_setup()
80 {
81 preinstall_openldap
82 }
83
84 src_prepare()
85 {
86 munpack ${SRCFILE} || die
87
88 local abi
89 for abi in ${MULTILIB_ABIS}
90 do
91 cd ${SRCDIR}-${abi}
92 # fix localstate dir to /run/openldap
93 sed -i 's:#define LDAPI_SOCK LDAP_RUNDIR LDAP_DIRSEP "run" LDAP_DIRSEP "ldapi":#define LDAPI_SOCK LDAP_DIRSEP "run" LDAP_DIRSEP "openldap" LDAP_DIRSEP "ldapi":' include/ldap_defaults.h || die
94 sed -i 's:%LOCALSTATEDIR%/run:/run/openldap:' servers/slapd/slapd.conf || die
95 sed -i 's:-$(MKDIR) $(DESTDIR)$(localstatedir)/run:-$(MKDIR) $(DESTDIR)/run/openldap:' servers/slapd/Makefile.in || die
96
97 # remove db version limits
98 sed -i '/6.0.20/ a\\t__db_version_compat' build/openldap.m4 || die
99
100 # non standard, autoreconf doesn't work
101 libtoolize --force || die
102 aclocal || die
103 autoconf --force || die
104 done
105 }
106
107 src_compile()
108 {
109 local myconf
110
111 if [[ ${ENABLE_SASL} = 1 ]]
112 then
113 # enable sasl
114 myconf+=" --with-cyrus-sasl"
115 else
116 # disable sasl
117 myconf+=" --without-cyrus-sasl"
118 fi
119
120 if [[ ${ENABLE_TCPWRAPPERS} = 1 ]]
121 then
122 # enable tcp-wrappers
123 myconf+=" --enable-wrappers"
124 else
125 # disable tcp-wrappers
126 myconf+=" --disable-wrappers"
127 fi
128
129 # use mdb as default db, drop berkeley db support
130 mconfigure \
131 --localstatedir=/var/lib/openldap \
132 --libexecdir=/usr/$(mlibdir)/openldap \
133 --enable-overlays=mod \
134 --enable-modules=yes \
135 ${myconf} \
136 || die
137
138 mmake || die
139 }
140
141 src_install_libldap()
142 {
143 mmake -j1 -C libraries DESTDIR=${BINDIR} install || die
144 }
145
146 src_install_libldap-dev()
147 {
148 mmake -j1 -C include DESTDIR=${BINDIR} install || die
149 mmake -j1 -C doc/man/man3 DESTDIR=${BINDIR} install || die
150 # install ldap.conf man
151 cp doc/man/man5/ldap.conf.5.tmp ldap.conf.5 || die
152 minstallman ldap.conf.5 || die
153
154 minstalldocs COPYRIGHT LICENSE || die
155 }
156
157 src_install_openldap()
158 {
159 mmake -j1 -C clients DESTDIR=${BINDIR} install || die
160 mmake -j1 -C servers DESTDIR=${BINDIR} install || die
161 mmake -j1 -C doc/man/man1 DESTDIR=${BINDIR} install || die
162 mmake -j1 -C doc/man/man5 DESTDIR=${BINDIR} install || die
163 mmake -j1 -C doc/man/man8 DESTDIR=${BINDIR} install || die
164 # missing symlink
165 mlink ../$(mlibdir)/openldap/slapd /usr/sbin/slapd || die
166 # remove ldap.conf man, which is in the lib package
167 mdelete /usr/share/man/man5/ldap.conf.5 || die
168
169 # create runtime
170 mkeepdir /var/lib/openldap || die
171 mchown ldap:ldap /var/lib/openldap || die
172 mchmod 0700 /var/lib/openldap || die
173 # openldap modules dir
174 mkeepdir /usr/$(mlibdir)/openldap/openldap || die
175
176 # service
177 minstallunit slapd.service || die
178 minstallconf slapd.confd slapd || die
179 minstalltmp slapd.tmpfile slapd.conf || die
180
181 # remove insecure rpath
182 mdeleterpath || die
183
184 minstalldocs ANNOUNCEMENT CHANGES COPYRIGHT LICENSE || die
185 }
186
187 preinstall_openldap()
188 {
189 # adding ldap user
190 mgroupadd -o "-g 439" ldap
191 museradd -o "-u 439 -g ldap -d /var/lib/openldap -s /bin/false" ldap
192 }
193
194 postinstall_openldap()
195 {
196 mstartunit slapd.service
197 }
198
199 postremove_openldap()
200 {
201 mstopunit slapd.service
202 }