From 11bddf07dd5451f0db1116a32a92b9c371aa2c95 Mon Sep 17 00:00:00 2001
From: Vincent Tavernier <vincent.tavernier@inria.fr>
Date: Wed, 29 Nov 2017 18:00:35 +0100
Subject: [PATCH] Fix dev packages on multiarch

---
 CMakeLists.txt                  | 4 +++-
 buildpackages.sh                | 2 +-
 debian/control                  | 2 +-
 debian/libshadertoy-dev.dirs    | 1 -
 debian/libshadertoy-dev.install | 3 ++-
 debian/libshadertoy0.dirs       | 1 -
 6 files changed, 7 insertions(+), 6 deletions(-)
 delete mode 100644 debian/libshadertoy-dev.dirs
 delete mode 100644 debian/libshadertoy0.dirs

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3bfdfa1..341b9b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,6 +164,8 @@ set_target_properties(shadertoy PROPERTIES
 install(TARGETS shadertoy
 		DESTINATION ${CMAKE_INSTALL_LIBDIR}
 		EXPORT shadertoy)
+install(EXPORT shadertoy
+		DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/shadertoy)
 
 install(EXPORT shadertoy
 		COMPONENT shadertoy-dev
@@ -178,7 +180,7 @@ configure_file(shadertoy-config-version.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/sha
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/shadertoy-config.cmake
 			  ${CMAKE_CURRENT_BINARY_DIR}/shadertoy-config-version.cmake
 		COMPONENT shadertoy-dev
-		DESTINATION ${CMAKE_INSTALL_DATADIR}/shadertoy)
+		DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/shadertoy)
 
 # Install the examples
 install(DIRECTORY examples
diff --git a/buildpackages.sh b/buildpackages.sh
index 77c12e4..10e1eac 100755
--- a/buildpackages.sh
+++ b/buildpackages.sh
@@ -30,7 +30,7 @@ for DISTRIBUTION in stretch xenial; do
 		echo "[==== TESTING ARTIFACTS $DISTRIBUTION-$ARCH ====]" >&2
 		(cd $LIBDIRECTORY &&
 			autopkgtest ../libshadertoy-$LIBVERSION-$DISTRIBUTION/libshadertoy*_$ARCH.deb \
-				../libshadertoy-$LIBVERSION-$DISTRIBUTION/libshadertoy-dev_${LIBVERSION}_all.deb \
+				../libshadertoy-$LIBVERSION-$DISTRIBUTION/libshadertoy-dev_${LIBVERSION}_$ARCH.deb \
 				-- schroot $DISTRIBUTION-$ARCH-sbuild)
 		if [ "$?" -ne "0" ]; then
 			echo "[==== TESTS FAILED FOR $DISTRIBUTION-$ARCH ====]" >&2
diff --git a/debian/control b/debian/control
index 7d3bb05..6a71a53 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Vcs-Browser: https://gitlab.inria.fr/vtaverni/libshadertoy/tree/master
 
 Package: libshadertoy-dev
 Section: libdevel
-Architecture: all
+Architecture: any
 Depends: libshadertoy0 (= ${binary:Version}), ${misc:Depends},
  libboost-all-dev, libsoil-dev, libjpeg-dev, libglew-dev, libgl-dev,
  libglm-dev, libunwind-dev
diff --git a/debian/libshadertoy-dev.dirs b/debian/libshadertoy-dev.dirs
deleted file mode 100644
index e43b95c..0000000
--- a/debian/libshadertoy-dev.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/include
diff --git a/debian/libshadertoy-dev.install b/debian/libshadertoy-dev.install
index e54bb63..f6639a8 100644
--- a/debian/libshadertoy-dev.install
+++ b/debian/libshadertoy-dev.install
@@ -1,3 +1,4 @@
 usr/include/*
+usr/lib/*/cmake/shadertoy/*
 usr/share/shadertoy/*
-usr/share/doc/*
\ No newline at end of file
+usr/share/doc/*
diff --git a/debian/libshadertoy0.dirs b/debian/libshadertoy0.dirs
deleted file mode 100644
index 6845771..0000000
--- a/debian/libshadertoy0.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
-- 
GitLab