>From b47dbc0053f38ded96d1dec1a80b9b80f5e6e6bf Mon Sep 17 00:00:00 2001
From: Ghislain Antony Vaillant <ghisv...@gmail.com>
Date: Sun, 27 Mar 2016 16:22:48 +0100
Subject: [PATCH 1/3] Fix and simplify multi-arch support: - d/patches: drop
 0001-multiarch-path-support.patch and   0004-fix-include-path.patch, no
 longer required. - d/rules: use the LIB_SUFFIX and INCLUDE_INSTALL_DIR cmake
 variables   to inject the multi-arch paths. - d/libjsoncpp-dev.install:
 adjust and simplify the install paths.

---
 debian/libjsoncpp-dev.install                    | 10 ++--
 debian/patches/0001-multiarch-path-support.patch | 62 ------------------------
 debian/patches/0004-fix-include-path.patch       | 15 ------
 debian/patches/series                            |  2 -
 debian/rules                                     |  5 +-
 5 files changed, 7 insertions(+), 87 deletions(-)
 delete mode 100644 debian/patches/0001-multiarch-path-support.patch
 delete mode 100644 debian/patches/0004-fix-include-path.patch

diff --git a/debian/libjsoncpp-dev.install b/debian/libjsoncpp-dev.install
index a27f88d..15ca733 100644
--- a/debian/libjsoncpp-dev.install
+++ b/debian/libjsoncpp-dev.install
@@ -1,5 +1,5 @@
-usr/include/jsoncpp/* usr/include/jsoncpp
-usr/lib/*/lib*.a
-usr/lib/*/lib*.so
-usr/lib/*/pkgconfig*
-usr/lib/cmake/jsoncpp/jsoncppConfig.cmake
+usr/include
+usr/lib/*/*.a
+usr/lib/*/*.so
+usr/lib/*/pkgconfig
+usr/lib/*/cmake
diff --git a/debian/patches/0001-multiarch-path-support.patch b/debian/patches/0001-multiarch-path-support.patch
deleted file mode 100644
index 5069df8..0000000
--- a/debian/patches/0001-multiarch-path-support.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Peter Spiess-Knafl <p...@autistici.org>
-Date: Sat, 28 Feb 2015 00:42:14 +0100
-Subject: multiarch path support
-
----
- src/lib_json/CMakeLists.txt | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/src/lib_json/CMakeLists.txt
-+++ b/src/lib_json/CMakeLists.txt
-@@ -48,8 +48,8 @@
- 
-     INSTALL( TARGETS jsoncpp_lib ${INSTALL_EXPORT}
-          RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
--         LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
--         ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR})
-+         LIBRARY DESTINATION "${LIBRARY_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}"
-+		 ARCHIVE DESTINATION "${ARCHIVE_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}")
- 
-     IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
-         TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib PUBLIC
-@@ -67,8 +67,8 @@
- 
-     INSTALL( TARGETS jsoncpp_lib_static ${INSTALL_EXPORT}
-          RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
--         LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR}
--             ARCHIVE DESTINATION ${ARCHIVE_INSTALL_DIR})
-+		 LIBRARY DESTINATION "${LIBRARY_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}"
-+		 ARCHIVE DESTINATION "${ARCHIVE_INSTALL_DIR}/${CMAKE_LIBRARY_ARCHITECTURE}")
- 
-     IF(NOT CMAKE_VERSION VERSION_LESS 2.8.11)
-         TARGET_INCLUDE_DIRECTORIES( jsoncpp_lib_static PUBLIC
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -12,6 +12,8 @@
- OPTION(BUILD_SHARED_LIBS "Build jsoncpp_lib as a shared library." OFF)
- OPTION(BUILD_STATIC_LIBS "Build jsoncpp_lib static library." ON)
- 
-+include(GNUInstallDirs)
-+
- # Ensures that CMAKE_BUILD_TYPE is visible in cmake-gui on Unix
- IF(NOT WIN32)
-     IF(NOT CMAKE_BUILD_TYPE)
-@@ -114,7 +116,7 @@
- 		"pkg-config/jsoncpp.pc"
- 		@ONLY)
- 	INSTALL(FILES "${CMAKE_BINARY_DIR}/pkg-config/jsoncpp.pc"
--		DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig")
-+			DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
- ENDIF(JSONCPP_WITH_PKGCONFIG_SUPPORT)
- 
- IF(JSONCPP_WITH_CMAKE_PACKAGE)
---- a/pkg-config/jsoncpp.pc.in
-+++ b/pkg-config/jsoncpp.pc.in
-@@ -1,6 +1,6 @@
- prefix=@CMAKE_INSTALL_PREFIX@
- exec_prefix=${prefix}
--libdir=@LIBRARY_INSTALL_DIR@
-+libdir=/usr/@CMAKE_INSTALL_LIBDIR@
- includedir=@INCLUDE_INSTALL_DIR@
- 
- Name: jsoncpp
diff --git a/debian/patches/0004-fix-include-path.patch b/debian/patches/0004-fix-include-path.patch
deleted file mode 100644
index 643376a..0000000
--- a/debian/patches/0004-fix-include-path.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Description: Fix include directory to avoid collisions with libjsonc
-Author: Peter Spiess-Knafl <d...@spiessknafl.at>
-Forwarded: not-needed
-Bug-Debian: https://bugs.debian.org/788379
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -30,7 +30,7 @@
-     CACHE PATH "Install dir for static libraries")
- SET(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
-     CACHE PATH "Install dir for shared libraries")
--SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include
-+SET(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/jsoncpp
-     CACHE PATH "Install dir for headers")
- SET(PACKAGE_INSTALL_DIR lib${LIB_SUFFIX}/cmake
-     CACHE PATH "Install dir for cmake package config files")
diff --git a/debian/patches/series b/debian/patches/series
index da7300c..e200273 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,2 @@
-0004-fix-include-path.patch
-0001-multiarch-path-support.patch
 fix-double-parsing.patch
 
diff --git a/debian/rules b/debian/rules
index c0972cc..9b603c3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,9 +9,8 @@ override_dh_auto_configure:
 			-DBUILD_SHARED_LIBS=ON \
 			-DBUILD_STATIC_LIBS=ON \
 			-DJSONCPP_WITH_CMAKE_PACKAGE=ON \
-			-DCMAKE_INSTALL_PREFIX=/usr \
-			-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
-			-DCMAKE_BUILD_TYPE=RelWithDebInfo
+			-DLIB_SUFFIX="/$(DEB_TARGET_MULTIARCH)" \
+			-DINCLUDE_INSTALL_DIR=/usr/include/jsoncpp
 
 override_dh_auto_build-indep:
 	python doxybuild.py --doxygen=/usr/bin/doxygen
-- 
2.8.0.rc3

Reply via email to