File spfmilter.spec of Package spfmilter
#
# spec file for package spfmilter
#
# Copyright (c) 2025 Barry Nelson
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Name: spfmilter
Summary: SPF Milter for a Mail Server
License: Apache-2.0
Group: Productivity/Networking/Email/Servers
Version: 2.001
Release: lp156.0.0
Source0: %{name}-%{version}.tar.gz
Source1: spfmilter.service
Source2: spf.pre
Source3: spfmilter.8
#BuildRoot: %{_tmppath}/%{name}-%{version}-build
#PreReq: bash /bin/echo /bin/mv
BuildRequires: sendmail-devel
BuildRequires: gcc <= 13
BuildRequires: libspf2-devel
Requires: libspf2-2
#Requires: pam
%description
This package contains the SPFMilter
%prep
%setup
cp %{SOURCE3} spfmilter.8
#setup -n panda-imap-imap-2025-04-06
#patch1 -p0
#patch2 -p0
%build
#export CFLAGS="$RPM_OPT_FLAGS -DSSL_get_peer_certificate=SSL_get1_peer_certificate -DOPENSSL_NO_DEPRECATED -DDISABLE_POP_PROXY=1 -fPIC -fno-strict-aliasing -fstack-protector"
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
%install
mkdir -p /usr/sbin
mkdir -p /usr/share/man/man8
install -d -m 755 %{buildroot}%{_prefix}/sbin
install -d -m 755 %{buildroot}%{_mandir}/man8
install -c -m 555 spfmilter %{buildroot}%{_prefix}/sbin
install -c -m 444 spfmilter.8 %{buildroot}%{_mandir}/man8
gzip -9 %{buildroot}%{_mandir}/man8/spfmilter.8
mkdir -p %{buildroot}/usr/lib/systemd/system || true
install -c -m 555 %{SOURCE1} %{buildroot}/usr/lib/systemd/system
mkdir -p %{buildroot}/etc/mail/system
install -c -m 555 %{SOURCE2} %{buildroot}/etc/mail/system
%post
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr (-,root,root)
%dir /etc/mail
%dir /etc/mail/system
%{_prefix}/sbin/spfmilter
%{_mandir}/man8/spfmilter.8.gz
/usr/lib/systemd/system/spfmilter.service
/etc/mail/system/spf.pre
%changelog