2

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.

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

%build

%install
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} \
   $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/oracle-instantclient.sh
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}

%clean
rm -rf %{buildroot}

%files
###%defattr(-,root,root,0755)
%{prefix}/%{shortname}-%{version}
/%{_sysconfdir}/profile.d/%{name}.sh
/%{_sysconfdir}/ld.so.conf.d/%{name}.conf

%post -p /sbin/ldconfig

%postun
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}
ldconfig
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
/sbin/ldconfig

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.

3

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
libpopt.so.0()(64bit)
libpopt.so.0(LIBPOPT_0)(64bit)

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.