#10 Add compat sbin Provides
Merged 3 months ago by jskarvad. Opened 3 months ago by zbyszek.
rpms/ zbyszek/postfix bin-sbin-merge  into  rawhide

file modified
+9 -3
@@ -143,6 +143,14 @@ 

  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 @@ 

  

  # 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

In preparation for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin.
About a dozen packages require /usr/sbin/sendmail.

Also, use macro instead of hardcoding "sbindir", so that it becomes
/usr/bin automatically when the macro definition is updated.

Why just:
...
Provides: /usr/sbin/smtp-sink
...

There are more /usr/sbin files like e.g.:
/usr/sbin/smtp-source

The Provides are conditionalized like this because if _sbindir is /usr/sbin, then the don't need the Provides, we get the automatic file provides. We could add it anyway, but it'd be duplicate, which seems kind of ugly. And also, once we decide to drop this compat, it'll be clearly guarded by the conditional.

As to which files are listed: I only included the files that are referred to by Requires in other packages to keep the churn in spec files and the dependency set size down. (It's a small minority of all files of files formerly in /sbin or /usr/sbin).

The following query returned nothing for me in rawhide:

$ LANG=C dnf repoquery --disablerepo=* --enablerepo=rawhide --whatrequires /usr/sbin/smtp-sink
Last metadata expiration check: 4:04:00 ago on Tue Apr 16 18:37:40 2024.

On the other hand:

$ LANG=C dnf repoquery --disablerepo=* --enablerepo=rawhide --whatrequires /usr/sbin/sendmail
Last metadata expiration check: 4:04:21 ago on Tue Apr 16 18:37:40 2024.
BackupPC-0:4.4.0-13.fc40.x86_64
alpine-0:2.26-8.fc40.x86_64
arpwatch-14:3.6-4.fc41.x86_64
asterisk-voicemail-0:18.12.1-1.fc40.7.x86_64
certwatch-mod_ssl-0:1.2-15.fc40.x86_64
condor-0:23.1.0-5.fc40.i686
condor-0:23.1.0-5.fc40.x86_64
fail2ban-sendmail-0:1.0.2-12.fc41.noarch
fvwm-0:2.7.0-10.fc40.x86_64
hylafax+-client-0:7.0.8-1.fc41.i686
hylafax+-client-0:7.0.8-1.fc41.x86_64
mgetty-0:1.2.1-22.fc40.x86_64
quilt-0:0.67-7.fc40.noarch
redhat-lsb-core-0:5.0-0.9.20231006git8d00acdc.fc41.i686
redhat-lsb-core-0:5.0-0.9.20231006git8d00acdc.fc41.x86_64
spamass-milter-0:0.4.0-26.fc40.x86_64
uudeview-0:0.5.20-53.fc39.x86_64
websec-0:1.9.0-36.fc40.noarch
x509watch-0:0.6.1-16.fc40.noarch

That's why I am curious why /usr/sbin/smtp-sink. Am I missing something?

php-phpmailer6 has BuildRequires: /usr/sbin/smtp-sink.

Thanks, good job, that's the query:

LANG=C dnf repoquery --disablerepo=* --enablerepo=rawhide-source --arch=src --whatrequires /usr/sbin/smtp-sink
Last metadata expiration check: 0:01:42 ago on Wed Apr 17 09:35:15 2024.
php-phpmailer6-0:6.9.1-3.fc40.src

Maybe add comment in the spec about it?

rebased onto 9967419

3 months ago

I added the comment to the commit message, next to the comment about /usr/sbin/sendmail.
(I don't like such comments in the spec file, they tend to go stale fairly quickly. It's much better if people use repoquery to check the current state.)

Pull-Request has been merged by jskarvad

3 months ago
Metadata