%global sysuser dkimpy-milter %global sysgroup dkimpy-milter Name: dkimpy-milter Version: 1.1.4 Release: 1%{?dist} Summary: DKIM signing/verifying milter for Postfix/Sendmail License: GPLv2+ URL: https://launchpad.net/dkimpy-milter Source0: %pypi_source Source1: %{name}-tmpfiles.conf BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: systemd-rpm-macros Requires: python3dist(authres) >= 1.1.0 Requires: python3dist(dkimpy) >= 0.7 Requires: python3dist(dnspython) Requires: python3dist(pymilter) Requires: python3dist(pynacl) Requires: python3dist(setuptools) Requires(pre): shadow-utils %description Domain Keys Identified Mail (DKIM) signing and verifying milter for Postfix/Sendmail. %prep %autosetup -n %{name}-%{version} # Remove bundled egg-info. rm -rf %{name}.egg-info %build %py3_build %install %py3_install # Update system paths to match Fedora's system paths. # NOTE: In the future, we should be able to specify different system paths by # passing parameters to setup.py: # https://bugs.launchpad.net/dkimpy-milter/+bug/1851804. # Move dkim-milter.conf to the correct location. mkdir -p %{buildroot}%{_sysconfdir} mv %{buildroot}/usr%{_sysconfdir}/dkimpy-milter.conf %{buildroot}%{_sysconfdir}/ # Remove SysV init file since Fedora uses systemd. rm %{buildroot}/usr%{_sysconfdir}/init.d/dkimpy-milter # Update paths in systemd unit file. sed -i 's|/usr/local/bin|/usr/bin|' %{buildroot}%{_unitdir}/%{name}.service sed -i 's|/usr/local/etc|/etc|' %{buildroot}%{_unitdir}/%{name}.service # Configure tmpfiles.d for managing files under /run. mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf # Create directory under /run. install -d -m 0755 %{buildroot}/run/%{name}/ %pre getent group %{sysgroup} >/dev/null || groupadd -r %{sysgroup} getent passwd %{sysuser} >/dev/null || \ useradd -r -g %{sysuser} -d /run/%{name} -s /sbin/nologin \ -c "dkimpy-milter's system user" %{sysuser} exit 0 %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license COPYING %doc README %{_bindir}/%{name} %{_sysconfdir}/%{name}.conf %{_unitdir}/%{name}.service %dir /run/%{name} %{_tmpfilesdir}/%{name}.conf %{python3_sitelib}/dkimpy_milter %{python3_sitelib}/dkimpy_milter-%{version}-py?.?.egg-info %{_mandir}/man5/%{name}.conf.5.gz %{_mandir}/man8/%{name}.8.gz %changelog * Thu Jan 02 2020 Tadej Janež - 1.1.4-1 - Initial package