Fix installation of shared vs static libraries
authorGuillem Jover <guillem@debian.org>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
committerGuillem Jover <guillem@debian.org>
Tue, 31 May 2016 18:38:08 +0000 (19:38 +0100)
Origin: vendor
Forwarded: no
Last-Update: 2007-09-11

Gbp-Pq: Name 02_libdevdir.patch

Makefile
src/Makefile

index 4cedbc9096fe672862cd65f01b5d7823a2395de7..aa4482134826540812eeb72a4cda89fffcc47c33 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,9 +5,11 @@ RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE))
 CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE))
 RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
 
+DESTDIR=
 prefix=/usr
 includedir=$(prefix)/include
 libdir=$(prefix)/lib
+libdevdir=$(prefix)/lib
 
 default: all
 
@@ -15,7 +17,12 @@ all:
        @$(MAKE) -C src
 
 install:
-       @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
+       @$(MAKE) -C src install \
+         DESTDIR=$(DESTDIR) \
+         prefix=$(prefix) \
+         includedir=$(includedir) \
+         libdir=$(libdir) \
+         libdevdir=$(libdevdir)
 
 check:
        @$(MAKE) -C harness check
index ecf5bf8d7147d60549217786f062e2e5f47df3c0..383699147a7e7c4e1d9d0d96edf2a28b6001747c 100644 (file)
@@ -1,6 +1,8 @@
+DESTDIR=
 prefix=/usr
 includedir=$(prefix)/include
 libdir=$(prefix)/lib
+libdevdir=$(prefix)/lib
 
 CFLAGS ?= -g -fomit-frame-pointer -O2
 CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
@@ -53,11 +55,11 @@ $(libname): $(libaio_sobjs) libaio.map
        $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
 
 install: $(all_targets)
-       install -D -m 644 libaio.h $(includedir)/libaio.h
-       install -D -m 644 libaio.a $(libdir)/libaio.a
-       install -D -m 755 $(libname) $(libdir)/$(libname)
-       ln -sf $(libname) $(libdir)/$(soname)
-       ln -sf $(libname) $(libdir)/libaio.so
+       install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
+       install -D -m 644 libaio.a $(DESTDIR)$(libdevdir)/libaio.a
+       install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
+       ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdir)/$(soname)
+       ln -sf $(libdir)/$(libname) $(DESTDIR)$(libdevdir)/libaio.so
 
 $(libaio_objs): libaio.h