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

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

 



Jeff Parker wrote:
> I need to install files from an RPM based on the version of Redhat Linux 
> running on that machine.

Ugh.  That is a problem.

> How can I best determine the version (Kernel?) 

Don't count on the kernel.  Many, many sites have equipment that needs
a special kernel driver.  Therefore they build their own kernel but
otherwise have a stock system.

It would probably be better to use the contents of
/etc/redhat-release.  But even better you should simply test for the
condition specifically that you are looking for.

> 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.

So I would look at the dependencies of the library and install your
secondary library based upon that and not the version of the OS.

  case $(ldd /usr/lib/libz.so.1) in
    ...) ...

> 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.

Since there is no conditional installation with the contents of the
rpm package I think your only recourse is to *not* package it in the
%files section in the actual location.  Instead put it off to the side
such as in /usr/lib/packagename/libname.so and then handle installing
it manually to %{_libdir} in the %post and %postun sections.  In the
post copy it into place from your private area conditionally depending
upon the system conditions.  In the postun remove it.

I suggest you add a %verify script to to check files that you handle
manually.

Bob


[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