diff -ur libterm-readkey-perl-2.30/debian/rules libterm-readkey-perl-2.30.fixed/debian/rules
--- libterm-readkey-perl-2.30/debian/rules	2012-09-27 02:50:34.000000000 +0100
+++ libterm-readkey-perl-2.30.fixed/debian/rules	2012-09-27 02:57:09.000000000 +0100
@@ -9,6 +9,8 @@
 
 include /usr/share/quilt/quilt.make
 
+DEB_HOST_GNU_TYPE       := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+
 # If set to a true value then MakeMaker's prompt function will
 # always return the default without waiting for user input.
 export PERL_MM_USE_DEFAULT=1
@@ -18,6 +20,9 @@
 TMP     = $(CURDIR)/debian/$(PACKAGE)
 DOC     = $(TMP)/usr/share/doc/$(PACKAGE)
 
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+HOSTLIB=/usr/lib/$(DEB_HOST_GNU_TYPE)/perl/5.14.2/
+
 # Allow disabling build optimisation by setting noopt in
 # $DEB_BUILD_OPTIONS
 CFLAGS = -Wall -g
@@ -31,9 +36,11 @@
 build-stamp: $(QUILT_STAMPFN)
 	dh_testdir
 	# Add commands to compile the package here
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	$(MAKE) OPTIMIZE="$(CFLAGS)" LD_RUN_PATH=""
+	$(PERL) Makefile.PL INSTALLDIRS=vendor CC=$(CC) LD=$(CC) INSTALLVENDORARCHLIB=/usr/lib/$(DEB_HOST_GNU_TYPE)/perl5
+	$(MAKE) PERL_INC=$(HOSTLIB)/CORE OPTIMIZE="$(CFLAGS)" LD_RUN_PATH=""
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 	$(MAKE) test
+endif
 	touch $@
 
 clean: unpatch
