# systemd-rpm-macros split out from systemd at Fedora 30 %if (0%{?fedora} && 0%{?fedora} <= 29) || 0%{?rhel} %global systemd_rpm_macros systemd %else %global systemd_rpm_macros systemd-rpm-macros %endif # Milter header files package name %if 0%{?fedora} > 25 || 0%{?rhel} > 7 %global milter_devel_package sendmail-milter-devel %else %global milter_devel_package sendmail-devel %endif # Do a hardened build where possible %global _hardened_build 1 Summary: Mail filter for sender address validation Name: smf-sav Version: 2.1 Release: 6%{?dist} License: GPL-2.0-or-later URL: http://smf-sav.anw.at/ Source0: http://smf-sav.anw.at/smf-sav-reloaded-%{version}.tar.gz Source2: smf-sav.service Source3: smfs.conf Source4: README.rpm Patch0: smf-sav-2.1-bubble.patch Patch1: smf-sav-1.4.0-nostrip.patch Patch4: smf-sav-2.1-config.patch Patch5: smf-sav-2.1-rundir.patch BuildRequires: coreutils BuildRequires: gcc BuildRequires: make BuildRequires: %milter_devel_package BuildRequires: %systemd_rpm_macros BuildRequires: systemd %{?systemd_requires} Requires(pre): shadow-utils # Need systemd for ownership of /usr/lib/tmpfiles.d directory Requires: systemd %description A lightweight, fast and reliable milter that implements a real-time sender address verification technology. This technology can stop some kinds of spam with spoofed sender's email addresses. Also it implements a real-time recipient address verification technology. It can be useful if your machine is a backup MX for the recipients' domains or if your machine forwards all email messages as a relay host for your domains to another internal or external email servers. %prep %setup -q -n smf-sav-reloaded-%{version} # Copy in additional sources cp -a %{SOURCE2} %{SOURCE3} %{SOURCE4} . # Miscellaneous third-party enhancements %patch -P 0 # Don't strip the binary so we get usable debuginfo %patch -P 1 -p1 # Clean up config file for packaging %patch -P 4 # Use /run rather than /var/run with systemd %patch -P 5 %build make %{?_smp_mflags} \ DATADIR="/run/smfs" \ CFLAGS="%{optflags} -pthread -D_GNU_SOURCE" \ LDFLAGS="$LDFLAGS -lmilter -lpthread -lresolv" %install install -d -m 711 %{buildroot}/run/smfs install -Dp -m 755 smf-sav %{buildroot}%{_sbindir}/smf-sav install -Dp -m 644 smf-sav.conf %{buildroot}%{_sysconfdir}/mail/smfs/smf-sav.conf # Install systemd unit file and tmpfiles.d configuration for /run/smfs install -Dp -m 644 smf-sav.service %{buildroot}%{_unitdir}/smf-sav.service install -Dp -m 644 smfs.conf %{buildroot}%{_prefix}/lib/tmpfiles.d/smfs.conf # Create dummy socket for %%ghost-ing : > %{buildroot}/run/smfs/smf-sav.sock %pre getent group smfs >/dev/null || groupadd -r smfs getent passwd smfs >/dev/null || \ useradd -r -g smfs -d %{_localstatedir}/lib/smfs \ -s /sbin/nologin -c "Smart Sendmail Filters" smfs exit 0 %post %systemd_post smf-sav.service %preun %systemd_preun smf-sav.service %postun %systemd_postun_with_restart smf-sav.service %files %license COPYING %doc ChangeLog readme README.rpm %{_sbindir}/smf-sav %dir %{_sysconfdir}/mail/smfs/ %config(noreplace) %{_sysconfdir}/mail/smfs/smf-sav.conf %attr(0700,smfs,smfs) %dir /run/smfs/ %ghost %attr(0600,smfs,smfs) /run/smfs/smf-sav.sock %{_prefix}/lib/tmpfiles.d/smfs.conf %{_unitdir}/smf-sav.service %changelog * Wed Oct 30 2024 Paul Howarth - 2.1-6 - Avoid use of deprecated patch syntax * Wed Feb 8 2023 Paul Howarth - 2.1-5 - Support only systemd init - Use SPDX-format license tag - Use %%license unconditionally - Do a hardened build where possible * Sun Mar 24 2019 Paul Howarth - 2.1-4 - Fix permissions of /run/smfs so that dac_read_search capability is not needed during milter start-up * Tue Mar 13 2018 Paul Howarth - 2.1-3 - systemd-units merged into systemd at Fedora 17 - Drop support for EOL distributions prior to F-13 - Drop BuildRoot: and Group: tags - Drop explicit buildroot cleaning in %%install section - Drop explicit %%clean section - %%{_initddir} macro always available * Fri Aug 5 2016 Paul Howarth - 2.1-2 - sendmail-devel renamed to sendmail-milter-devel from Fedora 26 - Use %%license where possible * Fri Jan 15 2016 Paul Howarth - 2.1-1 - Switch upstream to smf-sav-reloaded - Port "bubble" patch (adds PID file, ability to disable RAV, ability to distinguish between local and SMTP mailers) to new version - Update rundir patch * Sun Jul 28 2013 Paul Howarth - 1.4.0-5 - Systemd detection was broken in F-19 so hardcode it instead * Tue Jul 3 2012 Paul Howarth - 1.4.0-4 - Move tmpfiles.d config from %%{_sysconfdir} to %%{_prefix}/lib - Delay start-up until after network * Thu Sep 29 2011 Paul Howarth - 1.4.0-3 - Use presence of /run/lock to determine if init is systemd * Tue Jul 12 2011 Paul Howarth - 1.4.0-2 - Switch to systemd configuration where appropriate - Nobody else likes macros for commands * Wed Jul 28 2010 Paul Howarth - 1.4.0-1 - Initial RPM version