diff -Nru openscenegraph-3.0.1/debian/changelog openscenegraph-3.0.1/debian/changelog
--- openscenegraph-3.0.1/debian/changelog	2012-03-14 11:20:18.000000000 +0000
+++ openscenegraph-3.0.1/debian/changelog	2012-11-20 19:55:42.000000000 +0000
@@ -1,3 +1,16 @@
+openscenegraph (3.0.1-4) unstable; urgency=low
+
+  [ Alberto Luaces ]
+  * Upgraded debhelper compatibility level from 7 to 9.
+  * Upgraded standards version to 3.9.3.
+  * Append options to LDFLAGS instead of replacing its value.
+  * Use of hardening flags for building.
+  * Added a manpage for the osgviewerWX executable.
+  * Changes in the build prefix in order to fix the pkg-config files
+    (Closes: #690878).
+
+ -- Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com>  Tue, 20 Nov 2012 19:07:57 +0000
+
 openscenegraph (3.0.1-3) unstable; urgency=low
 
   * Depend on libpng-dev instead of libpng12-dev for libpng15-transition
diff -Nru openscenegraph-3.0.1/debian/compat openscenegraph-3.0.1/debian/compat
--- openscenegraph-3.0.1/debian/compat	2011-07-07 09:09:55.000000000 +0100
+++ openscenegraph-3.0.1/debian/compat	2012-11-15 23:42:00.000000000 +0000
@@ -1 +1 @@
-7
+9
diff -Nru openscenegraph-3.0.1/debian/control openscenegraph-3.0.1/debian/control
--- openscenegraph-3.0.1/debian/control	2012-03-14 11:15:52.000000000 +0000
+++ openscenegraph-3.0.1/debian/control	2012-11-20 18:32:11.000000000 +0000
@@ -4,7 +4,7 @@
 Maintainer: Loic Dachary (OuoU) <loic@debian.org>
 Uploaders: Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com>, Alberto Luaces <aluaces@udc.es>, Ola Lundqvist <opal@debian.org>
 DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7.0.0),
+Build-Depends: debhelper (>= 9~),
                cmake,
                g++ (>= 3.3.0),
                ccache,
@@ -30,7 +30,7 @@
                libqt4-opengl-dev,
                librsvg2-dev,
                libpoppler-glib-dev
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
 Homepage: http://www.openscenegraph.org/
 Vcs-Git: https://alioth.debian.org/anonscm/git/pkg-osg/pkg-osg.git
 Vcs-Browser: https://alioth.debian.org/scm/browser.php?group_id=100578
diff -Nru openscenegraph-3.0.1/debian/rules openscenegraph-3.0.1/debian/rules
--- openscenegraph-3.0.1/debian/rules	2011-07-07 09:09:55.000000000 +0100
+++ openscenegraph-3.0.1/debian/rules	2012-11-20 18:08:58.000000000 +0000
@@ -18,6 +18,15 @@
 #export DH_VERBOSE=1
 #export DH_OPTIONS=-v
 
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+# At the moment, CMake discards CPPFLAGS, so we have to add its value
+# to C{,XX}FLAGS variables
+
+CFLAGS += $(CPPFLAGS)
+CXXFLAGS += $(CPPFLAGS)
+
 %:
 	dh  $@
 
@@ -55,7 +64,7 @@
 CFLAGS := ${CFLAGS} ${ARCH_C_FLAGS}
 CXXFLAGS := ${CXXFLAGS} ${ARCH_CXX_FLAGS}
 
-LDFLAGS = -Wl,--as-needed
+LDFLAGS += -Wl,--as-needed
 
 #
 # Shared libraries version numbers
@@ -325,7 +334,8 @@
 	osgvirtualprogram.1 \
 	present3D.1 \
 	osguserdata.1 \
-	osgviewerQt.1
+	osgviewerQt.1 \
+	osgviewerWX.1
 
 install-arch: build-arch
 	dh_testdir
@@ -333,8 +343,8 @@
 
 	# Add here commands to install the package into debian/tmp
 	mkdir -p $(CURDIR)/debian/tmp/usr
-	$(MAKE) -C build/osgstatic DESTDIR=$(CURDIR)/debian/tmp/usr install
-	$(MAKE) -C build/osg DESTDIR=$(CURDIR)/debian/tmp/usr install
+	$(MAKE) -C build/osgstatic DESTDIR=$(CURDIR)/debian/tmp install
+	$(MAKE) -C build/osg DESTDIR=$(CURDIR)/debian/tmp install
 	-mv $(CURDIR)/debian/tmp/usr/share/OpenSceneGraph/bin/* $(CURDIR)/debian/tmp/usr/bin
 	for man in ${MANEXAMPLES} ; do rm -f $$man ; ln -s debian/osgexamples.1 $$man ; done
 	for man in ${MANAPPLICATIONS} ; do rm -f $$man ; ln -s debian/osgapplications.1 $$man ; done
@@ -393,7 +403,7 @@
 
 	mkdir -p build/osgstatic ; cd build/osgstatic ; ${SETAFFINITY} cmake --debug-output \
 		-D CMAKE_BUILD_TYPE:STRING=Release \
-		-D CMAKE_INSTALL_PREFIX:PATH=/ \
+		-D CMAKE_INSTALL_PREFIX:PATH=/usr \
 		-D DYNAMIC_OPENTHREADS:BOOL=OFF \
 		-D DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
 		-D BUILD_OSG_EXAMPLES:BOOL=OFF \
@@ -409,7 +419,7 @@
 		-D OPENTHREADS_SOVERSION:STRING=${OPENTHREADS_SOVERSION} \
 		-D OPENSCENEGRAPH_SOVERSION:STRING=${OPENSCENEGRAPH_SOVERSION} \
 		-D CMAKE_BUILD_TYPE:STRING=Release \
-		-D CMAKE_INSTALL_PREFIX:PATH=/ \
+		-D CMAKE_INSTALL_PREFIX:PATH=/usr \
 		-D BUILD_OSG_EXAMPLES:BOOL=ON \
 		-D LIB_POSTFIX="" \
 		${LINKER_FLAGS} \
