2012-07-17 23:05:08

Oracle Instant Client RPM failure

Oracle provides its own RPM packages for e.g. Red Hat Enterprise Linux. But some packages are faulty because they don't "provide" libs they contain and therefore cannot fullfill requirements other packages have. Here's an example:

Apparently the Oracle RPM package builders switched the "AutoProv" tag in the spec file off. This is easy to fix if you know how a spec file should look like and how packages are built. But let me show you a nice tool: rpmrebuild. With this tool you can rebuild RPM packages from binary packages, reconstruct spec file from binary packages and much more. You can rebuild the oracle packages with i.e.

With turning AutoProv and AutoReq on you can build the oracle package without the "requires" error shown above.

But stop! There are some more enhancements which could be done. You can provide an entry in /etc/ld.so.conf.d for the dynamic loader. And then there is a small bug left - at least in some oracle instant client packages version 10: The libs and binaries have the flag for executable stack set which can cause trouble when using SELinux.

I took the spec file extracted with rpmrebuild and made many changes. The libs and binaries of the oracle package did I store in a tgz archive:

As you can see there was libstdc++-33 installed as requirement for the oracle libs - this was also broken in the original oracle package. The custom php package which required libclntsh.so could also be installed without error. As a last test I did compare an original package installation and the new package installation for "SELinux compatibility". Old package install: