diff -urN origs/libsemanage-2.1.6/debian/changelog libsemanage-2.1.6/debian/changelog
--- origs/libsemanage-2.1.6/debian/changelog	2013-01-08 22:42:02.000000000 +0000
+++ libsemanage-2.1.6/debian/changelog	2013-01-22 20:46:24.000000000 +0000
@@ -1,3 +1,10 @@
+libsemanage (2.1.6-6ubuntu2) precise; urgency=low
+
+  * Fix crossbuild so it runs without ruby and python deps installed
+  * Fix dh_*clean override so it still runs 'make clean'
+
+ -- Wookey <wookey@wookware.org>  Tue, 22 Jan 2013 20:45:30 +0000
+
 libsemanage (2.1.6-6ubuntu1) raring; urgency=low
 
   * Add a DEB_STAGE=1 build variant that skips ruby & python bindings.
diff -urN origs/libsemanage-2.1.6/debian/control libsemanage-2.1.6/debian/control
--- origs/libsemanage-2.1.6/debian/control	2013-01-09 10:05:03.000000000 +0000
+++ libsemanage-2.1.6/debian/control	2013-01-22 11:29:57.000000000 +0000
@@ -11,15 +11,15 @@
                debhelper (>= 9),
                file,
                flex,
-               gem2deb (>= 0.2.13~),
+               gem2deb (>= 0.2.13~) <!stage1>,
                libbz2-dev,
                libcunit1-dev,
                libselinux1-dev (>= 2.1.9),
                libsepol1-dev (>= 2.1.4),
                libustr-dev,
                pkg-config,
-               python-all-dev (>= 2.6.6-3~),
-               swig
+               python-all-dev (>= 2.6.6-3~) <!stage1>,
+               swig <!stage1>
 Homepage: http://userspace.selinuxproject.org/
 X-Python-Version: >= 2.5
 XS-Ruby-Versions: all
diff -urN origs/libsemanage-2.1.6/debian/patches/crossbuild-support libsemanage-2.1.6/debian/patches/crossbuild-support
--- origs/libsemanage-2.1.6/debian/patches/crossbuild-support	1970-01-01 01:00:00.000000000 +0100
+++ libsemanage-2.1.6/debian/patches/crossbuild-support	2013-01-22 21:13:15.000000000 +0000
@@ -0,0 +1,35 @@
+Description: Enable crossbuilding
+ Set variables and paths for crossbuilding.
+ .
+ libsemanage (2.1.6-6ubuntu2) precise; urgency=low
+ .
+   * Fix crossbuild so it runs without ruby and python deps installed
+   * Set $CC and $LD and ensure library path is correct for multiarch
+       crossbuilds
+Author: Wookey <wookey@wookware.org>
+
+Last-Update: <2013-01-22>
+
+--- libsemanage-2.1.6.orig/src/Makefile
++++ libsemanage-2.1.6/src/Makefile
+@@ -8,8 +8,8 @@ RUBYPREFIX ?= $(notdir $(RUBY))
+ 
+ # Installation directories.
+ PREFIX ?= $(DESTDIR)/usr
+-LIBDIR ?= $(PREFIX)/lib
+-SHLIBDIR ?= $(PREFIX)/lib
++LIBDIR ?= $(PREFIX)/$(LIBBASE)
++SHLIBDIR ?= $(PREFIX)/$(LIBBASE)
+ INCLUDEDIR ?= $(PREFIX)/include
+ PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
+ PYINC ?= $(shell pkg-config --cflags $(PYPREFIX))
+--- libsemanage-2.1.6.orig/tests/Makefile
++++ libsemanage-2.1.6/tests/Makefile
+@@ -11,7 +10,6 @@ LIBS = ../src/libsemanage.a /usr/lib/$(D
+ ###########################################################################
+ 
+ EXECUTABLE = libsemanage-tests
+-CC = gcc
+ CFLAGS = -c -g -o0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+ INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include
+ LDFLAGS = -lcunit -lustr -lbz2
diff -urN origs/libsemanage-2.1.6/debian/patches/series libsemanage-2.1.6/debian/patches/series
--- origs/libsemanage-2.1.6/debian/patches/series	2013-01-08 17:00:52.000000000 +0000
+++ libsemanage-2.1.6/debian/patches/series	2013-01-22 20:52:35.000000000 +0000
@@ -4,3 +4,4 @@
 tests-makefile
 no-link-libpython.patch
 prefix-rubymodule.patch
+crossbuild-support
diff -urN origs/libsemanage-2.1.6/debian/python-semanage.debhelper.log libsemanage-2.1.6/debian/python-semanage.debhelper.log
diff -urN origs/libsemanage-2.1.6/debian/ruby-semanage.debhelper.log libsemanage-2.1.6/debian/ruby-semanage.debhelper.log
diff -urN origs/libsemanage-2.1.6/debian/rules libsemanage-2.1.6/debian/rules
--- origs/libsemanage-2.1.6/debian/rules	2013-01-08 22:40:24.000000000 +0000
+++ libsemanage-2.1.6/debian/rules	2013-01-22 20:49:29.000000000 +0000
@@ -1,23 +1,31 @@
 #!/usr/bin/make -f
-#export DH_VERBOSE=1
+export DH_VERBOSE=1
 
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+# set architecture and multiarch variables
+include /usr/share/dpkg/architecture.mk
 
 ifeq ($(DEB_STAGE),stage1)
 export DH_OPTIONS += -Nruby-semanage -Npython-semanage -Nlibsemanage-ruby1.8
+DH_PACKAGES = ""
 else
 PYVERSIONS = $(shell pyversions -rv)
+DH_PACKAGES = "--with python2 --with ruby"
 endif
 
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+  CROSS=$(DEB_HOST_GNU_TYPE)-
+endif
+
+
 # The build system doesn't use CPPFLAGS, pass them to CFLAGS to enable the
 # missing (hardening) flags.
 export DEB_CFLAGS_MAINT_APPEND = $(shell dpkg-buildflags --get CPPFLAGS)
 
 %:
-	dh $@ --with python2 --with ruby
+	dh $@ $(DH_PACKAGES)
 
 override_dh_auto_build:
-	$(MAKE) all LIBBASE="lib/${DEB_HOST_MULTIARCH}"
+	$(MAKE)  all LIBBASE="lib/${DEB_HOST_MULTIARCH}" CC=$(CROSS)gcc LD=$(CROSS)ld
 
 ifneq ($(DEB_STAGE),stage1)
 	set -ex; $(foreach py,$(PYVERSIONS), $(MAKE) pywrap PYTHON=python$(py) PYPREFIX=python-$(py);)
@@ -48,7 +56,7 @@
 	    RUBYINSTALL="${CURDIR}/debian/tmp/usr/lib/ruby/vendor_ruby/\$${RUBYLIBVER}/\$${RUBYPLATFORM}";
 endif
 
-override_dh_auto_clean:
+override_dh_clean:
 ifneq ($(DEB_STAGE),stage1)
 	for version in $(ALL_PY_VERSION); do              \
 	  $(MAKE) clean PYTHON=python$$version;  \
diff -urN origs/libsemanage-2.1.6/src/Makefile libsemanage-2.1.6/src/Makefile
--- origs/libsemanage-2.1.6/src/Makefile	2013-01-22 20:37:43.000000000 +0000
+++ libsemanage-2.1.6/src/Makefile	2013-01-22 21:08:52.000000000 +0000
@@ -8,8 +8,8 @@
 
 # Installation directories.
 PREFIX ?= $(DESTDIR)/usr
-LIBDIR ?= $(PREFIX)/lib
-SHLIBDIR ?= $(PREFIX)/lib
+LIBDIR ?= $(PREFIX)/$(LIBBASE)
+SHLIBDIR ?= $(PREFIX)/$(LIBBASE)
 INCLUDEDIR ?= $(PREFIX)/include
 PYLIBVER ?= $(shell $(PYTHON) -c 'import sys;print("python%d.%d" % sys.version_info[0:2])')
 PYINC ?= $(shell pkg-config --cflags $(PYPREFIX))
diff -urN origs/libsemanage-2.1.6/tests/Makefile libsemanage-2.1.6/tests/Makefile
--- origs/libsemanage-2.1.6/tests/Makefile	2013-01-22 20:37:43.000000000 +0000
+++ libsemanage-2.1.6/tests/Makefile	2013-01-22 21:10:34.000000000 +0000
@@ -11,7 +11,6 @@
 ###########################################################################
 
 EXECUTABLE = libsemanage-tests
-CC = gcc
 CFLAGS = -c -g -o0 -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
 INCLUDE = -I$(TESTSRC) -I$(TESTSRC)/../include
 LDFLAGS = -lcunit -lustr -lbz2
