Projects
home:pandora:RobinOS23
openldap
_service:download_src_package:openldap.spec
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:download_src_package:openldap.spec of Package openldap
%global check_password_version 1.1 %global so_ver 2 %global so_ver_compat 2 %global __brp_remove_la_files %nil %define anolis_release 2 Name: openldap Version: 2.6.3 Release: %{anolis_release}%{?dist} Summary: LDAP support libraries License: OpenLDAP URL: http://www.openldap.org/ Source0: https://openldap.org/software/download/OpenLDAP/openldap-release/openldap-%{version}.tgz Source1: slapd.service Source2: slapd.tmpfiles Source3: slapd.ldif Source4: ldap.conf Source5: UPGRADE_INSTRUCTIONS Source10: https://github.com/ltb-project/openldap-ppolicy-check-password/archive/v%{check_password_version}/openldap-ppolicy-check-password-%{check_password_version}.tar.gz Source50: libexec-functions Source52: libexec-check-config.sh Patch0: openldap-manpages.patch Patch1: openldap-reentrant-gethostby.patch Patch2: openldap-smbk5pwd-overlay.patch Patch3: openldap-ai-addrconfig.patch Patch4: openldap-allop-overlay.patch Patch5: openldap-switch-to-lt_dlopenadvise-to-get-RTLD_GLOBAL-set.patch Patch6: openldap-openssl-manpage-defaultCA.patch Patch7: openldap-add-export-symbols-LDAP_CONNECTIONLESS.patch Patch8: check-password-makefile.patch Patch9: check-password.patch BuildRequires: cyrus-sasl-devel gcc glibc-devel groff krb5-devel libtool-ltdl-devel libevent-devel make openssl-devel unixODBC-devel openldap-devel BuildRequires: perl(ExtUtils::Embed) perl-devel perl-generators perl-interpreter %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 doc Summary: Documentation files for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc The %{name}-doc package contains documentation files for %{name}. %package devel Summary: LDAP development libraries and header files Requires: openldap = %{version}-%{release} Requires: cyrus-sasl-devel %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. %package compat Summary: Package providing legacy non-threaded libldap Requires: openldap = %{version}-%{release} Provides: libldap-2.4.so.%{so_ver_compat}()(%{__isa_bits}bit) Provides: libldap_r-2.4.so.%{so_ver_compat}()(%{__isa_bits}bit) Provides: liblber-2.4.so.%{so_ver_compat}()(%{__isa_bits}bit) Provides: libslapi-2.4.so.%{so_ver_compat}()(%{__isa_bits}bit) %description compat The openldap-compat package contains shared libraries named as libldap-2.4.so, libldap_r-2.4.so, liblber-2.4.so and libslapi-2.4.so. The libraries are just links to the current version shared libraries, and are available for compatibility reasons. %package servers Summary: LDAP server License: OpenLDAP Requires: openldap = %{version}-%{release} Requires(pre): shadow-utils BuildRequires: systemd BuildRequires: cracklib-devel # migrationtools (slapadd functionality): Provides: ldif2ldbm %{?systemd_requires} %description servers 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. This package contains the slapd server and related files. %package clients Summary: LDAP client utilities Requires: openldap = %{version}-%{release} %description clients 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-clients package contains the client programs needed for accessing and modifying OpenLDAP directories. %prep %setup -q -c -a 0 -a 10 pushd openldap-%{version} %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 ln -s ../../../contrib/slapd-modules/smbk5pwd/smbk5pwd.c servers/slapd/overlays mv contrib/slapd-modules/smbk5pwd/README contrib/slapd-modules/smbk5pwd/README.smbk5pwd ln -s ../../../contrib/slapd-modules/allop/allop.c servers/slapd/overlays mv contrib/slapd-modules/allop/README contrib/slapd-modules/allop/README.allop mv contrib/slapd-modules/allop/slapo-allop.5 doc/man/man5/slapo-allop.5 mv servers/slapd/back-perl/README{,.back_perl} 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 pushd openldap-ppolicy-check-password-%{check_password_version} %patch8 -p1 %patch9 -p1 popd %build %set_build_flags export CFLAGS="${CFLAGS} ${LDFLAGS} -Wl,--as-needed -DLDAP_CONNECTIONLESS" pushd openldap-%{version} %configure \ --enable-debug \ --enable-dynamic \ --enable-versioning \ \ --enable-dynacl \ --enable-cleartext \ --enable-crypt \ --enable-lmpasswd \ --enable-spasswd \ --enable-modules \ --enable-perl \ --enable-rewrite \ --enable-rlookups \ --enable-slapi \ --disable-slp \ \ --enable-backends=mod \ --enable-bdb=yes \ --enable-hdb=yes \ --enable-mdb=yes \ --enable-monitor=yes \ --disable-ndb \ --disable-sql \ --disable-wt \ \ --enable-overlays=mod \ \ --disable-static \ \ --enable-balancer=mod \ \ --with-cyrus-sasl \ --without-fetch \ --with-threads \ --with-pic \ --with-gnu-ld \ \ --libexecdir=%{_libdir} %make_build popd pushd openldap-ppolicy-check-password-%{check_password_version} %make_build LDAP_INC="-I../openldap-%{version}/include -I../openldap-%{version}/servers/slapd -I../openldap-%{version}/build-servers/include" popd %install rm -rf $RPM_BUILD_ROOT mkdir -p %{buildroot}%{_libdir}/ pushd openldap-%{version} %make_install STRIP="" popd # install check_password module pushd openldap-ppolicy-check-password-%{check_password_version} mv check_password.so check_password.so.%{check_password_version} ln -s check_password.so.%{check_password_version} %{buildroot}%{_libdir}/openldap/check_password.so install -m 755 check_password.so.%{check_password_version} %{buildroot}%{_libdir}/openldap/ # install -m 644 README %{buildroot}%{_libdir}/openldap install -d -m 755 %{buildroot}%{_sysconfdir}/openldap cat > %{buildroot}%{_sysconfdir}/openldap/check_password.conf <<EOF # OpenLDAP pwdChecker library configuration #useCracklib 1 #minPoints 3 #minUpper 0 #minLower 0 #minDigit 0 #minPunct 0 EOF mv README{,.check_pwd} popd # setup directories for TLS certificates mkdir -p %{buildroot}%{_sysconfdir}/openldap/certs # setup data and runtime directories mkdir -p %{buildroot}%{_sharedstatedir} mkdir -p %{buildroot}%{_localstatedir} install -m 0700 -d %{buildroot}%{_sharedstatedir}/ldap install -m 0755 -d %{buildroot}%{_localstatedir}/run/openldap # setup autocreation of runtime directories on tmpfs mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %SOURCE2 %{buildroot}%{_tmpfilesdir}/slapd.conf # install default ldap.conf (customized) rm %{buildroot}%{_sysconfdir}/openldap/ldap.conf install -m 0644 %SOURCE4 %{buildroot}%{_sysconfdir}/openldap/ldap.conf # setup maintainance scripts mkdir -p %{buildroot}%{_libexecdir} install -m 0755 -d %{buildroot}%{_libexecdir}/openldap install -m 0644 %SOURCE50 %{buildroot}%{_libexecdir}/openldap/functions install -m 0755 %SOURCE52 %{buildroot}%{_libexecdir}/openldap/check-config.sh # remove build root from config files and manual pages perl -pi -e "s|%{buildroot}||g" %{buildroot}%{_sysconfdir}/openldap/*.conf perl -pi -e "s|%{buildroot}||g" %{buildroot}%{_mandir}/*/*.* # we don't need the default files -- RPM handles changes rm %{buildroot}%{_sysconfdir}/openldap/*.default # install an init script for the servers mkdir -p %{buildroot}%{_unitdir} install -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/slapd.service # 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 # re-symlink unversioned libraries, so ldconfig is not confused pushd %{buildroot}%{_libdir} v=%{version} version=$(echo ${v%.[0-9]*}) for lib in liblber libldap libslapi; do rm -f ${lib}.so ln -s ${lib}.so.%{so_ver} ${lib}.so done for lib in $(ls | grep libldap); do IFS='.' read -r -a libsplit <<< "$lib" if [[ -z "${libsplit[3]}" && -n "${libsplit[2]}" ]] then so_ver_short_2_4="%{so_ver_compat}" elif [ -n "${libsplit[3]}" ] then so_ver_full_2_4="%{so_ver_compat}.${libsplit[3]}.${libsplit[4]}" fi unset IFS done # Provide only libldap and copy it to libldap_r for both 2.4 and 2.6+ versions, make a versioned lib link # We increase it by 2 because libldap-2.4 has the 'so.2' major version on 2.4.59 (one of the last versions which is EOF) gcc -shared -o "%{buildroot}%{_libdir}/libldap-2.4.so.${so_ver_short_2_4}" -Wl,--no-as-needed \ -Wl,-soname -Wl,libldap-2.4.so.${so_ver_short_2_4} -L "%{buildroot}%{_libdir}" -lldap gcc -shared -o "%{buildroot}%{_libdir}/libldap_r-2.4.so.${so_ver_short_2_4}" -Wl,--no-as-needed \ -Wl,-soname -Wl,libldap_r-2.4.so.${so_ver_short_2_4} -L "%{buildroot}%{_libdir}" -lldap gcc -shared -o "%{buildroot}%{_libdir}/liblber-2.4.so.${so_ver_short_2_4}" -Wl,--no-as-needed \ -Wl,-soname -Wl,liblber-2.4.so.${so_ver_short_2_4} -L "%{buildroot}%{_libdir}" -llber gcc -shared -o "%{buildroot}%{_libdir}/libslapi-2.4.so.${so_ver_short_2_4}" -Wl,--no-as-needed \ -Wl,-soname -Wl,libslapi-2.4.so.${so_ver_short_2_4} -L "%{buildroot}%{_libdir}" -lslapi ln -s libldap-2.4.so.{${so_ver_short_2_4},${so_ver_full_2_4}} ln -s libldap_r-2.4.so.{${so_ver_short_2_4},${so_ver_full_2_4}} ln -s liblber-2.4.so.{${so_ver_short_2_4},${so_ver_full_2_4}} ln -s libslapi-2.4.so.{${so_ver_short_2_4},${so_ver_full_2_4}} cp libldap.so.${so_ver_full_2_4} libldap_r.so.${so_ver_full_2_4} ln -s libldap_r.so.{${so_ver_full_2_4},${so_ver_short_2_4}} ln -s libldap_r.so.${so_ver_full_2_4} libldap_r.so popd # tweak permissions on the libraries to make sure they're correct chmod 0755 %{buildroot}%{_libdir}/lib*.so* chmod 0644 %{buildroot}%{_libdir}/lib*.*a chmod 0644 %{buildroot}%{_libdir}/openldap/*.la # slapd.conf(5) is obsoleted since 2.3, see slapd-config(5) mkdir -p %{buildroot}%{_datadir} install -m 0755 -d %{buildroot}%{_datadir}/openldap-servers install -m 0644 %SOURCE3 %{buildroot}%{_datadir}/openldap-servers/slapd.ldif install -m 0644 %SOURCE5 %{buildroot}%{_datadir}/openldap-servers/UPGRADE_INSTRUCTIONS install -m 0700 -d %{buildroot}%{_sysconfdir}/openldap/slapd.d rm %{buildroot}%{_sysconfdir}/openldap/slapd.conf rm %{buildroot}%{_sysconfdir}/openldap/slapd.ldif # move doc files out of _sysconfdir mv %{buildroot}%{_sysconfdir}/openldap/schema/README README.schema # remove files which we don't want packaged rm %{buildroot}%{_libdir}/*.la # because we do not want files in %{_libdir}/openldap/ removed, yet %ldconfig_scriptlets %pre servers # create ldap user and group getent group ldap &>/dev/null || groupadd -r -g 55 ldap getent passwd ldap &>/dev/null || \ useradd -r -g ldap -u 55 -d %{_sharedstatedir}/ldap -s /sbin/nologin -c "OpenLDAP server" ldap exit 0 %post servers %systemd_post slapd.service # If it's not upgrade - we remove the UPGRADE_INSTRUCTIONS if [ $1 -lt 2 ] ; then rm %{_datadir}/openldap-servers/UPGRADE_INSTRUCTIONS fi # generate configuration if necessary if [[ ! -f %{_sysconfdir}/openldap/slapd.d/cn=config.ldif && \ ! -f %{_sysconfdir}/openldap/slapd.conf ]]; then # if there is no configuration available, generate one from the defaults mkdir -p %{_sysconfdir}/openldap/slapd.d/ &>/dev/null || : /usr/sbin/slapadd -F %{_sysconfdir}/openldap/slapd.d/ -n0 -l %{_datadir}/openldap-servers/slapd.ldif chown -R ldap:ldap %{_sysconfdir}/openldap/slapd.d/ %{systemctl_bin} try-restart slapd.service &>/dev/null fi # restart after upgrade if [ $1 -ge 1 ]; then %{systemctl_bin} condrestart slapd.service &>/dev/null || : fi exit 0 %preun servers %systemd_preun slapd.service %postun servers %systemd_postun_with_restart slapd.service %files %license openldap-%{version}/COPYRIGHT %license openldap-%{version}/LICENSE %dir %{_sysconfdir}/openldap %dir %{_sysconfdir}/openldap/certs %config(noreplace) %{_sysconfdir}/openldap/ldap.conf %dir %{_libexecdir}/openldap/ %{_libdir}/liblber.so.* %{_libdir}/libldap.so.* %{_libdir}/libslapi.so.* %{_libdir}/libldap_r.so.* %{_mandir}/man5/ldif.5* %{_mandir}/man5/ldap.conf.5* %files doc %doc openldap-%{version}/ANNOUNCEMENT %doc openldap-%{version}/README %doc openldap-%{version}/CHANGES %files servers %doc openldap-%{version}/contrib/slapd-modules/smbk5pwd/README.smbk5pwd %doc openldap-%{version}/doc/guide/admin/*.html %doc openldap-%{version}/doc/guide/admin/*.png %doc openldap-%{version}/servers/slapd/back-perl/SampleLDAP.pm %doc openldap-%{version}/servers/slapd/back-perl/README.back_perl %doc openldap-ppolicy-check-password-%{check_password_version}/README.check_pwd %doc README.schema %config(noreplace) %dir %attr(0750,ldap,ldap) %{_sysconfdir}/openldap/slapd.d %config(noreplace) %{_sysconfdir}/openldap/schema %config(noreplace) %{_sysconfdir}/openldap/check_password.conf %{_tmpfilesdir}/slapd.conf %dir %attr(0700,ldap,ldap) %{_sharedstatedir}/ldap %dir %attr(-,ldap,ldap) %{_localstatedir}/run/openldap %{_unitdir}/slapd.service %{_datadir}/openldap-servers/ %{_libdir}/openldap/* %{_libexecdir}/openldap/functions %{_libexecdir}/openldap/check-config.sh %{_sbindir}/sl* %{_mandir}/man8/* %{_mandir}/man5/lloadd.conf.5* %{_mandir}/man5/slapd*.5* %{_mandir}/man5/slapo-*.5* %{_mandir}/man5/slappw-argon2.5* # obsolete configuration %ghost %config(noreplace,missingok) %attr(0640,ldap,ldap) %{_sysconfdir}/openldap/slapd.conf %files clients %{_bindir}/* %{_mandir}/man1/* %files devel %doc openldap-%{version}/doc/drafts openldap-%{version}/doc/rfc %{_libdir}/*.so %{_includedir}/* %{_libdir}/pkgconfig/lber.pc %{_libdir}/pkgconfig/ldap.pc %{_mandir}/man3/* %files compat %{_libdir}/libldap-2.4*.so.* %{_libdir}/libldap_r-2.4*.so.* %{_libdir}/liblber-2.4*.so.* %{_libdir}/libslapi-2.4*.so.* %changelog * Tue Sep 13 2022 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.6.3-2 - add libldap_r.so * Mon Sep 5 2022 mgb01105731 <mgb01105731@alibaba-inc.com> - 2.6.3-1 - update to 2.6.3 * Thu Mar 17 2022 forrest_ly <flin@linux.alibaba.com> - 2.6.1-1 - Init for Anolis OS 23
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2