aboutsummaryrefslogtreecommitdiffstats
path: root/testing/debconf/fix-makefile_destdir.patch
blob: 7c31b998281a679c16abcc3f764d4db807a37738 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,4 @@
+PREFIX=/usr
 MUNGE=xargs perl -i.bak -ne ' \
 		print $$_."\# This file was preprocessed, do not edit!\n" \
 			if m:^\#!/usr/bin/perl:; \
@@ -24,20 +25,24 @@
 
 # Anything that goes in the debconf-utils package.
 install-utils:
-	install -d $(prefix)/usr/bin
+	install -d $(DESTDIR)$(PREFIX)/bin
 	find . -maxdepth 1 -perm /100 -type f -name 'debconf-*' | grep -v debconf-set-selections | grep -v debconf-show | grep -v debconf-copydb | grep -v debconf-communicate | grep -v debconf-apt-progress | grep -v debconf-escape | \
-		xargs -i install {} $(prefix)/usr/bin
+		xargs -i install {} $(DESTDIR)$(PREFIX)/bin
 
+# Installs only english man pages
+install-doc:
+	$(MAKE) -C doc PREFIX=$(PREFIX) DESTDIR=$(DESTDIR) install
+
 # Anything that goes in the debconf-i18n package.
 install-i18n:
-	$(MAKE) -C po install
+	$(MAKE) -C po PREFIX=$(PREFIX) DESTDIR=$(DESTDIR) install
 
 PERL := perl
 PERL_VENDORLIB := $(shell $(PERL) -MConfig -e 'print $$Config{vendorlib}')
 
 # This would probably be easier if we used setup.py ...
 PYTHON2_SUPPORTED := $(shell pyversions -s)
-PYTHON_SITEDIR = $(prefix)/usr/lib/$(1)/$(if $(filter 2.0 2.1 2.2 2.3 2.4 2.5,$(patsubst python%,%,$(1))),site-packages,dist-packages)
+PYTHON_SITEDIR = $(DESTDIR)$(PREFIX)/lib/$(1)/$(if $(filter 2.0 2.1 2.2 2.3 2.4 2.5,$(patsubst python%,%,$(1))),site-packages,dist-packages)
 
 # The Python 2 package.
 install-python2:
@@ -48,47 +53,47 @@
 
 # The Python 3 package.
 install-python3:
-	install -d $(prefix)/usr/lib/python3/dist-packages
-	install -m 0644 debconf.py $(prefix)/usr/lib/python3/dist-packages/
+	install -d $(DESTDIR)$(PREFIX)/lib/python3/dist-packages
+	install -m 0644 debconf.py $(DESTDIR)$(PREFIX)/lib/python3/dist-packages/
 
 # Install all else.
 install-rest:
-	install -d $(prefix)/etc \
-		$(prefix)/var/cache/debconf \
-		$(prefix)/usr/share/debconf \
-		$(prefix)/usr/share/pixmaps
-	install -m 0644 debconf.conf $(prefix)/etc/
-	install -m 0644 debian-logo.png $(prefix)/usr/share/pixmaps/
+	install -d $(DESTDIR)/etc \
+		$(DESTDIR)/var/cache/debconf \
+		$(DESTDIR)$(PREFIX)/share/debconf \
+		$(DESTDIR)$(PREFIX)/share/pixmaps
+	install -m 0644 debconf.conf $(DESTDIR)/etc/
+	install -m 0644 debian-logo.png $(DESTDIR)$(PREFIX)/share/pixmaps/
 	# This one is the ultimate backup copy.
-	grep -v '^#' debconf.conf > $(prefix)/usr/share/debconf/debconf.conf
+	grep -v '^#' debconf.conf > $(DESTDIR)$(PREFIX)/share/debconf/debconf.conf
 	# Make module directories.
 	find Debconf -type d |grep -v CVS | \
-		xargs -i install -d $(prefix)/$(PERL_VENDORLIB)/{}
+		xargs -i install -d $(DESTDIR)/$(PERL_VENDORLIB)/{}
 	# Install modules.
 	find Debconf -type f -name '*.pm' |grep -v CVS | \
-		xargs -i install -m 0644 {} $(prefix)/$(PERL_VENDORLIB)/{}
+		xargs -i install -m 0644 {} $(DESTDIR)/$(PERL_VENDORLIB)/{}
 	# Special case for back-compatability.
-	install -d $(prefix)/$(PERL_VENDORLIB)/Debian/DebConf/Client
+	install -d $(DESTDIR)/$(PERL_VENDORLIB)/Debian/DebConf/Client
 	cp Debconf/Client/ConfModule.stub \
