diff --git a/openldap2-client.changes b/openldap2-client.changes index a9e6b14..ce1c9c1 100644 --- a/openldap2-client.changes +++ b/openldap2-client.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 18 14:39:07 UTC 2014 - ckornacker@suse.com + +- Fix systemd service installation + ------------------------------------------------------------------- Wed Feb 12 11:24:08 UTC 2014 - varkoly@suse.com diff --git a/openldap2-client.spec b/openldap2-client.spec index 7c8719a..133e3a0 100644 --- a/openldap2-client.spec +++ b/openldap2-client.spec @@ -51,10 +51,11 @@ PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/group %if 0%{?suse_version} >= 1140 # avoid cycle with krb5 BuildRequires: krb5-mini +BuildRequires: pkgconfig(systemd) +%{?systemd_requires} %endif Conflicts: openldap-client Requires: libldap-2_4-2 = %{version_main} -Requires: systemd %endif Source: openldap-%{version_main}.tgz Source1: openldap-rc.tgz @@ -317,10 +318,10 @@ make SLAPD_DEBUG=0 test %install mkdir -p $RPM_BUILD_ROOT/usr/lib/openldap/ mkdir -p $RPM_BUILD_ROOT/usr/sbin -mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} make STRIP="" DESTDIR=$RPM_BUILD_ROOT install install -m 755 start $RPM_BUILD_ROOT/usr/lib/openldap/start -install -m 644 slapd.service $RPM_BUILD_ROOT/usr/lib/systemd/system +install -m 644 slapd.service $RPM_BUILD_ROOT/%{_unitdir} mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/slapd.d mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2 install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2/slapd.conf @@ -361,6 +362,13 @@ rm -f $RPM_BUILD_ROOT/etc/openldap/schema/README rm -f $RPM_BUILD_ROOT/etc/openldap/slapd.ldif* rm -f $RPM_BUILD_ROOT/var/run/slapd/openldap-data/DB_CONFIG.example mv servers/slapd/back-sql/rdbms_depend servers/slapd/back-sql/examples +# Provide SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO +# /usr/sbin/service exists only since openSUSE 12.3: +%if 0%{?suse_version} > 1220 +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcslapd +%else +ln -s /sbin/service %{buildroot}%{_sbindir}/rcslapd +%endif %if %suse_version < 1130 # install 2.3 slapcat install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat @@ -386,6 +394,7 @@ cat >openldap2.filelist < /etc/openldap/UPDATE_NEEDED ; fi +%service_add_pre slapd.service %post if [ ${1:-0} -gt 1 ] && [ -f %{_libdir}/sasl2/slapd.conf ] ; then @@ -548,12 +558,13 @@ if [ ${1:-0} -gt 1 ] && [ -f %{_libdir}/sasl2/slapd.conf ] ; then fi %{fillup_only -n openldap ldap} %{remove_and_set -n openldap OPENLDAP_RUN_DB_RECOVER} +%service_add_post slapd.service %preun -%stop_on_removal ldap +%service_del_preun slapd.service %postun -%restart_on_update ldap +%service_del_postun slapd.service %post -n compat-libldap-2_3-0 -p /sbin/ldconfig diff --git a/openldap2.changes b/openldap2.changes index a9e6b14..ce1c9c1 100644 --- a/openldap2.changes +++ b/openldap2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 18 14:39:07 UTC 2014 - ckornacker@suse.com + +- Fix systemd service installation + ------------------------------------------------------------------- Wed Feb 12 11:24:08 UTC 2014 - varkoly@suse.com diff --git a/openldap2.spec b/openldap2.spec index d472f8d..bb8fc66 100644 --- a/openldap2.spec +++ b/openldap2.spec @@ -51,10 +51,11 @@ PreReq: %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/group %if 0%{?suse_version} >= 1140 # avoid cycle with krb5 BuildRequires: krb5-mini +BuildRequires: pkgconfig(systemd) +%{?systemd_requires} %endif Conflicts: openldap-client Requires: libldap-2_4-2 = %{version_main} -Requires: systemd %endif Source: openldap-%{version_main}.tgz Source1: openldap-rc.tgz @@ -317,10 +318,10 @@ make SLAPD_DEBUG=0 test %install mkdir -p $RPM_BUILD_ROOT/usr/lib/openldap/ mkdir -p $RPM_BUILD_ROOT/usr/sbin -mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} make STRIP="" DESTDIR=$RPM_BUILD_ROOT install install -m 755 start $RPM_BUILD_ROOT/usr/lib/openldap/start -install -m 644 slapd.service $RPM_BUILD_ROOT/usr/lib/systemd/system +install -m 644 slapd.service $RPM_BUILD_ROOT/%{_unitdir} mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/openldap/slapd.d mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2 install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/sasl2/slapd.conf @@ -361,6 +362,13 @@ rm -f $RPM_BUILD_ROOT/etc/openldap/schema/README rm -f $RPM_BUILD_ROOT/etc/openldap/slapd.ldif* rm -f $RPM_BUILD_ROOT/var/run/slapd/openldap-data/DB_CONFIG.example mv servers/slapd/back-sql/rdbms_depend servers/slapd/back-sql/examples +# Provide SUSE policy symlink /usr/sbin/rcFOO -> /etc/init.d/FOO +# /usr/sbin/service exists only since openSUSE 12.3: +%if 0%{?suse_version} > 1220 +ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcslapd +%else +ln -s /sbin/service %{buildroot}%{_sbindir}/rcslapd +%endif %if %suse_version < 1130 # install 2.3 slapcat install -m 755 ../openldap-2.3.37/servers/slapd/slapcat $RPM_BUILD_ROOT/usr/sbin/openldap-2.3-slapcat @@ -386,6 +394,7 @@ cat >openldap2.filelist < /etc/openldap/UPDATE_NEEDED ; fi +%service_add_pre slapd.service %post if [ ${1:-0} -gt 1 ] && [ -f %{_libdir}/sasl2/slapd.conf ] ; then @@ -548,12 +558,13 @@ if [ ${1:-0} -gt 1 ] && [ -f %{_libdir}/sasl2/slapd.conf ] ; then fi %{fillup_only -n openldap ldap} %{remove_and_set -n openldap OPENLDAP_RUN_DB_RECOVER} +%service_add_post slapd.service %preun -%stop_on_removal ldap +%service_del_preun slapd.service %postun -%restart_on_update ldap +%service_del_postun slapd.service %post -n compat-libldap-2_3-0 -p /sbin/ldconfig