File: rules

package info (click to toggle)
console-setup 1.164
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 28,464 kB
  • sloc: perl: 10,923; xml: 5,812; sh: 3,891; makefile: 785
file content (328 lines) | stat: -rwxr-xr-x 13,782 bytes parent folder | download
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
#!/usr/bin/make -f

include Makefile

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  MAKEFLAGS += -j$(NUMJOBS)
endif

xkbdir := /usr/share/X11/xkb

pre := debian/preprocessor
manprocessor := sed \
	-e 's|^\([.a-zA-Z][a-zA-Z]*\) /usr/local/etc|\1 /etc|' \
	-e 's|^\([.a-zA-Z][a-zA-Z]*\) /usr/local|\1 /usr|'

# One font per fontset supported by d-i in text console
udeb-fonts := CyrAsia-Fixed16 CyrSlav-TerminusBold16 Greek-VGA16 \
Lat15-TerminusBold16 Lat2-TerminusBold16 Lat38-VGA16 Lat7-TerminusBold16
# These are not properly supported by d-i in text console
# Armenian-Fixed16 CyrKoi-TerminusBold16 Georgian-Fixed16 Hebrew-VGA16	Lao-Fixed16  Thai-Fixed16

# These are Linux-only
udeb-fonts-big := Uni1-VGA16 Uni2-VGA16 Uni3-Fixed16
# These are not properly supported by d-i in text console
# Arabic-VGA16 Ethiopian-Goha16 Vietnamese-Fixed16

# One fontset per charmap
udeb-scm := $(addprefix Fonts/, ARMSCII-8_Armenian.scm			\
CP1251_CyrSlav.scm CP1255_Hebrew.scm GEORGIAN-ACADEMY_Georgian.scm	\
GEORGIAN-PS_Georgian.scm IBM1133_Lao.scm ISO-8859-1_Lat15.scm		\
ISO-8859-2_Lat2.scm ISO-8859-3_Lat38.scm ISO-8859-4_Lat7.scm		\
ISO-8859-4_Lat15.scm ISO-8859-5_CyrSlav.scm ISO-8859-7_Greek.scm	\
ISO-8859-8_Hebrew.scm ISO-8859-9_Lat15.scm ISO-8859-10_Lat15.scm	\
ISO-8859-11_Thai.scm ISO-8859-13_Lat7.scm ISO-8859-14_Lat38.scm		\
ISO-8859-15_Lat15.scm ISO-8859-16_Lat2.scm KOI8-R_CyrKoi.scm		\
KOI8-U_CyrKoi.scm TIS-620_Thai.scm)

udeb-fonts-linux = $(addprefix Fonts/, $(addsuffix .psf.gz, \
			$(udeb-fonts)))
udeb-fonts-freebsd = $(addprefix Fonts/, $(addsuffix .fnt, $(udeb-fonts)))

debian/kbdnames.gz: $./Keyboard/KeyboardNames.pl
	( cd Keyboard \
	&& ./kbdnames-maker ./KeyboardNames.pl \
		| grep -v '^C[*]' | grep -v '[*]model[*]' | sort | gzip -9n ) >$@

models := amiga ataritt macintosh_old pc105 sun4 sun5

di-gzipped-ekmaps := $(addprefix $./, $(addsuffix .ekmap.gz, $(models)))

di-gzipped-ekbds := $./pc105.ekbd.gz

# di-kbdnames = us al ara es(ast) bd by in(ben) be ba br gb bg bg(phonetic)...
di-kbdnames := $(shell grep -A 2 keyboard-configuration/xkb-keymap debian/console-setup-udeb.templates | tail -n 1 | cut -d ' ' -f 2- | tr -d , | tr ' ' '\n' | grep -v skip-config)

$./%.ekmap : model = $(notdir $(@:%.ekmap=%))
$./%.ekmap :
	(cd Keyboard \
	&& ./kbdcompiler $(model) ./KeyboardNames.pl $(xkbdir) \
		"$(di-kbdnames)") >$@

$./%.ekbd : model = $(notdir $(@:%.ekbd=%))
$./%.ekbd :
	(cd Keyboard \
	&& ./kbdcompiler freebsd-$(model) ./KeyboardNames.pl $(xkbdir) \
		"$(di-kbdnames)") >$@

# The following rules ensure that kbdcompiler is not run
# simultaneously for normal and udeb kmaps
$(foreach i,$(gzipped-ekmaps:%.gz=%) $(gzipped-ekbds:%.gz=%),\
	$(eval $i: $(maindir)/$(notdir $i)))

