Big Picture: I am building an in-house rpm for a customized php. I build an rpm which works, but generate library requirements that I can't seem to meet without using 'nodeps', which I want to avoid to ensure other requirements are met in future usage.

The cause of This Problem: (As usual in linux it comes down to proprietary software)... is the Oracle client library. The RPM I built for it is not registering its 'provide' correctly so that RPM understands that it provides this library capability.

%setup -q -n %{shortname}-%{version}


mkdir -p %{buildroot}/%{prefix}
mkdir -p %{buildroot}/%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d

cp -a %{_builddir}/%{shortname}-%{version} %{buildroot}/%{prefix}/

%{__install} -m 644 -p %{SOURCE1} \
echo %{prefix}/%{shortname}-%{version}>%{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
rm -fv /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname}
ln -sv %{prefix}/%{shortname}-%{version} /opt/
ln -sv /opt/%{shortname}-%{version} /opt/%{shortname}
ln -sv %{prefix}/%{shortname}-%{version} /thisDir/
ln -sv /thisDir/%{shortname}-%{version} /thisDir/%{shortname}
chown -h user:user /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname}

rm -rf %{buildroot}


%post -p /sbin/ldconfig

rm -f /%{_sysconfdir}/profile.d/%{name}.sh /%{_sysconfdir}/ld.so.conf.d/%{name}.conf
rm -rfv /opt/%{shortname}-%{version} /opt/%{shortname} /thisDir/%{shortname}-%{version} /thisDir/%{shortname} %{_sysconfdir}/profile.d/%{source1}
rm -rf %{prefix}/%{shortname}-%{version}
rm -fv /opt/%{shortname}-%{version}
rm -fv /opt/%{shortname}
rm -fv /thisDir/%{shortname}-%{version}
rm -fv /thisDir/%{shortname}
rm -fv %{_sysconfdir}/profile.d/%{name}.sh

Most of this is just script providing symlinks we use for standard locations across our environment; the functional part is the ldconfig. What am I doing wrong to ensure that rpmbuild picks up the 'provides'? I'm having a very hard time finding documentation on how this works in contemporary rpmbuild in Cent6.

1 Answer 1


You are trying to automatically add the soname of an Oracle library as a Provide: of this package?

The very simplest method is just to type in the Provides: directly in the *.spec file.

If you wish to automate the extraction, you can use rpmdeps to extract the soname dependencies like this:

$ echo /lib64/libpopt.so.0.0.0 | /usr/lib/rpm/rpmdeps -P

Execute the above within a %(…) pipe like this in your *.spec file:

Provides: %(echo /lib64/libpopt.so.0.0.0 | /usr/lib/rpm/rpmdeps -P)

Change the paths to your Oracle libraries as appropriate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .