[lug] rpm spec: ldconfig-symlink

D. Stimits stimits at comcast.net
Sun Jul 17 18:31:30 MDT 2005


David L. Anselmi wrote:
> D. Stimits wrote:
> [...]
> 
>> ldconfig does have an option to create sym links. It appears it sym 
>> links the physical/real file name to the soname. I can't find how this 
>> differs from ln -s, except that (a) it might be safer than loading ln 
>> in a script, and (b) it automatically chooses the soname.
> 
> 
> I didn't use any options.  It made symlinks.  Another difference from ln 
> -s is that ldconfig updates the library cache the loader uses.
> 
>> ldconfig -l does indeed do fewer sym links, and without the -l, it 
>> does not make any sym links.
> 
> 
> That wasn't my experience, I didn't use -l.

Did you name the particular lib file? I've never seen ldconfig create 
any sym links without optional arguments. I'm assuming you meant 
ldconfig with the lib file name as an argument. So far as I know, no 
fedora/redhat distro has ever created sym links without naming what to link.

>> If rpmlint would accept the sym links, I would be ok with this, but it 
>> doesn't. I have a properly built and linked dynamic library (even the 
>> rpmlint documentation seems to think I used the right options), but 
>> regardless of how I do it, rpmlint claims:
>> <quote>
>>  > rpmlint -i libMyLib-0.0.0-1.i386.rpm
>> E: libMyLib no-ldconfig-symlink /usr/lib/libMyLib.so.0.0.0
>> The package should not only include the shared library itself, but
>> also the symbolic link which ldconfig would produce. (This is
>> necessary, so that the link gets removed by dpkg automatically when
>> the package gets removed.)  If the symlink is in the package, check
>> that the SONAME of the library matches the info in the shlibs
>> file.
>> </quote>
> 
> 
> Do you run rpmlint on the SRPM or the RPM?  Interesting that it tells 
> you that dpkg removes links.

On all. The srpm it has no complaint about. I can install and use the 
binary rpm's just fine as well...only rpmlint has a problem with it. I 
think the dpkg thing is just because people use rpmlint from non-rpm 
distros...this is fedora core 4 though, it has no debian packages on it 
anywhere, the message is more or less just a distraction.

No matter how I create a sym link, rpmlint *always* complains that there 
is none...it can't see the ln instruction, nor can it see the ldconfig 
instruction version. rpmbuild itself dies or complains if I use *actual* 
sym links as if they were files.

> By any chance have you looked at anyone else's SRPMs?  I looked at this 
> one:
> 
> ftp://rpmfind.net/linux/fedora/core/4/SRPMS/tcp_wrappers-7.6-39.src.rpm

I'll look at this one tomorrow. Most of the progress I've made is either 
because of hints from Hugh, or digging through rpm's. I've resorted to 
trying to read source code form rpmlint because other documentation is 
so bad. I ended up trying to read through the parsing code in rpmbuild 
itself, which helped me figure out which directives allow arguments or 
don't, but this is all the help it gave me. Oh, how happy I'd be if rpm 
spec files were XML (with a DTD)!

> and it only seems to use ldconfig for links.  I'm not that smart about 
> how libwrap.so.0.7.6 gets built though.  What does rpmlint say on this 
> package?

On the source rpm it complains (warning only) that the summary ends with 
a period (seems they should not).

If I rebuild the src.rpm, it complains as follows:
# rpmlint -i tcp_wrappers-7.6-39.i386.rpm
W: tcp_wrappers summary-ended-with-dot A security tool which acts as a 
wrapper for TCP daemons.
Summary ends with a dot.

W: tcp_wrappers devel-file-in-non-devel-package /usr/include/tcpd.h
A development file (usually source code) is located in a non-devel
package. If you want to include source code in your package, be sure to
create a development package.

E: tcp_wrappers non-readable /usr/sbin/tcpd 0711
The file can't be read by everybody. If this is normal (for security 
reason), send an
email to <flepied at mandriva.com> to add it to the list of exceptions 
in the next release.

E: tcp_wrappers non-standard-executable-perm /usr/sbin/tcpd 0711
A standard executable should have permission set to 0755. If you get 
this message,
that means that you have a wrong executable permission in your package.

W: tcp_wrappers devel-file-in-non-devel-package /usr/lib/libwrap.so
A development file (usually source code) is located in a non-devel
package. If you want to include source code in your package, be sure to
create a development package.

W: tcp_wrappers devel-file-in-non-devel-package /usr/lib/libwrap.a
A development file (usually source code) is located in a non-devel
package. If you want to include source code in your package, be sure to
create a development package.


I'll check out tomorrow how it deals with the .so options during build 
and spec file for packaging. It could be though that it simply packages 
the real file name as an exact match to the soname. Obviously rpmlint 
was not high on the priority of tcpwrappers packaging though.

D. Stimits, stimits AT comcast DOT net



More information about the LUG mailing list