Name kbd
Description Linux console font and keytable utilities
Version 2.6.4-2ubuntu2
Package Base
Homepage https://kbd-project.org/
Maintainers ['Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>']
Contributors ['Anton Zinoviev <zinoviev@debian.org>', 'Michael Schutte <michi@debian.org>']
Distro-repo https://git.launchpad.net/ubuntu/+source/kbd/tree/?h=ubuntu/noble
Sources ['https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/../?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/Change-misleading-kbd_mode-message-for-XLATE-mode.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/Check-for-X-in-kbd_mode.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/Miscellaneous-manpage-corrections-and-additions.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/Support-KT_DEAD2-diacritics.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/Various-fixes-to-the-openvt-utility.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/loadkeys_ckbcomp.diff?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/loadkeys_find_usable_console.diff?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/patches/series?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/kbd/plain/debian/watch?h=ubuntu/noble']
Dependencies ['console-setup | console-setup-mini', 'libc6']
Optional-Dependencies []
Build-Dependencies ['dpkg-dev', 'debhelper-compat', 'linuxdoc-tools', 'gettext', 'flex', 'bison', 'pkg-config', 'check']
Provides []
Builddate
Architecture amd64
Distro-Version noble
Licenses []
Hash ed05cafcbedae499a4a12ed492cc935611b8e76e0c291df3a2228b92a55a124c
#!/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 setvtrgb

# 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_USR_SBIN = vcstime setvesablank kbdrate setvtrgb

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
	# cleanup modified or leftover files from previous build
	! test -p tests/testsuite.dir/at-job-fifo || rm -f tests/testsuite.dir/at-job-fifo
	rm -f po/*.gmo po/stamp-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_USR_SBIN)) $(KBD)/usr/sbin/
# initramfs
	install -m 755 debian/kbd.initramfs-hook $(KBD)/usr/share/initramfs-tools/hooks/kbd
# 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