diff -Nru libselinux-2.1.9/debian/changelog libselinux-2.1.9/debian/changelog
--- libselinux-2.1.9/debian/changelog	2012-06-11 13:07:40.000000000 +0000
+++ libselinux-2.1.9/debian/changelog	2013-02-08 11:54:21.000000000 +0000
@@ -1,3 +1,9 @@
+libselinux (2.1.9-5ubuntu1profile1) raring; urgency=low
+
+  * Add staging info to control and fix staged build
+
+ -- Wookey <wookey@e102475-lin>  Fri, 08 Feb 2013 11:36:58 +0000
+
 libselinux (2.1.9-5ubuntu1) quantal; urgency=low
 
   * Resynchronise with Debian.  Remaining changes:
diff -Nru libselinux-2.1.9/debian/control libselinux-2.1.9/debian/control
--- libselinux-2.1.9/debian/control	2012-06-11 13:07:18.000000000 +0000
+++ libselinux-2.1.9/debian/control	2013-01-10 19:25:29.000000000 +0000
@@ -10,11 +10,11 @@
 Standards-Version: 3.9.3
 Build-Depends: debhelper (>= 9),
                file,
-               gem2deb (>= 0.2.7~),
+               gem2deb (>= 0.2.7~) <!stage1>,
                libsepol1-dev (>= 2.1.4-2),
                pkg-config,
-               python-all-dev (>= 2.6.6-3~),
-               swig
+               python-all-dev (>= 2.6.6-3~) <!stage1>,
+               swig <!stage1>
 X-Python-Version: >= 2.4
 XS-Ruby-Versions: all
 
diff -Nru libselinux-2.1.9/debian/rules libselinux-2.1.9/debian/rules
--- libselinux-2.1.9/debian/rules	2012-06-10 06:33:16.000000000 +0000
+++ libselinux-2.1.9/debian/rules	2013-02-09 19:55:13.000000000 +0000
@@ -8,14 +8,16 @@
 DEB_HOST_GNU_CPU	:= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
 DEB_HOST_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_MULTIARCH	:= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-LIBDIR_LIBSEPOL		:= $(shell pkg-config --variable=libdir libsepol)
+DEB_BUILD_GNU_TYPE      := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
-# for cross compilation
-ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
-  PREFIX = /usr
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+PKGCONFIG := pkg-config
 else
-  PREFIX = /usr/$(DEB_HOST_GNU_TYPE)
+PKGCONFIG := $(DEB_HOST_GNU_TYPE)-pkg-config
 endif
+LIBDIR_LIBSEPOL		:= $(shell $(PKGCONFIG) --variable=libdir libsepol)
+
+PREFIX = /usr
 
 ## Default target
 binary:
@@ -33,20 +35,24 @@
 .PHONY: FORCE
 FORCE:
 
-## By default, pass everything through debhelper automatically
-export DH_OPTIONS
-%: FORCE
-	@dh $@ --with=python2,ruby
-
 ## Don't try to rebuild the debian/rules file
 debian/rules:
 	@touch $@
 
 ## Skip python/ruby packages during stage1 build
-ifeq ($(DEB_STAGE),stage1)
+ifeq ($(DEB_BUILD_PROFILE),stage1)
 DH_OPTIONS += -Npython-selinux -Nruby-selinux -Nlibselinux-ruby1.8
+dh_modules =
+else
+dh_modules = --with=python2,ruby
 endif
 
+## By default, pass everything through debhelper automatically
+export DH_OPTIONS
+%: FORCE
+	@dh $@ $(dh_modules)
+
+
 ## Set up some variables to be passed to the upstream Makefile
 extra_make_args  = LIBSEPOLDIR=$(LIBDIR_LIBSEPOL)
 extra_make_args += ARCH=$(DEB_HOST_GNU_CPU)
@@ -72,13 +78,15 @@
 	install -d -m 755 $(DESTDIR)/usr/share/man/man1
 	mv $(DESTDIR)/usr/share/man/man8/getenforce.8     $(DESTDIR)/usr/share/man/man1/getenforce.1
 	mv $(DESTDIR)/usr/share/man/man8/selinuxenabled.8 $(DESTDIR)/usr/share/man/man1/selinuxenabled.1
-ifneq ($(DEB_STAGE),stage1)
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 	+$(MAKE) PREFIX="$(PREFIX)" $(python_extra_install_args) -f debian/python.mk
 	+$(MAKE) PREFIX="$(PREFIX)" $(extra_install_args) -f debian/ruby.mk
 else
 	@echo "Detected stage-1 bootstrap, skipping python/ruby bindings..."
 endif
 
+ifneq ($(DEB_BUILD_PROFILE),stage1)
 ## Generate a hard error for any upstream files we don't install
 override_dh_install: FORCE
 	dh_install --fail-missing
+endif
