void-packages/srcpkgs/libfetch/patches/soname.patch

43 lines
1.4 KiB
Diff

--- Makefile.orig 2015-02-16 10:55:42.669519299 +0100
+++ Makefile 2015-02-16 10:58:21.278068828 +0100
@@ -1,5 +1,7 @@
prefix = /usr
DESTDIR =
+MAJOR = 2
+MINOR = 34
FETCH_WITH_INET6 = true
FETCH_WITH_OPENSSL = true
@@ -41,25 +43,27 @@ httperr.h: http.errors Makefile errlist.
libfetch.so: $(GEN) $(INCS) $(OBJS)
rm -f $@
- $(CC) $(LDFLAGS) $(OBJS) $(LDADD) -shared -fPIC -o $@
+ $(CC) $(LDFLAGS) $(OBJS) $(LDADD) -shared -fPIC -Wl,-soname=$@.$(MAJOR) -o $@.$(MAJOR).$(MINOR)
libfetch.a: $(GEN) $(INCS) $(OBJS)
rm -f $@
$(AR) rcs $@ $(OBJS)
clean:
- rm -f libfetch.so libfetch.a *.o $(GEN)
+ rm -f libfetch.so* libfetch.a *.o $(GEN)
.PHONY: clean
install: all
- $(INSTALL) -m 755 libfetch.so $(DESTDIR)$(prefix)/lib/libfetch.so
+ $(INSTALL) -m 755 libfetch.so.$(MAJOR).$(MINOR) $(DESTDIR)$(prefix)/lib/libfetch.so.$(MAJOR).$(MINOR)
+ ln -s libfetch.so.$(MAJOR).$(MINOR) $(DESTDIR)$(prefix)/lib/libfetch.so.$(MAJOR)
+ ln -s libfetch.so.$(MAJOR).$(MINOR) $(DESTDIR)$(prefix)/lib/libfetch.so
$(INSTALL) -m 644 libfetch.a $(DESTDIR)$(prefix)/lib/libfetch.a
$(INSTALL) -m 644 fetch.h $(DESTDIR)$(prefix)/include/fetch.h
$(INSTALL) -m 644 fetch.3 $(DESTDIR)$(prefix)/share/man/man3/fetch.3
.PHONY: install
uninstall:
- rm -f $(DESTDIR)$(prefix)/lib/libfetch.so
+ rm -f $(DESTDIR)$(prefix)/lib/libfetch.so*
rm -f $(DESTDIR)$(prefix)/lib/libfetch.a
rm -f $(DESTDIR)$(prefix)/include/fetch.h
rm -f $(DESTDIR)$(prefix)/share/man/man3/fetch.3