openldap/openldap.spec

changeset 762
b63e85afed35
parent 586
e10b124b2f21
child 777
4e2fe5febd48
equal deleted inserted replaced
4:542fc8c24656 5:574164c374bb
29 Packager: OpenPKG Foundation e.V. 29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community 30 Distribution: OpenPKG Community
31 Class: BASE 31 Class: BASE
32 Group: LDAP 32 Group: LDAP
33 License: GPL 33 License: GPL
34 Version: 2.4.29 34 Version: 2.4.32
35 Release: 20120208 35 Release: 20120800
36 36
37 # package options 37 # package options
38 %option with_server yes 38 %option with_server yes
39 %option with_fsl yes 39 %option with_fsl yes
40 %option with_crypt yes 40 %option with_crypt yes
41 %option with_overlays yes 41 %option with_overlays yes
42 %option with_pthreads yes 42 %option with_pth yes
43 %option with_pth no 43 %option with_pthreads no
44 %option with_sasl no 44 %option with_sasl no
45 %option with_perl no 45 %option with_perl no
46 %option with_odbc no 46 %option with_odbc no
47 47
48 # list of sources 48 # list of sources
51 Source2: fsl.openldap 51 Source2: fsl.openldap
52 Source3: openldap.pc 52 Source3: openldap.pc
53 Patch0: openldap.patch 53 Patch0: openldap.patch
54 54
55 # build information 55 # build information
56 Prefix: %{l_prefix} 56 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc
57 BuildRoot: %{l_buildroot} 57 PreReq: OpenPKG, openpkg >= 20100101
58 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
59 PreReq: OpenPKG, openpkg >= 20060823
60 BuildPreReq: openssl, db >= 4.5 58 BuildPreReq: openssl, db >= 4.5
61 PreReq: openssl, db >= 4.5 59 PreReq: openssl, db >= 4.5
62 %if "%{with_server}" == "yes" && "%{with_fsl}" == "yes" 60 %if "%{with_server}" == "yes" && "%{with_fsl}" == "yes"
63 BuildPreReq: fsl 61 BuildPreReq: fsl
64 PreReq: fsl 62 PreReq: fsl
77 %endif 75 %endif
78 %if "%{with_server}" == "yes" && "%{with_odbc}" == "yes" 76 %if "%{with_server}" == "yes" && "%{with_odbc}" == "yes"
79 BuildPreReq: ODBC 77 BuildPreReq: ODBC
80 PreReq: ODBC 78 PreReq: ODBC
81 %endif 79 %endif
82 AutoReq: no
83 AutoReqProv: no
84 80
85 %description 81 %description
86 OpenLDAP is an open source implementation of the Lightweight 82 OpenLDAP is an open source implementation of the Lightweight
87 Directory Access Protocol (LDAP). The suite includes libraries 83 Directory Access Protocol (LDAP). The suite includes libraries
88 implementing the LDAP protocol plus a stand alone LDAP server 84 implementing the LDAP protocol plus a stand alone LDAP server
136 ARGS="$ARGS --enable-meta" 132 ARGS="$ARGS --enable-meta"
137 ARGS="$ARGS --enable-monitor" 133 ARGS="$ARGS --enable-monitor"
138 ARGS="$ARGS --enable-dnssrv" 134 ARGS="$ARGS --enable-dnssrv"
139 ARGS="$ARGS --enable-null" 135 ARGS="$ARGS --enable-null"
140 ARGS="$ARGS --enable-shell" 136 ARGS="$ARGS --enable-shell"
141 ARGS="$ARGS --with-proxycache" 137 ARGS="$ARGS --enable-proxycache"
138 ARGS="$ARGS --disable-mdb"
142 %else 139 %else
143 ARGS="$ARGS --disable-slapd" 140 ARGS="$ARGS --disable-slapd"
144 ARGS="$ARGS --disable-modules" 141 ARGS="$ARGS --disable-modules"
145 %endif 142 %endif
146 143
203 # configuration: special platform support 200 # configuration: special platform support
204 case "%{l_platform -t}" in 201 case "%{l_platform -t}" in
205 *-sunos* ) CFLAGS="$CFLAGS -D_AVL_H"; LIBS="$LIBS -lrt" ;; 202 *-sunos* ) CFLAGS="$CFLAGS -D_AVL_H"; LIBS="$LIBS -lrt" ;;
206 esac 203 esac
207 204
208 # configuration: use hard links and make sure our Berkeley-DB is picked up first 205 # configuration: use hard links and make sure our Berkeley DB is picked up first
209 %{l_shtool} subst \ 206 %{l_shtool} subst \
210 -e 's;ln -s;ln;g' \ 207 -e 's;ln -s;ln;g' \
211 -e 's;-ldb4[1-9];%{l_prefix}/lib/libdb.a;g' \ 208 -e 's;-ldb4[1-9];%{l_prefix}/lib/libdb.a;g' \
212 -e 's;<db\.h>;"db.h";g' \ 209 -e 's;<db\.h>;"db.h";g' \
213 configure 210 configure
214 211
215 # configuration 212 # configuration
216 ./configure --cache-file=./config.cache $ARGS 213 ./configure --cache-file=./config.cache $ARGS
217 214
218 # build toolkit 215 # build toolkit
219 %{l_make} %{l_mflags} depend 216 %{l_make} %{l_mflags -O} depend
220 %{l_make} %{l_mflags} 217 %{l_make} %{l_mflags -O}
221 218
222 %install 219 %install
223 # clean build cruft
224 rm -rf $RPM_BUILD_ROOT
225
226 # install toolkit 220 # install toolkit
227 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 221 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
228 222
229 # post adjustment: remove extra files 223 # post adjustment: remove extra files
230 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default 224 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
238 %endif 232 %endif
239 233
240 # post adjustment: enable and correct slapd.pid 234 # post adjustment: enable and correct slapd.pid
241 %if "%{with_server}" == "yes" 235 %if "%{with_server}" == "yes"
242 %{l_shtool} subst \ 236 %{l_shtool} subst \
243 -e 's;^[ #]*\(pidfile\).*$;\1 %{l_prefix}/var/openldap/run/slapd.pid;' \ 237 -e 's;^\(pidfile\).*$;\1 %{l_prefix}/var/openldap/run/slapd.pid;' \
244 -e 's;^\(argsfile\).*$;\1 %{l_prefix}/var/openldap/run/slapd.args;' \ 238 -e 's;^\(argsfile\).*$;\1 %{l_prefix}/var/openldap/run/slapd.args;' \
245 $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf 239 $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
246 %endif 240 %endif
247 241
248 # post adjustment: remove OSSP fsl dependency from libtool files 242 # post adjustment: remove OSSP fsl dependency from libtool files
250 %{l_shtool} subst \ 244 %{l_shtool} subst \
251 -e 's;-lfsl *;;' \ 245 -e 's;-lfsl *;;' \
252 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la 246 $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
253 %endif 247 %endif
254 248
255 # install run-command script 249 # install run command script
256 %if "%{with_server}" == "yes" 250 %if "%{with_server}" == "yes"
257 %{l_shtool} mkdir -f -p -m 755 \ 251 %{l_shtool} mkdir -f -p -m 755 \
258 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 252 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
259 %{l_shtool} install -c -m 755 %{l_value -s -a} \ 253 %{l_shtool} install -c -m 755 %{l_value -s -a} \
260 %{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 254 %{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
271 265
272 # install pkg-config configuration 266 # install pkg-config configuration
273 %{l_shtool} mkdir -f -p -m 755 \ 267 %{l_shtool} mkdir -f -p -m 755 \
274 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig 268 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
275 libs="-lldap -llber" 269 libs="-lldap -llber"
270 libdir="-L\${libdir}"
276 %if "%{with_sasl}" == "yes" 271 %if "%{with_sasl}" == "yes"
277 libs="$libs -lsasl2" 272 libs="$libs -lsasl2"
273 %endif
274 %if "%{with_pth}" == "yes"
275 libs="$libs -lpth"
276 libdir="$libdir -L\${libdir}/pth"
278 %endif 277 %endif
279 %{l_shtool} install -c -m 644 %{l_value -s -a} \ 278 %{l_shtool} install -c -m 644 %{l_value -s -a} \
280 -e "s;@version@;%{version};" \ 279 -e "s;@version@;%{version};" \
281 -e "s;@libs@;$libs;" \ 280 -e "s;@libs@;$libs;" \
281 -e "s;@libdir@;$libdir;" \
282 %{SOURCE openldap.pc} \ 282 %{SOURCE openldap.pc} \
283 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/ 283 $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
284 284
285 # optionally remove server-components 285 # optionally remove server components
286 %if "%{with_server}" != "yes" 286 %if "%{with_server}" != "yes"
287 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/schema 287 rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/schema
288 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf 288 rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
289 rm -rf $RPM_BUILD_ROOT%{l_prefix}/sbin 289 rm -rf $RPM_BUILD_ROOT%{l_prefix}/sbin
290 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/openldap 290 rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/openldap
304 '%config %{l_prefix}/etc/openldap/*.conf' 304 '%config %{l_prefix}/etc/openldap/*.conf'
305 305
306 %files -f files 306 %files -f files
307 307
308 %clean 308 %clean
309 rm -rf $RPM_BUILD_ROOT
310 309
311 %pre 310 %pre
312 %if "%{with_server}" == "yes" 311 %if "%{with_server}" == "yes"
313 # before upgrade, save status and stop service 312 # before upgrade, save status and stop service
314 [ $1 -eq 2 ] || exit 0 313 [ $1 -eq 2 ] || exit 0

mercurial