Description: Change the location of tcl binaries to make the packages multiarch compliant.
Author: Andrew Ross <andrewross@users.sourceforge.net>
Index: plplot-5.10.0/bindings/tk/CMakeLists.txt
===================================================================
--- plplot-5.10.0.orig/bindings/tk/CMakeLists.txt	2014-02-28 09:59:44.890958194 +0000
+++ plplot-5.10.0/bindings/tk/CMakeLists.txt	2014-02-28 09:59:44.870958194 +0000
@@ -50,7 +50,7 @@
 
   install(TARGETS plserver
     EXPORT export_plplot
-    DESTINATION ${BIN_DIR}
+    DESTINATION ${LIBEXEC_DIR}
     )
 endif(ENABLE_tkX)
 
Index: plplot-5.10.0/cmake/modules/instdirs.cmake
===================================================================
--- plplot-5.10.0.orig/cmake/modules/instdirs.cmake	2014-02-28 09:59:44.890958194 +0000
+++ plplot-5.10.0/cmake/modules/instdirs.cmake	2014-02-28 09:59:44.870958194 +0000
@@ -71,6 +71,12 @@
 CACHE PATH "install location for man documentation"
 )
 
+set(
+CMAKE_INSTALL_LIBEXECDIR
+${CMAKE_INSTALL_LIBDIR}/${PACKAGE}${VERSION}/bin
+CACHE PATH "install location for executables called by other executables or libraries"
+)
+
 # Configured PLplot install locations determined from user-updatable
 # cached values above.
 
@@ -112,6 +118,9 @@
 # Man pages.
 set(MAN_DIR ${CMAKE_INSTALL_MANDIR})
 
+# Libexec.
+set(LIBEXEC_DIR ${CMAKE_INSTALL_LIBEXECDIR})
+
 # Other path-related variables.
 
 # Absolute path of top-level build directory.
Index: plplot-5.10.0/plplot_config.h.in
===================================================================
--- plplot-5.10.0.orig/plplot_config.h.in	2014-02-28 09:59:44.890958194 +0000
+++ plplot-5.10.0/plplot_config.h.in	2014-02-28 09:59:44.874958194 +0000
@@ -20,6 +20,9 @@
 // Location of executables
 #define BIN_DIR                  "@BIN_DIR@"
 
+// Location of library executables
+#define LIBEXEC_DIR              "@LIBEXEC_DIR@"
+
 // Location of Build tree
 #define BUILD_DIR                "@BUILD_DIR@"
 
Index: plplot-5.10.0/src/plctrl.c
===================================================================
--- plplot-5.10.0.orig/src/plctrl.c	2014-02-28 09:59:44.890958194 +0000
+++ plplot-5.10.0/src/plctrl.c	2014-02-28 09:59:44.878958194 +0000
@@ -2124,6 +2124,7 @@
 //!	current directory
 //!	PLPLOT_HOME_ENV/bin = $(PLPLOT_HOME)/bin
 //!	BIN_DIR
+//!	LIBEXEC_DIR
 //!
 //! The caller must free the returned pointer (points to malloc'ed memory)
 //! when finished with it.
@@ -2189,6 +2190,14 @@
     if ( !plFindName( fs ) )
         return fs;
 #endif
+
+// LIBEXEC_DIR
+
+#if defined ( LIBEXEC_DIR )
+    plGetName( LIBEXEC_DIR, "", fn, &fs );
+    if ( !plFindName( fs ) )
+        return fs;
+#endif
 
 // Crapped out
 
