File: rules

package info (click to toggle)
console-data 2002.12.04dbs-49
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,024 kB
  • ctags: 26
  • sloc: perl: 1,663; makefile: 110; sh: 61
file content (165 lines) | stat: -rwxr-xr-x 5,156 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
#!/usr/bin/make -f
# -*- makefile -*-
#
# debian/rules file for package `console-tools'

# turn around bug in dpkg-parsechangelog
export LC_ALL=C

package=console-data
VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//')
fullversion := $(shell \
        dpkg-parsechangelog | sed -n 's/^Version: //p; t e; b; :e; q' \
	)

TAR_DIR=console-data-1999.08.29
export DH_COMPAT=3

# the dbs rules
include /usr/share/dbs/dbs-build.mk

ifeq (,$(DEB_BUILD_GNU_TYPE))
 include /usr/share/dbs/dpkg-arch.mk
endif
ARCH=$(shell dpkg --print-architecture)

# All the small .udebs that get built
EXTRA_UDEB_PKGS    = 	console-keymaps-mac	\
		console-keymaps-sun	\
		console-keymaps-acorn	\
		console-keymaps-atari	\
		console-keymaps-amiga	\
		console-keymaps-usb	\
		console-keymaps-dec
OPTIONAL_UDEB_PKGS = console-keymaps-at
UDEB_PKGS=${OPTIONAL_UDEB_PKGS} ${EXTRA_UDEB_PKGS}

topdir=$(shell pwd)
installdir=${topdir}/debian/console-data
docdir=${installdir}/usr/share/doc/${package}
exampledir=${docdir}/examples
sharedir=${installdir}/usr/share/console

build-stamp=${STAMP_DIR}/build-stamp
build-udeb-stamp =${STAMP_DIR}/build-udeb-stamp
configure-stamp=${STAMP_DIR}/configure-stamp

build: ${build-stamp} ${configure-stamp}
configure: ${configure-stamp}

${build-stamp}: ${configure-stamp} $(patched)
	dh_testdir
	make -C ${BUILD_TREE}
	chmod +x debian/gen-acorn-keymaps
	touch ${build-stamp}

build-udeb: ${build-stamp}
	dh_testdir
        # Ensure the acorn keymaps get built. Cheaper in space terms than shipping
	# ps2-to-riscpc on the boot floppies. 
	debian/gen-acorn-keymaps
	touch ${build-udeb-stamp}

${configure-stamp}: $(patched)
	dh_testdir
	( cd ${BUILD_TREE} && ./configure --with-main_compressor=gzip)
	( cp -a build-tree/extras/keymaps ${BUILD_TREE} )
	touch ${configure-stamp}

clean:
	dh_testdir
	dh_testroot
	rm -rf console-data.config debian/console-data.templates ${SOURCE_DIR} ${STAMP_DIR} debian/sort-tmp debian/locales
	rm -rf debian/substvars
	dh_clean

binary-indep: build build-udeb
	dh_testdir -i
	dh_testroot -i
	dh_clean -i -k
	dh_installdirs -i

	make -C ${BUILD_TREE} install DESTDIR=${installdir}
	mkdir -p  ${installdir}/usr/share/consolefonts
	# First fix the sfm tables in the lat2u fonts
	for d in ${topdir}/build-tree/extras/consolefonts/lat2u-*.psf ; do \
		psfaddtable $$d ${topdir}/build-tree/${TAR_DIR}/consoletrans/lat2u.sfm > X ; \
		mv X $$d ;  \
	done
	# 
	cp ${topdir}/build-tree/extras/consolefonts/* ${installdir}/usr/share/consolefonts
        # install the eurofonts collection	
	cp ${topdir}/build-tree/consolefonts/* ${installdir}/usr/share/consolefonts
	cp ${topdir}/build-tree/consoletrans/* ${installdir}/usr/share/consoletrans
	# uudecode -o ${installdir}/usr/share/consoletrans/iso13.acm < debian/iso13.acm.uue 
	# gzip ${installdir}/usr/share/consoletrans/iso13*
	gzip -9 <  ${installdir}/usr/share/consoletrans/iso13.sfm \
	  >   ${installdir}/usr/share/consoletrans/iso13.acm.gz
	gzip  -9 -f ${installdir}/usr/share/consolefonts/*.psf
	# move the euro.inc so everyone can use it
	# mv ${installdir}/usr/share/keymaps/i386/include/euro* \
		${installdir}/usr/share/keymaps/include
        # these fonts have a redistribution restriction
	rm -f ${installdir}/usr/share/consolefonts/Agafari-1*
	# And this is a mistake
	rm -f ${installdir}/usr/share/consolefonts/t.psf*
	# No more speakup keymaps
	rm -rf ${installdir}/usr/share/keymaps/i386/qwerty/speakup*

        # Install the udeb files
	for P in ${UDEB_PKGS} ; do  dh_install -p $$P ; done

	dh_consoledata -i
	dh_installdebconf -i 
	# Sort keymaps (including in translations)
	# MUST be after dh_installdebconf
	chmod u+x ./sort-keymaps
	./sort-keymaps

	dh_installdocs -p console-data debian/README.us-intl
	install -d -m755 ${exampledir}
	mv $(docdir)/README.us-intl \
		${docdir}/keymaps/
	mv ${docdir}/keymaps/hypermap.m4 \
		${exampledir}/

        # install changelog in non-udeb only
	dh_installchangelogs -p console-data

	dh_compress -i --package console-data
	dh_fixperms -i
	dh_installdeb -i

	dh_perl       --package console-data -d
	dh_gencontrol --package console-data
	dh_builddeb --package console-data
        # md5sums for deb only, not udeb
	dh_md5sums  --package  console-data

        # Build udebs, avoid automagic problem. Don't use dh_gencontrol guesses
        # instead, register file manually with distaddfile 
	chmod +x ./debian/trim_keymaps.sh
	for P in ${OPTIONAL_UDEB_PKGS} ; do							\
		dpkg-distaddfile  $${P}_${fullversion}_all.udeb debian-installer optional ; 	\
	done
	for P in ${EXTRA_UDEB_PKGS} ; do							\
		 dpkg-distaddfile  $${P}_${fullversion}_all.udeb debian-installer extra ;	\
	done
	for P in ${UDEB_PKGS}; do 								\
		./debian/trim_keymaps.sh ${topdir}/debian/$${P} ; 				\
		dh_link -p $${P} ;								\
		find debian/$${P} -name 'postrm' -exec rm {} \;	 ;				\
		dh_gencontrol --package $${P} -- -fdebian/files~ ;				\
		dh_builddeb --package $${P} 				 			\
			--filename=$${P}_${fullversion}_all.udeb ; 				\
	done


binary-arch:


# Below here is fairly generic really

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean checkroot