# A hack so that KeyboardNames.pl is recomputed using the files in
# /usr/share/X11/xkb instead of the files shipped with console-setup
$(gzipped-ekmaps:%.gz=%) $(gzipped-ekbds:%.gz=%) $(di-gzipped-ekmaps:%.gz=%) $(di-gzipped-ekbds:%.gz=%) : $./Keyboard/KeyboardNames.pl
$./Keyboard/KeyboardNames.pl : building_debian
building_debian :
	touch building_debian

build: debian/kbdnames.gz $(di-gzipped-ekmaps) $(di-gzipped-ekbds)

clean : maintainer-clean
	dh_testdir
	-rm -f *.ekmap *.ekbd *.ekmap.gz *.ekbd.gz
	debconf-updatepo
	-rm -f build main_build building_debian
	-rm -f debian/kbdnames.gz
	-rm -f debian/*~
	dh_clean

.PHONY : deb-udeb-install
deb-udeb-install: deb-install-linux deb-install-freebsd deb-install-main deb-install-bdf2psf udeb-install-linux udeb-install-freebsd udeb-install

.PHONY : deb-install-linux
deb-install-linux: build
	dh_testdir
	dh_testroot
	dh_prep -p console-setup-linux
	$(MAKE) etcdir=debian/console-setup-linux/etc \
		prefix=debian/console-setup-linux/usr install-common-linux
	dh_install -p console-setup-linux \
		init/90-console-setup.rules lib/udev/rules.d/
	dh_install -p console-setup-linux \
		init/keyboard-setup.sh lib/console-setup/
	dh_install -p console-setup-linux \
		init/console-setup.sh lib/console-setup/
	dh_systemd_enable -p console-setup-linux \
		--name keyboard-setup
	dh_systemd_enable -p console-setup-linux \
		--name console-setup
	dh_installinit -p console-setup-linux \
		--no-start --name keyboard-setup.sh
	dh_installinit -p console-setup-linux \
		--no-start --name console-setup.sh
	dh_systemd_start -p console-setup-linux \
		--no-start --name keyboard-setup
	dh_systemd_start -p console-setup-linux \
		--no-start --name console-setup
	sed -i 's/RUNLEVEL/2 3 4 5/' \
		debian/console-setup-linux/etc/init.d/console-setup.sh

.PHONY : deb-install-freebsd
deb-install-freebsd: build
	dh_testdir
	dh_testroot
	dh_prep -p console-setup-freebsd
	$(MAKE) etcdir=debian/console-setup-freebsd/etc \
		prefix=debian/console-setup-freebsd/usr install-common-freebsd
	dh_install -p console-setup-freebsd \
		init/keyboard-setup.sh lib/console-setup/
	dh_install -p console-setup-freebsd \
		init/console-setup.sh lib/console-setup/
	dh_systemd_enable -p console-setup-freebsd \
		--name keyboard-setup
	dh_systemd_enable -p console-setup-freebsd \
		--name console-setup
	dh_installinit -p console-setup-freebsd \
		--no-start --name keyboard-setup.sh
	dh_installinit -p console-setup-freebsd \
		--no-start --name console-setup.sh
	dh_systemd_start -p console-setup-freebsd \
		--no-start --name keyboard-setup
	dh_systemd_start -p console-setup-freebsd \
		--no-start --name console-setup
	sed -i 's/RUNLEVEL/S/' \
		debian/console-setup-freebsd/etc/init.d/console-setup.sh

.PHONY : deb-install-main
deb-install-main: build
	dh_testdir
	dh_testroot
	dh_prep -pkeyboard-configuration
	dh_prep -p console-setup
	dh_prep -p console-setup-mini
	$(MAKE) etcdir=debian/console-setup/etc \
		prefix=debian/console-setup/usr install-common
	$(MAKE) etcdir=debian/console-setup/etc \
		prefix=debian/console-setup/usr install-ckbcomp
	$(MAKE) etcdir=debian/console-setup-mini/etc \
		prefix=debian/console-setup-mini/usr install-common
	$(MAKE) etcdir=debian/console-setup-mini/etc \
		prefix=debian/console-setup-mini/usr install-ckbcomp-mini
	$(pre) --mini debian/console-setup-mini/bin/setupcon
	$(pre) --mini debian/console-setup-mini/usr/bin/ckbcomp-mini
	ls debian/console-setup/usr/share/man/*/* \
	   debian/console-setup-mini/usr/share/man/*/* \
		| xargs -n 1 $(manprocessor) -i
	install -d debian/keyboard-configuration/usr/share/console-setup/
	mv debian/console-setup/etc/default/keyboard \
		debian/keyboard-configuration/usr/share/console-setup/
	install -d debian/console-setup/usr/share/console-setup/
	mv debian/console-setup/etc/default/console-setup \
		debian/console-setup/usr/share/console-setup/
	rm debian/console-setup-mini/etc/default/keyboard
	rm debian/console-setup-mini/etc/default/console-setup
	dh_movefiles -pkeyboard-configuration --sourcedir=debian/console-setup \
		usr/share/man/man5/keyboard.5
	rm debian/console-setup-mini/usr/share/man/man5/keyboard.5
# For KeyboardNames.pl and kbdnames-maker see #420914
	dh_install -pkeyboard-configuration Keyboard/KeyboardNames.pl \
		usr/share/console-setup/
	dh_install -pkeyboard-configuration Keyboard/kbdnames-maker \
		usr/share/console-setup/
	dh_link -pkeyboard-configuration usr/share/X11/xkb/rules/xorg.lst \
		usr/share/doc/keyboard-configuration/xorg.lst

.PHONY : deb-install-bdf2psf
deb-install-bdf2psf: build
	dh_testdir
	dh_testroot
	dh_prep -pbdf2psf
	dh_install -pbdf2psf Fonts/bdf2psf usr/bin/
	dh_install -pbdf2psf Fonts/*.equivalents Fonts/*.set \
		Fonts/fontsets usr/share/bdf2psf
	dh_installman -pbdf2psf man/bdf2psf.1
	dh_installdocs -pbdf2psf debian/README.fontsets

.PHONY : udeb-install-linux
udeb-install-linux: build
	dh_testdir
	dh_testroot
# console-setup-linux-charmaps-udeb
	dh_prep -p console-setup-linux-charmaps-udeb
	$(MAKE) etcdir=debian/console-setup-linux-charmaps-udeb/etc \
		prefix=debian/console-setup-linux-charmaps-udeb/usr \
			install-common-linux
	dh_install -p console-setup-linux-charmaps-udeb \
		Keyboard/charmap_functions.sh usr/share/console-setup/
	rm -r debian/console-setup-linux-charmaps-udeb/usr/share/consolefonts/
# console-setup-linux-fonts-udeb
	dh_prep -p console-setup-linux-fonts-udeb
	dh_install -p console-setup-linux-fonts-udeb $(udeb-fonts-linux) \
		usr/share/consolefonts
	dh_install -p console-setup-linux-fonts-udeb debian/font-switch \
		/usr/share/console-setup

.PHONY : udeb-install-freebsd
udeb-install-freebsd: build
	dh_testdir
	dh_testroot
# console-setup-freebsd-charmaps-udeb
	dh_prep -p console-setup-freebsd-charmaps-udeb
	$(MAKE) etcdir=debian/console-setup-freebsd-charmaps-udeb/etc \
		prefix=debian/console-setup-freebsd-charmaps-udeb/usr \
			install-common-freebsd
	dh_install -p console-setup-freebsd-charmaps-udeb \
		Keyboard/charmap_functions.sh usr/share/console-setup/
	rm -r debian/console-setup-freebsd-charmaps-udeb/usr/share/consoletrans/
	rm -r debian/console-setup-freebsd-charmaps-udeb/usr/share/syscons/
# console-setup-freebsd-fonts-udeb
	dh_prep -p console-setup-freebsd-fonts-udeb
	dh_install -p console-setup-freebsd-fonts-udeb $(udeb-fonts-freebsd) \
		usr/share/syscons/fonts/
	dh_install -p console-setup-freebsd-fonts-udeb $(udeb-scm) \
		usr/share/syscons/scrnmaps/

.PHONY : udeb-install
udeb-install: build
	dh_testdir
	dh_testroot
	dh_prep -p console-setup-amiga-ekmap
	dh_prep -p console-setup-ataritt-ekmap
	dh_prep -p console-setup-macintoshold-ekmap
	dh_prep -p console-setup-pc-ekmap
	dh_prep -p console-setup-sun4-ekmap
	dh_prep -p console-setup-sun5-ekmap
	dh_prep -p console-setup-udeb
	dh_prep -p console-setup-pc-ekbd
	$(MAKE) etcdir=debian/console-setup-udeb/etc \
		prefix=debian/console-setup-udeb/usr install-common
	$(MAKE) etcdir=debian/console-setup-udeb/etc \
		prefix=debian/console-setup-udeb/usr install-ckbcomp-mini
	$(pre) --udeb debian/console-setup-udeb/bin/setupcon
	$(pre) --udeb debian/console-setup-udeb/usr/bin/ckbcomp-mini
	rm -r debian/console-setup-udeb/usr/share/man/
	dh_installdirs -p console-setup-udeb usr/share/console-setup
	mv debian/console-setup-udeb/etc/default/keyboard \
		debian/console-setup-udeb/usr/share/console-setup/
	rm debian/console-setup-udeb/etc/default/console-setup
	rm debian/console-setup-udeb/usr/share/console-setup/charmap_functions.sh
	install -m0755 debian/keyboard-configuration.config \
		debian/console-setup-udeb/usr/share/console-setup/
	$(pre) --udeb debian/console-setup-udeb/usr/share/console-setup/keyboard-configuration.config
	dh_installdirs -p console-setup-udeb lib/debian-installer.d/
	install -m0644 debian/console-setup-udeb.startup \
		debian/console-setup-udeb/lib/debian-installer.d/S55console-setup
	dh_installdirs -p console-setup-udeb usr/lib/base-installer.d
	install -m0755 debian/console-setup-udeb.base-installer \
		debian/console-setup-udeb/usr/lib/base-installer.d/20console-setup
	$(pre) --udeb debian/console-setup-udeb/usr/lib/base-installer.d/20console-setup
# console-setup-*-ekmap
	dh_movefiles -p console-setup-amiga-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/amiga.ekmap.gz
	cat amiga.ekmap.gz >debian/console-setup-amiga-ekmap/usr/share/console-setup/amiga.ekmap.gz
	dh_movefiles -p console-setup-ataritt-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/ataritt.ekmap.gz
	cat ataritt.ekmap.gz >debian/console-setup-ataritt-ekmap/usr/share/console-setup/ataritt.ekmap.gz
	dh_movefiles -p console-setup-macintoshold-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/macintosh_old.ekmap.gz
	cat macintosh_old.ekmap.gz >debian/console-setup-macintoshold-ekmap/usr/share/console-setup/macintosh_old.ekmap.gz
	dh_movefiles -p console-setup-pc-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/pc105.ekmap.gz
	cat pc105.ekmap.gz >debian/console-setup-pc-ekmap/usr/share/console-setup/pc105.ekmap.gz
	dh_movefiles -p console-setup-sun4-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/sun4.ekmap.gz
	cat sun4.ekmap.gz >debian/console-setup-sun4-ekmap/usr/share/console-setup/sun4.ekmap.gz
	dh_movefiles -p console-setup-sun5-ekmap --sourcedir=debian/console-setup-udeb usr/share/console-setup/sun5.ekmap.gz
	cat sun5.ekmap.gz >debian/console-setup-sun5-ekmap/usr/share/console-setup/sun5.ekmap.gz
# console-setup-pc-ekbd
	dh_movefiles -p console-setup-pc-ekbd --sourcedir=debian/console-setup-udeb usr/share/console-setup/pc105.ekbd.gz
	cat pc105.ekbd.gz >debian/console-setup-pc-ekbd/usr/share/console-setup/pc105.ekbd.gz

# Build architecture-independent files here.
.PHONY : binary-indep
binary-indep: build deb-udeb-install
	dh_testdir
	dh_testroot
	dh_installdebconf
	dh_installdocs -pkeyboard-configuration \
		FAQ copyright.fonts copyright.xkb
	dh_installdocs -p console-setup-linux --link-doc=keyboard-configuration
	dh_installdocs -pconsole-setup-freebsd --link-doc=keyboard-configuration
	dh_installdocs -p console-setup-mini --link-doc=keyboard-configuration
	dh_installdocs -p console-setup --link-doc=keyboard-configuration
	dh_lintian
	dh_bugfiles
	dh_installman
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
# To deal somehow with bug #657904.  See also #255819 and #17624.
#	rm debian/console-setup/usr/share/doc/console-setup
	$(pre) debian/keyboard-configuration/DEBIAN/config
	$(pre) debian/keyboard-configuration/DEBIAN/postinst
	$(pre) debian/console-setup/DEBIAN/config
	$(pre) debian/console-setup/DEBIAN/postinst
	$(pre) --udeb debian/console-setup-udeb/DEBIAN/postinst
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
.PHONY : binary-arch
binary-arch : build deb-udeb-install
# We have nothing to do by default.

.PHONY : binary
binary : binary-indep binary-arch

.PHONY : build-arch build-indep build-stamp
build-arch build-indep build-stamp : build