# "tools/check-rpm-version.py" ensures that "pypi_version" matches VERSION.txt # and "Version" is derived from it, e.g. "0.14.0.dev0" -> "0.14.0~dev0". %global pypi_version 1.0.0 Name: mailqueue-runner Version: 1.0.0 Release: 1%{?dist} Summary: SMTP client for CLI scripts License: MIT URL: https://github.com/FelixSchwarz/mailqueue-runner Source: %{pypi_source mailqueue_runner %{pypi_version}} Source1: mailqueue-runner.conf Source2: mailqueue-runner.logrotate Recommends: logrotate BuildArch: noarch BuildRequires: python3-devel # The other test dependencies come from the "testutils" extra (see # "%%generate_buildrequires"). The "testing" extra can not be used as it # requires PuzzlePluginSystem which is not packaged for Fedora/EPEL (the plugin # tests are skipped without it). BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest-xdist) Requires(post): %{_sbindir}/alternatives Requires(postun): %{_sbindir}/alternatives Provides: /usr/bin/mail %if "%{_sbindir}" == "%{_bindir}" # Compat symlinks for Requires in other packages. # We rely on filesystem to create the symlinks for us. Requires: filesystem(unmerged-sbin-symlinks) Provides: /usr/sbin/sendmail %endif %global _description %{expand: An SMTP client which provides a robust way to send email messages to an external SMTP server.} %description %_description %prep %autosetup -p1 -n mailqueue_runner-%{pypi_version} rm -rf *.egg-info %if 0%{?rhel} == 9 # hatchling 1.21.1 in EL9 only accepts a table for "license-files" (the list # form came with the final version of PEP 639). Without that key hatchling # still includes "LICENSE.txt" as it matches its default patterns. sed -i '/^license-files\s*=/d' pyproject.toml %endif %generate_buildrequires %pyproject_buildrequires -x testutils %build %pyproject_wheel %install %pyproject_install /usr/bin/install --preserve-timestamps \ --mode=0600 \ -D --target-directory=%{buildroot}%{_sysconfdir} \ %SOURCE1 /usr/bin/mkdir \ --parents \ --mode=0700 \ %{buildroot}%{_localstatedir}/spool/mailqueue-runner/{new,cur,tmp} /usr/bin/mkdir \ --parents \ --mode=0700 \ %{buildroot}%{_localstatedir}/log/mailqueue-runner /usr/bin/install --preserve-timestamps \ --mode=0644 \ -D \ %{SOURCE2} \ %{buildroot}/%{_sysconfdir}/logrotate.d/mailqueue-runner.conf # https://bugzilla.redhat.com/show_bug.cgi?id=1935266 # namespace packages not fully supported ("schwarz/mailqueue" does not work) %pyproject_save_files -l schwarz %check %pytest -n auto %post # set -x restorecon %{_sysconfdir}/mailqueue-runner.conf # using two different alternatives allows the administrator to use some other # software alongside mailqueue-runner. For example "msmtp" provides a "sendmail" # alternative so with two alternatives, we can still provide "/usr/bin/mail". %{_sbindir}/alternatives --install %{_sbindir}/sendmail mta %{_bindir}/mq-sendmail 30 %{_sbindir}/alternatives --install %{_bindir}/mail mail %{_bindir}/mq-mail 30 \ --slave %{_bindir}/mailx mailx %{_bindir}/mq-mail %postun # set -x if [ $1 -eq 0 ] ; then %{_sbindir}/alternatives --remove mta %{_bindir}/mq-sendmail %{_sbindir}/alternatives --remove mail %{_bindir}/mq-mail fi %files -f %{pyproject_files} %doc README.md %config(noreplace) %{_sysconfdir}/mailqueue-runner.conf %dir %{_sysconfdir}/logrotate.d %config(noreplace) %{_sysconfdir}/logrotate.d/mailqueue-runner.conf %{_bindir}/mq-mail %{_bindir}/mq-run %{_bindir}/mq-send-test %{_bindir}/mq-sendmail %ghost %{_bindir}/mail %ghost %{_bindir}/mailx %if "%{_sbindir}" == "%{_bindir}" %ghost %{_bindir}/sendmail %else %ghost %{_sbindir}/sendmail %endif %dir %{_localstatedir}/spool/mailqueue-runner %dir %{_localstatedir}/spool/mailqueue-runner/new %dir %{_localstatedir}/spool/mailqueue-runner/cur %dir %{_localstatedir}/spool/mailqueue-runner/tmp %dir %{_localstatedir}/log/mailqueue-runner %changelog * Wed Oct 07 2026 Felix Schwarz - 1.0.0-1 - update to 1.0.0 * Mon Jun 02 2025 Felix Schwarz - 0.13.1-1 - update to 0.13.1 * Fri Oct 18 2024 Felix Schwarz - 0.13.0-1 - update to 0.13.0 * Sun Sep 15 2024 Felix Schwarz - 0.12.1-1 - update to 0.12.1 * Sun Sep 01 2024 Felix Schwarz - 0.12.0-1 - update to 0.12.0 * Wed Aug 07 2024 Felix Schwarz - 0.11.0-1 - update to 0.11.0 * Mon Aug 05 2024 Felix Schwarz - 0.10.0.20240805-1 - initial spec file