[sqlgrey] Moderize spec file. Fixes bug #850325

Kevin Fenzi kevin at fedoraproject.org
Tue Nov 18 20:57:03 UTC 2014


commit 6838d7f6f67ad7148b061ef3cb942a614c104df1
Author: Kevin Fenzi <kevin at scrye.com>
Date:   Tue Nov 18 13:56:59 2014 -0700

    Moderize spec file. Fixes bug #850325

 sqlgrey.spec |   66 ++++++++++++++++-----------------------------------------
 1 files changed, 19 insertions(+), 47 deletions(-)
---
diff --git a/sqlgrey.spec b/sqlgrey.spec
index 9404ddd..96aa1f4 100644
--- a/sqlgrey.spec
+++ b/sqlgrey.spec
@@ -1,6 +1,6 @@
 Name:           sqlgrey
 Version:        1.8.0
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Postfix grey-listing policy service
 Group:          System Environment/Daemons
 License:        GPLv2+
@@ -12,17 +12,13 @@ Patch1:         sqlgrey-1.7.4-warnings.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
-BuildRequires:          systemd-units
 Requires:               postfix
 Requires:               perl(DBD::SQLite)
-#Requires(post):         /sbin/chkconfig
-#Requires(post):         /sbin/service
-#Requires(preun):        /sbin/chkconfig
-#Requires(preun):        /sbin/service
-#Requires(postun):       /sbin/service
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
+Requires(pre): shadow-utils
+Requires(post): systemd
+Requires(preun): systemd
+Requires(postun): systemd
+BuildRequires: systemd
 
 
 %description
@@ -37,7 +33,7 @@ to 90% of junk mails (spam and virus) before they reach your Postfix server
 %patch1 -p1
 
 %build
-make
+make %{?_smp_mflags}
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -71,49 +67,25 @@ rm -rf $RPM_BUILD_ROOT
 %attr(644,root,root) %config %{_sysconfdir}/sqlgrey/README
 
 %pre
-if ! id sqlgrey &>/dev/null ; then
-    /usr/sbin/groupadd -r sqlgrey || :
-    /usr/sbin/useradd -r -s /sbin/nologin -d /var/lib/sqlgrey -M \
-        -c 'SQLgrey Server' -g sqlgrey sqlgrey || :
-fi
+getent group sqlgrey >/dev/null || groupadd -r sqlgrey
+getent passwd sqlgrey >/dev/null || \
+    useradd -r -g sqlgrey -d /var/lib/sqlgrey -s /sbin/nologin \
+    -c "SQLgrey server" sqlgrey
+exit 0
 
 %post
-#/sbin/chkconfig --add sqlgrey || :
-#/sbin/service sqlgrey condrestart || :
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post sqlgrey.service
 
 %preun
-#if [ "$1" -eq 0 ]; then
-#    /sbin/service sqlgrey stop || :
-#    /sbin/chkconfig --del sqlgrey || :
-#fi
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable sqlgrey.service > /dev/null 2>&1 || :
-    /bin/systemctl stop sqlgrey.service > /dev/null 2>&1 || :
-fi
+%systemd_preun sqlgrey.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart sqlgrey.service >/dev/null 2>&1 || :
-fi
-
-%triggerun -- sqlgrey < 1.8.0-1
-# Save the current service runlevel info
-# User must manually run systemd-sysv-convert --apply sqlgrey
-# to migrate them to systemd targets
-/usr/bin/systemd-sysv-convert --save sqlgrey >/dev/null 2>&1 ||:
-
-# Run these because the SysV package being removed won't do them
-/sbin/chkconfig --del sqlgrey >/dev/null 2>&1 || :
-/bin/systemctl try-restart sqlgrey.service >/dev/null 2>&1 || :
+%systemd_postun_with_restart sqlgrey.service
 
 %changelog
+* Tue Nov 18 2014 Kevin Fenzi <kevin at scrye.com> 1.8.0-8
+- Moderize spec file. Fixes bug #850325
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.8.0-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
@@ -236,7 +208,7 @@ fi
 - IPv6 support
 - Optin/optout support
 
-* Tue Apr 25 2005 Lionel Bouton <lionel-dev at bouton.name>
+* Mon Apr 25 2005 Lionel Bouton <lionel-dev at bouton.name>
 - 1.5.5 release
 - small fix for SRS (again!)
 - small fix for deverp code


More information about the scm-commits mailing list