File: rules

package info (click to toggle)
kbd 2.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 14,964 kB
  • sloc: ansic: 13,897; javascript: 3,038; sh: 1,973; pascal: 643; makefile: 602; lex: 532; yacc: 354; perl: 126
file content (86 lines) | stat: -rwxr-xr-x 2,804 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
#!/usr/bin/make -f

TOPDIR = $(shell pwd)
KBD = $(TOPDIR)/debian/kbd
KBD_DOC = $(KBD)/usr/share/doc/kbd
KBD_UDEB = $(TOPDIR)/debian/kbd-udeb

# build these twice, once optimized for size (for kbd-udeb)
UDEB_BINARIES = loadkeys kbd_mode setfont

# non-standard binaries to build
EXTRA_BINARIES = screendump setlogcons setvesablank
CONTRIB_BINARIES = codepage splitfont vcstime

# we don’t want these in /usr/bin
MOVE_TO_BIN = kbd_mode setfont fgconsole openvt chvt dumpkeys unicode_start loadkeys
MOVE_TO_SBIN = kbdrate
MOVE_TO_USR_SBIN = vcstime setvesablank

include /usr/share/dpkg/architecture.mk

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	CROSS := CC=$(DEB_HOST_GNU_TYPE)-gcc
endif

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	[ ! -f Makefile ] || $(MAKE) clean
	cd src/ && rm -f $(EXTRA_BINARIES) *-udeb
	cd contrib/ && rm -f $(CONTRIB_BINARIES)
	rm -f po/gr.po			# replaced by el.po
	# force rebuilding of generated code
	rm -f src/libkeymap/analyze.h src/libkeymap/analyze.c

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-nls \
		--disable-libkeymap \
		--disable-vlock

override_dh_auto_build:
ifeq (, $(filter noudeb, $(DEB_BUILD_PROFILES)))
	$(MAKE) -C src/libkeymap CFLAGS="-Os -g" analyze.h
	$(MAKE) -C src/libcommon CFLAGS="-Os -g"
	$(MAKE) -C src/libkbdfile CFLAGS="-Os -g"
	$(MAKE) -C src/libkeymap CFLAGS="-Os -g"
	$(MAKE) -C src/libkfont CFLAGS="-Os -g"
	$(MAKE) -C src/ CFLAGS="-Os -g" $(UDEB_BINARIES)
	cd src/ && for ITEM in $(UDEB_BINARIES); do mv $$ITEM $$ITEM-udeb; done
	$(MAKE) -C src/libkeymap clean
	$(MAKE) -C src/libcommon clean
	$(MAKE) -C src/libkbdfile clean
	$(MAKE) -C src/libkfont clean
	$(MAKE) -C src/ clean
endif
	$(MAKE)
	$(MAKE) -C src/ $(EXTRA_BINARIES)
	$(MAKE) $(CROSS) CFLAGS="-O2 -g" -C contrib/ $(CONTRIB_BINARIES)

override_dh_auto_install:
# the kbd “core”
	$(MAKE) DESTDIR=$(KBD) install-exec
	$(MAKE) DESTDIR=$(KBD) -C po/ install
	$(MAKE) DESTDIR=$(KBD) -C docs/man/ install
# some additional utilities
	install -m755 $(addprefix src/,$(EXTRA_BINARIES)) $(KBD)/usr/bin/
	install -m755 $(addprefix contrib/,$(CONTRIB_BINARIES)) $(KBD)/usr/bin/
	install -m755 data/keymaps/i386/mk_modmap $(KBD)/usr/bin
# move everything where it belongs
	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_BIN)) $(KBD)/bin/
	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_SBIN)) $(KBD)/sbin/
	mv $(addprefix debian/kbd/usr/bin/,$(MOVE_TO_USR_SBIN)) $(KBD)/usr/sbin/
# prepare udeb
ifeq (, $(filter noudeb, $(DEB_BUILD_PROFILES)))
	for ITEM in $(UDEB_BINARIES); do install -m755 src/$$ITEM-udeb $(KBD_UDEB)/bin/$$ITEM; done
endif
# drop libtool files
	find $(KBD) -name '*.la' -delete

override_dh_installdocs:
	dh_installdocs
	install -d $(KBD_DOC)/charsets
	cp docs/doc/iso8859.info docs/doc/iso*.txt docs/doc/cp*.txt $(KBD_DOC)/charsets