-		$(prefix)/$(PERL_VENDORLIB)/Debian/DebConf/Client/ConfModule.pm
+		$(DESTDIR)/$(PERL_VENDORLIB)/Debian/DebConf/Client/ConfModule.pm
 	# Other libs and helper stuff.
-	install -m 0644 confmodule.sh confmodule $(prefix)/usr/share/debconf/
-	install frontend $(prefix)/usr/share/debconf/
-	install -m 0755 transition_db.pl fix_db.pl $(prefix)/usr/share/debconf/
+	install -m 0644 confmodule.sh confmodule $(DESTDIR)$(PREFIX)/share/debconf/
+	install frontend $(DESTDIR)$(PREFIX)/share/debconf/
+	install -m 0755 transition_db.pl fix_db.pl $(DESTDIR)$(PREFIX)/share/debconf/
 	# Install essential programs.
-	install -d $(prefix)/usr/sbin $(prefix)/usr/bin
+	install -d $(DESTDIR)$(PREFIX)/sbin $(DESTDIR)$(PREFIX)/bin
 	find . -maxdepth 1 -perm /100 -type f -name 'dpkg-*' | \
-		xargs -i install {} $(prefix)/usr/sbin
+		xargs -i install {} $(DESTDIR)$(PREFIX)/sbin
 	find . -maxdepth 1 -perm /100 -type f -name debconf -or -name debconf-show -or -name debconf-copydb -or -name debconf-communicate -or -name debconf-set-selections -or -name debconf-apt-progress -or -name debconf-escape | \
-		xargs -i install {} $(prefix)/usr/bin
+		xargs -i install {} $(DESTDIR)$(PREFIX)/bin
 	# Now strip all pod documentation from all .pm files and scripts.
-	find $(prefix)/$(PERL_VENDORLIB)/ $(prefix)/usr/sbin		\
-	     $(prefix)/usr/share/debconf/frontend 			\
-	     $(prefix)/usr/share/debconf/*.pl $(prefix)/usr/bin		\
-	     -name '*.pl' -or -name '*.pm' -or -name 'dpkg-*' -or	\
-	     -name 'debconf-*' -or -name 'frontend' | 			\
+	find $(DESTDIR)/$(PERL_VENDORLIB)/ $(DESTDIR)$(PREFIX)/sbin		\
+	     $(DESTDIR)$(PREFIX)/share/debconf/frontend 			\
+	     $(DESTDIR)$(PREFIX)/share/debconf/*.pl $(DESTDIR)$(PREFIX)/bin	\
+	     -name '*.pl' -or -name '*.pm' -or -name 'dpkg-*' -or		\
+	     -name 'debconf-*' -or -name 'frontend' | 				\
 	     grep -v Client/ConfModule | $(MUNGE)
-	find $(prefix) -name '*.bak' | xargs rm -f
+	find $(DESTDIR) -name '*.bak' | xargs rm -f
 
 demo:
 	PERL5LIB=. ./frontend samples/demo

--- a/po/Makefile
+++ b/po/Makefile
@@ -4,14 +4,15 @@
 
 POFILES=$(wildcard *.po)
 MOFILES=$(POFILES:.po=.mo)
+PREFIX=/usr
 
 all: debconf.pot $(MOFILES)
 
 install: all
 	for file in $(MOFILES); do \
 		lang=`echo $$file | sed 's/\.mo//'`; \
-		install -d $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/; \
-		install -m 0644 $$file $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/debconf.mo; \
+		install -d $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/; \
+		install -m 0644 $$file $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/debconf.mo; \
 	done
 
 debconf.pot: $(POTFILES)

--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,6 +1,7 @@
 all: manpages
 	./graph.pl `find .. -name \*.pm` > hierarchy.txt
 
+PREFIX=/usr
 pod2man=pod2man -c Debconf -r '' --utf8
 manpages:
 	cd man && po4a po4a/po4a.cfg
@@ -18,6 +19,13 @@
 		xargs -i sh -c "cd .. ; $(pod2man) --section=1 {} > doc/man/gen/{}.1"
 	find .. -maxdepth 1 -perm /100 -type f -name 'dpkg-*' -printf '%P\n' | \
 		xargs -i sh -c "cd .. ; $(pod2man) --section=8 {} > doc/man/gen/{}.8"
+
+install:
+	install -d $(DESTDIR)$(PREFIX)/share/man/man1 $(DESTDIR)$(PREFIX)/share/man/man3 $(DESTDIR)$(PREFIX)/share/man/man8
+
+	for num in 1 3 8; do \
+		find man/gen/ -type f -not -name "*.*.*" -name "*.$$num" -exec cp --target-directory=$(DESTDIR)$(PREFIX)/share/man/man$$num/ {} +; \
+	done
 
 clean:
 	cd man && po4a --rm-translations po4a/po4a.cfg