# Tests by default. No tests: rpm -ba --define 'dotests 0' openldap*.spec %{!?dotests: %define dotests 1} Summary: The configuration files, libraries, and documentation for OpenLDAP Name: openldap Version: 2.4.56 Release: 2 License: OpenLDAP Group: System Environment/Daemons Source: ftp://ftp.OpenLDAP.org/pub/OpenLDAP/openldap-release/openldap-%{version}.tgz # Patches for 2.4 Patch0: %{name}-%{version}-config.patch Patch1: %{name}-%{version}-ldaprc.patch Patch2: %{name}-%{version}-aix-conf.patch Patch3: %{name}-%{version}-libtool.patch URL: http://www.openldap.org/ #BuildRequires: libtool >= 1.5.6-2, openssl-devel, db >= 4.2 BuildRequires: libtool >= 2.4.6-2 BuildRequires: libgcc >= 8.3.0-1 BuildRequires: cyrus-sasl-devel >= 2.1.26-3 Requires: libgcc >= 8.3.0-1 Requires: cyrus-sasl >= 2.1.26-3 Obsoletes: compat-openldap < 2.4 #AutoReqProv: no %define ldbm_backend berkeley %ifos aix5.3 %define buildhost powerpc-ibm-aix5.3.0.0 %endif %ifos aix6.1 %define buildhost powerpc-ibm-aix6.1.0.0 %endif %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 openldap package contains configuration files, libraries, and documentation for OpenLDAP. %package devel Summary: OpenLDAP development libraries and header files Group: Development/Libraries Requires: openldap = %{version}-%{release} %description devel The openldap-devel package includes the development libraries and header files needed for compiling applications that use LDAP (Lightweight Directory Access Protocol) internals. LDAP is a set of protocols for enabling directory services over the Internet. Install this package only if you plan to develop or will need to compile customized LDAP clients. %prep %setup -q %patch0 -p1 -b .config %patch1 -p1 -b .ldaprc %patch2 -p1 -b .aix-conf mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cp -r 32bit/* 64bit %build export RM="/usr/bin/rm -f" export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" # OpenSSL's header and library dependencies. OPENSSL_CPPFLAGS="-I/opt/freeware/include/openssl" CPPFLAGS="$OPENSSL_CPPFLAGS" ; export CPPFLAGS OPENSSL_LDFLAGS="-L/opt/freeware/lib" LDFLAGS="$OPENSSL_LDFLAGS" ; export LDFLAGS # build on 64bit mode export OBJECT_MODE=64 #export CC="/usr/vac/bin/xlc_r -q64" export CC="/opt/freeware/bin/gcc -maix64" libtool='%{_builddir}/openldap-%{version}/64bit/libtool' cd 64bit CPPFLAGS="-I%{_prefix}/include $OPENSSL_CPPFLAGS" \ LDFLAGS="-L%{_builddir}/%{name}-%{version}/64bit/libraries/libldap/.libs -L%{_prefix}/lib64 -L%{_prefix}/lib -L/usr/lib64 -L/usr/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib $OPENSSL_LDFLAGS" \ CFLAGS="-O2 -DMDB_USE_ROBUST=0" \ LIBS=-lpthread \ ./configure \ --prefix=%{_prefix} \ --libdir=%{_prefix}/lib64 \ --libexecdir=%{_prefix}/lib64 \ --enable-local --enable-rlookups \ --enable-passwd \ --enable-cleartext \ --enable-lmpasswd \ --enable-dynamic \ --enable-shared \ --disable-static \ --disable-sql \ --enable-slapd \ --without-keberos \ --enable-plugins \ --enable-multimaster \ --enable-bdb=no \ --enable-hdb=no \ --enable-mdb \ --enable-ldap \ --enable-ldbm \ --with-ldbm-api=%{ldbm_backend} \ --enable-meta \ --enable-monitor \ --enable-null \ --enable-shell \ --enable-relay \ --host=%{buildhost} --target=%{buildhost} --build=%{buildhost} \ --with-cyrus-sasl --enable-spasswd patch -p0 < %{PATCH3} make depend make LIBTOOL="$libtool" # Patch the libdir= in the .la file with the path to the built libraries. #cat libraries/liblber/liblber.la | awk -F= \ # '{ # if($1=="libdir") # print "libdir=$RPM_BUILD_ROOT/opt/freeware/lib64"; # else # print $0 # }' > /tmp/LIBLBER #cp /tmp/LIBLBER libraries/liblber/liblber.la if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi #now build on 32bit mode export OBJECT_MODE=32 #export CC="/usr/vac/bin/xlc_r" export CC="/opt/freeware/bin/gcc -maix32" libtool='%{_builddir}/openldap-%{version}/32bit/libtool' cd ../32bit CPPFLAGS="-I%{_prefix}/include $OPENSSL_CPPFLAGS" \ LDFLAGS="-L%{_builddir}/%{name}-%{version}/32bit/libraries/libldap/.libs -L%{_prefix}/lib -L/usr/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib $OPENSSL_LDFLAGS -Wl,-bmaxdata:0x80000000" \ CFLAGS="-O2 -D_LARGE_FILES -DMDB_USE_ROBUST=0" \ LIBS=-lpthread \ ./configure \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --libexecdir=%{_libdir} \ --enable-local --enable-rlookups \ --enable-passwd \ --enable-cleartext \ --enable-lmpasswd \ --enable-dynamic \ --enable-shared \ --disable-static \ --disable-sql \ --enable-slapd \ --without-keberos \ --enable-plugins \ --enable-multimaster \ --enable-bdb=no \ --enable-hdb=no \ --enable-mdb \ --enable-ldap \ --enable-ldbm \ --with-ldbm-api=%{ldbm_backend} \ --enable-meta \ --enable-monitor \ --enable-null \ --enable-shell \ --enable-relay \ --host=%{buildhost} --target=%{buildhost} --build=%{buildhost} \ --with-cyrus-sasl --enable-spasswd patch -p0 < %{PATCH3} make depend make LIBTOOL="$libtool" # Patch the libdir= in the .la file with the path to the built libraries. #cat libraries/liblber/liblber.la | awk -F= \ # '{ # if($1=="libdir") # print "libdir=$RPM_BUILD_ROOT/opt/freeware/lib"; # else # print $0 # }' > /tmp/LIBLBER #cp /tmp/LIBLBER libraries/liblber/liblber.la if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi %install export AR="/usr/bin/ar -X32_64" export NM="/usr/bin/nm -X32_64" export RM="/usr/bin/rm -f" export CONFIG_SHELL=/opt/freeware/bin/bash export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT [ -e /opt/freeware/lib64/liblber.a ] || ln -s /opt/freeware/lib/liblber.a /opt/freeware/lib64/liblber.a # Installing in 64bit mode cd 64bit export OBJECT_MODE=64 libtool='%{_builddir}/openldap-%{version}/64bit/libtool' mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib64 ( for lib in liblber.a liblber.la libldap.la do dirlib="`echo ${lib} | cut -d"." -f1`" if [ ! -e $RPM_BUILD_ROOT/%{_prefix}/lib64/${lib} ]; then ln -s %{_builddir}/openldap-%{version}/64bit/libraries/${dirlib}/.libs/${lib} $RPM_BUILD_ROOT/%{_prefix}/lib64/${lib} fi done ) cd %{_builddir}/openldap-%{version}/64bit/build sed "s;strip \$dsttmp || shtool_exit;strip -X32_64 \$dsttmp || shtool_exit;" shtool >shtool.tmp mv -f shtool.tmp shtool chmod +x shtool cd - make install DESTDIR=$RPM_BUILD_ROOT ( cd ${RPM_BUILD_ROOT}%{_bindir} rm -f ldapadd for f in * ; do mv -f ${f} ${f}_64 done ln -s ldapmodify_64 ldapadd_64 ) # move slapd out of %{_prefix}/lib64 mv ${RPM_BUILD_ROOT}%{_libdir}64/slapd ${RPM_BUILD_ROOT}%{_sbindir}/slapd_64 for i in acl add auth cat dn index passwd schema test ; do rm -f ${RPM_BUILD_ROOT}%{_sbindir}/slap${i} done # set up tools as symlinks to slapd for i in acl add auth cat dn index passwd schema test ; do ln -s slapd_64 ${RPM_BUILD_ROOT}%{_sbindir}/slap${i}_64 done #rm -f %{_prefix}/lib64/liblber.a #rm -f %{_prefix}/lib64/liblber.la #rm -f %{_prefix}/lib64/libldap.la #/usr/bin/ar -X64 -rv ${RPM_BUILD_ROOT}%{_prefix}/lib64/liblber.a ${RPM_BUILD_ROOT}%{_prefix}/lib64/liblber-2.4.so.2 #/usr/bin/ar -X64 -rv ${RPM_BUILD_ROOT}%{_prefix}/lib64/libldap.a ${RPM_BUILD_ROOT}%{_prefix}/lib64/libldap-2.4.so.2 # building in 32bit mode cd ../32bit export OBJECT_MODE=32 libtool='%{_builddir}/openldap-%{version}/32bit/libtool' mkdir -p $RPM_BUILD_ROOT/%{_libdir} for lib in liblber.a liblber.la libldap.la do dirlib="`echo ${lib} | cut -d"." -f1`" if [ ! -e %{_libdir}/${lib} ]; then ln -s %{_builddir}/openldap-%{version}/32bit/libraries/${dirlib}/.libs/${lib} $RPM_BUILD_ROOT/%{_libdir}/${lib} fi done cd %{_builddir}/openldap-%{version}/32bit/build sed "s;strip \$dsttmp || shtool_exit;strip -X32_64 \$dsttmp || shtool_exit;" shtool >shtool.tmp mv -f shtool.tmp shtool chmod +x shtool cd - make install DESTDIR=$RPM_BUILD_ROOT ( cd ${RPM_BUILD_ROOT}%{_bindir} rm -f ldapadd for f in $(ls -1| grep -v -e _32 -e _64) ; do mv -f ${f} ${f}_32 ln -sf "$f"_64 $f done ln -s ldapmodify_32 ldapadd_32 ln -sf ldapadd_64 ldapadd ) # move slapd out of %{_libdir} mv ${RPM_BUILD_ROOT}%{_libdir}/slapd ${RPM_BUILD_ROOT}%{_sbindir}/slapd_32 for i in acl add auth cat dn index passwd schema test ; do rm -f ${RPM_BUILD_ROOT}%{_sbindir}/slap${i} done # set up tools as symlinks to slapd for i in acl add auth cat dn index passwd schema test ; do ln -s slapd_32 ${RPM_BUILD_ROOT}%{_sbindir}/slap${i}_32 done ( cd ${RPM_BUILD_ROOT}%{_sbindir} for i in acl add auth cat dn index passwd schema test ; do ln -sf slap${i}_64 slap${i} done ln -sd slapd_64 slapd ) #rm -f %{_libdir}/liblber.a #rm -f %{_libdir}/liblber.la #rm -f %{_libdir}/libldap.la ( cd ${RPM_BUILD_ROOT}%{_libdir} for f in *.a ; do /usr/bin/ar -X32 -x ${f} done cd ${RPM_BUILD_ROOT}%{_prefix}/lib64 for f in *.a ; do /usr/bin/ar -X64 -x ${f} done ) # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects for i in lber-2.4 ldap-2.4 ldap_r-2.4 ; do /usr/bin/ar -X64 -q ${RPM_BUILD_ROOT}%{_libdir}/lib${i}.a ${RPM_BUILD_ROOT}%{_prefix}/lib64/lib${i}.so* done mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/run/openldap mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/lib/ldap %clean rm -rf $RPM_BUILD_ROOT %pre # add the "ldap" group only if it does not yet exist result=`/usr/sbin/lsgroup ldap | /usr/bin/awk '{ print $1 }' 2>/dev/null` if [ "${result}" != "ldap" ] ; then /usr/bin/mkgroup ldap 2> /dev/null || : fi %preun if [ "$1" = "0" ] ; then /sbin/service ldap stop > /dev/null 2>&1 || : fi # remove "ldap" group /usr/sbin/rmgroup ldap || : %post if [ "$1" == "2" ];then output=$(/usr/bin/lslpp -l|/usr/bin/grep idsldap) if [ ! -z "$output" ];then version=$(/usr/bin/echo "$output"|/usr/bin/head -1|/usr/bin/awk '{print $2}'|/usr/bin/cut -d. -f1,2) echo "" echo "Openldap <= 2.4.46-1 overwrites symbolic links created by ibmldap in /usr/bin. From 2.4.46-2 onwards, no files are being shipped in /usr/bin directory." echo "So updating openldap from any version <= 2.4.46-1 will remove symbolic links created by ibmldap in /usr/bin. One can recreate them using the following command" echo "/opt/IBM/ldap/V${version}/bin/idslink -g -f" echo "" fi fi %files %defattr(-,root,system) %doc 32bit/ANNOUNCEMENT %doc 32bit/CHANGES %doc 32bit/COPYRIGHT %doc 32bit/LICENSE %doc 32bit/README %doc 32bit/contrib/slapd-modules/smbk5pwd/README %attr(0755,root,system) %dir %{_sysconfdir}/openldap %attr(0755,root,system) %dir %{_localstatedir}/run/openldap %attr(0755,root,system) %dir %{_localstatedir}/lib/ldap %attr(0640,root,ldap) %config(noreplace) %{_sysconfdir}/openldap/slapd.conf* %attr(0644,root,system) %config(noreplace) %{_sysconfdir}/openldap/schema*/*.schema* %attr(0644,root,system) %config(noreplace) %{_sysconfdir}/openldap/schema*/*.ldif %attr(0644,root,system) %config(noreplace) %{_sysconfdir}/openldap/ldap*.conf* %attr(0755,root,system) %{_libdir}/liblber.a %attr(0755,root,system) %{_libdir}/liblber-2.4* %attr(0755,root,system) %{_libdir}/libldap.a %attr(0755,root,system) %{_libdir}/libldap-2.4* %attr(0755,root,system) %{_libdir}/libldap_r.a %attr(0755,root,system) %{_libdir}/libldap_r-2.4* %attr(0755,root,system) %{_prefix}/lib64/liblber.a %attr(0755,root,system) %{_prefix}/lib64/libldap.a %attr(0755,root,system) %{_prefix}/lib64/liblber-2.4* %attr(0755,root,system) %{_prefix}/lib64/libldap-2.4* %attr(0755,root,system) %{_prefix}/lib64/libldap_r-2.4* %attr(0755,root,system) %{_bindir}/* %attr(0755,root,system) %{_sbindir}/* %attr(0644,root,system) %{_prefix}/share/man/man1/* %attr(0644,root,system) %{_prefix}/share/man/man3/* %attr(0644,root,system) %{_prefix}/share/man/man5/* %attr(0644,root,system) %{_prefix}/share/man/man8/* %files devel %defattr(-,root,system) #%attr(0755,root,system) %{_libdir}/libl*.la %attr(0644,root,system) %{_includedir}/* %attr(0644,root,system) %{_prefix}/share/man/man3/* %changelog * Wed Apr 07 2021 Rishita Saha 2.4.56-2 - Rebuilt with fixed cyrus-sasl * Wed Dec 02 2020 Rishita Saha 2.4.56-1 - Update to fix CVE-2020-25692 * Tue Jul 14 2020 Rishita Saha 2.4.50-1 - Update to fix CVE-2020-12243 * Wed Sep 25 2019 Reshma V Kumar 2.4.48-1 - Update to fix CVE-2019-13565 * Tue May 21 2019 Reshma V Kumar 2.4.46-2 - Rebuild with cyrus-sasl 2.1.26-4 and mdb support * Wed Nov 14 2018 Reshma V Kumar 2.4.46-1 - Update to latest version * Wed Aug 1 2018 Reshma V Kumar 2.4.45-3 - Rebuild adding Requires: libgcc>=6.3.0 * Wed Jul 18 2018 Reshma V Kumar 2.4.45-2 - Rebuild with cyrus-sasl support * Thu Mar 3 2016 Sangamesh Mallayya - 2.4.40-1 - Update to 2.4.40. * Thu Jun 20 2013 Gerard Visiedo - 2.4.35-1 - Update to 2.4.35. Build on 32 and 64bit * Tue Feb 07 2012 Gerard Visiedo - 2.4.24-1 - Inital port on Aix 6.1 * Wed Mar 2 2011 Gerard Visiedo 2.4.24-0 - Update to 2.4.24 * Mon Dec 1 2008 Jean Noel Cordenner 2.4.11-2 - Bug fix during rpm installation + adding devel package * Thu Sep 25 2008 Jean Noel Cordenner 2.4.11 - Update to 2.4.11 * Wed Jul 9 2008 Jean Noel Cordenner 2.4.8 - Port on AIX plateform