OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 16-Sep-2007 20:21:29
Branch: HEAD Handle: 2007091619212700
Modified files:
openpkg-src/openldap openldap.spec
Log:
allow one to build OpenLDAP as a client-only package, too
Summary:
Revision Changes Path
1.193 +57 -9 openpkg-src/openldap/openldap.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openldap/openldap.spec
============================================================================
$ cvs diff -u -r1.192 -r1.193 openldap.spec
--- openpkg-src/openldap/openldap.spec 21 Aug 2007 14:59:09 -0000
1.192
+++ openpkg-src/openldap/openldap.spec 16 Sep 2007 18:21:27 -0000
1.193
@@ -33,9 +33,10 @@
Group: LDAP
License: GPL
Version: 2.3.38
-Release: 20070821
+Release: 20070916
# package options
+%option with_server yes
%option with_fsl yes
%option with_crypt yes
%option with_overlays yes
@@ -57,7 +58,7 @@
PreReq: OpenPKG, openpkg >= 20060823
BuildPreReq: readline, openssl, db >= 4.2, pth
PreReq: readline, openssl, db >= 4.2, pth
-%if "%{with_fsl}" == "yes"
+%if "%{with_server}" == "yes" && "%{with_fsl}" == "yes"
BuildPreReq: fsl >= 1.2.0
PreReq: fsl >= 1.2.0
%endif
@@ -65,7 +66,7 @@
BuildPreReq: sasl
PreReq: sasl
%endif
-%if "%{with_odbc}" == "yes"
+%if "%{with_server}" == "yes" && "%{with_odbc}" == "yes"
BuildPreReq: ODBC
PreReq: ODBC
%endif
@@ -112,6 +113,9 @@
ARGS="$ARGS --without-fetch"
ARGS="$ARGS --disable-dynamic"
ARGS="$ARGS --disable-shared"
+%if "%{with_server}" == "yes"
+ ARGS="$ARGS --enable-slapd"
+ ARGS="$ARGS --enable-slurpd"
ARGS="$ARGS --disable-modules"
ARGS="$ARGS --enable-ldbm"
ARGS="$ARGS --enable-ldbm-api=berkeley"
@@ -126,21 +130,29 @@
ARGS="$ARGS --enable-null"
ARGS="$ARGS --enable-shell"
ARGS="$ARGS --with-proxycache"
- ARGS="$ARGS --enable-slurpd"
+%else
+ ARGS="$ARGS --disable-slapd"
+ ARGS="$ARGS --disable-slurpd"
+ ARGS="$ARGS --disable-modules"
+%endif
# configuration: force to use OSSP fsl
+%if "%{with_server}" == "yes"
LDFLAGS="$LDFLAGS %{l_fsl_ldflags}"
LIBS="$LIBS %{l_fsl_libs}"
+%endif
# configuration: force to use GNU pth
+%if "%{with_server}" == "yes"
CFLAGS="$CFLAGS `%{l_prefix}/bin/pth-config --cflags`"
CPPFLAGS="$CPPFLAGS -I`%{l_prefix}/bin/pth-config --includedir`"
LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pth-config --ldflags`"
LIBS="`%{l_prefix}/bin/pth-config --libs` $LIBS"
ARGS="$ARGS --with-threads=pth"
+%endif
# configuration: optional overlay support
-%if "%{with_overlays}" == "yes"
+%if "%{with_server}" == "yes" && "%{with_overlays}" == "yes"
ARGS="$ARGS --enable-overlays=yes"
%endif
@@ -160,12 +172,12 @@
%endif
# configuration: optional Perl support
-%if "%{with_perl}" == "yes"
+%if "%{with_server}" == "yes" && "%{with_perl}" == "yes"
ARGS="$ARGS --enable-perl"
%endif
# configuration: optional ODBC-based RDBMS support
-%if "%{with_odbc}" == "yes"
+%if "%{with_server}" == "yes" && "%{with_odbc}" == "yes"
ARGS="$ARGS --enable-sql"
%endif
@@ -197,29 +209,43 @@
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*/*.default
+ # post adjustment: move files
+%if "%{with_server}" == "yes"
+ mv $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/DB_CONFIG.example \
+ $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/DB_CONFIG
+%endif
+
# post adjustment: enable and correct slurpd.pid (slapd.pid as a
precaution, too)
+%if "%{with_server}" == "yes"
%{l_shtool} subst \
-e 's;^[ #]*\(pidfile \).*$;\1
%{l_prefix}/var/openldap/run/slapd.pid;' \
-e 's;^[ #]*\(replica-pidfile \).*$;\1
%{l_prefix}/var/openldap/run/slurpd.pid;' \
$RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
+%endif
# post adjustment: remove OSSP fsl dependency from libtool files
+%if "%{with_server}" == "yes"
%{l_shtool} subst \
-e 's;-lfsl *;;' \
$RPM_BUILD_ROOT%{l_prefix}/lib/*.la
+%endif
# install run-command script
+%if "%{with_server}" == "yes"
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.openldap} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
+%endif
# install OSSP fsl configuration
+%if "%{with_server}" == "yes"
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/etc/fsl
%{l_shtool} install -c -m 644 %{l_value -s -a} \
%{SOURCE fsl.openldap} \
$RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
+%endif
# install pkg-config configuration
%{l_shtool} mkdir -f -p -m 755 \
@@ -234,13 +260,29 @@
%{SOURCE openldap.pc} \
$RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
+ # optionally remove server-components
+%if "%{with_server}" != "yes"
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/schema
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/slapd.conf
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/DB_CONFIG
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/sbin
+ rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/openldap
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/include/slapi-plugin.h
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man5/slap*
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/slap*
+ rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/slurp*
+%endif
+
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
+%if "%{with_server}" == "yes"
'%config %{l_prefix}/etc/fsl/fsl.openldap' \
- '%config %{l_prefix}/etc/openldap/*.conf' \
'%config %{l_prefix}/etc/openldap/schema/*.schema' \
- '%config %{l_prefix}/etc/openldap/schema/*.ldif'
+ '%config %{l_prefix}/etc/openldap/schema/*.ldif' \
+ '%config %{l_prefix}/etc/openldap/DB_CONFIG' \
+%endif
+ '%config %{l_prefix}/etc/openldap/*.conf'
%files -f files
@@ -248,23 +290,29 @@
rm -rf $RPM_BUILD_ROOT
%pre
+%if "%{with_server}" == "yes"
# before upgrade, save status and stop service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} openldap status 2>/dev/null | tee %{l_tmpfile}`
%{l_rc} openldap stop 2>/dev/null
exit 0
+%endif
%post
# after upgrade, restore status
+%if "%{with_server}" == "yes"
[ $1 -eq 2 ] || exit 0
{ eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}; true; } >/dev/null 2>&1
[ ".$openldap_active" = .yes ] && %{l_rc} openldap start
exit 0
+%endif
%preun
# before erase, stop service and remove log files
+%if "%{with_server}" == "yes"
[ $1 -eq 0 ] || exit 0
%{l_rc} openldap stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/openldap/openldap.log* >/dev/null 2>&1 ||
true
exit 0
+%endif
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]