Search
SailfishOS Open Build Service
>
Projects
>
home:r0kk3rz
:
firefox-wayland
>
openldap
> openldap.spec
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File openldap.spec of Package openldap
%define debug_package %{nil} Name: openldap Version: 2.4.46 Release: 1 Group: System/Servers Summary: An open source implementation of the Lightweight Directory Access Protocol URL: http://www.openldap.org Source0: ftp://ftp.openldap.org/pub/OpenLDAP/%{name}-release/%{name}-%{version}.tgz Source1: openldap.service Source2: openldap.tmpfiles License: OpenLDAP Public License BuildRequires: glibc-devel BuildRequires: libicu52-devel BuildRequires: openssl-devel BuildRequires: systemd-devel BuildRequires: libtool-ltdl-devel BuildRequires: db4-devel libgpg-error Requires: libopenldap = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-build %description OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. %package -n lib%{name} Summary: OpenLDAP libraries Group: System/Libraries Provides: liblber.so.2 Provides: libldap.so.2 Provides: libldap_r.so.2 %description -n lib%{name} OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. This package contains the OpenLDAP libraries. %package -n lib%{name}-devel Summary: OpenLDAP development files Group: Development/Libraries Requires: libopenldap = %{version}-%{release} %description -n lib%{name}-devel OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. This package contains static libraries and header files need for development. %package clients Summary: OpenLDAP clients Group: System/Libraries Requires: libopenldap = %{version}-%{release} %description clients OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. This package contains the OpenLDAP clients and related files. %package server Summary: OpenLDAP server Group: System/Libraries Requires: libopenldap = %{version}-%{release} Provides: openldap-servers Obsoletes: openldap-servers %description server OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol. This package contains the OpenLDAP server and related files. %prep %setup -q %build ./configure \ --prefix=/usr \ --libexecdir=%{_sbindir} \ --localstatedir=%{_localstatedir} \ --enable-slapd \ --enable-crypt \ --enable-lmpasswd \ --enable-passwd \ --enable-modules \ --enable-rewrite \ --without-cyrus-sasl \ --enable-dynamic make depend make %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" make install DESTDIR=%{buildroot} install -d %{buildroot}/var/lib/%{name}-data install -d %{buildroot}/var/run/openldap/ install -D -m 644 %{SOURCE1} %{buildroot}/lib/systemd/system/openldap.service install -D -m 644 %{SOURCE2} %{buildroot}/%{_tmpfilesdir}/openldap.conf rm -f %{buildroot}%{_sysconfdir}/%{name}/*.default rm -f %{buildroot}%{_sysconfdir}/%{name}/schema/*.default # allow client requests without client certificate mkdir -p %{buildroot}%{_sysconfdir}/openldap cat > %{buildroot}%{_sysconfdir}/openldap/ldap.conf << EOF TLS_REQCERT allow EOF cat > %{buildroot}/var/lib/openldap-data/DB_CONFIG << _EOF set_cachesize 0 150000000 1 set_lg_regionmax 262144 set_lg_bsize 2097152 #set_lg_dir /var/log/bdb set_flags DB_LOG_AUTOREMOVE EOF rm -f %{buildroot}/var/openldap-data/DB_CONFIG.example %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post -n lib%{name} -p /sbin/ldconfig %postun -n lib%{name} -p /sbin/ldconfig %pre -n %{name}-server if [ $1 -eq 2 ]; then # upgrade # make a backup of the existing tree ldapadd -VV 2>&1 | grep "ldapmodify 2.1" >/dev/null if [ $? -eq 0 ]; then echo "Backing up current ldap tree" [ -e /run/openldap/slapd.pid ] && service openldap stop slapcat > /var/lib/ldap/openldap-data/ldap-backup.rpm_update fi fi if [ $1 -eq 1 ]; then # new install groupadd ldap 2>/dev/null || true useradd -g ldap -c "LDAP user" -d /var/lib/ldap \ -s /bin/false ldap 2>/dev/null || true fi exit 0 %post -n %{name}-server # new install if [ $1 -eq 1 ]; then if [ -e /etc/sysconfig/hostname ]; then HOSTNAME=`cat /etc/sysconfig/hostname` else . %{_sysconfdir}/sysconfig/network fi ldap_hostname=${HOSTNAME/.*} ldap_domain=${HOSTNAME/*.} if [ "$ldap_hostname" ]; then [ "$ldap_domain" ] || ldap_domain=local suffix="dc=${ldap_hostname},dc=${ldap_domain}" rootdn="cn=Manager,${suffix}" sed -i "s|cn=Manager,dc=my-domain,dc=com|${rootdn}| s|dc=my-domain,dc=com|${suffix}|" \ %{_sysconfdir}/openldap/slapd.conf fi chkconfig --add openldap systemctl enable openldap.service -q fi if [ $1 -gt 1 ]; then # update sed -i "s|/var/run/openldap|/run/openldap|" %{_sysconfdir}/openldap/slapd.conf if [ -f /var/lib/ldap/openldap-data/ldap-backup.rpm_update ]; then # update from previous LDAP version (rebuild database) echo "Backing up current ldap bdb files into /var/lib/ldap/openldap-data/backup-2.1" mkdir -p /var/lib/ldap/openldap-data/backup-2.1 mv /var/lib/ldap/openldap-data/*.bdb /var/lib/ldap/openldap-data/backup-2.1 mv /var/lib/ldap/openldap-data/log* /var/lib/ldap/openldap-data/backup-2.1 mv /var/lib/ldap/openldap-data/__db.* /var/lib/ldap/openldap-data/backup-2.1 echo "Restoring ldap information into new ldap server" slapadd < /var/lib/ldap/openldap-data/ldap-backup.rpm_update chown ldap.ldap /var/lib/ldap/openldap-data/* mv /var/lib/ldap/openldap-data/ldap-backup.rpm_update /var/lib/ldap/openldap-data/backup-2.1 fi fi if [ $1 -ge 1 ]; then systemctl daemon-reload -q fi exit 0 %preun -n %{name}-server #erase if [ $1 -eq 0 ]; then service openldap stop chkconfig --del openldap systemctl disable openldap.service -q systemctl daemon-reload -q fi exit 0 fi exit 0 %postun -n %{name}-server #update if [ $1 -eq 1 ]; then service openldap condrestart fi exit 0 %files -n lib%{name} %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/openldap/ldap.conf %{_bindir}/ldapurl %{_libdir}/*.so.* %doc COPYRIGHT LICENSE %files -n lib%{name}-devel %defattr(-,root,root) %{_includedir}/* %{_libdir}/*.so %{_libdir}/*.a %{_libdir}/*.la %doc doc/devel/* doc/drafts/draft*.txt doc/rfc/rfc*.txt %doc ANNOUNCEMENT CHANGES README %files clients %defattr(-,root,root) %{_bindir}/ldapexop %{_bindir}/ldapadd %{_bindir}/ldapdelete %{_bindir}/ldapmodify %{_bindir}/ldapmodrdn %{_bindir}/ldappasswd %{_bindir}/ldapsearch %{_mandir}/man1/* %{_mandir}/man5/* %files server %defattr(-,root,root) %dir %{_sysconfdir}/openldap %{_prefix}%{_sysconfdir}/openldap/DB_CONFIG.example %{_prefix}%{_sysconfdir}/openldap/ldap.conf %{_prefix}%{_sysconfdir}/openldap/ldap.conf.default %{_prefix}%{_sysconfdir}/openldap/schema/README %{_prefix}%{_sysconfdir}/openldap/schema/collective.ldif %{_prefix}%{_sysconfdir}/openldap/schema/collective.schema %{_prefix}%{_sysconfdir}/openldap/schema/corba.ldif %{_prefix}%{_sysconfdir}/openldap/schema/corba.schema %{_prefix}%{_sysconfdir}/openldap/schema/core.ldif %{_prefix}%{_sysconfdir}/openldap/schema/core.schema %{_prefix}%{_sysconfdir}/openldap/schema/cosine.ldif %{_prefix}%{_sysconfdir}/openldap/schema/cosine.schema %{_prefix}%{_sysconfdir}/openldap/schema/duaconf.ldif %{_prefix}%{_sysconfdir}/openldap/schema/duaconf.schema %{_prefix}%{_sysconfdir}/openldap/schema/dyngroup.ldif %{_prefix}%{_sysconfdir}/openldap/schema/dyngroup.schema %{_prefix}%{_sysconfdir}/openldap/schema/inetorgperson.ldif %{_prefix}%{_sysconfdir}/openldap/schema/inetorgperson.schema %{_prefix}%{_sysconfdir}/openldap/schema/java.ldif %{_prefix}%{_sysconfdir}/openldap/schema/java.schema %{_prefix}%{_sysconfdir}/openldap/schema/misc.ldif %{_prefix}%{_sysconfdir}/openldap/schema/misc.schema %{_prefix}%{_sysconfdir}/openldap/schema/nis.ldif %{_prefix}%{_sysconfdir}/openldap/schema/nis.schema %{_prefix}%{_sysconfdir}/openldap/schema/openldap.ldif %{_prefix}%{_sysconfdir}/openldap/schema/openldap.schema %{_prefix}%{_sysconfdir}/openldap/schema/pmi.ldif %{_prefix}%{_sysconfdir}/openldap/schema/pmi.schema %{_prefix}%{_sysconfdir}/openldap/schema/ppolicy.ldif %{_prefix}%{_sysconfdir}/openldap/schema/ppolicy.schema %{_prefix}%{_sysconfdir}/openldap/slapd.conf %{_prefix}%{_sysconfdir}/openldap/slapd.conf.default %{_prefix}%{_sysconfdir}/openldap/slapd.ldif %{_prefix}%{_sysconfdir}/openldap/slapd.ldif.default %{_localstatedir}/openldap-data/DB_CONFIG.example %{_bindir}/ldapcompare %{_bindir}/ldapwhoami %{_sbindir}/slapacl %{_sbindir}/slapadd %{_sbindir}/slapauth %{_sbindir}/slapcat %{_sbindir}/slapd %{_sbindir}/slapdn %{_sbindir}/slapindex %{_sbindir}/slappasswd %{_sbindir}/slapschema %{_sbindir}/slaptest /lib/systemd/system/openldap.service /%{_tmpfilesdir}/openldap.conf %dir %attr(700,ldap,ldap) /var/lib/openldap-data %config(noreplace) /var/lib/openldap-data/DB_CONFIG %{_mandir}/man3/* %{_mandir}/man8/* %changelog