File dba-openldap-2610.spec of Package dba-openldap-2610

%define real_name 	openldap
%define version         2.6.10
%define vers            2610
%define prefix		/DBA/openldap/%{version}
%define latest_script   set_openldap_2.6.latest.sh

Name:           	dba-%{real_name}-%{vers}
Summary:        	An open source implementation of the Lightweight Directory Access Protocol
Vendor: openSUSE Build Service
License:                OLDAP-2.8 
Group:          	Productivity/Networking/LDAP/Servers
Version:        	%{version}
Release:        	1
Source0:        	https://www.openldap.org/software/download/OpenLDAP/openldap-release/%{real_name}-%{version}.tgz
Url:            	https://www.openldap.org
Source1:                https://www.openldap.org/software/download/OpenLDAP/openldap-release/%{real_name}-%{version}.tgz.asc
Source2:        	dba-openldap-rpmlintrc
Source3:                filter-provides-openldap.sh 
Source4:                filter-requires-openldap.sh
Source5:                %{latest_script}
AutoReqProv:    	on
BuildRoot:      	%{_tmppath}/%{name}-%{version}-build

%define _use_internal_dependency_generator 0
%define __find_provides %{SOURCE3}
%define __find_requires %{SOURCE4}

%if 0%{?suse_version} >= 1100
BuildRequires:          -post-build-checks
%endif

BuildRequires:  cyrus-sasl-devel
BuildRequires:  groff
BuildRequires:  dba-openssl-3016-static
%define ssldir /DBA/openssl/3.0.16
#!BuildIgnore:  openssl-devel libopenssl-devel openssl
BuildRequires:  libtool
BuildRequires:  openslp-devel
BuildRequires:  unixODBC-devel
BuildRequires:  gcc-c++ libtool-ltdl-devel perl
%if 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700
BuildRequires:  perl-devel
%endif
#BuildRequires:  openldap2-devel
# avoid cycle with krb5
BuildRequires:  pkgconfig(krb5)
#BuildRequires:  krb5-devel

%if %{?suse_version:1}0
BuildRequires:  db-devel
%else
%if 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700
BuildRequires:  libdb
%else
BuildRequires:  db4-devel
%endif
%endif


%description
OpenLDAP is a client and server reference implementation of the
Lightweight Directory Access Protocol v3 (LDAPv3).


%prep
%setup -q -n %{real_name}-%{version}

%{__chmod} +x %{SOURCE3}
%{__chmod} +x %{SOURCE4}

%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags} -Wno-format-extra-args -fno-strict-aliasing -std=gnu99 -DNDEBUG -DSLAP_CONFIG_DELETE -DSLAP_SCHEMA_EXPOSE -DLDAP_COLLECTIVE_ATTRIBUTES -DLDAP_USE_NON_BLOCKING_TLS"
export STRIP=""
export CFLAGS="$CFLAGS -I%{ssldir}/include -I/usr/lib64/perl5/CORE"
export LDFLAGS="$LDFLAGS -L%{ssldir}/lib64 -lssl -ldl -lcrypto -pthread"
export CPPFLAGS="$CPPFLAGS -I%{ssldir}/include -I/usr/lib64/perl5/CORE"
export LIBS="$LIBS -L%{ssldir}/lib64 -lssl -ldl -lcrypto -pthread"
export PKG_CONFIG_PATH="%{ssldir}/lib/pkgconfig:$PKG_CONFIG_PATH"

./configure \
    --prefix=%{prefix} \
    --enable-spasswd \
    --enable-modules \
    --enable-dynamic \
    --enable-static \
    --with-tls=openssl \
    --with-cyrus-sasl \
    --enable-crypt \
    --enable-ipv6=yes \
    --enable-dynacl \
    --enable-aci \
    --enable-ldap=mod \
    --enable-meta=mod \
    --enable-perl=mod \
    --enable-sock=mod \
    --enable-sql=mod \
    --enable-mdb=mod \
    --enable-relay=mod \
    --enable-slp \
    --enable-overlays=mod \
    --enable-syncprov=mod \
    --enable-ppolicy=mod \
    --with-yielding-select \

make depend

%{__make}

%install
# prevent rpath problem on suse
export NO_BRP_CHECK_RPATH=true

make DESTDIR=%{buildroot} install

find doc/guide '(' ! -name *.html -a ! -name *.gif -a ! -name *.png -a ! -type d ')' -delete
rm -rf doc/guide/release
rm -f %{buildroot}%{_libdir}/openldap/*.a
rm -f %{buildroot}/usr/share/man/man5/slapd-dnssrv.5
rm -f %{buildroot}/usr/share/man/man5/slapd-ndb.5
rm -f %{buildroot}/usr/share/man/man5/slapd-null.5
rm -f %{buildroot}/usr/share/man/man5/slapd-passwd.5
rm -f %{buildroot}/usr/share/man/man5/slapd-shell.5
rm -f %{buildroot}/usr/share/man/man5/slapd-tcl.5
# Remove *.la files, libtool does not handle this correct
# Keep .la files for modules in the openldap subdirectory, which are consumed
# in this form.
rm -f  %{buildroot}%{_libdir}/*.la

#%{__mkdir_p} %{buildroot}%{prefix}
#%{__mkdir_p} %{buildroot}%{prefix}/conf
#%{__mkdir_p} %{buildroot}%{prefix}/samples
#%{__mkdir_p} %{buildroot}%{prefix}/var

%{__install} -m 0755 %{SOURCE5} %{buildroot}%{prefix}/bin/%{latest_script}


%post
cd %{prefix}/..
%{prefix}/bin/%{latest_script}


%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}


%files
%defattr(-,root,root)
#%dir %{prefix} 
%{prefix}/bin
%{prefix}/etc
%{prefix}/include
%{prefix}/lib
%{prefix}/libexec
%{prefix}/sbin
%{prefix}/share

%changelog
* Mon Aug 11 2025 Dennis Hampe <dennis.hampe@bertelsmann.de>
- inital version
openSUSE Build Service is sponsored by