Name: postsrsd Version: 1.4 Release: 3%{?dist} Summary: PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix. Group: System Environment/Daemons License: GPLv2+ URL: https://github.com/roehling/postsrsd Source0: https://github.com/roehling/%{name}/archive/%{version}.tar.gz Source1: postsrsd.init Source2: postsrsd.sysconfig BuildRequires: cmake BuildRequires: help2man Requires: coreutils Requires: postfix BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} %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 %check ctest -V %{?_smp_mflags} %build mkdir -p build cd build %cmake -DINIT_FLAVOR=systemd -DCONFIG_DIR=%{_sysconfdir}/sysconfig -DGENERATE_SRS_SECRET=OFF -DCHROOT_DIR=%{_sharedstatedir}/%{name} .. make %{?_smp_mflags} %install %make_install %{__mkdir_p} %{buildroot}%{_initrddir} %{__install} -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/%{name} %{__mkdir_p} %{buildroot}%{_sysconfdir}/sysconfig %{__install} -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{__mkdir_p} %{buildroot}%{_var}/lib/%{name} %{__rm} %{buildroot}/etc/systemd/system/postsrsd.service %clean %{__rm} -rf %{buildroot} %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 %post chkconfig --add %{name} chkconfig %{name} on %postun if [ -f "%{_sysconfdir}/postsrsd.secret" ]; then rm -f "%{_sysconfdir}/postsrsd.secret" fi %files %defattr(-,root,root,-) %doc README.md main.cf.ex %doc %{_defaultdocdir}/postsrsd %doc %{_mandir}/man8/postsrsd.8.gz %config(noreplace) %{_sysconfdir}/sysconfig/postsrsd %{_initrddir}/%{name} %{_sbindir}/%{name} %attr(700, nobody, nobody) %{_var}/lib/%{name} %changelog * Sat Jun 04 2016 Thomas Vander Stichele - Adapted from CentOS 7 version - pulled in sysconfig/init scripts from http://repo.mailserver.guru/6/x86_64/Packages/postsrsd-1.0.1-1.el6.x86_64.rpm * 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 * Tue Dec 31 2013 Time OS - 0.1 - Initial - Built from upstream version.