%global build_options -DGENERATE_SRS_SECRET=ON -DWITH_SQLITE=ON #%%undefine __cmake_in_source_build Name: postsrsd Version: 2.0.11 Release: 1%{?dist} Summary: Sender Rewriting Scheme (SRS) provider License: GPL-3.0-only AND BSD-3-Clause AND FSFAP AND FSFUL URL: https://github.com/roehling/postsrsd Source0: https://github.com/roehling/%{name}/archive/%{version}/%{name}-%{version}.tar.gz Source1: postsrsd.conf Patch1: postsrsd-local-libs.patch BuildRequires: cmake BuildRequires: gcc BuildRequires: libconfuse-devel BuildRequires: autoconf, automake BuildRequires: flex BuildRequires: libasan BuildRequires: libubsan BuildRequires: sqlite-devel BuildRequires: check-devel %{?systemd_requires} BuildRequires: systemd Requires(post): policycoreutils Requires(preun): policycoreutils Requires(postun): policycoreutils %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 %autosetup -n %{name}-%{version} %cmake %build_options %build %cmake_build %install %cmake_install # %%ghost file requires it is present in the build root mkdir -p %{buildroot}/%{_sysconfdir} touch %{buildroot}/%{_sysconfdir}/postsrsd.secret # default configuration and chroot directory cp %{SOURCE1} %{buildroot}/%{_sysconfdir}/ sed -ri -e "s/(\[Install\])/RuntimeDirectory=postsrsd\nRuntimeDirectoryMode=0750\n\n\1/" %{buildroot}/%{_unitdir}/postsrsd.service %files %license LICENSES/* %doc README.rst CHANGELOG.rst %doc %{_docdir}/postsrsd/postsrsd.conf %ghost %{_sysconfdir}/postsrsd.secret %config(noreplace) %{_sysconfdir}/postsrsd.conf %{_unitdir}/postsrsd.service %{_sbindir}/postsrsd %{_sysusersdir}/postsrsd.conf %post if [ "$1" -le "1" ] ; then # first install semodule -i %{_datadir}/selinux/packages/%{name}/postsrsd.pp || true fixfiles -R %{name} restore || true fi [ -f %{_sysconfdir}/postsrsd.secret ] || dd if=/dev/urandom bs=18 count=1 2>/dev/null | base64 >%{_sysconfdir}/postsrsd.secret # the admin may modify / restore from a backup, so better restore SELinux permissions unconditionally restorecon %{_sysconfdir}/postsrsd.secret %systemd_post %{name}.service %preun %systemd_preun %{name}.service if [ "$1" -lt "1" ] ; then # final removal semodule -r postsrsd 2>/dev/null || true fi %postun if [ "$1" -ge "1" ] ; then # upgrade semodule -i %{_datadir}/selinux/packages/%{name}/postsrsd.pp || true fixfiles -R %{name} restore || true fi %systemd_postun_with_restart %{name}.service #if [ "$1" -eq "0" ] ; then # final removal #fi %changelog * Tue Jun 17 2025 Ján ONDREJ (SAL) - 2.0.11-1 - Update to upstream. * Fri Jul 26 2024 Miroslav Suchý - 2.0.2-7 - convert license to SPDX * Fri Jul 19 2024 Fedora Release Engineering - 2.0.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jan 26 2024 Fedora Release Engineering - 2.0.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 2.0.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Jul 21 2023 Fedora Release Engineering - 2.0.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Fri Jan 20 2023 Fedora Release Engineering - 2.0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Tue Nov 29 2022 Marc Dequènes (Duck) - 1.12-3 - fix changelog entry * Tue Nov 29 2022 Marc Dequènes (Duck) - 1.12-2 - mark /etc/default/postsrsd as conffile * Wed Oct 26 2022 Marc Dequènes (Duck) - 1.12-1 - NUR * Fri Jul 22 2022 Fedora Release Engineering - 1.11-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Fri Jan 21 2022 Fedora Release Engineering - 1.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 1.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Mar 23 2021 Marc Dequènes (Duck) - 1.11-1 - NUR * Fri Mar 19 2021 Alexander Boström - 1.10-0.1 - Update to 1.10 - adds postsrsd-systemd-launcher wrapper script * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 1.6-3 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. * Wed Jan 27 2021 Fedora Release Engineering - 1.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Tue Oct 06 2020 Marc Dequènes (Duck) - 1.6-1 - NUR - define INIT_FLAVOR as detection does not work in build environment - ensure build in not done in-source - add gcc to BuildRequires (removing it was a mistake) - add compat for EL7 around cmake_* macros * Thu Aug 13 2020 Marc Dequènes (Duck) - 1.4-10.20170118gita77bf99 - migrate to new cmake macros for out-of-source builds * Thu Oct 05 2017 Marc Dequènes (Duck) - 1.4-9.20170118gita77bf99 - use the %%ghost feature to ensure the secret file is owned by the package - it is then not necessary to handle its removal in %%postun * Thu Sep 28 2017 Marc Dequènes (Duck) - 1.4-8.20170118gita77bf99 - Thanks Matthias Runge Mauchin for the review - break description line too long - build dependency on gcc is not needed * Wed Sep 27 2017 Marc Dequènes (Duck) - 1.4-7.20170118gita77bf99 - make the changelog more readable - stop recreating buildroot, it is made clean already * Wed Aug 23 2017 Marc Dequènes (Duck) - 1.4-6.20170118gita77bf99 - remove unnecessary Requires on make - use _sysconfdir macro - use name macro when it makes sense - remove unnecessary %%doc as the buildsys already populates docdir * Tue Aug 22 2017 Marc Dequènes (Duck) - 1.4-5.20170118gita77bf99 - remove %%clean section, not needed in Fedora * Tue Aug 22 2017 Marc Dequènes (Duck) - 1.4-4.20170118gita77bf99 - don't remove secret file during upgrade - start service at the end of post scriptlet - improve SELinux rules handling (now requires a running SELinux) * Tue Aug 22 2017 Marc Dequènes (Duck) - 1.4-3.20170118gita77bf99 - Thanks Robert-André Mauchin for the review - snapshot is packaged to get this necessary fix: https://github.com/roehling/postsrsd/pull/65 - fixed version - fixed source URL - use macros for standard paths and build steps - add missing systemd scriptlets - specify doc and license files - remove unnecessary Requires on base64 - remove Group information unsupported in Fedora * Fri Apr 14 2017 Marc Dequènes (Duck) - 1.4-2 - create /etc/postsrsd.secret if missing - move systemd config into directory for packages - move chroot directory into /run - autocreate chroot directory * Thu Mar 30 2017 Marc Dequènes (Duck) - 1.4-1 - initial packaging