From 8c1ca9708549c483647509e292b8d24059158daf Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawars@ncbs.res.in>
Date: Thu, 1 Mar 2018 17:58:21 +0530
Subject: [PATCH] Finally. Needs to write setup.cfg file to make /usr/local 
 and /usr prefix consistent.

---
 .travis.yml                      | 2 --
 debian/rules                     | 2 +-
 moose-core/CMakeLists.txt        | 7 ++++---
 moose-core/python/setup.cmake.py | 1 +
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 047a95a5..1a6d6efd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,4 @@
 sudo : required
-dist : trusty
-group : edge
 
 compiler:
     - gcc
diff --git a/debian/rules b/debian/rules
index 823c7f63..b9f79dc0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,7 +13,7 @@ override_dh_auto_clean:
 
 # consider using -DUSE_VERSIONED_DIR=ON if backporting
 override_dh_auto_configure:
-	cmake -DCMAKE_INSTALL_PREFIX=debian/tmp/usr
+	cmake -DCMAKE_INSTALL_PREFIX=debian/tmp/usr -DCMAKE_VERSION=3.2.git
 
 override_dh_auto_build:
 	make VERBOSE=0 -j`nproc`
diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt
index 59bd2d49..6b40a8ed 100644
--- a/moose-core/CMakeLists.txt
+++ b/moose-core/CMakeLists.txt
@@ -461,11 +461,12 @@ endif( )
 
 # get platform and arch using python.
 # NOTE: creating bdist or bdist_dump uses /usr and /usr/local on rpm and deb
-# based unix respectively. Not a great situation to be in. We are using
-# bdist_egg and then copy everything from egg/. 
+# based unix respectively. Not a great situation to be in. Need to write a
+# setup.cfg file to fix the prefix in all cases. 
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/python/setup.cfg "[install]\nprefix=/usr" )
 find_package( PythonInterp REQUIRED)
 add_custom_target( bdist 
-    COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py bdist_egg -d ${PYMOOSE_BDIST_DIR}
+    COMMAND ${PYTHON_EXECUTABLE} setup.cmake.py bdist_dumb -d ${PYMOOSE_BDIST_DIR}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/python
     COMMENT "Genearating bdist using setup.cmake.py." 
     VERBATIM
diff --git a/moose-core/python/setup.cmake.py b/moose-core/python/setup.cmake.py
index 22da886d..b1761f99 100644
--- a/moose-core/python/setup.cmake.py
+++ b/moose-core/python/setup.cmake.py
@@ -25,6 +25,7 @@ try:
 except Exception as e:
     from distutils.core import setup
 
+
 # Read version from VERSION created by cmake file. This file must be present for
 # setup.cmake.py to work perfectly.
 script_dir = os.path.dirname( os.path.abspath( __file__ ) )
-- 
GitLab