Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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