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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21 Oct 2021, at 14:05, Lukasz Stelmach <l.stelmach@xxxxxxxxxxx> 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

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux