File: rules

package info (click to toggle)
xfonts-terminus 4.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,992 kB
  • ctags: 172
  • sloc: makefile: 1,171; perl: 590; sh: 116; awk: 12
file content (151 lines) | stat: -rwxr-xr-x 4,593 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
#!/usr/bin/make -f

# Copyright (C) 2002 Anton Zinoviev <zinoviev@debian.org>

# This software may be used, modified, copied, distributed, and sold,
# in both source and binary form provided that the copyright
# and these terms are retained. Under no circumstances is the author
# responsible for the proper functioning of this software, nor does
# the author assume any responsibility for damages incurred with its use.

SHELL = /bin/bash
export DH_COMPAT=3

X_ENCODINGS=cp1251 pt154 koi8-r koi8-u iso-8859-1 iso-8859-2 iso-8859-5 \
		iso-8859-9 iso-8859-13 iso-8859-15 iso-8859-16 \
		unicode

DOS_ENCODINGS=ibm437 ibm850 ibm852 ibm855 ibm860 ibm863 ibm865 ibm866 \
		 mik ruscii

CONSOLE_ENCODINGS=1 2 9 c d g p v

ENCODINGS=$(X_ENCODINGS) $(DOS_ENCODINGS)

CONSOLE_BDFS = $(wildcard \
			ter-u14[nbv].bdf \
			ter-u16[nbv].bdf \
		)

SOURCE_BDFS = $(wildcard \
			ter-u12[nb].bdf \
			ter-u14[nb].bdf \
			ter-u16[nb].bdf \
			ter-u20[nb].bdf \
			ter-u24[nb].bdf \
			ter-u28[nb].bdf \
			ter-u32[nb].bdf \
		)

oblique_bdfs = $(SOURCE_BDFS:%.bdf=%o.bdf)

convertors=$(addsuffix _conv, $(ENCODINGS))

new_x_bdfs = $(foreach enc, $(X_ENCODINGS), \
		$(addsuffix _$(enc).bdf, $(SOURCE_BDFS:%.bdf=%)))

new_oblique_bdfs = $(foreach enc, $(X_ENCODINGS), \
			$(addsuffix _$(enc).bdf, $(oblique_bdfs:%.bdf=%)))

new_dos_bdfs = $(foreach enc, $(DOS_ENCODINGS), \
		$(addsuffix _$(enc).bdf, $(SOURCE_BDFS:%.bdf=%)))

new_bdfs = $(new_x_bdfs) $(new_oblique_bdfs) $(new_dos_bdfs)

new_psfs = $(subst v.psf,f.psf,$(foreach enc, $(CONSOLE_ENCODINGS), \
		$(addprefix ter-$(enc), $(CONSOLE_BDFS:ter-u%.bdf=%.psf))))

compressed_x_fonts = $(new_x_bdfs:%.bdf=%.pcf.gz)

compressed_oblique_fonts = $(new_oblique_bdfs:%.bdf=%.pcf.gz)

compressed_dos_fonts = $(new_dos_bdfs:%.bdf=%.pcf.gz)

compressed_console_fonts = $(new_psfs:%.psf=%.psf.gz)

compressed_fonts = $(compressed_x_fonts) $(compressed_oblique_fonts) \
			$(compressed_dos_fonts) $(compressed_console_fonts)


%.gz : %
	gzip -9 <$< >$@

$(oblique_bdfs) : %o.bdf : %.bdf
	perl debian/bdfslant.pl -unjag <$< >$@

$(convertors):
	trbdf -f unicode -t $(@:_conv=) --no-fallback -s >$@

$(new_bdfs) : basename_encoding = $(subst _,/,$(@:%.bdf=%))
$(new_bdfs) : basename = $(subst /,,$(dir $(basename_encoding)))
$(new_bdfs) : encoding = $(notdir $(basename_encoding))
# It's not possible to use prerequisite like $(encoding)_conv here:
$(new_bdfs) : $(SOURCE_BDFS) $(oblique_bdfs) $(convertors)
	awk -f $(encoding)_conv <$(basename).bdf >$@

%.pcf : %.bdf
	bdftopcf $< >$@

$(new_psfs) :
	$(MAKE) $@

build: $(compressed_fonts)

.PHONY : clean
clean:
	dh_testdir
	-$(MAKE) clean
	-rm -rf $(convertors) $(oblique_bdfs) $(new_bdfs) $(compressed_fonts)
	dh_clean

.PHONY : install
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_install -pxfonts-terminus $(compressed_x_fonts) usr/X11R6/lib/X11/fonts/misc
	dh_install -pxfonts-terminus-oblique $(compressed_oblique_fonts) usr/X11R6/lib/X11/fonts/misc
	dh_install -pxfonts-terminus-dos $(compressed_dos_fonts) usr/X11R6/lib/X11/fonts/misc
	dh_install -pconsole-terminus $(compressed_console_fonts) usr/share/consolefonts
	dh_install -pxfonts-terminus debian/xfonts-terminus.alias etc/X11/fonts/misc
	sh debian/generate_aliases terminus "$(X_ENCODINGS)" >>debian/xfonts-terminus/etc/X11/fonts/misc/xfonts-terminus.alias
	dh_install -pxfonts-terminus-dos debian/xfonts-terminus-dos.alias etc/X11/fonts/misc
	sh debian/generate_aliases terminus-dos "$(DOS_ENCODINGS)" >>debian/xfonts-terminus-dos/etc/X11/fonts/misc/xfonts-terminus-dos.alias
	dh_installdirs -pxfonts-terminus usr/share/fonts/bitmap/terminus/
	dh_installdirs -pxfonts-terminus-oblique usr/share/fonts/bitmap/terminus/
	for i in $(compressed_x_fonts); do \
		ln -s ../../../../X11R6/lib/X11/fonts/misc/$$i debian/xfonts-terminus/usr/share/fonts/bitmap/terminus/$$i; \
	done
	for i in $(compressed_oblique_fonts); do \
		ln -s ../../../../X11R6/lib/X11/fonts/misc/$$i debian/xfonts-terminus-oblique/usr/share/fonts/bitmap/terminus/$$i; \
	done
	dh_link

# Build architecture-independent files here.
.PHONY : binary-indep
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installxfonts
#	dh_installdebconf -pxfonts-terminus
	dh_installdocs -A README README-BG
#	dh_installexamples
#	dh_installman
#	dh_installinfo
#	dh_undocumented
	dh_installchangelogs
#	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

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