Accepting request 965156 from home:coolo:branches:network:ldap

- Add _multibuild support to integrate the build of libldapcpp-devel
  to drop the outdated copy

OBS-URL: https://build.opensuse.org/request/show/965156
OBS-URL: https://build.opensuse.org/package/show/network:ldap/openldap2?expand=0&rev=294
This commit is contained in:
Jan Engelhardt 2022-03-30 10:18:15 +00:00 committed by Git OBS Bridge
parent 3c3f552ff2
commit 67bef5017a
3 changed files with 68 additions and 3 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>contrib</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Mar 26 14:08:57 UTC 2022 - Stephan Kulow <coolo@suse.com>
- Add _multibuild support to integrate the build of libldapcpp-devel
to drop the outdated copy
-------------------------------------------------------------------
Mon Oct 25 22:03:53 UTC 2021 - Michael Ströder <michael@stroeder.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package openldap2
# spec file
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,8 +19,14 @@
%define run_test_suite 0
%define version_main 2.5.9
%define slapdrundir %{_rundir}/slapd
%define flavor @BUILD_FLAVOR@%{nil}
%if "%flavor" == "contrib"
%define name_suffix -%{flavor}-src
%else
%define name_suffix %{nil}
%endif
Name: openldap2
Name: openldap2%{name_suffix}
Summary: An open source implementation of the Lightweight Directory Access Protocol
License: OLDAP-2.8
Group: Productivity/Networking/LDAP/Servers
@ -64,6 +70,10 @@ BuildRequires: unixODBC-devel
# avoid cycle with krb5
BuildRequires: pkgconfig(krb5)
BuildRequires: pkgconfig(systemd)
%if "%flavor" == "contrib"
BuildRequires: gcc-c++
BuildRequires: openldap2-devel
%endif
%if %{suse_version} < 1500
%{?systemd_requires}
%endif
@ -203,6 +213,26 @@ Recommends: libldap-data >= %{version_main}
%description -n libldap-2_5-0
This package contains the OpenLDAP client libraries.
%package -n libldapcpp-devel
Summary: C++ wrapper around openLDAP API
Group: Development/Libraries/C and C++
Requires: libldapcpp0 = %{version}
Requires: openldap2-devel
%description -n libldapcpp-devel
This package contains files needed for development with the LDAP C++
library.
%package -n libldapcpp0
Summary: C++ wrapper around openLDAP API
Group: Development/Libraries/C and C++
Provides: ldapcpplib = %{version}
Obsoletes: ldapcpplib <= 0.0.5
%description -n libldapcpp0
This package provides a C++ library for accessing LDAP (Version 3)
Servers
%prep
# Unpack and patch OpenLDAP 2.5
%setup -q -a 9 -n openldap-%{version_main}
@ -213,6 +243,11 @@ This package contains the OpenLDAP client libraries.
cp %{SOURCE5} .
%build
%if "%flavor" == "contrib"
cd contrib/ldapc++
%configure --disable-static
make %{?_smp_mflags}
%else
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags} -Wno-format-extra-args -fno-strict-aliasing -DNDEBUG -DSLAP_CONFIG_DELETE -DSLAP_SCHEMA_EXPOSE -DLDAP_COLLECTIVE_ATTRIBUTES -DLDAP_USE_NON_BLOCKING_TLS"
export STRIP=""
@ -259,6 +294,7 @@ make -C contrib/slapd-modules/smbk5pwd %{?_smp_mflags} "sysconfdir=%{_sysconfdir
# Create ldap user
%sysusers_generate_pre %{SOURCE19} ldap
%endif
%check
%if %run_test_suite
@ -286,6 +322,10 @@ make SLAPD_DEBUG=0 test
%endif
%install
%if "%flavor" == "contrib"
cd contrib/ldapc++
%make_install
%else
mkdir -p %{buildroot}%{_libdir}/openldap
mkdir -p %{buildroot}/usr/lib/openldap
mkdir -p %{buildroot}%{_sbindir}
@ -365,6 +405,7 @@ rm -f %{buildroot}%{_libdir}/*.la
# Provide a libldap_r for backwards-compatibility with OpenLDAP < 2.5.
ln -fs libldap.so "%{buildroot}%{_libdir}/libldap_r.so"
%endif
%pre -f ldap.pre
%service_add_pre slapd.service
@ -384,6 +425,19 @@ ln -fs libldap.so "%{buildroot}%{_libdir}/libldap_r.so"
%postun
%service_del_postun slapd.service
%if "%flavor" == "contrib"
%files -n libldapcpp-devel
%doc contrib/ldapc++/README
%_includedir/*.h
%_libdir/libldapcpp.la
%_libdir/libldapcpp.so
%files -n libldapcpp0
%_libdir/libldapcpp.so.0
%_libdir/libldapcpp.so.0.0.0
%else
%files
%defattr(-,root,root)
%config %{_sysconfdir}/openldap/schema/*.schema
@ -551,4 +605,6 @@ ln -fs libldap.so "%{buildroot}%{_libdir}/libldap_r.so"
%_libdir/liblber.a
%_libdir/libldap*.a
%endif # !flavor:contrib
%changelog