automatic version update by autodist [release 2.5.5-1mamba;Thu Jun 10 2021]
This commit is contained in:
parent
6bff585692
commit
f03ab264e6
130
openldap.spec
130
openldap.spec
@ -1,5 +1,5 @@
|
||||
Name: openldap
|
||||
Version: 2.4.58
|
||||
Version: 2.5.5
|
||||
Release: 1mamba
|
||||
Group: System/Servers
|
||||
Summary: An open source implementation of the Lightweight Directory Access Protocol
|
||||
@ -21,13 +21,12 @@ Patch4: openldap-2.4.43-liblmdb-installdirs.patch
|
||||
License: OpenLDAP Public License
|
||||
## AUTOBUILDREQ-BEGIN
|
||||
BuildRequires: glibc-devel
|
||||
BuildRequires: libdb53-devel
|
||||
BuildRequires: libe2fs-devel
|
||||
BuildRequires: libicu-devel
|
||||
BuildRequires: libkrb5-devel
|
||||
BuildRequires: libltdl-devel
|
||||
BuildRequires: libopenssl-devel
|
||||
BuildRequires: libsasl2-devel
|
||||
BuildRequires: libsystemd-devel
|
||||
BuildRequires: libuuid-devel
|
||||
## AUTOBUILDREQ-END
|
||||
BuildRequires: libsasl-devel >= 2.1.26
|
||||
@ -43,9 +42,6 @@ Summary: OpenLDAP libraries
|
||||
Group: System/Libraries
|
||||
# requires latest SASL libraries
|
||||
Requires: libsasl >= 2.1.25
|
||||
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.
|
||||
@ -74,7 +70,7 @@ Summary: OpenLDAP server
|
||||
Group: System/Libraries
|
||||
Requires: libopenldap = %{version}-%{release}
|
||||
Provides: openldap-servers
|
||||
Obsoletes: openldap-servers
|
||||
Obsoletes: openldap-servers < 2.5.5
|
||||
|
||||
%description server
|
||||
OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol.
|
||||
@ -113,10 +109,8 @@ This package contains static libraries and header files needed for development.
|
||||
#-D -T
|
||||
#:<< _EOF
|
||||
#cp %{SOURCE3} servers/slapd/slapd.conf
|
||||
%patch0 -p1 -b .ntlm
|
||||
#%patch0 -p1 -b .ntlm
|
||||
%patch2 -p1
|
||||
#%patch3 -p1
|
||||
#%patch4 -p1
|
||||
|
||||
%build
|
||||
#:<< _EOF
|
||||
@ -151,10 +145,10 @@ chmod +x %{buildroot}%{_libdir}/lib*.so.*
|
||||
install -d %{buildroot}/var/lib/%{name}-data
|
||||
install -d %{buildroot}/var/run/openldap/
|
||||
|
||||
install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
|
||||
#install -D -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name}
|
||||
install -D -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
||||
install -D -m 644 %{SOURCE4} %{buildroot}/lib/systemd/system/openldap.service
|
||||
install -D -m 644 %{SOURCE5} %{buildroot}%_tmpfilesdir/openldap.conf
|
||||
#install -D -m 644 %{SOURCE4} %{buildroot}/lib/systemd/system/openldap.service
|
||||
#install -D -m 644 %{SOURCE5} %{buildroot}%_tmpfilesdir/openldap.conf
|
||||
|
||||
rm -f %{buildroot}%{_sysconfdir}/%{name}/*.default
|
||||
rm -f %{buildroot}%{_sysconfdir}/%{name}/schema/*.default
|
||||
@ -187,94 +181,23 @@ rm -f %{buildroot}/var/openldap-data/DB_CONFIG.example
|
||||
%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
|
||||
%systemd_post slapd
|
||||
:
|
||||
|
||||
%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
|
||||
%systemd_preun slapd
|
||||
:
|
||||
|
||||
%postun -n %{name}-server
|
||||
#update
|
||||
if [ $1 -eq 1 ]; then
|
||||
service openldap condrestart
|
||||
fi
|
||||
exit 0
|
||||
%systemd_postun_with_restart slapd
|
||||
:
|
||||
|
||||
%files -n lib%{name}
|
||||
%defattr(-,root,root)
|
||||
%config(noreplace) %{_sysconfdir}/openldap/ldap.conf
|
||||
%{_bindir}/ldapurl
|
||||
%{_libdir}/liblber-*.so.*
|
||||
%{_libdir}/libldap-*.so.*
|
||||
%{_libdir}/libldap_r-*.so.*
|
||||
#%{_libdir}/libldap_r-*.so.*
|
||||
%doc COPYRIGHT LICENSE
|
||||
|
||||
%files -n lib%{name}-devel
|
||||
@ -295,14 +218,17 @@ exit 0
|
||||
%{_libdir}/libldap.a
|
||||
%{_libdir}/libldap.la
|
||||
%{_libdir}/libldap.so
|
||||
%{_libdir}/libldap_r.a
|
||||
%{_libdir}/libldap_r.la
|
||||
%{_libdir}/libldap_r.so
|
||||
#%{_libdir}/libldap_r.a
|
||||
#%{_libdir}/libldap_r.la
|
||||
#%{_libdir}/libldap_r.so
|
||||
%{_libdir}/pkgconfig/lber.pc
|
||||
%{_libdir}/pkgconfig/ldap.pc
|
||||
%doc doc/devel/* doc/drafts/draft*.txt doc/rfc/rfc*.txt
|
||||
%doc ANNOUNCEMENT CHANGES README
|
||||
|
||||
%files clients
|
||||
%defattr(-,root,root)
|
||||
%config(noreplace) %{_sysconfdir}/openldap/ldap.conf
|
||||
%{_bindir}/ldapexop
|
||||
%{_bindir}/ldapadd
|
||||
%{_bindir}/ldapdelete
|
||||
@ -310,6 +236,8 @@ exit 0
|
||||
%{_bindir}/ldapmodrdn
|
||||
%{_bindir}/ldappasswd
|
||||
%{_bindir}/ldapsearch
|
||||
%{_bindir}/ldapurl
|
||||
%{_bindir}/ldapvc
|
||||
#%{_bindir}/saucer
|
||||
#%{_bindir}/ud
|
||||
%{_mandir}/man1/*
|
||||
@ -318,13 +246,12 @@ exit 0
|
||||
%files server
|
||||
%defattr(-,root,root)
|
||||
%dir %{_sysconfdir}/openldap
|
||||
%{_sysconfdir}/openldap/DB_CONFIG.example
|
||||
#%{_sysconfdir}/openldap/DB_CONFIG.example
|
||||
%{_sysconfdir}/openldap/slapd.ldif
|
||||
%config(noreplace) %attr(640,root,ldap) %{_sysconfdir}/openldap/slapd.conf
|
||||
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/openldap
|
||||
%dir %{_sysconfdir}/openldap/schema
|
||||
%{_sysconfdir}/openldap/schema/*
|
||||
%{_initrddir}/openldap
|
||||
%{_bindir}/ldapcompare
|
||||
%{_bindir}/ldapwhoami
|
||||
%{_sbindir}/slapacl
|
||||
@ -334,20 +261,21 @@ exit 0
|
||||
%{_sbindir}/slapd
|
||||
%{_sbindir}/slapdn
|
||||
%{_sbindir}/slapindex
|
||||
%{_sbindir}/slapmodify
|
||||
%{_sbindir}/slappasswd
|
||||
%{_sbindir}/slapschema
|
||||
%{_sbindir}/slaptest
|
||||
#%{_sbindir}/slurpd
|
||||
/lib/systemd/system/openldap.service
|
||||
%_tmpfilesdir/openldap.conf
|
||||
#%{_datadir}/openldap/ucdata/*
|
||||
%{_unitdir}/slapd.service
|
||||
#%{_tmpfilesdir}/openldap.conf
|
||||
%dir %attr(700,ldap,ldap) /var/lib/openldap-data
|
||||
#%dir %attr(700,ldap,ldap) /var/run/openldap
|
||||
%config(noreplace) /var/lib/openldap-data/DB_CONFIG
|
||||
%{_mandir}/man3/*
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%changelog
|
||||
* Thu Jun 10 2021 Automatic Build System <autodist@mambasoft.it> 2.5.5-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
* Wed Mar 17 2021 Automatic Build System <autodist@mambasoft.it> 2.4.58-1mamba
|
||||
- automatic version update by autodist
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user