Fedora Linux Support Community & Resources Center
  #1  
Old 16th May 2011, 03:10 PM
gbuergisser Offline
Registered User
 
Join Date: Jun 2008
Location: Switzerland
Age: 40
Posts: 21
linuxfedorafirefox
How to install symbolic links via RPM?

Hi all,

I'm trying to build a RPM package consisting of some .so files and some symbolic links pointing to these .so files. Just like "libxyz-2.9.so -> libxyz-2.9.so.1".

In the .spec file all the files and symbolic links are explicitly listed in the %files section. When manually extracting the files from the RPM with rpm2cpio the symbolic links are extracted correctly. But when I install the RPM using yum the files pointed to by the symbolic link will be installed instead of the symbolic link!

What am I doing wrong?

Thanks for your help!
Reply With Quote
  #2  
Old 16th May 2011, 04:19 PM
PabloTwo's Avatar
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: How to install symbolic links via RPM?

Here is what worked for me to make a relative symbolic link (using your example as an example).
In the %install section of the spec file:

ln -s libxyz-2.9.so.1 $RPM_BUILD_ROOT%{_libdir}/libxyz-2.9.so > /dev/null 2>&1 || :

The above assumes the target shared object file (libxyz-2.9.so.1) is in %{_libdir} and puts the symlink (libxyz-2.9.so) to it in that directory.
Reply With Quote
  #3  
Old 30th June 2011, 09:10 AM
mschwendt's Avatar
mschwendt Offline
Registered User
 
Join Date: Jun 2010
Posts: 246
linuxfirefox
Re: How to install symbolic links via RPM?

Show the verbose RPM file list of your built package. Use "rpm -qlvp ..." (possibly just "rpmls -v ...").

Packaging symlinks works for thousands of packages in the Fedora package collection, so don't let us guess what mistake you may have inserted into your spec file.

@ Pablo
Quote:
ln -s libxyz-2.9.so.1 $RPM_BUILD_ROOT%{_libdir}/libxyz-2.9.so > /dev/null 2>&1 || :
The " > /dev/null 2>&1 || :" is a bad idea, however, since it would be bad packaging practice to hide the output and to ignore the error return value. Just create the softlink and let the build fail if there is an error. Optionally avoid wildcards in the %files section for the library file names, so it will also fail to build if the lib version changes (and the SONAME has changed very likely, too), which forces you to learn about this.
Reply With Quote
Reply

Tags
install, links, rpm, symbolic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using symbolic links in /var/ftp/ with vsftpd Stone Dragon Servers & Networking 3 13th December 2007 08:56 PM
Another F8 Install Issue: Symbolic Links stepher Installation and Live Media 5 4th December 2007 09:36 PM
Symbolic links ajamison Using Fedora 3 5th May 2007 04:16 AM
FC5 apache and symbolic links Knudson Servers & Networking 0 24th June 2006 10:10 AM
Symbolic links. mattmns Using Fedora 6 16th March 2005 04:54 AM


Current GMT-time: 09:08 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat