LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File libss7-1.0.2-SONAME.patch of Package libss7 (Project network:telephony)

Last-Updated-By: Jan Engelhardt <jengelh@medozas.de>
Last-Updated-Date: 2011-10-05 00:05:29.145938780 +0200
Upstream: ?

build: use proper SO versioning

1.0 is not a commonly-encountered variant, and whoever uses it
probably has not understood SO versioning. (libpri, from which
the comment was copied in part does, for example, not.)
Use a simple integer, so people can't do anything wrong.

---
 Makefile |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Index: libss7-1.0.2/Makefile
===================================================================
--- libss7-1.0.2.orig/Makefile
+++ libss7-1.0.2/Makefile
@@ -4,13 +4,18 @@ AWK=awk
 
 OSARCH=$(shell uname -s)
 
+# SOVER version; should be changed on every ABI change
+# please don't change it needlessly; it's perfectly fine to have a SOVER
+# of 1 and a version of 1.4.x
+SOVER:=1
+
 INSTALL_PREFIX=$(DESTDIR)
 INSTALL_BASE=/usr
 libdir?=$(INSTALL_BASE)/lib
 STATIC_OBJS=mtp2.o ss7_sched.o ss7.o mtp3.o isup.o version.o
 DYNAMIC_OBJS=mtp2.o ss7_sched.o ss7.o mtp3.o isup.o version.o
 STATIC_LIBRARY=libss7.a
-DYNAMIC_LIBRARY=libss7.so.1.0
+DYNAMIC_LIBRARY=libss7.so.$(SOVER)
 CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC
 LDCONFIG_FLAGS=-n
 SOFLAGS=-Wl,-hlibss7.so.1
@@ -37,7 +42,7 @@ MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$
 	$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
 
 clean:
-	rm -f *.o *.so *.lo *.so.1 *.so.1.0
+	rm -f *.o *.so *.lo *.so.*
 	rm -f parser_debug ss7linktest ss7test $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
 	rm -f .*.d
 
@@ -46,7 +51,7 @@ install: $(STATIC_LIBRARY) $(DYNAMIC_LIB
 	mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
 	install -m 644 libss7.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
 	install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
-	( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libss7.so.1 libss7.so ; ln -sf libss7.so.1.0 libss7.so.1 )
+	( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libss7.so.$(SOVER) libss7.so)
 	install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
 	if test $$(id -u) = 0; then $(LDCONFIG); fi
 
@@ -57,8 +62,7 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
 $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
 	$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
 	$(LDCONFIG) $(LDCONFIG_FLAGS) .
-	ln -sf libss7.so.1 libss7.so
-	ln -sf libss7.so.1.0 libss7.so.1
+	ln -sf libss7.so.$(SOVER) libss7.so
 
 version.c: FORCE
 	@build_tools/make_version_c > $@.tmp