public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Christopher Meng <i@cicku.me>
To: git-commits@fedoraproject.org
Subject: [rpms/postgrey] epel10.3: SPEC cleanup;
Date: Mon, 30 Nov 2026 12:53:21 GMT	[thread overview]
Message-ID: <179604320171.1.12750513809195972676.rpms-postgrey-485605b72c8f@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/postgrey
            Branch : epel10.3
            Commit : 485605b72c8f3a1ba2eb0cf6efe80c95f52fdcb9
            Author : Christopher Meng <i@cicku.me>
            Date   : 2014-01-12T23:28:17+08:00
            Stats  : +42/-69 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/postgrey/c/485605b72c8f3a1ba2eb0cf6efe80c95f52fdcb9?branch=epel10.3

            Log:
            SPEC cleanup;
Add tmpfiles control.
Try build #1

---
diff --git a/postgrey-tmpfiles.conf b/postgrey-tmpfiles.conf
new file mode 100644
index 0000000..19c61d1
--- /dev/null
+++ b/postgrey-tmpfiles.conf
@@ -0,0 +1 @@
+d /var/run/postgrey 0755 postgrey postgrey -

diff --git a/postgrey.spec b/postgrey.spec
index c4d99b2..2f3ebf9 100644
--- a/postgrey.spec
+++ b/postgrey.spec
@@ -1,32 +1,29 @@
-%define confdir %{_sysconfdir}/postfix
+%global confdir %{_sysconfdir}/postfix
 
-Summary: Postfix Greylisting Policy Server
-Name: postgrey
-Version: 1.34
-Release: 8%{?dist}
+Name:              postgrey
+Version:           1.34
+Release:           8%{?dist}
 # File headers only state "GNU GPL", but the LICENSE sections state v2 and "any
 # later version"
-License: GPLv2+
-Group: System Environment/Daemons
-URL: http://postgrey.schweikert.ch/
-Source0: http://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz
-Source1: postgrey.service
-Source2: README-rpm
-Source3: postgrey.sysconfig
-Patch0: postgrey-1.28-group.patch
-Patch1: postgrey-1.34-perl-5.18.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: systemd-units
+Summary:           Postfix Greylisting Policy Server
+License:           GPLv2+
+URL:               http://postgrey.schweikert.ch/
+Source0:           http://postgrey.schweikert.ch/pub/postgrey-%{version}.tar.gz
+Source1:           postgrey.service
+Source2:           README-rpm
+Source3:           postgrey.sysconfig
+Source4:           postgrey-tmpfiles.conf
+Patch0:            postgrey-1.28-group.patch
+Patch1:            postgrey-1.34-perl-5.18.patch
+BuildArch:         noarch
+BuildRequires:     systemd
 # We require postfix for its directories and gid
-Requires: postfix
-Requires(pre): /usr/sbin/useradd
-#Requires(post): /sbin/chkconfig
-#Requires(preun): /sbin/service, /sbin/chkconfig
-#Requires(postun): /sbin/service
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
-BuildArch: noarch
+Requires:          perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
+Requires:          postfix
+Requires(pre):     shadow-utils
+Requires(post):    systemd
+Requires(preun):   systemd
+Requires(postun):  systemd
 
 %description
 Postgrey is a Postfix policy server implementing greylisting.  When a request
@@ -36,13 +33,11 @@ seen, or if the triplet was first seen less than 5 minutes, then the mail gets
 rejected with a temporary error. Hopefully spammers or viruses will not try
 again later, as it is however required per RFC.
 
-
 %prep
 %setup -q
 %patch0 -p1 -b .group
 %patch1 -p1 -b .perl-5.18
-%{__install} -p -m 0644 %{SOURCE2} README-rpm
-
+install -pm0644 %{SOURCE2} README-rpm
 
 %build
 # We only have perl scripts, so just "build" the man page
@@ -51,76 +46,53 @@ pod2man \
     --section="8" \
     postgrey > postgrey.8
 
-
 %install
-%{__rm} -rf %{buildroot}
-
 # Configuration files
