%global debug_package %{nil} %define _build_id_links none %global _hardened_build 1 # Disable automatic .la file removal %global __brp_remove_la_files %nil %if 0%{?rhel} && 0%{?rhel} < 10 %global gcc_toolset_enable source /opt/rh/gcc-toolset-15/enable %else %global gcc_toolset_enable source /usr/lib/gcc-toolset/15-env.source %endif Name: openldap Version: 2.7.2 Release: 1%{?dist} Summary: LDAP support libraries License: OLDAP-2.8 URL: http://www.openldap.org/ Source0: https://openldap.org/software/download/OpenLDAP/openldap-release/openldap-%{version}.tgz # Patches for 2.6 Patch0: openldap-manpages.patch Patch1: openldap-reentrant-gethostby.patch Patch4: openldap-ai-addrconfig.patch BuildRequires: gcc-toolset-15-gcc BuildRequires: gcc-toolset-15-gcc-c++ BuildRequires: gcc-toolset-15-gcc-plugin-annobin BuildRequires: glibc-devel BuildRequires: groff BuildRequires: libtool-ltdl-devel BuildRequires: libevent-devel BuildRequires: libxcrypt-devel BuildRequires: make BuildRequires: openssl-devel BuildRequires: systemd-devel %description OpenLDAP is an open source suite of LDAP (Lightweight Directory Access Protocol) applications and development tools. LDAP is a set of protocols for accessing directory services (usually phone book style information, but other information is possible) over the Internet, similar to the way DNS (Domain Name System) information is propagated over the Internet. The package contains libraries for OpenLDAP. %package devel Summary: LDAP development libraries and header files Requires: openldap%{?_isa} = %{version}-%{release} %description devel The package contains header files. %package server Summary: LDAP server %description server The package contains the slapd server and related files. %package client Summary: LDAP client utilities Requires: openldap%{?_isa} = %{version}-%{release} %description client The package contains the client programs needed for accessing and modifying OpenLDAP directories. %prep %{gcc_toolset_enable} %setup -q -c -a 0 pushd openldap-%{version} %patch -P0 -p1 %patch -P1 -p1 %patch -P4 -p1 # fix documentation encoding for filename in doc/drafts/draft-ietf-ldapext-acl-model-xx.txt; do iconv -f iso-8859-1 -t utf-8 "$filename" > "$filename.utf8" mv "$filename.utf8" "$filename" done popd %build %{gcc_toolset_enable} %set_build_flags # enable experimental support for LDAP over UDP (LDAP_CONNECTIONLESS) export CFLAGS="${CFLAGS} ${LDFLAGS} -Wl,--as-needed -Wl,-z,now" # disable legacy hash algorithm export CFLAGS="${CFLAGS} -DOPENSSL_NO_MD2" pushd openldap-%{version} %configure \ --disable-debug \ --enable-versioning \ --with-systemd \ \ --enable-dynacl \ --enable-cleartext \ --disable-crypt \ --disable-spasswd \ --disable-argon2 \ \ --enable-modules \ --disable-rlookups \ --disable-slp \ \ --enable-backends=no \ --enable-mdb=yes \ \ --enable-overlays=no \ \ --disable-static \ \ --enable-balancer=no \ \ --without-cyrus-sasl \ --without-fetch \ --with-threads \ --with-pic \ --with-gnu-ld \ \ --libexecdir=%{_libdir} %make_build popd %install %{gcc_toolset_enable} mkdir -p %{buildroot}%{_libdir}/ pushd openldap-%{version} %make_install STRIP_OPTS="" popd # move slapd out of _libdir mv %{buildroot}%{_libdir}/slapd %{buildroot}%{_sbindir}/ # setup tools as symlinks to slapd for X in acl add auth cat dn index modify passwd test schema ; do rm %{buildroot}%{_sbindir}/slap$X ln -s slapd %{buildroot}%{_sbindir}/slap$X done # tweak permissions on the libraries to make sure they're correct chmod 0755 %{buildroot}%{_libdir}/lib*.so* chmod 0644 %{buildroot}%{_libdir}/lib*.*a # remove files which we don't want packaged rm %{buildroot}%{_libdir}/*.la # remove man pages and default config files rm -rf %{buildroot}%{_mandir} rm -rf %{buildroot}%{_sysconfdir}/openldap rm -f %{buildroot}%{_unitdir}/slapd.service %ldconfig_scriptlets %files %{_libdir}/liblber.so.* %{_libdir}/libldap.so.* %files server %{_sbindir}/slap* %files client %{_bindir}/ldap* %files devel %{_libdir}/liblber.so %{_libdir}/libldap.so %{_includedir}/* %{_libdir}/pkgconfig/lber.pc %{_libdir}/pkgconfig/ldap.pc %changelog %autochangelog