This patch ensures that the package builds correctly 
for Debian GNU/Linux systems.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e647b3..83a7982 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -514,6 +514,30 @@ endforeach(i)
 add_custom_target(doc_progs)
 add_dependencies(doc_progs ${OpenMS_doc_executables} TOPP UTILS GUI)
 
+if(DEBIAN_BUILD)
+## Official Debian stuff by Filippo Rusconi <lopippo@debian.org>
+## This stuff was put here after the suggestion made by 
+## Hannes Roest (release manager of the upstream project).
+
+# No RPATH at all in any of the binaries built here:
+set (CMAKE_SKIP_RPATH TRUE)
+MESSAGE(STATUS "Official Debian packaging recognized")
+MESSAGE(STATUS "CMAKE_SKIP_RPATH: ${CMAKE_SKIP_RPATH}")
+
+# Let's have the lib version and the soversion in
+# the lib filename. No symlinking upon install.
+set(OPENMS_VSTRING "${OPENMS_PACKAGE_VERSION_MAJOR}.${OPENMS_PACKAGE_VERSION_MINOR}.${OPENMS_PACKAGE_VERSION_PATCH}")
+set_target_properties(OpenMS PROPERTIES VERSION ${OPENMS_VSTRING} SOVERSION ${OPENMS_VSTRING})
+install(TARGETS OpenMS LIBRARY DESTINATION lib NAMELINK_SKIP)
+set_target_properties(OpenMS_GUI PROPERTIES VERSION ${OPENMS_VSTRING} SOVERSION ${OPENMS_VSTRING})
+install(TARGETS OpenMS_GUI LIBRARY DESTINATION lib NAMELINK_SKIP)
+set_target_properties(OpenSwathAlgo PROPERTIES VERSION ${OPENMS_VSTRING} SOVERSION ${OPENMS_VSTRING})
+install(TARGETS OpenSwathAlgo LIBRARY DESTINATION lib NAMELINK_SKIP)
+
+# Force *.so to be used, not *.a.
+set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
+endif()
+
 ##### CTDs ####
 # We will use this path for the knime packages and the osx installer
 set(SEARCH_ENGINES_DIRECTORY "" CACHE PATH "Directory containing the search engine executables that should be shipped with OpenMS. Note: We expect the layout from the SVN.")