-%{__mkdir_p} %{buildroot}%{confdir}
-%{__install} -p -m 0644 postgrey_whitelist_{clients,recipients} \
+mkdir -p %{buildroot}%{confdir}
+istall -pm0644 postgrey_whitelist_{clients,recipients} \
     %{buildroot}%{confdir}/
 # Local whitelist file
 echo "# Clients that should not be greylisted.  See postgrey(8)." \
     > %{buildroot}%{confdir}/postgrey_whitelist_clients.local
 
 # Main script
-%{__install} -D -p -m 0755 postgrey %{buildroot}%{_sbindir}/postgrey
+install -pDm0755 postgrey %{buildroot}%{_sbindir}/postgrey
 
 # Spool directory
-%{__mkdir_p} %{buildroot}%{_var}/spool/postfix/postgrey
+mkdir -p %{buildroot}%{_localstatedir}/spool/postfix/postgrey
 
 # Init script
-%{__install} -D -p -m 0644 %{SOURCE1} \
+install -pDm0644 %{SOURCE1} \
     %{buildroot}%{_unitdir}/postgrey.service
 
 # Sysconfig
-%{__install} -D -p -m 0644 %{SOURCE3} \
+install -pDm0644 %{SOURCE3} \
     %{buildroot}%{_sysconfdir}/sysconfig/postgrey
 
 # Man page
-%{__install} -D -p -m 0644 postgrey.8 \
+install -pDm0644 postgrey.8 \
     %{buildroot}%{_mandir}/man8/postgrey.8
 
 # Optional report script
-%{__install} -D -p -m 0755 contrib/postgreyreport \
+install -pDm0755 contrib/postgreyreport \
     %{buildroot}%{_sbindir}/postgreyreport
 
-
-%clean
-%{__rm} -rf %{buildroot}
-
+# Tmpfiles.d
+mkdir -p %{buildroot}%{_tmpfilesdir}
+install -m0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
 
 %pre
-/usr/sbin/useradd -d %{_var}/spool/postfix/postgrey -s /sbin/nologin \
+/usr/sbin/useradd -d %{_localstatedir}/spool/postfix/postgrey -s /sbin/nologin \
     -M -r postgrey &>/dev/null || :
 
 %post
-#/sbin/chkconfig --add postgrey
-if [ $1 -eq 1 ] ; then 
-    # Initial installation 
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post postgrey.service
 
 %preun
-#if [ $1 -eq 0 ]; then
-#    /sbin/service postgrey stop &>/dev/null || :
-#    /sbin/chkconfig --del postgrey
-#fi
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable postgrey.service > /dev/null 2>&1 || :
-    /bin/systemctl stop postgrey.service > /dev/null 2>&1 || :
-fi
+%systemd_preun postgrey.service
 
 %postun
-#if [ $1 -ge 1 ]; then
-#    /sbin/service postgrey condrestart &>/dev/null || :
-#fi
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart postgrey.service >/dev/null 2>&1 || :
-fi
+%systemd_postun postgrey.service
 
 %triggerun -- postgrey < 1.34-3
 # Save the current service runlevel info
@@ -133,9 +105,10 @@ fi
 /bin/systemctl try-restart postgrey.service >/dev/null 2>&1 || :
 
 %files
-%defattr(-,root,root,-)
 %doc Changes COPYING README README-rpm
 %{_unitdir}/postgrey.service
+%{_tmpfilesdir}/postgrey.conf
+%{_localstatedir}/run/postgrey
 %{_sysconfdir}/sysconfig/postgrey
 %config(noreplace) %{confdir}/postgrey_whitelist_clients
 %config(noreplace) %{confdir}/postgrey_whitelist_recipients
@@ -143,8 +116,7 @@ fi
 %{_sbindir}/postgrey
 %{_sbindir}/postgreyreport
 %{_mandir}/man8/postgrey.8*
-%dir %attr(0751,postgrey,postfix) %{_var}/spool/postfix/postgrey/
-
+%dir %attr(0751,postgrey,postfix) %{_localstatedir}/spool/postfix/postgrey/
 
 %changelog
 * Wed Jan 01 2014 Nils Philippsen <nils@redhat.com> - 1.34-8

                 reply	other threads:[~2026-11-30 12:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179604320171.1.12750513809195972676.rpms-postgrey-485605b72c8f@fedoraproject.org \
    --to=i@cicku.me \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox