Bug#819376: Fix and simplify multi-arch handling

2016-03-28 Thread Ghislain Vaillant

I would have appreciated that the patches were committed to the
packaging repository **with** authorship information:

here:


https://anonscm.debian.org/git/collab-maint/libjsoncpp.git/commit/?id=b832e69d7861b412f93510dcd57df7b6e70e9fc6

and here:


https://anonscm.debian.org/git/collab-maint/libjsoncpp.git/commit/?id=e0f7dd90905dfe418a58bd5c37d5cbbce2fe8cd8

I guess it is too late now, but please be careful in the future. Thanks
for crediting my work in the changelog though.

Ghis


On 28/03/16 03:50, Peter Spiess-Knafl wrote:

Hi Ghis!

Thank you for your patch. I applied it in the git repo, an upload will
follow soon.

It really makes things much easier, thank you!

Greetings
Peter

On 03/27/2016 09:43 PM, Ghislain Vaillant wrote:

Package: libjsoncpp
Version: 1.6.5-4

Dear maintainer,

Whilst using your package, I noticed that the CMake package files
were not installed in a multi-arch enabled location of the form:

/usr/lib//cmake/

I am forwarding a patch to the packaging repository which addresses
this.

I also took this opportunity to significantly simplify multi-arch path
injection to the build system. So far, this was handled by patching the
sources (last resort solution) whilst the upstream build system does
provide overridable CMake variables for this purpose. This patch uses
these variables instead and drops the corresponding patches from the
patch-queue.

A successful build with the applied patch is available here:


http://debomatic-amd64.debian.net/distribution#unstable/libjsoncpp/1.6.5-4.1/buildlog


Best regards,
Ghis





Bug#819376: Fix and simplify multi-arch handling

2016-03-27 Thread Peter Spiess-Knafl
Hi Ghis!

Thank you for your patch. I applied it in the git repo, an upload will
follow soon.

It really makes things much easier, thank you!

Greetings
Peter

On 03/27/2016 09:43 PM, Ghislain Vaillant wrote:
> Package: libjsoncpp
> Version: 1.6.5-4
> 
> Dear maintainer,
> 
> Whilst using your package, I noticed that the CMake package files
> were not installed in a multi-arch enabled location of the form:
> 
> /usr/lib//cmake/
> 
> I am forwarding a patch to the packaging repository which addresses
> this.
> 
> I also took this opportunity to significantly simplify multi-arch path
> injection to the build system. So far, this was handled by patching the
> sources (last resort solution) whilst the upstream build system does
> provide overridable CMake variables for this purpose. This patch uses
> these variables instead and drops the corresponding patches from the
> patch-queue.
> 
> A successful build with the applied patch is available here:
> 
> 
> http://debomatic-amd64.debian.net/distribution#unstable/libjsoncpp/1.6.5-4.1/buildlog
> 
> 
> Best regards,
> Ghis
> 



Bug#819376: Fix and simplify multi-arch handling (added patch)

2016-03-27 Thread Ghislain Vaillant
 >From b47dbc0053f38ded96d1dec1a80b9b80f5e6e6bf Mon Sep 17 00:00:00 2001
From: Ghislain Antony Vaillant 
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..000
--- a/debian/patches/0001-multiarch-path-support.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Peter Spiess-Knafl 
-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..000
--- 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 
-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

Bug#819376: Fix and simplify multi-arch handling

2016-03-27 Thread Ghislain Vaillant

Package: libjsoncpp
Version: 1.6.5-4

Dear maintainer,

Whilst using your package, I noticed that the CMake package files
were not installed in a multi-arch enabled location of the form:

/usr/lib//cmake/

I am forwarding a patch to the packaging repository which addresses
this.

I also took this opportunity to significantly simplify multi-arch path
injection to the build system. So far, this was handled by patching the
sources (last resort solution) whilst the upstream build system does 
provide overridable CMake variables for this purpose. This patch uses

these variables instead and drops the corresponding patches from the
patch-queue.

A successful build with the applied patch is available here:


http://debomatic-amd64.debian.net/distribution#unstable/libjsoncpp/1.6.5-4.1/buildlog

Best regards,
Ghis