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: 25-Dec-2005 23:41:24
Branch: HEAD Handle: 2005122522412400
Modified files:
openpkg-src/openldap openldap.spec
Log:
make build procedure more modular and cleanup some parts of the
packaging
Summary:
Revision Changes Path
1.153 +71 -64 openpkg-src/openldap/openldap.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openldap/openldap.spec
============================================================================
$ cvs diff -u -r1.152 -r1.153 openldap.spec
--- openpkg-src/openldap/openldap.spec 24 Dec 2005 08:38:09 -0000
1.152
+++ openpkg-src/openldap/openldap.spec 25 Dec 2005 22:41:24 -0000
1.153
@@ -33,7 +33,7 @@
Group: Database
License: GPL
Version: 2.3.14
-Release: 20051224
+Release: 20051225
# package options
%option with_fsl yes
@@ -84,74 +84,83 @@
%patch -p0
%build
- # configure toolkit
- # (1. use hard-links)
- # (2. make sure our Berkeley-DB is picked up first)
- %{l_shtool} subst \
- -e 's;ln -s;ln;g' \
- -e 's;-ldb42;-ldb;g' \
- -e 's;-ldb43;-ldb;g' \
- -e 's;<db\.h>;"db.h";g' \
- configure
+ # configuration: standard build flags
+ export CC="%{l_cc}"
+ export CFLAGS="%{l_cflags -O}"
+ export CPPFLAGS="%{l_cppflags}"
+ export LDFLAGS="%{l_ldflags}"
+ export LIBS=""
+ export ARGS=""
+ ARGS="$ARGS --prefix=%{l_prefix}"
+ ARGS="$ARGS --libexecdir=%{l_prefix}/libexec/openldap"
+ ARGS="$ARGS --localstatedir=%{l_prefix}/var/openldap"
+ ARGS="$ARGS --enable-syslog"
+ ARGS="$ARGS --with-readline"
+ ARGS="$ARGS --with-tls"
+ ARGS="$ARGS --disable-dynamic"
+ ARGS="$ARGS --disable-shared"
+ ARGS="$ARGS --disable-modules"
+ ARGS="$ARGS --enable-ldbm"
+ ARGS="$ARGS --enable-ldbm-api=berkeley"
+ ARGS="$ARGS --enable-ldbm-type=btree"
+ ARGS="$ARGS --enable-bdb"
+ ARGS="$ARGS --enable-rewrite"
+ ARGS="$ARGS --enable-hdb"
+ ARGS="$ARGS --enable-ldap"
+ ARGS="$ARGS --enable-meta"
+ ARGS="$ARGS --enable-monitor"
+ ARGS="$ARGS --enable-dnssrv"
+ ARGS="$ARGS --enable-null"
+ ARGS="$ARGS --enable-shell"
+ ARGS="$ARGS --with-dyngroup"
+ ARGS="$ARGS --with-proxycache"
+ ARGS="$ARGS --enable-slurpd"
+
+ # configuration: force to use OSSP fsl
+ LDFLAGS="$LDFLAGS %{l_fsl_ldflags}"
+ LIBS="$LIBS %{l_fsl_libs}"
+
+ # configuration: force to use GNU pth
+ 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"
+
+ # configuration: optional SASL support
%if "%{with_sasl}" == "yes"
- # hard-code use of SASL2 library
( echo "ac_cv_lib_sasl2_sasl_client_init=yes"
) >config.cache
- cf="%{l_cppflags sasl}"
-%else
- cf="%{l_cppflags}"
-%endif
- LOCLIBS=""
- case "%{l_platform -t}" in
- *-sunos* )
- LOCLIBS="-lrt"
- ;;
- esac
- CC="%{l_cc}" \
- CFLAGS="%{l_cflags -O} `%{l_prefix}/bin/pth-config --cflags`" \
- CPPFLAGS="$cf -I`%{l_prefix}/bin/pth-config --includedir`" \
- LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/pth-config --ldflags`
%{l_fsl_ldflags}" \
- LIBS="`%{l_prefix}/bin/pth-config --libs` %{l_fsl_libs} $LOCLIBS" \
- ./configure \
- --cache-file=./config.cache \
- --prefix=%{l_prefix} \
- --libexecdir=%{l_prefix}/libexec/openldap \
- --localstatedir=%{l_prefix}/var/openldap \
- --enable-syslog \
- --with-readline \
- --with-tls \
-%if "%{with_sasl}" == "yes"
- --with-cyrus-sasl \
- --enable-spasswd \
+ CPPFLAGS="%{l_cppflags sasl} $CPPFLAGS"
+ ARGS="$ARGS --with-cyrus-sasl --enable-spasswd"
%else
- --without-cyrus-sasl \
- --disable-spasswd \
+ ARGS="$ARGS --without-cyrus-sasl --disable-spasswd"
%endif
+
+ # configuration: optional crypt(3) support
%if "%{with_crypt}" == "yes"
- --enable-crypt \
+ ARGS="$ARGS --enable-crypt"
%endif
- --disable-dynamic \
- --disable-shared \
- --disable-modules \
- --enable-rewrite \
- --enable-ldbm \
- --enable-ldbm-api=berkeley \
- --enable-ldbm-type=btree \
- --enable-bdb \
- --enable-hdb \
- --enable-ldap \
- --enable-meta \
- --enable-monitor \
- --enable-dnssrv \
- --enable-null \
- --enable-shell \
+
+ # configuration: optional Perl support
%if "%{with_perl}" == "yes"
- --enable-perl \
+ ARGS="$ARGS --enable-perl"
%endif
- --with-dyngroup \
- --with-proxycache \
- --with-threads=pth \
- --enable-slurpd
+
+ # configuration: special platform support
+ case "%{l_platform -t}" in
+ *-sunos* ) LIBS="$LIBS -lrt" ;;
+ esac
+
+ # configuration: use hard-links and make sure our Berkeley-DB is
picked up first
+ %{l_shtool} subst \
+ -e 's;ln -s;ln;g' \
+ -e 's;-ldb4[234];-ldb;g' \
+ -e 's;<db\.h>;"db.h";g' \
+ configure
+
+ # configuration
+ ./configure --cache-file=./config.cache $ARGS
# build toolkit
%{l_make} %{l_mflags} depend
@@ -160,8 +169,6 @@
%install
# install toolkit
rm -rf $RPM_BUILD_ROOT
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/var/openldap
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
# post adjustment: remove extra files
@@ -200,7 +207,7 @@
libs="$libs -lsasl2"
%endif
%{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e 's;@version@;%{version};' \
+ -e "s;@version@;%{version};" \
-e "s;@libs@;$libs;" \
%{SOURCE openldap.pc} \
$RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
@@ -226,8 +233,8 @@
exit 0
%post
- [ $1 -eq 2 ] || exit 0
# after upgrade, restore status
+ [ $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
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [email protected]