%global selinux_variants mls targeted Name: postsrsd Version: 1.10 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/%{version}.tar.gz BuildRequires: cmake3 BuildRequires: help2man Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd Requires: coreutils postfix # SELinux-related requires BuildRequires: checkpolicy, selinux-policy-devel Requires(post): 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 %setup -q -n %{name}-%{version} %check ctest3 -V %{?_smp_mflags} %build mkdir -p build cd build %cmake3 -DINIT_FLAVOR=systemd -DCONFIG_DIR=%{_sysconfdir}/sysconfig -DSYSD_UNIT_DIR=%{_unitdir} \ -DGENERATE_SRS_SECRET=OFF -DCHROOT_DIR=%{_sharedstatedir}/%{name} .. make %{?_smp_mflags} cd - cd selinux make -f /usr/share/selinux/devel/Makefile cd - %install %make_install install -d %{buildroot}%{_sharedstatedir}/%{name} install -D selinux/%{name}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}.pp %pre 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 semodule -u %{_datadir}/selinux/packages/%{name}.pp fixfiles -R %{name} restore || : %systemd_post postsrsd.service %postun %systemd_postun_with_restart postsrsd.service if [ "$1" -lt "1" ]; then #Final uninstall semodule -r %{_datadir}/selinux/packages/%{name}.pp fixfiles -R %{name} restore || : fi %files %config(noreplace) %{_sysconfdir}/sysconfig/postsrsd %{_unitdir}/postsrsd.service %{_sbindir}/postsrsd %{_datadir}/selinux/packages/%{name}.pp %{_datadir}/postsrsd %doc %{_defaultdocdir}/postsrsd %doc %{_mandir}/man8/postsrsd.8.gz %attr(700, nobody, nobody) %dir %{_sharedstatedir}/%{name} %changelog * 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