Optional %files support - (A or B or C)

Lukasz Stelmach l.stelmach at samsung.com
Thu Oct 21 12:05:40 UTC 2021


It was <2021-10-20 śro 16:51>, when Graham Leggett wrote:
> Hi all,
>
> 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?

-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20211021/b86362db/attachment.asc>


More information about the Rpm-list mailing list