Re: Conditional installing of files from RPM based on REDHAT version.

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

 



JEFFREY.H.PARKER@xxxxxxxx (Jeff Parker) writes:

> I need to install files from an RPM based on the version of Redhat
> Linux running on that machine.  How can I best determine the version
> (Kernel?) and install or NOT install a file based on that version.  My
> situation is that my RPM may be installed on RH 7.3 or Enterprise 3.0
> or 4.0.  If it's Enterprise 3.0, I have a special library I need
> installed but that library will cause the installation to fail on
> RH7.3 due to a failed dependency of this library on other Entreprise
> libraries NOT found on RH7.3.  I don't want to make separate RPMs for
> each RH version.  I also don't want to use '--nodeps' because that
> would be global for all files being installed.

One suggestion would be to build the binary rpms from the same source
rpm but adding distribution-specific information into the build
procedure.  You may also want to do something so that the resultant
binary rpm has a name which includes the distribution (something like
a .rh73 or .rhel3 Release: suffix).

You will need to build on both distributions, but IMO this is the only
safe way to do things as the various system library dependencies may
be different and this may cause you problems if you try to build only
on the "older platform" and hope it works on the newer one.

you can set up a various %defines which use the %() macro to check the
output of rpm -q redhat-release and convert it into a value you can
use elsewhere.  That's how most people create rpms to work on more
than one distribution.

Simon


[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