[linux-dvb] [patch 1/6] honor DESTDIR and libdir in order to ease rpm builds

Ludwig Nussel ludwig.nussel at suse.de
Thu Sep 7 15:08:18 CEST 2006


Signed-off-by: lnussel at suse.de

diff -r 56f0dba7274c Make.rules
--- a/Make.rules	Wed Sep  6 16:17:34 2006
+++ b/Make.rules	Thu Sep  7 14:45:13 2006
@@ -31,6 +31,10 @@
 prefix = /usr
 endif
 
+lib=lib
+libdir=$(prefix)/$(lib)
+datadir=$(prefix)/share
+
 ifeq ($(V),1)
 %.o: %.c
 	$(CC) -c $(CPPFLAGS) $(CFLAGS) -MMD -o $@ $< $(filter-out %.h %.c,$^)
@@ -46,16 +50,16 @@
 	$(RM) -f $(prerequisites) $(objects) $(libraries) $(binaries) $(removing) *~
 install::
 ifneq ($(includes),)
-	mkdir -p $(prefix)/include/$(lib_name)
-	install -m 644 $(includes) $(prefix)/include/$(lib_name)/
+	mkdir -p $(DESTDIR)$(prefix)/include/$(lib_name)
+	install -m 644 $(includes) $(DESTDIR)$(prefix)/include/$(lib_name)/
 endif
 ifneq ($(libraries),)
-	mkdir -p $(prefix)/lib
-	install -m 644 $(libraries) $(prefix)/lib/
+	mkdir -p $(DESTDIR)$(libdir)
+	install -m 644 $(libraries) $(libdir)
 endif
 ifneq ($(inst_bin),)
-	mkdir -p $(prefix)/bin
-	install -m 755 $(inst_bin) $(prefix)/bin/
+	mkdir -p $(DESTDIR)$(prefix)/bin
+	install -m 755 $(inst_bin) $(DESTDIR)$(prefix)/bin/
 endif
 else
 %.o: %.c
@@ -79,18 +83,18 @@
 install::
 ifneq ($(includes),)
 	@echo installing headers
-	@mkdir -p $(prefix)/include/$(lib_name)
-	@install -m 644 $(includes) $(prefix)/include/$(lib_name)/
+	@mkdir -p $(DESTDIR)$(prefix)/include/$(lib_name)
+	@install -m 644 $(includes) $(DESTDIR)$(prefix)/include/$(lib_name)/
 endif
 ifneq ($(libraries),)
 	@echo installing libraries
-	@mkdir -p $(prefix)/lib
-	@install -m 644 $(libraries) $(prefix)/lib/
+	@mkdir -p $(DESTDIR)$(libdir)
+	@install -m 644 $(libraries) $(DESTDIR)$(libdir)
 endif
 ifneq ($(inst_bin),)
 	@echo installing binaries
-	@mkdir -p $(prefix)/bin
-	@install -m 755 $(inst_bin) $(prefix)/bin/
+	@mkdir -p $(DESTDIR)$(prefix)/bin
+	@install -m 755 $(inst_bin) $(DESTDIR)$(prefix)/bin/
 endif
 endif
 
diff -r 56f0dba7274c util/scan/Makefile
--- a/util/scan/Makefile	Wed Sep  6 16:17:34 2006
+++ b/util/scan/Makefile	Thu Sep  7 14:45:13 2006
@@ -15,6 +15,7 @@
 removing = atsc_psip_section.c atsc_psip_section.h
 
 CPPFLAGS += -I../../include
+CFLAGS += -DDATADIR=\"$(datadir)\"
 
 .PHONY: all
 

--
 (o_   Ludwig Nussel
 //\   SUSE LINUX Products GmbH, Development
 V_/_  http://www.suse.de/



More information about the linux-dvb mailing list