summarylogtreecommitdiffstats
path: root/0001-Makefile-DESTDIR-support.patch
blob: a6aed3a81730c9951adbadb4596b112b91090269 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 8f1dc9498cb4f7969d5700904d4b19d8517c9679 Mon Sep 17 00:00:00 2001
From: Ivan Shapovalov <intelfx@intelfx.name>
Date: Sat, 22 Oct 2016 12:35:14 +0300
Subject: [PATCH 1/5] Makefile: DESTDIR support

---
 Makefile | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index 051dc66..8079ddf 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ INSTALL=install
 ROOT=root
 
 # Pathnames for referenced packages...
-FOODB=$(DESTDIR)/usr/share/foomatic/db/source
+FOODB=$(PREFIX)/share/foomatic/db/source
 
 # User ID's
 LPuid=-oroot
@@ -251,8 +251,9 @@ FILES	=	\
 
 # CUPS vars
 CUPS_SERVERBIN := $(DESTDIR)$(shell cups-config --serverbin 2>/dev/null)
-CUPS_DEVEL := $(shell grep cupsSideChannelDoRequest /usr/include/cups/sidechannel.h 2>/dev/null)
-CUPS_GOODAPI := $(shell cups-config --api-version 2>/dev/null | sed "s/1\.[0123].*//")
+CUPS_DEVEL := $(DESTDIR)$(shell grep cupsSideChannelDoRequest /usr/include/cups/sidechannel.h 2>/dev/null)
+CUPS_GOODAPI := $(DESTDIR)$(shell cups-config --api-version 2>/dev/null | sed "s/1\.[0123].*//")
+
 
 # hpclj2600n-0.icm km2430_0.icm km2430_1.icm km2430_2.icm samclp300-0.icm
 # sihp1000.img sihp1005.img sihp1020.img sihp1018.img
@@ -676,7 +677,7 @@ install-prog:
 	$(INSTALL) -c $(PROGS) $(SHELLS) $(BIN)/
 	if [ "$(BINPROGS)" != "" ]; then \
 	    $(INSTALL) -d $(UDEVBIN); \
-	    $(INSTALL) -c $(BINPROGS) $(UDEVBIN); \
+	    $(INSTALL) -c $(BINPROGS) $(DESTDIR)/usr/bin/; \
 	fi
 	#
 	# Install gamma correction files.  These are just templates,
@@ -730,10 +731,10 @@ install-foo:
 	#
 	# Clear foomatic cache and rebuild database if needed
 	#
-	rm -rf /var/cache/foomatic/*/*
-	rm -f /var/cache/foomatic/printconf.pickle
-	if [ -d /var/cache/foomatic/compiled ]; then \
-	    cd /var/cache/foomatic/compiled; \
+	rm -rf $(DESTDIR)/var/cache/foomatic/*/*
+	rm -f $(DESTDIR)/var/cache/foomatic/printconf.pickle
+	if [ -d $(DESTDIR)/var/cache/foomatic/compiled ]; then \
+	    cd $(DESTDIR)/var/cache/foomatic/compiled; \
 	    foomatic-combo-xml -O >overview.xml; \
 	fi
 
@@ -863,7 +864,7 @@ install-extra:
 	done
 
 MODEL=$(PREFIX)/share/cups/model
-LOCALMODEL=$(DESTDIR)/usr/local/share/cups/model
+LOCALMODEL=$(PREFIX)/usr/local/share/cups/model
 MACMODEL=/Library/Printers/PPDs/Contents/Resources
 PPD=$(PREFIX)/share/ppd
 VARPPD=/var/lp/ppd
@@ -923,9 +924,9 @@ install-ppd:
 	    done; \
 	fi
 
-APPL=$(DESTDIR)/usr/share/applications
-OLDAPPL=$(DESTDIR)/usr/share/gnome/apps/System
-PIXMAPS=$(DESTDIR)/usr/share/pixmaps
+APPL=$(PREFIX)/usr/share/applications
+OLDAPPL=$(PREFIX)/usr/share/gnome/apps/System
+PIXMAPS=$(PREFIX)/usr/share/pixmaps
 
 install-desktop:
 	#
@@ -949,7 +950,7 @@ install-gui:
 	$(INSTALL) -c -m 755 hplj10xx_gui.tcl $(SHAREZJS)
 	
 
-USBDIR=/etc/hotplug/usb
+USBDIR=$(DESTDIR)/etc/hotplug/usb
 UDEVDIR=/etc/udev/rules.d
 LIBUDEVDIR=/lib/udev/rules.d
 RULES=hplj10xx.rules
-- 
2.12.1