2006-12-19 00:17:14 +01:00
|
|
|
#
|
2009-08-06 18:21:51 +02:00
|
|
|
# spec file for package openldap2 (Version 2.4.17)
|
2006-12-19 00:17:14 +01:00
|
|
|
#
|
2009-01-09 01:42:38 +01:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2006-12-19 00:17:14 +01:00
|
|
|
#
|
2008-08-11 23:19:12 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
2008-02-25 17:35:54 +01:00
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
Name: openldap2
|
2008-12-15 15:02:48 +01:00
|
|
|
BuildRequires: cyrus-sasl-devel db-devel libopenssl-devel openslp-devel tcpd-devel
|
2008-08-02 02:08:43 +02:00
|
|
|
%if %sles_version == 9
|
2009-03-24 19:56:33 +01:00
|
|
|
BuildRequires: -db-devel -libopenssl-devel -pwdutils libdb-4_5-devel openssl-devel
|
2008-08-02 02:08:43 +02:00
|
|
|
%endif
|
|
|
|
%if %sles_version == 10
|
2008-12-15 15:02:48 +01:00
|
|
|
BuildRequires: -db-devel -libopenssl-devel -pwdutils libdb-4_5-devel openssl-devel
|
2008-08-02 02:08:43 +02:00
|
|
|
%endif
|
2009-12-11 13:08:01 +01:00
|
|
|
Version: 2.4.17
|
|
|
|
Release: 5
|
2007-10-30 01:33:48 +01:00
|
|
|
Url: http://www.openldap.org
|
2009-06-20 01:13:14 +02:00
|
|
|
License: BSD 3-clause (or similar) ; openldap 2.8
|
2006-12-19 00:17:14 +01:00
|
|
|
%if "%{name}" == "openldap2"
|
2009-08-06 18:21:51 +02:00
|
|
|
Group: Productivity/Networking/LDAP/Clients
|
2006-12-19 00:17:14 +01:00
|
|
|
Provides: ldap2 openldap2-back-ldap openldap2-back-monitor
|
|
|
|
Obsoletes: openldap2-back-ldap openldap2-back-monitor
|
|
|
|
Conflicts: openldap
|
2008-09-13 06:27:04 +02:00
|
|
|
Requires: libldap-2_4-2 = %{version}
|
2007-06-15 00:27:29 +02:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/groupadd /usr/bin/grep
|
2009-08-06 18:21:51 +02:00
|
|
|
Summary: The OpenLDAP commandline client tools
|
2006-12-19 00:17:14 +01:00
|
|
|
%else
|
2009-08-06 18:21:51 +02:00
|
|
|
Group: Productivity/Networking/LDAP/Clients
|
2006-12-19 00:17:14 +01:00
|
|
|
Conflicts: openldap-client
|
2009-08-06 18:21:51 +02:00
|
|
|
Summary: The OpenLDAP commandline client tools
|
2006-12-19 00:17:14 +01:00
|
|
|
%endif
|
2007-10-30 01:33:48 +01:00
|
|
|
AutoReqProv: on
|
2006-12-19 00:17:14 +01:00
|
|
|
Source: openldap-%{version}.tar.bz2
|
|
|
|
Source1: openldap-rc.tgz
|
2007-12-19 14:52:01 +01:00
|
|
|
Source2: addonschema.tar.gz
|
|
|
|
Source3: DB_CONFIG
|
|
|
|
Source4: sasl-slapd.conf
|
2008-05-17 01:48:12 +02:00
|
|
|
Source5: README.update
|
2009-10-03 00:27:25 +02:00
|
|
|
Source6: schema2ldif
|
2008-05-17 01:48:12 +02:00
|
|
|
Source100: openldap-2.3.37.tar.bz2
|
2009-12-11 13:08:01 +01:00
|
|
|
Patch: openldap2.dif
|
2006-12-19 00:17:14 +01:00
|
|
|
Patch2: slapd_conf.dif
|
|
|
|
Patch3: ldap_conf.dif
|
|
|
|
Patch4: ldapi_url.dif
|
2009-12-11 13:08:01 +01:00
|
|
|
Patch5: test056-monitor-its6213.dif
|
2006-12-19 00:17:14 +01:00
|
|
|
Patch6: libldap-gethostbyname_r.dif
|
|
|
|
Patch7: pie-compile.dif
|
2008-09-13 06:27:04 +02:00
|
|
|
Patch11: slapd-bconfig-del-db.dif
|
2009-12-11 13:08:01 +01:00
|
|
|
Patch14: slapo-collect-include.dif
|
|
|
|
Patch15: libldap-tls_chkhost-its6239.dif
|
2008-05-17 01:48:12 +02:00
|
|
|
Patch100: openldap-2.3.37.dif
|
2009-03-24 19:56:33 +01:00
|
|
|
Patch200: slapd_getaddrinfo_dupl.dif
|
2006-12-19 00:17:14 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-08-06 18:21:51 +02:00
|
|
|
%if "%{name}" == "openldap2"
|
2006-12-19 00:17:14 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
The Lightweight Directory Access Protocol (LDAP) is used to access
|
|
|
|
online directory services. It runs directly over TCP and can be used to
|
|
|
|
access a stand-alone LDAP directory service or to access a directory
|
|
|
|
service that has an X.500 back-end.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
|
|
|
%package -n openldap2-back-perl
|
2009-06-20 01:13:14 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2006-12-19 00:17:14 +01:00
|
|
|
Summary: OpenLDAP Perl Back-End
|
2008-09-26 15:06:42 +02:00
|
|
|
Requires: openldap2 = %{version} perl = %{perl_version}
|
2007-10-30 01:33:48 +01:00
|
|
|
AutoReqProv: on
|
2006-12-19 00:17:14 +01:00
|
|
|
Group: Productivity/Networking/LDAP/Servers
|
|
|
|
|
|
|
|
%description -n openldap2-back-perl
|
|
|
|
The OpenLDAP Perl back-end allows you to execute Perl code specific to
|
|
|
|
different LDAP operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
|
|
|
%package -n openldap2-back-meta
|
2009-06-20 01:13:14 +02:00
|
|
|
License: BSD 3-clause (or similar)
|
2006-12-19 00:17:14 +01:00
|
|
|
Summary: OpenLDAP Meta Back-End
|
|
|
|
Requires: openldap2 = %{version}
|
2007-10-30 01:33:48 +01:00
|
|
|
AutoReqProv: on
|
2006-12-19 00:17:14 +01:00
|
|
|
Group: Productivity/Networking/LDAP/Servers
|
|
|
|
Provides: openldap2:/usr/share/man/man5/slapd-meta.5.gz
|
|
|
|
|
|
|
|
%description -n openldap2-back-meta
|
|
|
|
The OpenLDAP Meta back-end is able to perform basic LDAP proxying with
|
|
|
|
respect to a set of remote LDAP servers. The information contained in
|
|
|
|
these servers can be presented as belonging to a single Directory
|
|
|
|
Information Tree (DIT).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
2008-07-08 15:40:57 +02:00
|
|
|
%else
|
|
|
|
|
2009-08-06 18:21:51 +02:00
|
|
|
%description
|
|
|
|
This package contains the OpenLDAP client utilities.
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
%package -n openldap2-devel
|
2009-06-20 01:13:14 +02:00
|
|
|
License: BSD 3-clause (or similar) ; openldap 2.8
|
2008-02-25 17:35:54 +01:00
|
|
|
Summary: Libraries, Header Files and Documentation for OpenLDAP
|
2007-10-30 01:33:48 +01:00
|
|
|
AutoReqProv: on
|
2009-01-09 01:42:38 +01:00
|
|
|
# bug437293
|
|
|
|
%ifarch ppc64
|
|
|
|
Obsoletes: openldap2-devel-64bit
|
|
|
|
%endif
|
|
|
|
#
|
2008-06-25 18:32:44 +02:00
|
|
|
Conflicts: openldap-devel
|
2009-03-24 19:56:33 +01:00
|
|
|
%if %suse_version >= 1110
|
2008-12-15 15:02:48 +01:00
|
|
|
Requires: libldap-2_4-2 = %{version} cyrus-sasl-devel libopenssl-devel
|
2009-03-24 19:56:33 +01:00
|
|
|
%else
|
|
|
|
Requires: libldap-2_4-2 = %{version} cyrus-sasl-devel openssl-devel
|
|
|
|
%endif
|
2006-12-19 00:17:14 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
|
|
|
|
%description -n openldap2-devel
|
2008-02-25 17:35:54 +01:00
|
|
|
This package provides the OpenLDAP libraries, header files, and
|
2006-12-19 00:17:14 +01:00
|
|
|
documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-06-25 18:32:44 +02:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
|
|
|
%package -n libldap-2_4-2
|
2009-06-20 01:13:14 +02:00
|
|
|
License: BSD 3-clause (or similar) ; openldap 2.8
|
2008-06-25 18:32:44 +02:00
|
|
|
Summary: OpenLDAP Client Libraries
|
|
|
|
AutoReqProv: on
|
|
|
|
Group: Productivity/Networking/LDAP/Clients
|
|
|
|
|
|
|
|
%description -n libldap-2_4-2
|
|
|
|
This package contains the OpenLDAP client libraries.
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
The OpenLDAP Project <project@openldap.org>
|
|
|
|
|
2008-07-08 15:40:57 +02:00
|
|
|
%endif
|
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
%prep
|
2008-05-17 01:48:12 +02:00
|
|
|
%setup -q -n openldap-%{version} -a1 -a2 -b100
|
2009-12-11 13:08:01 +01:00
|
|
|
%patch
|
2006-12-19 00:17:14 +01:00
|
|
|
%patch2
|
|
|
|
%patch3
|
|
|
|
%patch4
|
2009-12-11 13:08:01 +01:00
|
|
|
%patch5
|
2006-12-19 00:17:14 +01:00
|
|
|
%patch6
|
2008-08-02 02:08:43 +02:00
|
|
|
%if %suse_version > 920
|
2006-12-19 00:17:14 +01:00
|
|
|
%patch7
|
2008-08-02 02:08:43 +02:00
|
|
|
%endif
|
2008-09-13 06:27:04 +02:00
|
|
|
%patch11
|
2009-12-10 17:03:08 +01:00
|
|
|
%patch14 -p1
|
2009-12-11 13:08:01 +01:00
|
|
|
%patch15
|
2009-03-24 19:56:33 +01:00
|
|
|
%if %suse_version == 1100
|
|
|
|
%patch200 -p1
|
|
|
|
%endif
|
2009-04-23 23:12:13 +02:00
|
|
|
cp %{SOURCE5} .
|
|
|
|
cd ../openldap-2.3.37
|
|
|
|
%patch100
|
2006-12-19 00:17:14 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%{?suse_update_config:%{suse_update_config -f build}}
|
|
|
|
libtoolize --force
|
|
|
|
autoreconf
|
2008-08-02 02:08:43 +02:00
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED -DLDAP_CONNECTIONLESS -DSLAP_CONFIG_DELETE"
|
2006-12-19 00:17:14 +01:00
|
|
|
./configure --prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
2007-05-17 11:50:08 +02:00
|
|
|
--sysconfdir=%{_sysconfdir} \
|
2006-12-19 00:17:14 +01:00
|
|
|
--localstatedir=/var/run/slapd \
|
|
|
|
--libexecdir=/usr/lib/openldap \
|
|
|
|
--libdir=%{_libdir} \
|
|
|
|
--mandir=%{_mandir} \
|
|
|
|
--enable-wrappers \
|
|
|
|
--enable-aclgroups \
|
|
|
|
--enable-spasswd \
|
|
|
|
--enable-modules \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-dynamic \
|
|
|
|
--with-tls \
|
|
|
|
--with-cyrus-sasl \
|
|
|
|
--enable-crypt \
|
|
|
|
--enable-ipv6=yes \
|
|
|
|
%if "%{name}" == "openldap2"
|
|
|
|
--enable-aci \
|
|
|
|
--enable-bdb \
|
|
|
|
--enable-hdb \
|
|
|
|
--enable-rewrite \
|
|
|
|
--enable-ldap=yes \
|
|
|
|
--enable-meta=mod \
|
|
|
|
--enable-monitor=yes \
|
|
|
|
--enable-perl=mod \
|
|
|
|
--enable-slp \
|
|
|
|
--enable-overlays=yes \
|
|
|
|
%else
|
|
|
|
--disable-slapd \
|
|
|
|
%endif
|
|
|
|
--enable-lmpasswd \
|
|
|
|
--with-yielding-select
|
|
|
|
make depend
|
|
|
|
make %{?jobs:-j%jobs}
|
2008-05-17 01:48:12 +02:00
|
|
|
%if "%{name}" == "openldap2"
|
|
|
|
# build a static slapcat binary from the OpenLDAP 2.3 release
|
|
|
|
# to be able to update existing databases
|
|
|
|
cd ../openldap-2.3.37
|
|
|
|
%{?suse_update_config:%{suse_update_config -f build}}
|
|
|
|
libtoolize --force
|
|
|
|
#aclocal -I build
|
|
|
|
autoreconf
|
|
|
|
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -DLDAP_DEPRECATED"
|
|
|
|
./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
|
|
|
|
make depend
|
|
|
|
make %{?jobs:-j%jobs}
|
|
|
|
%endif
|
2007-10-30 01:33:48 +01:00
|
|
|
|
|
|
|
%check
|
2006-12-19 00:17:14 +01:00
|
|
|
# calculate the base port to be use in the test-suite
|
|
|
|
SLAPD_BASEPORT=10000
|
|
|
|
if [ -f /.buildenv ] ; then
|
|
|
|
. /.buildenv
|
2008-08-13 17:27:01 +02:00
|
|
|
SLAPD_BASEPORT=$(($SLAPD_BASEPORT + ${BUILD_INCARNATION:-0} * 10))
|
2006-12-19 00:17:14 +01:00
|
|
|
fi
|
|
|
|
export SLAPD_BASEPORT
|
|
|
|
%ifnarch %arm alpha
|
2008-10-06 19:05:59 +02:00
|
|
|
rm -f tests/scripts/test019-syncreplication-cascade
|
2007-12-19 14:52:01 +01:00
|
|
|
rm -f tests/scripts/test022-ppolicy
|
2009-08-06 18:21:51 +02:00
|
|
|
rm -f tests/scripts/test023-refint
|
2008-10-06 19:05:59 +02:00
|
|
|
rm -f tests/scripts/test033-glue-syncrepl
|
2009-08-06 18:21:51 +02:00
|
|
|
#rm -f tests/scripts/test036-meta-concurrency
|
|
|
|
#rm -f tests/scripts/test039-glue-ldap-concurrency
|
2008-10-06 19:05:59 +02:00
|
|
|
rm -f tests/scripts/test043-delta-syncrepl
|
2009-08-06 18:21:51 +02:00
|
|
|
#rm -f tests/scripts/test045-syncreplication-proxied
|
2008-10-06 19:05:59 +02:00
|
|
|
rm -f tests/scripts/test048-syncrepl-multiproxy
|
|
|
|
rm -f tests/scripts/test050-syncrepl-multimaster
|
2009-08-06 18:21:51 +02:00
|
|
|
rm -f tests/scripts/test058-syncrepl-asymmetric
|
2008-09-26 15:06:42 +02:00
|
|
|
make SLAPD_DEBUG=0 test
|
2006-12-19 00:17:14 +01:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
|
|
|
make 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
|
2007-12-19 14:52:01 +01:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/slapd.d
|
2007-05-17 11:50:08 +02:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2
|
2007-12-19 14:52:01 +01:00
|
|
|
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2/slapd.conf
|
2006-12-19 00:17:14 +01:00
|
|
|
install -m 755 -d $RPM_BUILD_ROOT/var/lib/ldap
|
|
|
|
chmod a+x $RPM_BUILD_ROOT/%{_libdir}/liblber.so*
|
|
|
|
chmod a+x $RPM_BUILD_ROOT/%{_libdir}/libldap_r.so*
|
|
|
|
chmod a+x $RPM_BUILD_ROOT/%{_libdir}/libldap.so*
|
2009-10-03 00:27:25 +02:00
|
|
|
install -m 755 %{SOURCE6} $RPM_BUILD_ROOT/usr/sbin/schema2ldif
|
2006-12-19 00:17:14 +01:00
|
|
|
%if "%{name}" == "openldap2"
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
|
|
|
install -m 644 sysconfig.openldap $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.openldap
|
|
|
|
install -m 644 *.schema $RPM_BUILD_ROOT/etc/openldap/schema
|
2007-12-19 14:52:01 +01:00
|
|
|
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/var/lib/ldap/DB_CONFIG
|
2006-12-19 00:17:14 +01:00
|
|
|
install -m 644 $RPM_BUILD_ROOT/etc/openldap/DB_CONFIG.example $RPM_BUILD_ROOT/var/lib/ldap/DB_CONFIG.example
|
2007-03-15 18:11:06 +01:00
|
|
|
install -d $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/
|
|
|
|
install -m 644 SuSEfirewall2.openldap $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/openldap
|
2007-12-19 14:52:01 +01:00
|
|
|
rm -f `find doc/guide ! -name *.html -a ! -name *.gif -a ! -name *.png -a ! -type d`
|
|
|
|
rm -rf doc/guide/release
|
2006-12-19 00:17:14 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/etc/openldap/DB_CONFIG.example
|
2008-09-26 15:06:42 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/etc/openldap/schema/README
|
2006-12-19 00:17:14 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/var/run/slapd/openldap-data/DB_CONFIG.example
|
2008-05-17 01:48:12 +02:00
|
|
|
# install 2.3 slapcat
|
|
|
|
install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat
|
2006-12-19 00:17:14 +01:00
|
|
|
%endif
|
|
|
|
rm -f $RPM_BUILD_ROOT/usr/lib/openldap/modules/*.a
|
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-dnssrv.5
|
2008-10-13 16:43:35 +02:00
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-ndb.5
|
2006-12-19 00:17:14 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-null.5
|
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-passwd.5
|
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-shell.5
|
2008-02-25 17:35:54 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-sock.5
|
2006-12-19 00:17:14 +01:00
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-sql.5
|
|
|
|
rm -f $RPM_BUILD_ROOT/usr/share/man/man5/slapd-tcl.5
|
|
|
|
# Remove *.la files, libtool does not handle this correct
|
|
|
|
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
|
2008-09-26 15:06:42 +02:00
|
|
|
%config /etc/sysconfig/SuSEfirewall2.d/services/openldap
|
2006-12-19 00:17:14 +01:00
|
|
|
/usr/sbin/rcldap
|
|
|
|
/usr/sbin/slap*
|
2008-05-17 01:48:12 +02:00
|
|
|
/usr/sbin/openldap-2.3-slapcat
|
2006-12-19 00:17:14 +01:00
|
|
|
%dir /etc/openldap
|
2007-12-19 14:52:01 +01:00
|
|
|
%dir %attr(0770, ldap, ldap) /etc/openldap/slapd.d
|
2008-09-26 15:06:42 +02:00
|
|
|
%dir /etc/openldap/schema
|
|
|
|
%config /etc/openldap/schema/*.schema
|
|
|
|
%config /etc/openldap/schema/*.ldif
|
2006-12-19 00:17:14 +01:00
|
|
|
%config(noreplace) %attr(640, root, ldap) /etc/openldap/slapd.conf
|
2008-04-25 15:20:02 +02:00
|
|
|
%config(noreplace) %attr(640, ldap, ldap) /var/lib/ldap/DB_CONFIG
|
|
|
|
%config /var/lib/ldap/DB_CONFIG.example
|
2007-12-19 14:52:01 +01:00
|
|
|
%attr(640, root, ldap) /%{_sysconfdir}/openldap/slapd.conf.default
|
2006-12-19 00:17:14 +01:00
|
|
|
%config(noreplace) /etc/sasl2/slapd.conf
|
|
|
|
%dir /usr/lib/openldap
|
|
|
|
%dir /usr/lib/openldap/modules
|
|
|
|
/usr/lib/openldap/slapd
|
|
|
|
%dir %attr(0700, ldap, ldap) /var/lib/ldap
|
2009-09-23 21:15:25 +02:00
|
|
|
%dir %attr(0711, ldap, ldap) /var/run/slapd
|
2006-12-19 00:17:14 +01:00
|
|
|
%doc %{_mandir}/man8/sl*
|
|
|
|
%doc %{_mandir}/man5/slapd.*
|
|
|
|
%doc %{_mandir}/man5/slapd-bdb.*
|
2007-12-19 14:52:01 +01:00
|
|
|
%doc %{_mandir}/man5/slapd-config.*
|
2006-12-19 00:17:14 +01:00
|
|
|
%doc %{_mandir}/man5/slapd-hdb.*
|
|
|
|
%doc %{_mandir}/man5/slapd-ldbm.*
|
|
|
|
%doc %{_mandir}/man5/slapd-ldap.*
|
|
|
|
%doc %{_mandir}/man5/slapd-ldif.*
|
|
|
|
%doc %{_mandir}/man5/slapd-monitor.*
|
|
|
|
%doc %{_mandir}/man5/slapd-relay.*
|
|
|
|
%doc %{_mandir}/man5/slapo-*
|
|
|
|
%doc ANNOUNCEMENT COPYRIGHT INSTALL LICENSE README CHANGES
|
2007-12-19 14:52:01 +01:00
|
|
|
%doc doc/drafts doc/guide
|
2008-05-17 01:48:12 +02:00
|
|
|
%doc README.update
|
2006-12-19 00:17:14 +01:00
|
|
|
EOF
|
|
|
|
#
|
|
|
|
cat > openldap2-client.filelist <<EOF
|
|
|
|
%dir /etc/openldap
|
|
|
|
%config(noreplace) /etc/openldap/ldap.conf
|
|
|
|
/etc/openldap/ldap.conf.default
|
|
|
|
/usr/bin/ldapadd
|
|
|
|
/usr/bin/ldapcompare
|
|
|
|
/usr/bin/ldapdelete
|
2007-12-19 14:52:01 +01:00
|
|
|
/usr/bin/ldapexop
|
2006-12-19 00:17:14 +01:00
|
|
|
/usr/bin/ldapmodify
|
|
|
|
/usr/bin/ldapmodrdn
|
|
|
|
/usr/bin/ldapsearch
|
|
|
|
/usr/bin/ldappasswd
|
2009-03-24 19:56:33 +01:00
|
|
|
/usr/bin/ldapurl
|
2006-12-19 00:17:14 +01:00
|
|
|
/usr/bin/ldapwhoami
|
2009-10-03 00:27:25 +02:00
|
|
|
/usr/sbin/schema2ldif
|
2006-12-19 00:17:14 +01:00
|
|
|
%doc %{_mandir}/man1/ldap*
|
|
|
|
%doc %{_mandir}/man5/ldap.conf*
|
|
|
|
%doc %{_mandir}/man5/ldif.*
|
|
|
|
EOF
|
2008-06-25 18:32:44 +02:00
|
|
|
cat > libldap.filelist <<EOF
|
|
|
|
%{_libdir}/liblber*.so.*
|
|
|
|
%{_libdir}/libldap*.so.*
|
|
|
|
EOF
|
2006-12-19 00:17:14 +01:00
|
|
|
cat > openldap2-devel.filelist <<EOF
|
|
|
|
/usr/include/lber.h
|
|
|
|
/usr/include/lber_types.h
|
|
|
|
/usr/include/ldap*.h
|
|
|
|
/usr/include/slapi-plugin.h
|
|
|
|
%{_libdir}/liblber.a
|
|
|
|
%{_libdir}/liblber.so
|
2008-03-03 16:20:00 +01:00
|
|
|
%{_libdir}/libldap*.a
|
|
|
|
%{_libdir}/libldap*.so
|
2006-12-19 00:17:14 +01:00
|
|
|
%doc %{_mandir}/man3/ber*
|
|
|
|
%doc %{_mandir}/man3/lber*
|
|
|
|
%doc %{_mandir}/man3/ld_errno*
|
|
|
|
%doc %{_mandir}/man3/ldap*
|
|
|
|
EOF
|
|
|
|
cat > openldap2-back-perl.filelist <<EOF
|
|
|
|
/usr/lib/openldap/modules/back_perl*
|
|
|
|
%doc %{_mandir}/man5/slapd-perl.*
|
|
|
|
EOF
|
|
|
|
cat > openldap2-back-meta.filelist <<EOF
|
|
|
|
/usr/lib/openldap/modules/back_meta*
|
|
|
|
%doc %{_mandir}/man5/slapd-meta.*
|
|
|
|
EOF
|
|
|
|
#remove files from other spec file
|
|
|
|
%if "%{name}" == "openldap2"
|
2008-06-25 18:32:44 +02:00
|
|
|
cat openldap2-client.filelist libldap.filelist openldap2-devel.filelist |
|
2006-12-19 00:17:14 +01:00
|
|
|
%else
|
|
|
|
cat openldap2.filelist openldap2-back-perl.filelist openldap2-back-meta.filelist |
|
|
|
|
%endif
|
|
|
|
grep -v "%dir " |sed -e "s|^.* ||" |grep "^/" |while read name ; do
|
|
|
|
rm -rf $RPM_BUILD_ROOT$name
|
|
|
|
done
|
|
|
|
%if "%{name}" == "openldap2"
|
|
|
|
|
|
|
|
%pre
|
|
|
|
/usr/sbin/groupadd -g 70 -o -r ldap 2> /dev/null || :
|
|
|
|
/usr/sbin/useradd -r -o -g ldap -u 76 -s /bin/bash -c "User for OpenLDAP" -d \
|
2008-05-17 01:48:12 +02:00
|
|
|
/var/lib/ldap ldap 2> /dev/null || :
|
|
|
|
# try to figure out if a db update is needed
|
|
|
|
if [ ${1:-0} -gt 1 ] && [ -f /usr/lib/openldap/slapd ] &&
|
|
|
|
/usr/bin/strings /usr/lib/openldap/slapd | \
|
|
|
|
grep "slapd 2.3" 2>&1 > /dev/null;
|
|
|
|
then
|
|
|
|
# create a backup of the schema shipped with 2.3
|
|
|
|
# at least core.schema changed between 2.3 and 2.4
|
|
|
|
TEMPDIR=`mktemp -d /etc/openldap/schema.backup.XXXXXX`
|
|
|
|
echo "Schema backup created in $TEMPDIR"
|
|
|
|
cp -p --remove-destination /etc/openldap/schema/* $TEMPDIR
|
|
|
|
echo $TEMPDIR > /etc/openldap/UPDATE_NEEDED ;
|
|
|
|
fi
|
2006-12-19 00:17:14 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
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
|
2008-08-18 18:57:28 +02:00
|
|
|
%{fillup_and_insserv -n openldap ldap}
|
2006-12-19 00:17:14 +01:00
|
|
|
%{remove_and_set -n openldap OPENLDAP_RUN_DB_RECOVER}
|
2008-05-17 01:48:12 +02:00
|
|
|
# convert database if needed
|
|
|
|
if [ -f /etc/openldap/UPDATE_NEEDED ] ; then
|
|
|
|
read SCHEMA_BACKUP < /etc/openldap/UPDATE_NEEDED
|
|
|
|
SLAPD_CONF=/etc/openldap/slapd.conf
|
|
|
|
sed -e "s;/etc/openldap/schema/;$SCHEMA_BACKUP/;g" \
|
|
|
|
< $SLAPD_CONF > $SCHEMA_BACKUP/slapd.conf.update
|
|
|
|
LOGFILE="slaptool.log"
|
|
|
|
BACKENDS=`grep ^database $SLAPD_CONF | awk '{print $2}'`
|
|
|
|
DIRECTORIES=(`grep ^directory $SLAPD_CONF | awk '{print $2}'`)
|
|
|
|
MSG=""
|
|
|
|
db_num=0
|
|
|
|
dir_num=0
|
2008-11-07 15:31:05 +01:00
|
|
|
restart=""
|
|
|
|
/etc/init.d/ldap status 2&>1 > /dev/null
|
|
|
|
if [ "$?" = "0" ]; then
|
|
|
|
/etc/init.d/ldap stop
|
|
|
|
restart="1"
|
|
|
|
fi
|
2008-05-17 01:48:12 +02:00
|
|
|
for i in $BACKENDS; do
|
|
|
|
db_num=$((db_num+1));
|
2008-11-07 15:31:05 +01:00
|
|
|
if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then
|
2008-05-17 01:48:12 +02:00
|
|
|
db_dir=${DIRECTORIES[$dir_num]};
|
2008-11-07 15:31:05 +01:00
|
|
|
if [ -f $db_dir/id2entry.bdb ] || [ -f $db_dir/id2entry.dbb ] ; then
|
2008-05-17 01:48:12 +02:00
|
|
|
rm $db_dir/__db* ;
|
|
|
|
mkdir $db_dir/db_bak ;
|
|
|
|
echo "Dumping database to: $db_dir/ldapbak.ldif.$db_num" ;
|
|
|
|
/usr/sbin/openldap-2.3-slapcat -T c \
|
|
|
|
-f $SCHEMA_BACKUP/slapd.conf.update \
|
2008-11-07 15:31:05 +01:00
|
|
|
-n $db_num -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE;
|
|
|
|
if [ "x$i" = "xldbm" ] ; then
|
|
|
|
mv $db_dir/*.dbb $db_dir/db_bak/ ;
|
|
|
|
else
|
|
|
|
mv $db_dir/*.bdb $db_dir/db_bak/ ;
|
|
|
|
mv $db_dir/log.* $db_dir/db_bak/ ;
|
|
|
|
fi
|
|
|
|
mv $db_dir/alock $db_dir/db_bak/ ;
|
2008-05-17 01:48:12 +02:00
|
|
|
rm -f $db_dir/__db* ;
|
|
|
|
fi
|
|
|
|
dir_num=$((dir_num+1));
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
db_num=0
|
|
|
|
dir_num=0
|
2008-11-07 15:31:05 +01:00
|
|
|
sed -i -e "s;ldbm;bdb;g" $SLAPD_CONF
|
2008-05-17 01:48:12 +02:00
|
|
|
for i in $BACKENDS; do
|
|
|
|
db_num=$((db_num+1));
|
2008-11-07 15:31:05 +01:00
|
|
|
if [ "x$i" = "xbdb" ] || [ "x$i" = "xhdb" ] || [ "x$i" = "xldbm" ] ; then
|
2008-05-17 01:48:12 +02:00
|
|
|
db_dir=${DIRECTORIES[$dir_num]};
|
|
|
|
if [ -s $db_dir/ldapbak.ldif.$db_num ] ; then
|
2008-11-07 15:31:05 +01:00
|
|
|
if [ `wc -l $db_dir/ldapbak.ldif.$db_num | awk '{print $1}'` -lt 2500000 ]; then
|
|
|
|
if [ "x$i" = "xldbm" ] ; then
|
|
|
|
echo "Converting $i database to bdb in $db_dir" ;
|
|
|
|
# Create default DB_CONFIG for better performance
|
|
|
|
echo "set_cachesize 0 15000000 1" > $db_dir/DB_CONFIG
|
|
|
|
echo "set_lg_regionmax 262144" >> $db_dir/DB_CONFIG
|
|
|
|
echo "set_lg_bsize 2097152" >> $db_dir/DB_CONFIG
|
|
|
|
echo "set_flags DB_LOG_AUTOREMOVE" >> $db_dir/DB_CONFIG
|
|
|
|
else
|
|
|
|
echo "Restoring $i database in $db_dir" ;
|
|
|
|
fi
|
2008-05-17 01:48:12 +02:00
|
|
|
slapadd -q -n $db_num -f $SLAPD_CONF -l $db_dir/ldapbak.ldif.$db_num 2>> $db_dir/$LOGFILE ;
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
MSG="$MSG\nFailed to restore database in $db_dir";
|
|
|
|
MSG="$MSG\nPlease restore manually from the LDIF dump $db_dir/ldapbak.ldif.$db_num\n";
|
|
|
|
else
|
|
|
|
rm -f $db_dir/ldapbak.ldif.$db_num
|
|
|
|
rm -rf $db_dir/db_bak/
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
MSG="$MSG\nPlease restore the database in $db_dir manually by using";
|
|
|
|
MSG="$MSG\nslapadd with the LDIF dump $db_dir/ldapbak.ldif.$db_num\n";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
dir_num=$((dir_num+1));
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ "$MSG" ] ; then
|
|
|
|
echo -e "$MSG";
|
|
|
|
else
|
|
|
|
rm -f /etc/openldap/UPDATE_NEEDED ;
|
2008-11-07 15:31:05 +01:00
|
|
|
if [ $restart ]; then
|
|
|
|
/etc/init.d/ldap start
|
|
|
|
fi
|
2008-05-17 01:48:12 +02:00
|
|
|
fi
|
|
|
|
fi
|
2006-12-19 00:17:14 +01:00
|
|
|
|
|
|
|
%preun
|
2007-12-19 14:52:01 +01:00
|
|
|
%stop_on_removal ldap
|
2006-12-19 00:17:14 +01:00
|
|
|
|
|
|
|
%postun
|
2007-12-19 14:52:01 +01:00
|
|
|
%restart_on_update ldap
|
2006-12-19 00:17:14 +01:00
|
|
|
%insserv_cleanup
|
|
|
|
|
|
|
|
%files -f openldap2.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
|
|
|
%files -n openldap2-back-perl -f openldap2-back-perl.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
|
|
|
%files -n openldap2-back-meta -f openldap2-back-meta.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%else
|
|
|
|
|
2008-06-25 18:32:44 +02:00
|
|
|
%post -n libldap-2_4-2 -p /sbin/ldconfig
|
2007-08-24 01:51:41 +02:00
|
|
|
|
2008-06-25 18:32:44 +02:00
|
|
|
%postun -n libldap-2_4-2 -p /sbin/ldconfig
|
2007-08-24 01:51:41 +02:00
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
%files -f openldap2-client.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
2008-06-25 18:32:44 +02:00
|
|
|
%files -n libldap-2_4-2 -f libldap.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
2006-12-19 00:17:14 +01:00
|
|
|
%files -n openldap2-devel -f openldap2-devel.filelist
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%endif
|
2007-12-19 14:52:01 +01:00
|
|
|
|
2007-02-25 23:33:24 +01:00
|
|
|
%changelog
|