From f25689a3886dfb28418838f797776d512051f900 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Mon, 20 Feb 2012 15:13:49 +0100 Subject: [PATCH] unify systemctl binary paths throughout the specfile and make them usrmove compliant make path to chkconfig binary usrmove compliant --- openldap.spec | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/openldap.spec b/openldap.spec index 56ea4a1..29c8045 100644 --- a/openldap.spec +++ b/openldap.spec @@ -4,9 +4,11 @@ %global evolution_connector_includedir %{evolution_connector_prefix}/include %global evolution_connector_libdir %{evolution_connector_prefix}/%{_lib} +%global systemctl_bin /usr/bin/systemctl + Name: openldap Version: 2.4.29 -Release: 1%{?dist} +Release: 2%{?dist} Summary: LDAP support libraries Group: System Environment/Daemons License: OpenLDAP @@ -426,7 +428,7 @@ exit 0 if [ $1 -eq 1 ]; then # initial installation - /bin/systemctl daemon-reload &>/dev/null || : + %{systemctl_bin} daemon-reload &>/dev/null || : fi # generate sample TLS certificate for server (will not replace) @@ -446,8 +448,8 @@ start_slapd=0 # upgrade the database if [ -f %{_sharedstatedir}/ldap/rpm_upgrade_openldap ]; then - if /bin/systemctl --quiet is-active slapd.service; then - /bin/systemctl stop slapd.service + if %{systemctl_bin} --quiet is-active slapd.service; then + %{systemctl_bin} stop slapd.service start_slapd=1 fi @@ -483,9 +485,9 @@ fi # restart after upgrade if [ $1 -ge 1 ]; then if [ $start_slapd -eq 1 ]; then - /bin/systemctl start slapd.service &>/dev/null || : + %{systemctl_bin} start slapd.service &>/dev/null || : else - /bin/systemctl condrestart slapd.service &>/dev/null || : + %{systemctl_bin} condrestart slapd.service &>/dev/null || : fi fi @@ -494,17 +496,17 @@ exit 0 %preun servers if [ $1 -eq 0 ]; then # package removal - /bin/systemctl --no-reload disable slapd.service &>/dev/null || : - /bin/systemctl stop slapd.service &>/dev/null || : + %{systemctl_bin} --no-reload disable slapd.service &>/dev/null || : + %{systemctl_bin} stop slapd.service &>/dev/null || : fi %postun servers /sbin/ldconfig -/bin/systemctl daemon-reload &>/dev/null || : +%{systemctl_bin} daemon-reload &>/dev/null || : if [ $1 -ge 1 ]; then # package upgrade - /bin/systemctl try-restart slapd.service &>/dev/null || : + %{systemctl_bin} try-restart slapd.service &>/dev/null || : fi exit 0 @@ -520,8 +522,8 @@ exit 0 # migration from SysV to systemd /usr/bin/systemd-sysv-convert --save slapd &>/dev/null || : -/sbin/chkconfig --del slapd &>/dev/null || : -/bin/systemctl try-restart slapd.service &>/dev/null || : +/usr/sbin/chkconfig --del slapd &>/dev/null || : +%{systemctl_bin} try-restart slapd.service &>/dev/null || : %triggerin servers -- libdb @@ -543,8 +545,8 @@ exit 0 # libdb upgrade (finish %%triggerin) if [ -f %{_sharedstatedir}/ldap/rpm_upgrade_libdb ]; then - if /bin/systemctl --quiet is-active slapd.service; then - /bin/systemctl stop slapd.service + if %{systemctl_bin} --quiet is-active slapd.service; then + %{systemctl_bin} stop slapd.service start=1 else start=0 @@ -553,7 +555,7 @@ if [ -f %{_sharedstatedir}/ldap/rpm_upgrade_libdb ]; then %{_libexecdir}/openldap/upgrade-db.sh &>/dev/null rm -f %{_sharedstatedir}/ldap/rpm_upgrade_libdb - [ $start -eq 1 ] && /bin/systemctl start slapd.service &>/dev/null + [ $start -eq 1 ] && %{systemctl_bin} start slapd.service &>/dev/null fi exit 0 @@ -649,6 +651,10 @@ exit 0 %{evolution_connector_prefix}/ %changelog +* Mon Feb 20 2012 Jan Synáček - 2.4.29-2 +- unify systemctl binary paths throughout the specfile and make them usrmove compliant +- make path to chkconfig binary usrmove compliant + * Wed Feb 15 2012 Jan Vcelak 2.4.29-1 - new upstream release + MozNSS fixes