[Fedora-packaging] RPM conditional based on installed library?

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Dec 11 16:08:05 UTC 2013


On Wed, Dec 11, 2013 at 5:03 PM, John Dennis <jdennis at redhat.com> wrote:
> I'm not sure how to solve the following problem and I'm looking for advice.
>
> I've got a package which uses a configure script (autotools) which
> decides what loadable modules it will build based on what's available
> from the installed libraries [1]. This changes what will appear in the
> %files section. I control what's in the %files via an RPM variable I set
> based on %{?rhel} and %{%fedora} tests.
>
> But basing the conditional on the rhel or fedora version is fragile
> because updates have changed what's available in the library. I'd prefer
> to base the conditional on the library contents just like the configure
> script does. But I'm not really sure how to go about this. I don't
> believe there is any mechanism which would allow me to interrogate the
> contents of config.status from the %build stage which would allow me to
> conditionalize the contents of %files (or is there?).

I can't test this right now, but I'd naively try something like:

%if 0%(grep feature_pattern config.status)
...
%endif

> I suppose I could perform a test equivalent to the one used by configure
> by running a shell command early in the spec file (akin to what we
> currently do to determine the Python library path, etc.)
>
> Are there examples of solving this problem cleanly? Suggestions? Comments?
>
> [1] For the curious the issue is the availability of elliptic curve
> crypto features, something which seems to keep changing and my spec file
> breaks whenever it does.
>
> --
> John
> --
> packaging mailing list
> packaging at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging


More information about the packaging mailing list