[Pkg-kbd-devel] Bug#670653: kbd: support cross-building

Colin Watson cjwatson at ubuntu.com
Fri Apr 27 16:17:17 UTC 2012


Package: kbd
Version: 1.15.3-7
Severity: wishlist
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch quantal

This patch makes it possible to cross-build the kbd package.  The
simplest approach involves bumping to debhelper compat level 9 so that
dh_auto_configure will do the right thing.

  * Build-depend on gettext:any, since we only need it to run tools at
    build-time.
  * Use dh_auto_configure.
  * Pass CC=$(DEB_HOST_GNU_TYPE)-gcc when cross-building contrib.

diff -Nru kbd-1.15.3/debian/compat kbd-1.15.3/debian/compat
--- kbd-1.15.3/debian/compat	2011-09-23 21:05:40.000000000 +0100
+++ kbd-1.15.3/debian/compat	2012-04-27 16:56:20.000000000 +0100
@@ -1 +1 @@
-8
+9
diff -Nru kbd-1.15.3/debian/control kbd-1.15.3/debian/control
--- kbd-1.15.3/debian/control	2011-09-23 21:41:57.000000000 +0100
+++ kbd-1.15.3/debian/control	2012-04-27 16:56:37.000000000 +0100
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Console utilities maintainers <pkg-kbd-devel at lists.alioth.debian.org>
 Uploaders: Michael Schutte <michi at debian.org>, Anton Zinoviev <zinoviev at debian.org>
-Build-Depends: dpkg-dev (>= 1.16.1), debhelper (>= 8), autoconf, automake, linuxdoc-tools, gettext, flex, bison
+Build-Depends: dpkg-dev (>= 1.16.1), debhelper (>= 8.9.0), autoconf, automake, linuxdoc-tools, gettext:any, flex, bison
 Standards-Version: 3.9.2
 Vcs-Git: git://anonscm.debian.org/git/pkg-kbd/kbd.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-kbd/kbd.git
diff -Nru kbd-1.15.3/debian/rules kbd-1.15.3/debian/rules
--- kbd-1.15.3/debian/rules	2011-09-23 20:59:19.000000000 +0100
+++ kbd-1.15.3/debian/rules	2012-04-27 16:32:58.000000000 +0100
@@ -17,6 +17,12 @@
 MOVE_TO_SBIN = kbdrate
 MOVE_TO_USR_SBIN = vcstime setvesablank
 
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_GNU_TYPE  := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+	CROSS := CC=$(DEB_HOST_GNU_TYPE)-gcc
+endif
+
 %:
 	dh $@
 
@@ -32,8 +38,7 @@
 	rm -f src/loadkeys.c src/loadkeys.h src/loadkeys.analyze.c
 
 override_dh_auto_configure:
-	./configure --prefix=/usr --datadir=/usr/share --mandir=/usr/share/man --enable-nls \
-		$(shell dpkg-buildflags --export=configure)
+	dh_auto_configure -- --enable-nls
 
 override_dh_auto_build:
 	$(MAKE) -C po/ eo.gmo it.gmo ru.gmo
@@ -42,7 +47,7 @@
 	$(MAKE) -C src/ clean
 	$(MAKE)
 	$(MAKE) -C src/ $(EXTRA_BINARIES)
-	$(MAKE) CFLAGS="-O2 -g" -C contrib/ $(CONTRIB_BINARIES)
+	$(MAKE) $(CROSS) CFLAGS="-O2 -g" -C contrib/ $(CONTRIB_BINARIES)
 
 override_dh_auto_install:
 # the kbd “core”

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Pkg-kbd-devel mailing list