rpm-software-management / spec-cleaner

spec-cleaner
BSD 3-Clause "New" or "Revised" License
28 stars 34 forks source link

%{_libexecprefix} different on openSUSE and Fedora #232

Closed toabctl closed 6 years ago

toabctl commented 6 years ago

The openstack/rpm-packaging project got recently some lint failures (using spec-cleaner) like:

-%dir %{_prefix}/lib/monasca
-%{_prefix}/lib/monasca/agent
+%dir %{_libexecdir}/monasca
+%{_libexecdir}/monasca/agent

On openSUSE Tumbleweed, I get:

$ rpmspec --eval '%{_libexecdir}'
/usr/lib

But according to Fedoras doc, it is:

%{_prefix}            /usr
%{_exec_prefix}       %{_prefix}
%{_libdir}            %{_exec_prefix}/%{_lib}
%{_libexecdir}        %{_exec_prefix}/libexec
scarabeusiv commented 6 years ago

This is correct behaviour.

If you install stuff to /usr/lib on Fedora then you screwed up, they don't allow /usr/lib.

scarabeusiv commented 6 years ago

And actually it seems the fedora installs the pyton stuff to /usr/lib, but some to libexec.

scarabeusiv commented 6 years ago

Solution to fix this would be to detect if _libexecdir on the spec-cleaner side evals to the /usr/lib prior the replacements.

scarabeusiv commented 6 years ago

Added an option to change this behaviour as needed.

Conan-Kudo commented 6 years ago

The correct answer here is that if it's not actually LIBEXECDIR, then don't call it %_libexecdir, but that's hard for spec-cleaner to divine.