Description: Fix SONAME setting for the shared library
 Upstream introduced a versioned SONAME, however the makefile still called the
 linker with the generic libliquid.so name as the argument for -soname. Fix that
 and the installation of the file, and don't create the files with the software
 release number.
Author: Andreas Bombe <aeb@debian.org>
Last-Update: 2023-01-05
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/makefile.in
+++ b/makefile.in
@@ -47,6 +47,7 @@
 BUGREPORT	:= @PACKAGE_BUGREPORT@
 AR_LIB		:= @AR_LIB@
 SH_LIB		:= @SH_LIB@
+SOVERSION	:= 1
 
 # paths
 prefix		:= @prefix@
@@ -1245,6 +1246,7 @@
 # Shared library targets
 ARCHIVE_LIB	= libliquid.${AR_LIB}
 SHARED_LIB	= libliquid.${SH_LIB}
+SHARED_LIB_VERS	= ${SHARED_LIB}.${SOVERSION}
 
 #
 # darwin
@@ -1263,11 +1265,11 @@
 	${AR} r $@ $^
 	${RANLIB} $@
 
-libliquid.so : libliquid.a
+$(SHARED_LIB_VERS) : libliquid.a
 	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive $(LIBS)
 
 # static archive and library objects
-all: ${ARCHIVE_LIB} ${SHARED_LIB}
+all: ${ARCHIVE_LIB} ${SHARED_LIB_VERS}
 
 ##
 ## TARGET : help      - print list of targets
@@ -1287,11 +1289,9 @@
 	@echo ""
 	mkdir -p $(DESTDIR)$(prefix)/include/liquid
 	mkdir -p $(DESTDIR)$(libdir)
-	install -m 644 -p libliquid.${AR_LIB} $(DESTDIR)$(libdir)/libliquid.${AR_LIB}.${VERSION}
-	install -m 644 -p libliquid.${SH_LIB} $(DESTDIR)$(libdir)/libliquid.${SH_LIB}.${VERSION}
+	install -m 644 -p ${ARCHIVE_LIB} ${SHARED_LIB_VERS} $(DESTDIR)$(libdir)
 	install -m 644 -p include/liquid.h $(DESTDIR)$(prefix)/include/liquid/liquid.h
-	ln -sf libliquid.${SH_LIB}.${VERSION} $(DESTDIR)$(libdir)/libliquid.${SH_LIB}
-	ln -sf libliquid.${SH_LIB}.${VERSION} $(DESTDIR)$(libdir)/libliquid.${SH_LIB}.1
+	ln -sf ${SHARED_LIB_VERS} $(DESTDIR)$(libdir)/${SHARED_LIB}
 	@echo ""
 	@echo "---------------------------------------------------------"
 	@echo "  liquid-dsp was successfully installed.     "
@@ -1314,10 +1314,9 @@
 uninstall:
 	@echo "uninstalling..."
 	$(RM) $(DESTDIR)$(prefix)/include/liquid/liquid.h
-	$(RM) $(DESTDIR)$(libdir)/libliquid.${AR_LIB}.${VERSION}
-	$(RM) $(DESTDIR)$(libdir)/libliquid.${SH_LIB}.${VERSION}
-	$(RM) $(DESTDIR)$(libdir)/libliquid.${SH_LIB}.1
-	$(RM) $(DESTDIR)$(libdir)/libliquid.${SH_LIB}
+	$(RM) $(DESTDIR)$(libdir)/${ARCHIVE_LIB}
+	$(RM) $(DESTDIR)$(libdir)/${SHARED_LIB}
+	$(RM) $(DESTDIR)$(libdir)/${SHARED_LIB_VERS}
 	@echo "done."
 
 ##
