[znc] Fix various bugs

Nick Bebout nb at fedoraproject.org
Mon Nov 11 23:30:09 UTC 2013


commit 5526916761533ec8f7d17c7142aa167ea0c031c9
Author: Nick Bebout <nb at fedoraproject.org>
Date:   Mon Nov 11 17:30:20 2013 -0600

    Fix various bugs

 znc.service |    2 +-
 znc.spec    |   24 +++++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)
---
diff --git a/znc.service b/znc.service
index e2c92b2..55bb678 100644
--- a/znc.service
+++ b/znc.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=Daemon to do something
+Description=ZNC - an advanced IRC bouncer
 After=network.target
 
 [Service]
diff --git a/znc.spec b/znc.spec
index 0f458b6..1db1168 100644
--- a/znc.spec
+++ b/znc.spec
@@ -5,6 +5,8 @@
 %define use_systemd 1
 %endif
 
+%global _hardened_build 1
+
 %global __python %{__python3}
 
 Summary:        An advanced IRC bouncer
@@ -12,7 +14,7 @@ Name:           znc
 Version:        1.2
 #Release:        0.1.20110801git%{?dist}
 #Release:        0.4.rc2%{?dist}
-Release:        1%{?dist}
+Release:        2%{?dist}
 License:        ASL 2.0
 Group:          System Environment/Daemons
 URL:            http://znc.in
@@ -143,10 +145,7 @@ install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/znc
 %post
 
 %if %{use_systemd}
-if [ $1 -eq 1 ] ; then
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post znc.service
 %endif
 
 %if !%{use_systemd}
@@ -157,11 +156,7 @@ fi
 %postun
 
 %if %{use_systemd}
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart znc.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart znc.service
 %endif
 
 %if !%{use_systemd}
@@ -173,11 +168,7 @@ fi
 %preun
 
 %if %{use_systemd}
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable znc.service > /dev/null 2>&1 || :
-    /bin/systemctl stop znc.service > /dev/null 2>&1 || :
-fi
+%systemd_preun znc.service
 %endif
 
 %if !%{use_systemd}
@@ -276,6 +267,9 @@ fi
 %{_libdir}/znc/modpython.so
 
 %changelog
+* Mon Nov 11 2013 Nick Bebout <nb at fedoraproject.org> - 1.2-2
+- Enable PIE, Fix systemd description, use systemd macros
+
 * Mon Nov 11 2013 Nick Bebout <nb at fedoraproject.org> - 1.2-1
 - Upgrade to 1.2
 


More information about the scm-commits mailing list