1
0
forked from pool/openldap2

- Add systemd style service definition

- FATE#315028 remove memory limit for slapd
- FATE#315415: LDAP compat packages required for older SLES versions
  For this reson following patches were applied:
   openldap-2.3.37-libldap-suid.diff
   openldap-2.3.37-libldap-ldapi_url.dif
   openldap-2.3.37-libldap-ntlm.diff
   openldap-2.3.37-libldap-gethostbyname_r.dif
   openldap-2.3.37-libldap-sasl-max-buff-size.dif
   openldap-2.3.37-libldap-utf8-ADcanonical.dif
   openldap-2.3.37-liblber-length-decoding.dif
   openldap-2.3.37-libldap-ld_defconn-ldap_free_connection.dif
   openldap-2.3.37-libldap-tls_chkhost-its6239.dif
   openldap-2.3.37-libldap-ssl.dif

OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=106
This commit is contained in:
Peter Varkoly
2014-02-11 12:31:42 +00:00
committed by Git OBS Bridge
parent cb4daf01de
commit 5798d8fa39
15 changed files with 834 additions and 54 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package openldap2
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,6 +17,7 @@
%define run_test_suite 0
%define version_main 2.4.38
Name: openldap2
Summary: The OpenLDAP Server
@@ -44,7 +45,7 @@ BuildRequires: -libdb-4_8-devel
BuildRequires: libdb-4_5-devel
%endif
Conflicts: openldap
Requires: libldap-2_4-2 = %{version}
Requires: libldap-2_4-2 = %{version_main}
PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/groupadd /usr/bin/grep
%else
%if 0%{?suse_version} >= 1140
@@ -52,9 +53,10 @@ PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/group
BuildRequires: krb5-mini
%endif
Conflicts: openldap-client
Requires: libldap-2_4-2 = %{version}
Requires: libldap-2_4-2 = %{version_main}
Requires: systemd
%endif
Source: openldap-%{version}.tgz
Source: openldap-%{version_main}.tgz
Source1: openldap-rc.tgz
Source2: addonschema.tar.gz
Source3: DB_CONFIG
@@ -71,6 +73,16 @@ Patch5: 0005-pie-compile.dif
Patch6: 0006-No-Build-date-and-time-in-binaries.dif
Patch7: 0007-Recover-on-DB-version-change.dif
Patch100: openldap-2.3.37.dif
Patch101: openldap-2.3.37-libldap-suid.diff
Patch102: openldap-2.3.37-libldap-ldapi_url.dif
Patch103: openldap-2.3.37-libldap-ntlm.diff
Patch104: openldap-2.3.37-libldap-gethostbyname_r.dif
Patch105: openldap-2.3.37-libldap-sasl-max-buff-size.dif
Patch106: openldap-2.3.37-libldap-utf8-ADcanonical.dif
Patch107: openldap-2.3.37-liblber-length-decoding.dif
Patch108: openldap-2.3.37-libldap-ld_defconn-ldap_free_connection.dif
Patch109: openldap-2.3.37-libldap-tls_chkhost-its6239.dif
Patch110: openldap-2.3.37-libldap-ssl.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if "%{name}" == "openldap2"
@@ -82,8 +94,9 @@ service that has an X.500 back-end.
%package -n openldap2-back-perl
Summary: OpenLDAP Perl Back-End
License: OLDAP-2.8
Group: Productivity/Networking/LDAP/Servers
Requires: openldap2 = %{version}
Requires: openldap2 = %{version_main}
Requires: perl = %{perl_version}
%description -n openldap2-back-perl
@@ -92,8 +105,9 @@ different LDAP operations.
%package -n openldap2-back-meta
Summary: OpenLDAP Meta Back-End
License: OLDAP-2.8
Group: Productivity/Networking/LDAP/Servers
Requires: openldap2 = %{version}
Requires: openldap2 = %{version_main}
Provides: openldap2:/usr/share/man/man5/slapd-meta.5.gz
%description -n openldap2-back-meta
@@ -104,8 +118,9 @@ Information Tree (DIT).
%package -n openldap2-back-sql
Summary: OpenLDAP SQL Back-End
License: OLDAP-2.8
Group: Productivity/Networking/LDAP/Servers
Requires: openldap2 = %{version}
Requires: openldap2 = %{version_main}
%description -n openldap2-back-sql
The primary purpose of this OpenLDAP backend is to present information
@@ -114,6 +129,7 @@ to do any programming.
%package -n openldap2-doc
Summary: OpenLDAP Documentation
License: OLDAP-2.8
Group: Documentation/Other
Provides: openldap2:/usr/share/doc/packages/openldap2/drafts/README
%if 0%{?suse_version} > 1110
@@ -123,6 +139,22 @@ BuildArch: noarch
%description -n openldap2-doc
The OpenLDAP Admin Guide plus a set of OpenLDAP related IETF internet drafts
%package -n compat-libldap-2_3-0
Summary: OpenLDAP Client Libraries
License: BSD-3-Clause and OLDAP-2.8 and OLDAP-2.8
Group: Productivity/Networking/LDAP/Clients
Version: 2.3.37
Release: 2.<RELEASE22>
%description -n compat-libldap-2_3-0
This package contains the OpenLDAP client libraries.
Authors:
--------
The OpenLDAP Project <project@openldap.org>
%else
%description
@@ -130,6 +162,7 @@ This package contains the OpenLDAP client utilities.
%package -n openldap2-devel
Summary: Libraries, Header Files and Documentation for OpenLDAP
License: OLDAP-2.8
Group: Development/Libraries/C and C++
# bug437293
%ifarch ppc64
@@ -137,7 +170,7 @@ Obsoletes: openldap2-devel-64bit
%endif
#
Conflicts: openldap-devel
Requires: libldap-2_4-2 = %{version}
Requires: libldap-2_4-2 = %{version_main}
%description -n openldap2-devel
This package provides the OpenLDAP libraries, header files, and
@@ -145,6 +178,7 @@ documentation.
%package -n openldap2-devel-static
Summary: Static libraries for the OpenLDAP libraries
License: OLDAP-2.8
Group: Development/Libraries/C and C++
Requires: openldap2-devel = %version
%if %sles_version == 10
@@ -160,6 +194,7 @@ for development.
%package -n libldap-2_4-2
Summary: OpenLDAP Client Libraries
License: OLDAP-2.8
Group: Productivity/Networking/LDAP/Clients
%description -n libldap-2_4-2
@@ -168,7 +203,7 @@ This package contains the OpenLDAP client libraries.
%endif
%prep
%setup -q -n openldap-%{version} -a1 -a2 -b100
%setup -q -n openldap-%{version_main} -a1 -a2 -b100
%patch1 -p1
%patch2 -p1
%patch3 -p1
@@ -180,6 +215,16 @@ cp %{SOURCE5} .
cp %{SOURCE6} .
cd ../openldap-2.3.37
%patch100
%patch101
%patch102
%patch103
%patch104
%patch105
%patch106
%patch107
%patch108
%patch109 -p1
%patch110
%build
%{?suse_update_config:%{suse_update_config -f build}}
@@ -222,7 +267,7 @@ export STRIP=""
make depend
make %{?jobs:-j%jobs}
%if "%{name}" == "openldap2"
%if %suse_version < 1130
#%if %suse_version < 1130
# build a static slapcat binary from the OpenLDAP 2.3 release
# to be able to update existing databases
cd ../openldap-2.3.37
@@ -230,18 +275,18 @@ cd ../openldap-2.3.37
libtoolize --force
#aclocal -I build
autoreconf
export CFLAGS="$RPM_OPT_FLAGS -Wno-format-extra-args -fno-strict-aliasing -DLDAP_DEPRECATED"
export CFLAGS="$RPM_OPT_FLAGS -Wno-format-extra-args -fno-strict-aliasing -DLDAP_DEPRECATED -DLDAP_CONNECTIONLESS"
./configure --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc \
--localstatedir=/var/run/slapd --libexecdir=/usr/lib/openldap \
--libdir=%{_libdir} --mandir=%{_mandir} --enable-aci \
--enable-hdb --enable-bdb --enable-ldbm --enable-crypt \
--enable-ipv6=no \
--enable-ldap --enable-monitor --enable-meta --enable-rewrite \
--enable-dynamic=no --enable-shared=no
--enable-dynamic=no --enable-shared=yes
make depend
make %{?jobs:-j%jobs}
make -C libraries %{?jobs:-j%jobs}
%endif
#%endif
%endif
%check
@@ -270,11 +315,12 @@ make SLAPD_DEBUG=0 test
%endif
%install
mkdir -p $RPM_BUILD_ROOT/etc/init.d
mkdir -p $RPM_BUILD_ROOT/usr/lib/openldap/
mkdir -p $RPM_BUILD_ROOT/usr/sbin
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
make STRIP="" DESTDIR=$RPM_BUILD_ROOT install
install -m 755 rc.ldap $RPM_BUILD_ROOT/etc/init.d/ldap
ln -sf ../../etc/init.d/ldap $RPM_BUILD_ROOT/usr/sbin/rcldap
install -m 755 start $RPM_BUILD_ROOT/usr/lib/openldap/start
install -m 644 slapd.service $RPM_BUILD_ROOT/usr/lib/systemd/system
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/slapd.d
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2/slapd.conf
@@ -319,6 +365,10 @@ mv servers/slapd/back-sql/rdbms_depend servers/slapd/back-sql/examples
# install 2.3 slapcat
install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat
%endif
# install sle-10 compat libraries
pushd ../openldap-2.3.37/libraries
make DESTDIR=$RPM_BUILD_ROOT install
popd
%endif
rm -f $RPM_BUILD_ROOT/usr/lib/openldap/modules/*.a
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-dnssrv.5
@@ -334,21 +384,19 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/lib*.la
#put filelists into files
cat >openldap2.filelist <<EOF
/var/adm/fillup-templates/sysconfig.openldap
%config /etc/init.d/ldap
%config /etc/sysconfig/SuSEfirewall2.d/services/openldap
/usr/sbin/rcldap
/usr/sbin/slap*
%dir /etc/sasl2
%dir /etc/openldap
%dir %attr(0770, ldap, ldap) /etc/openldap/slapd.d
%dir /etc/openldap/schema
%dir %{_sysconfdir}/sasl2
%config /etc/openldap/schema/*.schema
%config /etc/openldap/schema/*.ldif
%config(noreplace) %attr(640, root, ldap) /etc/openldap/slapd.conf
%config(noreplace) %attr(640, ldap, ldap) /var/lib/ldap/DB_CONFIG
%config /var/lib/ldap/DB_CONFIG.example
%attr(640, root, ldap) /%{_sysconfdir}/openldap/slapd.conf.default
%config(noreplace) /%{_sysconfdir}/sasl2/slapd.conf
%config(noreplace) /etc/sasl2/slapd.conf
%dir /usr/lib/openldap
%dir /usr/lib/openldap/modules
/usr/lib/openldap/modules/accesslog*
@@ -370,6 +418,8 @@ cat >openldap2.filelist <<EOF
/usr/lib/openldap/modules/unique*
/usr/lib/openldap/modules/valsort*
/usr/lib/openldap/slapd
/usr/lib/openldap/start
/usr/lib/systemd/system/slapd.service
%dir %attr(0700, ldap, ldap) /var/lib/ldap
%dir %attr(0755, ldap, ldap) %ghost /var/run/slapd
%doc %{_mandir}/man8/sl*
@@ -397,6 +447,11 @@ cat >>openldap2.filelist <<EOF
/usr/sbin/openldap-2.3-slapcat
EOF
%endif
cat > compat-libldap.filelist <<EOF
%{_libdir}/liblber*2.3.so.*
%{_libdir}/libldap*2.3.so.*
EOF
#
#
cat > openldap2-client.filelist <<EOF
%dir /etc/openldap
@@ -418,8 +473,8 @@ cat > openldap2-client.filelist <<EOF
%doc %{_mandir}/man5/ldif.*
EOF
cat > libldap.filelist <<EOF
%{_libdir}/liblber*.so.*
%{_libdir}/libldap*.so.*
%{_libdir}/liblber*2.4.so.*
%{_libdir}/libldap*2.4.so.*
EOF
cat > openldap2-devel.filelist <<EOF
/usr/include/*.h
@@ -462,7 +517,7 @@ cat openldap2-client.filelist libldap.filelist openldap2-devel.filelist \
%else
cat openldap2.filelist openldap2-back-perl.filelist \
openldap2-back-meta.filelist openldap2-back-sql.filelist \
openldap2-doc.filelist |
openldap2-doc.filelist compat-libldap.filelist |
%endif
grep -v "%dir " |sed -e "s|^.* ||" |grep "^/" |while read name ; do
rm -rf $RPM_BUILD_ROOT$name
@@ -491,7 +546,7 @@ if [ ${1:-0} -gt 1 ] && [ -f %{_libdir}/sasl2/slapd.conf ] ; then
cp /etc/sasl2/slapd.conf /etc/sasl2/slapd.conf.rpmnew
cp %{_libdir}/sasl2/slapd.conf /etc/sasl2/slapd.conf
fi
%{fillup_and_insserv -n openldap ldap}
%{fillup_only -n openldap ldap}
%{remove_and_set -n openldap OPENLDAP_RUN_DB_RECOVER}
%preun
@@ -499,7 +554,10 @@ fi
%postun
%restart_on_update ldap
%insserv_cleanup
%post -n compat-libldap-2_3-0 -p /sbin/ldconfig
%postun -n compat-libldap-2_3-0 -p /sbin/ldconfig
%files -f openldap2.filelist
%defattr(-,root,root)
@@ -515,6 +573,10 @@ fi
%files -n openldap2-doc -f openldap2-doc.filelist
%defattr(-,root,root)
%files -n compat-libldap-2_3-0 -f compat-libldap.filelist
%defattr(-,root,root)
%else
%post -n libldap-2_4-2 -p /sbin/ldconfig