0

I need help in writing a Makefile that installs my library on Linux FHS. https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-dev says that there should be a link from .so to .so.$(version).$(minor) and a link from .so.$(version) to .so to .so.$(version).$(minor). Below is snippet from my Makefile

install -D ${CND_ARTIFACT_PATH_${CONF}} $(DESTDIR)/usr/lib/${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0
ln -s $(DESTDIR)/usr/lib/${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0 $(DESTDIR)/usr/lib/${CND_ARTIFACT_NAME_${CONF}}
ln -s $(DESTDIR)/usr/lib/${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0 $(DESTDIR)/usr/lib/${CND_ARTIFACT_NAME_${CONF}}.$(version)

after packaging with dpkg-buildpackage -rfakeroot -b and installing the package the soft links created are pointing to actual .so used to build the package but not to the .so that was installed in /usr/lib/

gowtham@VBUbu:~$ ls -la /usr/lib/libbase.so.1*
lrwxrwxrwx 1 root root     67 Aug 25 00:35 /usr/lib/libbase.so.1 -> /home/gowtham/Packages/base-1.0/debian/tmp/usr/lib/libbase.so.1.0.0
-rw-r--r-- 1 root root 170588 Aug 25 00:35 /usr/lib/libbase.so.1.0.0
2
  • 1
    Those links are usually relative and not absolute. I think you'll have to cd to the $(DESTDIR)/usr/lib directory and do ln -s ${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0 ${CND_ARTIFACT_NAME_${CONF}}.
    – muru
    Aug 24, 2014 at 20:40
  • @muru It worked! I actually tried it before but I couldn't succeed then due to some other mistake. Anyway I retried after your comment. Thanks.
    – Necktwi
    Aug 24, 2014 at 22:27

1 Answer 1

1

For the symbolic links to libraries I could find on my system, the links were all relative, and not absolute:

lrwxrwxrwx 1 root root       14 Aug  9 03:52 libwine.so -> libwine.so.1.0
lrwxrwxrwx 1 root root       14 Aug  9 03:52 libwine.so.1 -> libwine.so.1.0

So, it looks like the Makefile should do a cd to the library folder and make relative symbolic links:

cd $(DESTDIR)/usr/lib
ln -s ${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0 ${CND_ARTIFACT_NAME_${CONF}}
ln -s ${CND_ARTIFACT_NAME_${CONF}}.$(version).0.0 ${CND_ARTIFACT_NAME_${CONF}}.$(version)
cd -

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .