| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- ##
- ## openldap24.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package information
- Name: openldap24
- Summary: Lightweight Directory Access Protocol (LDAP) Toolkit
- URL: http://www.openldap.org/
- Vendor: OpenLDAP Project
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: LDAP
- License: GPL
- Version: 2.4.5
- Release: 20070905
- # package options
- %option with_fsl yes
- %option with_crypt yes
- %option with_overlays yes
- %option with_sasl no
- %option with_perl no
- %option with_odbc no
- # list of sources
- Source0: ftp://ftp.openldap.org/pub/openldap/openldap-test/openldap-%{version}beta.tgz
- Source1: rc.openldap
- Source2: fsl.openldap
- Source3: openldap.pc
- Patch0: openldap24.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc
- PreReq: OpenPKG, openpkg >= 20060823
- BuildPreReq: readline, openssl, db >= 4.2, pth
- PreReq: readline, openssl, db >= 4.2, pth
- %if "%{with_fsl}" == "yes"
- BuildPreReq: fsl >= 1.2.0
- PreReq: fsl >= 1.2.0
- %endif
- %if "%{with_sasl}" == "yes"
- BuildPreReq: sasl
- PreReq: sasl
- %endif
- %if "%{with_odbc}" == "yes"
- BuildPreReq: ODBC
- PreReq: ODBC
- %endif
- AutoReq: no
- AutoReqProv: no
- Provides: openldap
- Conflicts: openldap
- %description
- OpenLDAP is an open source implementation of the Lightweight
- Directory Access Protocol (LDAP). The suite includes libraries
- implementing the LDAP protocol plus a stand-alone LDAP server
- slapd(8) and a stand-alone LDAP replication server slurpd(8).
- THIS IS AN EXPERIMENTAL VERSION! DO NOT USE FOR PRODUCTION!
- %track
- prog openldap = {
- version = %{version}
- url = ftp://ftp.openldap.org/pub/openldap/openldap-test/
- regex = openldap-(__VER__)beta\.tgz
- }
- %prep
- %setup -q -n openldap-%{version}beta
- %patch -p0
- %{l_shtool} subst \
- -e 's;-ldb-4\.[1-9];-ldb;g' \
- -e 's;-ldb-4-[1-9];-ldb;g' \
- -e 's;-ldb-4[1-9];-ldb;g' \
- -e 's;-ldb-4;-ldb;g' \
- configure
- %build
- # 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 --without-fetch"
- 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-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 overlay support
- %if "%{with_overlays}" == "yes"
- ARGS="$ARGS --enable-overlays=yes"
- %endif
- # configuration: optional SASL support
- %if "%{with_sasl}" == "yes"
- ( echo "ac_cv_lib_sasl2_sasl_client_init=yes"
- ) >config.cache
- CPPFLAGS="%{l_cppflags sasl} $CPPFLAGS"
- ARGS="$ARGS --with-cyrus-sasl --enable-spasswd"
- %else
- ARGS="$ARGS --without-cyrus-sasl --disable-spasswd"
- %endif
- # configuration: optional crypt(3) support
- %if "%{with_crypt}" == "yes"
- ARGS="$ARGS --enable-crypt"
- %endif
- # configuration: optional Perl support
- %if "%{with_perl}" == "yes"
- ARGS="$ARGS --enable-perl"
- %endif
- # configuration: optional ODBC-based RDBMS support
- %if "%{with_odbc}" == "yes"
- ARGS="$ARGS --enable-sql"
- %endif
- # configuration: special platform support
- case "%{l_platform -t}" in
- *-sunos* ) CFLAGS="$CFLAGS -D_AVL_H"; 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];%{l_prefix}/lib/libdb.a;g' \
- -e 's;<db\.h>;"db.h";g' \
- configure
- # configuration
- ./configure --cache-file=./config.cache $ARGS
- # build toolkit
- %{l_make} %{l_mflags} depend
- %{l_make} %{l_mflags}
- %install
- # install toolkit
- rm -rf $RPM_BUILD_ROOT
- %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
- # post adjustment: remove extra files
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*.default
- rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/openldap/*/*.default
- # post adjustment: enable and correct slurpd.pid (slapd.pid as a precaution, too)
- %{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
- # post adjustment: remove OSSP fsl dependency from libtool files
- %{l_shtool} subst \
- -e 's;-lfsl *;;' \
- $RPM_BUILD_ROOT%{l_prefix}/lib/*.la
- # install run-command script
- %{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/
- # install OSSP fsl configuration
- %{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/
- # install pkg-config configuration
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
- libs="-lldap -llber"
- %if "%{with_sasl}" == "yes"
- libs="$libs -lsasl2"
- %endif
- %{l_shtool} install -c -m 644 %{l_value -s -a} \
- -e "s;@version@;%{version};" \
- -e "s;@libs@;$libs;" \
- %{SOURCE openldap.pc} \
- $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} \
- '%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'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %pre
- # 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
- %post
- # 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
- %preun
- # before erase, stop service and remove log files
- [ $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
|