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-22 14:59:06.000000000 +0000
@@ -1,3 +1,16 @@
+openscenegraph (3.0.1-4) unstable; urgency=low
+
+  [ Alberto Luaces ]
+  * 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).
+  * Removal of unused LINKER_FLAGS variable in debian/rules.
+
+ -- Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com>  Thu, 22 Nov 2012 22: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/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-22 15:03:01.000000000 +0000
@@ -5,6 +5,7 @@
 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),
+               dpkg-dev (>= 1.16.1~),
                cmake,
                g++ (>= 3.3.0),
                ccache,
@@ -30,7 +31,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-22 12:14:06.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,13 +403,12 @@
 
 	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 \
 		-D BUILD_OSG_APPLICATIONS:BOOL=OFF \
 		-D LIB_POSTFIX="" \
-		${LINKER_FLAGS} \
 		../../${OSG}
 	${MAKE} ${PARALLEL_OPTIONS} VERBOSE=1 -C build/osgstatic
 
@@ -409,10 +418,9 @@
 		-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} \
 		../../${OSG}
 	${MAKE} ${PARALLEL_OPTIONS} VERBOSE=1 -C build/osg
 
