File: rules

package info (click to toggle)
kbd 2.0.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 14,136 kB
  • sloc: sh: 12,838; ansic: 12,531; pascal: 472; lex: 466; makefile: 394; yacc: 356; perl: 126; sed: 16
file content (71 lines) | stat: -rwxr-xr-x 2,385 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
#!/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-vlock

override_dh_auto_build:
	$(MAKE) -C src/libkeymap CFLAGS="-Os -g" analyze.h
	$(MAKE) -C src/libkeymap 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/ clean
	$(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
	for ITEM in $(UDEB_BINARIES); do install -m755 src/$$ITEM-udeb $(KBD_UDEB)/bin/$$ITEM; done

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