summaryrefslogtreecommitdiff
path: root/packaging
diff options
context:
space:
mode:
authorMichael Sweet <michael.r.sweet@gmail.com>2017-06-16 20:29:51 -0400
committerMichael Sweet <michael.r.sweet@gmail.com>2017-06-16 20:29:51 -0400
commit75105fbdfb70b5179bdfdcb98bd9cae6de8feffb (patch)
tree3bcc2c24c50755c6111a95d39d9159e4c458a8ae /packaging
parentd2f1a784c46310f86c34434e9bf447f060bf0ec2 (diff)
downloadcups-75105fbdfb70b5179bdfdcb98bd9cae6de8feffb.tar.gz
Fix issues in RPM spec file.
Diffstat (limited to 'packaging')
-rw-r--r--packaging/cups.spec.in31
1 files changed, 30 insertions, 1 deletions
diff --git a/packaging/cups.spec.in b/packaging/cups.spec.in
index 55713006b..7b311ee65 100644
--- a/packaging/cups.spec.in
+++ b/packaging/cups.spec.in
@@ -128,6 +128,15 @@ make BUILDROOT=$RPM_BUILD_ROOT install
rm -rf $RPM_BUILD_ROOT/usr/share/cups/banners $RPM_BUILD_ROOT/usr/share/cups/data
%post
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+/bin/systemctl enable org.cups.cupsd.service
+
+if test $1 -ge 1; then
+ /bin/systemctl stop org.cups.cupsd.service
+ /bin/systemctl start org.cups.cupsd.service
+fi
+
+%else
/sbin/chkconfig --add cups
/sbin/chkconfig cups on
@@ -136,21 +145,38 @@ if test $1 -gt 1; then
/sbin/service cups stop
/sbin/service cups start
fi
+%endif
%post libs
/sbin/ldconfig
%preun
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+if test $1 -ge 1; then
+ /bin/systemctl stop org.cups.cupsd.service
+ /bin/systemctl disable org.cups.cupsd.service
+fi
+
+%else
if test $1 = 0; then
/sbin/service cups stop
/sbin/chkconfig --del cups
fi
+%endif
%postun
+%if %{?_with_systemd:1}%{!?_with_systemd:0}
+if test $1 -ge 1; then
+ /bin/systemctl stop org.cups.cupsd.service
+ /bin/systemctl start org.cups.cupsd.service
+fi
+
+%else
if test $1 -ge 1; then
/sbin/service cups stop
/sbin/service cups start
fi
+%endif
%postun libs
/sbin/ldconfig
@@ -194,13 +220,13 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/cancel
/usr/bin/cupstestdsc
/usr/bin/cupstestppd
-/usr/bin/ippfind
/usr/bin/ipptool
/usr/bin/lp*
%dir /usr/lib/cups
%dir /usr/lib/cups/backend
%if %{?_with_dnssd:1}%{!?_with_dnssd:0}
# DNS-SD
+/usr/bin/ippfind
/usr/lib/cups/backend/dnssd
%endif
/usr/lib/cups/backend/http
@@ -306,7 +332,10 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/man/man1/cups.1.gz
/usr/share/man/man1/cupstestdsc.1.gz
/usr/share/man/man1/cupstestppd.1.gz
+%if %{?_with_dnssd:1}%{!?_with_dnssd:0}
+# DNS-SD
/usr/share/man/man1/ippfind.1.gz
+%endif
/usr/share/man/man1/ipptool.1.gz
/usr/share/man/man1/lp.1.gz
/usr/share/man/man1/lpoptions.1.gz