single RPM for all distros?

Craig Ringer craig at 2ndquadrant.com
Fri Apr 29 14:35:50 UTC 2016


On 29 April 2016 at 22:00, Heyman, Jerrold <Jerrold.Heyman at emc.com> wrote:

> I’m pretty sure I know the answer, but is there a way to have a single
> product RPM that can be installed on multiple distros?
>

Not a binary package, no.

You can have a single SRPM that can be rebuilt, though, if you write the
spec with care. You can included various patches/sources for all targets
and conditionally use them depending on what the srpm is being rebuilt
on/for.


> Specifically, I need to ‘Require’ the libraries for FUSE, but on RHEL the
> name is ‘fuse-libs’, on SuSE the name is libfuse, on Mageia it is lib64fuse.
>

Where possible, test for a Provides: rather than the package name its self.
There's no guarantee all distros use the same Provides: for a package, but
it's more common at least.


> Is there a way to write conditional ‘Requires’??
>

Use %if directives to test distro and version macros.

An example from a package I maintain:

%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  perl(ExtUtils::MakeMaker)
%else
BuildRequires:  perl-ExtUtils-Embed
BuildRequires:  perl(ExtUtils::MakeMaker)
%endif
%if 0%{?fedora} >= 22
BuildRequires:  perl-ExtUtils-Embed
BuildRequires:  perl(ExtUtils::MakeMaker)
%endif





>
>
> Jerry Heyman                           |
>
> Principal Software Engineer            |    Software is the difference
>
> EMC Data Domain                        |    between hardware and reality
>
> Jerrold.Heyman at emc.com / 919.597.7812  |
>
>
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-list
>
>


-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20160429/d25046f3/attachment.html>


More information about the Rpm-list mailing list