Discussion:
New to RPMs - Dependencies in my own rpm
Linux
2008-01-27 16:02:30 UTC
Permalink
_______________________________________________
Rpm-list mailing list
Rpm-***@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
Jeff Johnson
2008-01-27 19:01:26 UTC
Permalink
I am attempting to create an RPM with a binary and a dependent
shared library.
%files
/mypath/bin
/mypath/lib
myprog
In the library, is my library plus links to the library
mylib.so.2.1.1 (actually library)
mylib.so (link to the library)
When I try to install the rpm, it says that mylib.so is required by
the rpm to install, but it is in the rpm.
If I querry the package to see what it provides, it provides
mylib.so.2.1.1
But the link is what is "needed" by the package. How do I get the
rpm to know that it also provides the link? Or am I linking the
executable incorrectly?
The very simplest answer is just add
Provides: mylib.so
to the spec file, build, and see whether the installed package "works".

Usually the DT_SONAME (run readelf -a on the library) is what is
"provided"
for the DT_NEEDED (run readelf -a on the executable) for the
"required" symbol.

The soname used is usually mylib.so.2.1.1 not mylib.so.

73 de Jeff
Tim Mooney
2008-01-27 22:40:23 UTC
Permalink
I am attempting to create an RPM with a binary and a dependent shared
library.
 
%files
/mypath/bin
/mypath/lib
 
myprog
 
In the library, is my library plus links to the library
mylib.so.2.1.1 (actually library)
mylib.so (link to the library)
 
When I try to install the rpm, it says that mylib.so is required by the
rpm to install, but it is in the rpm.
 
If I querry the package to see what it provides, it provides
mylib.so.2.1.1
 
But the link is what is "needed" by the package. How do I get the rpm to
know that it also provides the link? Or am I linking the executable
incorrectly?
It's more likely you're building the library incorrectly. Does your
library have a SONAME? If not, you need to build it so that is has one,
and then relink myprog. That will probably fix the issue you're having.

Basically, running

ldd myprog

and

objdump -p mylib.so.2.1.1 | egrep SONAME

should both agree for mylib.

Tim
--
Tim Mooney ***@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
Loading...