%global username postsrsd Name: postsrsd Version: 2.0.11 Release: 1%{?dist} Summary: A sender-envelope rewriter to comply with SPF forwarding for postfix License: GPLv2+ URL: https://github.com/roehling/postsrsd Source0: https://github.com/roehling/postsrsd/archive/refs/tags/%{version}.tar.gz Source10: postsrsd.sysusers BuildRequires: cmake3, gcc, sqlite-devel, libconfuse-devel, sendmail-milter-devel, check-devel, pkgconf-pkg-config, libasan, libubsan BuildRequires: systemd-rpm-macros Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd Requires: coreutils postfix %{?sysusers_requires_compat} %description PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix. SRS is needed if your mail server acts as forwarder. %prep %setup -q -n %{name}-%{version} %build mkdir -p _build pushd _build cmake .. \ -DPOSTSRSD_USER:STRING=%{username} \ -DCMAKE_INSTALL_PREFIX:PATH=%{_usr} \ -DBUILD_SHARED_LIBS:BOOL=ON \ -DPOSTSRSD_CONFIGDIR:PATH=%{_sysconfdir}/postsrsd \ -DPOSTSRSD_DATADIR:PATH=%{_sharedstatedir}/postsrsd \ -DGENERATE_SRS_SECRET=OFF -DWITH_SQLITE=on -DWITH_MILTER=on \ -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS %make_build popd %install pushd _build %make_install install -d %{buildroot}%{_sharedstatedir}/%{name} popd mkdir -p %{buildroot}%{_sysconfdir}/postsrsd install -p -D -m 0644 %{SOURCE10} %{buildroot}%{_sysusersdir}/postsrsd.conf %check pushd _build ctest3 -V %{?_smp_mflags} popd %pre %sysusers_create_compat %{SOURCE10} if [ ! -f "%{_sysconfdir}/postsrsd.secret" ]; then umask 077 dd if=/dev/urandom bs=18 count=1 status=noxfer 2> /dev/null | base64 > %{_sysconfdir}/postsrsd.secret fi %preun %systemd_preun postsrsd.service %post %systemd_post postsrsd.service %postun %systemd_postun_with_restart postsrsd.service %files %config(noreplace) %{_sysconfdir}/postsrsd %{_unitdir}/postsrsd.service %{_sysusersdir}/postsrsd.conf %{_sbindir}/postsrsd %dir %attr(0750, %{username}, -) %doc %{_defaultdocdir}/postsrsd %changelog * Tue May 05 2026 Konstantin Ryabitsev - Update to latest 2.0.11 - Drop selinux (gone) * Mon Mar 08 2021 Konstantin Ryabitsev - Update to latest upstream 1.10. * Mon May 01 2017 Konstantin Ryabitsev - Update to latest upstream with SELinux fixes. - Use version 1.5-0.{gitinfo} until 1.5 release by upstream. * Mon Mar 07 2016 Anatole Denis - Add selinux policy compilation. Do not use the one in the CMakefile, it breaks sandbox * Mon Feb 22 2016 Anatole Denis - Stop using systemd_requires macro (not recommended by guidelines) * Tue Feb 16 2016 Anatole Denis - Version 1.4 - Change the source URL to use github releases instead of tags * Mon Dec 14 2015 Anatole Denis - Version Bump