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
For the symbolic links to libraries I could find on my system, the links were all relative, and not absolute:
So, it looks like the Makefile should do a
cd
to the library folder and make relative symbolic links: