On 29 April 2016 at 22:00, Heyman, Jerrold <Jerrold.Heyman@xxxxxxx> 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@xxxxxxx / 919.597.7812 |
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list
_______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxxxxx http://lists.rpm.org/mailman/listinfo/rpm-list