From 9967419b85ed38a8ecb433953910764c1dfcacb9 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Apr 17 2024 09:05:18 +0000 Subject: Add compat sbin Provides In preparation for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin. About a dozen packages require /usr/sbin/sendmail. php-phpmailer6 has BuildRequires: /usr/sbin/smtp-sink. Also, use macro instead of hardcoding "sbindir", so that it becomes /usr/bin automatically when the macro definition is updated. --- diff --git a/postfix.spec b/postfix.spec index e135a68..14e0cba 100644 --- a/postfix.spec +++ b/postfix.spec @@ -143,6 +143,14 @@ BuildRequires: libnsl2-devel Requires: %{name}-lmdb%{?_isa} = %{epoch}:%{version}-%{release} %endif +%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 +Provides: /usr/sbin/smtp-sink +%endif + %description Postfix is a Mail Transport Agent (MTA). @@ -474,9 +482,7 @@ rm -f $RPM_BUILD_ROOT%{postfix_config_dir}/aliases # create /usr/lib/sendmail mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib -pushd $RPM_BUILD_ROOT%{_prefix}/lib -ln -sf ../sbin/sendmail.postfix . -popd +ln -sf --relative $RPM_BUILD_ROOT%{_sbindir}/sendmail.postfix $RPM_BUILD_ROOT%{_prefix}/lib/ mkdir -p $RPM_BUILD_ROOT%{_var}/lib/misc touch $RPM_BUILD_ROOT%{_var}/lib/misc/postfix.aliasesdb-stamp