I am trying for the first time to pack a small library for Debian. To do this, I use the official Debian policy guide, but two days later I ran into a problem that I can’t fix.
So I pack:
- Creating a tarball (here libvl_1.0.orig.tar.gz)
- Using dh_make to create a debian conf file in the debian directory
- Modification of file management, changes and copyright.
- Build a package using the dpkg-buildpackage command.
There are no problems. But since this is a library, I need to create some symbolic links when installing it, which is due to the SONAME library. Here my library is called libvl. So, for example, I create a file called libvl.so.1.0, since this is the first version. To do this correctly, I assume that I should create symbolic links as follows:
libvl.so -> libvl.so.1 -> libvl.so.1.0
To do this, I try to create these links when starting the installation process using make. This works if you run the "make install" command. But when installing with dpkg none if links are created, and I can not understand why. I also tried using a postinst script, but without any results. The following is the makefile:
DESTDIR =
LIBDIR = usr/lib
LIB = libvl.so
MAJOR = 1
MINOR = 0
CC = gcc
CC_FLAGS = -Wall -ansi -Isrc/
LD_FLAGS =
LN = ln -s
SRC = very_long.c
OBJ = $(SRC:.c=.o)
all: libvl
libvl: $(OBJ)
$(CC) -fPIC -c $(SRC)
$(CC) -shared -a -o $(LIBDIR)/$(LIB).$(MAJOR).$(MINOR) $(OBJ)
install:
install -d -m 0755 -o root -g root $(DESTDIR)/$(LIBDIR)
install -m 0755 -o root -g root $(LIBDIR)/$(LIB).$(MAJOR).$(MINOR) $(DESTDIR)/$(LIBDIR)
$(LN) /usr/lib/$(LIB).$(MAJOR).$(MINOR) /usr/lib/$(LIB).1
$(LN) /usr/lib/$(LIB).$(MAJOR) /usr/lib/$(LIB)
clean:
rm $(OBJ) $(LIBDIR)/$(LIB).1.0
I think the problem is there. I would appreciate any answer or comment on this :-)