Optional %files support - (A or B or C)
Graham Leggett
minfrin at sharp.fm
Thu Oct 21 13:31:54 UTC 2021
On 21 Oct 2021, at 14:05, Lukasz Stelmach <l.stelmach at samsung.com> wrote:
>> I am trying to package an Apache module in such a way that it can be built across distributions.
>>
>> The BuildRequires and Requires both work fine as follows:
>>
>> BuildRequires: gcc, pkgconfig(apr-1), pkgconfig(apr-util-1), (httpd-devel or apache-devel or apache2-devel)
>> Requires: (httpd or apache or apache2)
>>
>> My next problem is the %files section. The modules will be installed in one of two locations:
>>
>> (%{_libdir}/apache2/mod_mymodule.so or %{_libdir}/httpd/modules/mod_mymodule.so)
>>
>> Is there a syntax like Requires that can specify a file at location A or B or C?
>>
>> Obviously the workaround is using %if to target certain macros on
>> certain distros, but I've just had one of these macros arbitrarily
>> disappear on a platform, so this is brittle and painful.
>>
>> Is there a better way to do this?
>
> How about defining %{_apache_mod_dir} and using it in the %files
> section?
Alas that just moves the problem elsewhere, it doesn’t solve the problem.
What I’m looking for, like conditional dependencies, is for the ability to say “include files A, B or C, whichever is present”. The details and complexity of what distro has what layout then becomes irrelevant.
Regards,
Graham
—
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20211021/240982b2/attachment.html>
More information about the Rpm-list
mailing list