SCIENTIFIC-LINUX-USERS Archives

July 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Stodola <[log in to unmask]>
Reply To:
Mark Stodola <[log in to unmask]>
Date:
Fri, 15 Jul 2011 15:59:44 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (98 lines)
Andrew Z wrote:
> On Fri, Jul 15, 2011 at 3:41 PM, Phil Perry <[log in to unmask] 
> <mailto:[log in to unmask]>> wrote:
>
>     On 15/07/11 19:54, Andrew Z wrote:
>
>         On Fri, Jul 15, 2011 at 2:42 PM, Phil Perry<[log in to unmask]
>         <mailto:[log in to unmask]>>  wrote:
>
>             On 15/07/11 19:28, Andrew Z wrote:
>
>
>         <Skip>
>
>             You need to have your SPEC file create the symlinks in the
>             buildroot so that
>             they are a part of the package, i.e, the symlinks are
>             owned by the rpm
>             package. Then when you uninstall or update the package rpm
>             will
>             remove/update the symlinks for you rather than leave them
>             dangling as per
>             your example above.
>
>             Take a look in any relevant package SPEC file from the
>             distro for examples
>             of how this should be handled.
>
>
>         Phil,
>          thank you. That's what i thought and i took a look @
>         glibc-2.3.4-2.54.src.rpm. I didn't notice any of the
>         functionality you
>         mentioned, which prompted me to write the email.
>
>         another question is :
>          do i explicitly add the file.version to the %files section
>          or just
>         mention the link ?
>
>         Thank you
>         Andrew
>
>
>     To summarize,  lib_andrew-123.rpm installs the file
>     lib_andrew.so.123 and creates a symlink to it called lib_andrew.so
>
>     Here is how I would handle it:
>
>     # make the libdir directory in the buildroot
>     %{__mkdir_p} %{buildroot}/path/to/libdir/
>
>     # then install the lib
>     %{__install} -p -m 0755 lib_andrew.so.123 %{buildroot}/path/to/libdir/
>
>     # then create the symlink(s) as necessary
>     %{__ln_s} lib_andrew.so.123 %{buildroot}/path/to/libdir/lib_andrew.so
>
>
>     You must also make sure /path/to/libdir is on the ldconfig path if
>     you have installed to a non-standard path - if not, add it like so:
>
>     %{__mkdir_p} %{buildroot}%{_sysconfdir}/ld.so.conf.d/
>     echo /path/to/libdir >
>     %{buildroot}%{_sysconfdir}/ld.so.conf.d/lib_andrew.conf
>
>     but if you can, it's far easier to just install to /usr/lib(64)
>
>     Finally, in %post run /sbin/ldconfig
>
>     Your %files section then needs to include all of the above.
>
>     Hope that helps
>
>
> Phil this is very helpful indeed. But the links are created by "make" 
> not by mr (rpm).  So how should we go around this?
>  
> Andrew
>
If I'm not mistaken, you should not need to manually link libraries.  
ldconfig should be taking care of this for you, so all you would need is 
the %post entry to run ldconfig with the proper flags after 
install/upgrade/removal.  Assuming it ends up in a standard path, 
otherwise the ld.so.conf entries are needed as well.

-Mark

-- 
Mr. Mark V. Stodola
Digital Systems Engineer

National Electrostatics Corp.
P.O. Box 620310
Middleton, WI 53562-0310 USA
Phone: (608) 831-7600
Fax: (608) 831-9591

ATOM RSS1 RSS2