diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000..4cccec26ee --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +resinsight (0.9.2-1) precise; urgency=low + + * Initial release + + -- Arne Morten Kvarving Tue, 15 Jan 2013 18:22:16 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000..e20e82e8d5 --- /dev/null +++ b/debian/control @@ -0,0 +1,38 @@ +Source: resinsight +Section: science +Priority: extra +Maintainer: Arne Morten Kvarving +Build-Depends: debhelper (>= 8.0.0), cmake, octave-headers, qt4-dev-tools, + libqt4-dev, libqt4-opengl-dev, libert.ecl-dev +Standards-Version: 3.9.2 +Homepage: http://opm-project.org +Vcs-Git: git://github.com/akva2/ResInsight.git +Vcs-Browser: https://github.com/akva2/ResInsight + +Package: resinsight +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: ResInsight - the 3D reservoir viewer and post processor + ResInsight is a 3D viewer and post processing tool for reservoir models. + It has been co-developed by Statoil and Ceetron with the aim to provide + a versatile tool for professionals who need to visualize and process + reservoir models. + +Package: resinsight-dbg +Architecture: any +Section: debug +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: ResInsight - the 3D reservoir viewer and post processor -- debug symbols + ResInsight is a 3D viewer and post processing tool for reservoir models. + It has been co-developed by Statoil and Ceetron with the aim to provide + a versatile tool for professionals who need to visualize and process + reservoir models. + +Package: octave-resinsight +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: ResInsight - the 3D reservoir viewer and post processor - octave support + ResInsight is a 3D viewer and post processing tool for reservoir models. + It has been co-developed by Statoil and Ceetron with the aim to provide + a versatile tool for professionals who need to visualize and process + reservoir models. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..00e820065d --- /dev/null +++ b/debian/copyright @@ -0,0 +1,13 @@ +License: GPL-3+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000..e845566c06 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README diff --git a/debian/octave-resinsight.install b/debian/octave-resinsight.install new file mode 100644 index 0000000000..f1d0181f52 --- /dev/null +++ b/debian/octave-resinsight.install @@ -0,0 +1 @@ +usr/lib/* diff --git a/debian/patches/01_use_system_ert.patch b/debian/patches/01_use_system_ert.patch new file mode 100644 index 0000000000..97ee35712f --- /dev/null +++ b/debian/patches/01_use_system_ert.patch @@ -0,0 +1,278 @@ +commit 8f1291094f04563cefc93085b9b61c2bf3d914b8 +Author: Arne Morten Kvarving +Date: Tue Apr 9 17:10:58 2013 +0200 + + Use system ERT + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e09c591..349ecf5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,6 +4,8 @@ project (ResInsight) + + set (VIZ_MODULES_FOLDER_NAME VisualizationModules) + ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ++ ${CMAKE_SOURCE_DIR}/cmake/Modules) + + # Setup the main platform defines + #----------------------------------------------------- +@@ -37,22 +39,28 @@ include (ResInsightVersion.cmake) + ################################################################################ + # ERT + ################################################################################ +-add_subdirectory(ThirdParty/Ert/devel) +- +-include_directories( +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include/ert/ecl +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include/ert/geometry +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include +- +- ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util +- ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include +-) +- ++find_package(ERT) ++IF(ERT_FOUND) ++ include_directories(${ERT_INCLUDE_DIR}/ert/ecl ++ ${ERT_INCLUDE_DIR}/ert/geometry ++ ${ERT_INCLUDE_DIR}/ert/ecl_well ++ ${ERT_INCLUDE_DIR}/ert/util) ++else(ERT_FOUND) ++ add_subdirectory(ThirdParty/Ert/devel) ++ include_directories( ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include/ert/ecl ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include/ert/geometry ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include ++ ++ ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ++ ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include ++ ) ++endif(ERT_FOUND) + + ################################################################################ + # Qt +diff --git a/cmake/Modules/FindERT.cmake b/cmake/Modules/FindERT.cmake +new file mode 100644 +index 0000000..8067421 +--- /dev/null ++++ b/cmake/Modules/FindERT.cmake +@@ -0,0 +1,208 @@ ++# - Find the Ensemble-based Reservoir Tool (ERT) ++# ++# Set the cache variable ERT_ROOT to the install location of the ERT ++# libraries and header files. ++# ++# If found, it sets these variables: ++# ++# ERT_INCLUDE_DIRS Header file directories ++# ERT_LIBRARIES Archives and shared objects ++# ERT_CONFIG_VARS Definitions that goes in config.h ++# ERT_LINKER_FLAGS Options that must be passed to linker ++# ++# It will also add to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if necessary to ++# link with the ERT libraries. ++ ++# variables to pass on to other packages ++if (FIND_QUIETLY) ++ set (ERT_QUIET "QUIET") ++else (FIND_QUIETLY) ++ set (ERT_QUIET "") ++endif (FIND_QUIETLY) ++ ++# if a directory has been specified by the user, then don't go look ++# in the system directories as well ++if (ERT_ROOT) ++ set (_no_default_path "NO_DEFAULT_PATH") ++else (ERT_ROOT) ++ set (_no_default_path "") ++endif (ERT_ROOT) ++ ++# ERT doesn't have any config-mode file, so we need to specify the root ++# directory in its own variable ++find_path (ERT_ECL_INCLUDE_DIR ++ NAMES "ert/ecl/ecl_util.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "../ert" ++ PATH_SUFFIXES "devel/libecl/include/" "include" ++ DOC "Path to ERT Eclipse library header files" ++ ${_no_default_path} ++ ) ++find_path (ERT_UTIL_INCLUDE_DIR ++ NAMES "ert/util/stringlist.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "../ert" ++ PATH_SUFFIXES "devel/libert_util/include/" "include" ++ DOC "Path to ERT Eclipse library header files" ++ ${_no_default_path} ++ ) ++find_path (ERT_GEN_INCLUDE_DIR ++ NAMES "ert/util/int_vector.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "libert_util/include/" "include" ++ DOC "Path to ERT generated library header files" ++ ${_no_default_path} ++ ) ++ ++# need all of these libraries ++if (CMAKE_SIZEOF_VOID_P) ++ math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}") ++endif (CMAKE_SIZEOF_VOID_P) ++find_library (ERT_LIBRARY_ECL ++ NAMES "ecl" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Eclipse library archive/shared object files" ++ ${_no_default_path} ++ ) ++find_library (ERT_LIBRARY_GEOMETRY ++ NAMES "ert_geometry" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Geometry library archive/shared object files" ++ ${_no_default_path} ++ ) ++find_library (ERT_LIBRARY_UTIL ++ NAMES "ert_util" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Utilities library archive/shared object files" ++ ${_no_default_path} ++ ) ++# the "library" found here is actually a list of several files ++list (APPEND ERT_INCLUDE_DIR ++ ${ERT_ECL_INCLUDE_DIR} ++ ${ERT_UTIL_INCLUDE_DIR} ++ ${ERT_GEN_INCLUDE_DIR} ++ ) ++list (APPEND ERT_LIBRARY ++ ${ERT_LIBRARY_ECL} ++ ${ERT_LIBRARY_GEOMETRY} ++ ${ERT_LIBRARY_UTIL} ++ ) ++list (APPEND ERT_LIBRARIES ${ERT_LIBRARY}) ++list (APPEND ERT_INCLUDE_DIRS ${ERT_INCLUDE_DIR}) ++ ++# if we didn't find any files, then don't proceed through the entire dependency list ++include (FindPackageHandleStandardArgs) ++if (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND") ++ find_package_handle_standard_args (ERT ++ DEFAULT_MSG ++ ERT_INCLUDE_DIR ERT_LIBRARY ++ ) ++ # write unsuccessful result to the cache, as the check_c_source_compiles ++ # would do if it failed ++ set (HAVE_ERT) ++ set (HAVE_ERT "${HAVE_ERT}" CACHE INTERNAL "Did an ERT sample program compile?") ++ return () ++endif (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND") ++ ++# these system variables are probed for, and used in HEADER files (sic) ++list (APPEND ERT_CONFIG_VARS ++ HAVE_ISFINITE ++ HAVE_GLOB ++ HAVE_FORK ++ HAVE_GETUID ++ HAVE_LOCKF ++ HAVE_OPENDIR ++ HAVE_PROC ++ HAVE_READLINKAT ++ HAVE_SYMLINK ++ HAVE_VA_COPY ++ ) ++include (CheckSymbolExists) ++include (CheckFunctionExists) ++check_symbol_exists (isfinite math.h HAVE_ISFINITE) ++check_function_exists (glob HAVE_GLOB) ++check_function_exists (fork HAVE_FORK) ++check_function_exists (getuid HAVE_GETUID) ++check_function_exists (lockf HAVE_LOCKF) ++check_function_exists (opendir HAVE_OPENDIR) ++check_function_exists (readlinkat HAVE_READLINKAT) ++check_function_exists (symlink HAVE_SYMLINK) ++check_symbol_exists (va_copy stdarg.h HAVE_VA_COPY) ++ ++if (UNIX) ++ set (HAVE_PROC 1) ++else (UNIX) ++ set (HAVE_PROC) ++endif (UNIX) ++ ++# dependencies ++ ++# compression library ++find_package (ZLIB ${ERT_QUIET}) ++if (ZLIB_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${ZLIB_LIBRARIES}) ++endif (ZLIB_FOUND) ++ ++# numerics ++find_package (BLAS ${ERT_QUIET}) ++if (BLAS_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${BLAS_LIBRARIES}) ++ list (APPEND ERT_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) ++endif (BLAS_FOUND) ++find_package (LAPACK ${ERT_QUIET}) ++if (LAPACK_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${LAPACK_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${LAPACK_LIBRARIES}) ++ list (APPEND ERT_LINKER_FLAGS ${LAPACK_LINKER_FLAGS}) ++endif (LAPACK_FOUND) ++ ++# math library (should exist on all unices; automatically linked on Windows) ++if (UNIX) ++ find_library (MATH_LIBRARY ++ NAMES "m" ++ ) ++ list (APPEND ERT_LIBRARIES ${MATH_LIBRARY}) ++endif (UNIX) ++ ++# see if we can compile a minimum example ++# CMake logical test doesn't handle lists (sic) ++if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ include (CMakePushCheckState) ++ include (CheckCSourceCompiles) ++ cmake_push_check_state () ++ set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR}) ++ set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES}) ++ check_c_source_compiles ( ++ "#include ++int main (void) { ++ int sz; ++ sz = ecl_util_get_sizeof_ctype (ECL_INT_TYPE); ++ return 0; ++}" HAVE_ERT) ++ cmake_pop_check_state () ++else (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ # write unsuccessful result to the cache, as the check_c_source_compiles ++ # would do if it failed ++ set (HAVE_ERT) ++ set (HAVE_ERT "${HAVE_ERT}" CACHE INTERNAL "Did an ERT sample program compile?") ++endif (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ ++# if the test program didn't compile, but was required to do so, bail ++# out now and display an error; otherwise limp on ++find_package_handle_standard_args (ERT ++ DEFAULT_MSG ++ ERT_INCLUDE_DIR ERT_LIBRARY HAVE_ERT ++ ) diff --git a/debian/patches/02_install_docdir.patch b/debian/patches/02_install_docdir.patch new file mode 100644 index 0000000000..4ce5f295f1 --- /dev/null +++ b/debian/patches/02_install_docdir.patch @@ -0,0 +1,24 @@ +diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt +index 7995ceb..4930b98 100644 +--- a/ApplicationCode/CMakeLists.txt ++++ b/ApplicationCode/CMakeLists.txt +@@ -8,6 +8,10 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ApplicationCode/Adm/RIVersionInfo.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RIVersionInfo.h + ) + ++if(NOT CMAKE_INSTALL_DOCDIR) ++ set(CMAKE_INSTALL_DOCDIR share/doc/resinsight) ++endif(NOT CMAKE_INSTALL_DOCDIR) ++ + + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} +@@ -313,7 +317,7 @@ else (PRIVATE_INSTALL) + ) + # license go in /usr/share/doc + install (FILES ${RESINSIGHT_LICENSE_FILES} +- DESTINATION share/doc/ResInsight ++ DESTINATION ${CMAKE_INSTALL_DOCDIR} + ) + # no bundled libraries for system install + # application icon diff --git a/debian/patches/03_remove_internal_header_include.patch b/debian/patches/03_remove_internal_header_include.patch new file mode 100644 index 0000000000..a72e206495 --- /dev/null +++ b/debian/patches/03_remove_internal_header_include.patch @@ -0,0 +1,24 @@ +diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp b/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp +index 7a2aef0..c552574 100644 +--- a/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp ++++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp +@@ -23,7 +23,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +index 2c77fd6..b6eeba7 100644 +--- a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +@@ -20,7 +20,6 @@ + + #include "util.h" + #include "ecl_file.h" +-#include "ecl_intehead.h" + #include "ecl_kw_magic.h" + + #include diff --git a/debian/patches/04_ert_api_changes.patch b/debian/patches/04_ert_api_changes.patch new file mode 100644 index 0000000000..2c24d7f185 --- /dev/null +++ b/debian/patches/04_ert_api_changes.patch @@ -0,0 +1,39 @@ +diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +index 40b3e7a..27bb973 100644 +--- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +@@ -53,7 +53,7 @@ bool RifEclipseRestartFilesetAccess::open(const QStringList& fileSet) + { + progInfo.setProgressDescription(fileSet[i]); + +- ecl_file_type* ecl_file = ecl_file_open(fileSet[i].toAscii().data()); ++ ecl_file_type* ecl_file = ecl_file_open(fileSet[i].toAscii().data(), 0); + if (!ecl_file) return false; + + m_ecl_files.push_back(ecl_file); +diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +index 8fecb28..73be912 100644 +--- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +@@ -53,7 +53,7 @@ bool RifEclipseUnifiedRestartFileAccess::open(const QStringList& fileSet) + { + QString fileName = fileSet[0]; + +- m_ecl_file = ecl_file_open(fileName.toAscii().data()); ++ m_ecl_file = ecl_file_open(fileName.toAscii().data(), 0); + if (!m_ecl_file) return false; + + return true; +diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +index bd2ec9b..e9d0afe 100644 +--- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp ++++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +@@ -439,7 +439,7 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) + QString initFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_INIT_FILE); + if (initFileName.size() > 0) + { +- ecl_file_type* ecl_file = ecl_file_open(initFileName.toAscii().data()); ++ ecl_file_type* ecl_file = ecl_file_open(initFileName.toAscii().data(), 0); + if (!ecl_file) return false; + + progInfo.incrementProgress(); diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000000..50d86eec62 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,4 @@ +01_use_system_ert.patch +02_install_docdir.patch +03_remove_internal_header_include.patch +04_ert_api_changes.patch diff --git a/debian/resinsight.install b/debian/resinsight.install new file mode 100644 index 0000000000..87deca1134 --- /dev/null +++ b/debian/resinsight.install @@ -0,0 +1,2 @@ +usr/bin/* +usr/share/* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000..948ecf6abe --- /dev/null +++ b/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +override_dh_auto_configure: + dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=Release -DPRIVATE_INSTALL=0 -DCMAKE_INSTALL_DOCDIR=share/doc/resinsight + +.PHONY: override_dh_strip +override_dh_strip: + dh_strip --dbg-package=resinsight-dbg + +override_dh_installdocs: + dh_installdocs --link-doc=resinsight diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/redhat/01_use_system_ert.patch b/redhat/01_use_system_ert.patch new file mode 100644 index 0000000000..97ee35712f --- /dev/null +++ b/redhat/01_use_system_ert.patch @@ -0,0 +1,278 @@ +commit 8f1291094f04563cefc93085b9b61c2bf3d914b8 +Author: Arne Morten Kvarving +Date: Tue Apr 9 17:10:58 2013 +0200 + + Use system ERT + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e09c591..349ecf5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,6 +4,8 @@ project (ResInsight) + + set (VIZ_MODULES_FOLDER_NAME VisualizationModules) + ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ++ ${CMAKE_SOURCE_DIR}/cmake/Modules) + + # Setup the main platform defines + #----------------------------------------------------- +@@ -37,22 +39,28 @@ include (ResInsightVersion.cmake) + ################################################################################ + # ERT + ################################################################################ +-add_subdirectory(ThirdParty/Ert/devel) +- +-include_directories( +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include/ert/ecl +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include/ert/geometry +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include +- ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include +- +- ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util +- ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include +-) +- ++find_package(ERT) ++IF(ERT_FOUND) ++ include_directories(${ERT_INCLUDE_DIR}/ert/ecl ++ ${ERT_INCLUDE_DIR}/ert/geometry ++ ${ERT_INCLUDE_DIR}/ert/ecl_well ++ ${ERT_INCLUDE_DIR}/ert/util) ++else(ERT_FOUND) ++ add_subdirectory(ThirdParty/Ert/devel) ++ include_directories( ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include/ert/ecl ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include/ert/geometry ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include/ert/ecl_well ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libert_util/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libgeometry/include ++ ${CMAKE_SOURCE_DIR}/ThirdParty/Ert/devel/libecl_well/include ++ ++ ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include/ert/util ++ ${CMAKE_BINARY_DIR}/ThirdParty/Ert/devel/libert_util/include ++ ) ++endif(ERT_FOUND) + + ################################################################################ + # Qt +diff --git a/cmake/Modules/FindERT.cmake b/cmake/Modules/FindERT.cmake +new file mode 100644 +index 0000000..8067421 +--- /dev/null ++++ b/cmake/Modules/FindERT.cmake +@@ -0,0 +1,208 @@ ++# - Find the Ensemble-based Reservoir Tool (ERT) ++# ++# Set the cache variable ERT_ROOT to the install location of the ERT ++# libraries and header files. ++# ++# If found, it sets these variables: ++# ++# ERT_INCLUDE_DIRS Header file directories ++# ERT_LIBRARIES Archives and shared objects ++# ERT_CONFIG_VARS Definitions that goes in config.h ++# ERT_LINKER_FLAGS Options that must be passed to linker ++# ++# It will also add to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if necessary to ++# link with the ERT libraries. ++ ++# variables to pass on to other packages ++if (FIND_QUIETLY) ++ set (ERT_QUIET "QUIET") ++else (FIND_QUIETLY) ++ set (ERT_QUIET "") ++endif (FIND_QUIETLY) ++ ++# if a directory has been specified by the user, then don't go look ++# in the system directories as well ++if (ERT_ROOT) ++ set (_no_default_path "NO_DEFAULT_PATH") ++else (ERT_ROOT) ++ set (_no_default_path "") ++endif (ERT_ROOT) ++ ++# ERT doesn't have any config-mode file, so we need to specify the root ++# directory in its own variable ++find_path (ERT_ECL_INCLUDE_DIR ++ NAMES "ert/ecl/ecl_util.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "../ert" ++ PATH_SUFFIXES "devel/libecl/include/" "include" ++ DOC "Path to ERT Eclipse library header files" ++ ${_no_default_path} ++ ) ++find_path (ERT_UTIL_INCLUDE_DIR ++ NAMES "ert/util/stringlist.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "../ert" ++ PATH_SUFFIXES "devel/libert_util/include/" "include" ++ DOC "Path to ERT Eclipse library header files" ++ ${_no_default_path} ++ ) ++find_path (ERT_GEN_INCLUDE_DIR ++ NAMES "ert/util/int_vector.h" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "libert_util/include/" "include" ++ DOC "Path to ERT generated library header files" ++ ${_no_default_path} ++ ) ++ ++# need all of these libraries ++if (CMAKE_SIZEOF_VOID_P) ++ math (EXPR _BITS "8 * ${CMAKE_SIZEOF_VOID_P}") ++endif (CMAKE_SIZEOF_VOID_P) ++find_library (ERT_LIBRARY_ECL ++ NAMES "ecl" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Eclipse library archive/shared object files" ++ ${_no_default_path} ++ ) ++find_library (ERT_LIBRARY_GEOMETRY ++ NAMES "ert_geometry" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Geometry library archive/shared object files" ++ ${_no_default_path} ++ ) ++find_library (ERT_LIBRARY_UTIL ++ NAMES "ert_util" ++ HINTS "${ERT_ROOT}" ++ PATHS "${PROJECT_BINARY_DIR}/../ert" "${PROJECT_BINARY_DIR}/../ert-build" ++ "${PROJECT_BINARY_DIR}/../ert/devel" ++ PATH_SUFFIXES "lib" "lib${_BITS}" "lib/${CMAKE_LIBRARY_ARCHITECTURE}" ++ DOC "Path to ERT Utilities library archive/shared object files" ++ ${_no_default_path} ++ ) ++# the "library" found here is actually a list of several files ++list (APPEND ERT_INCLUDE_DIR ++ ${ERT_ECL_INCLUDE_DIR} ++ ${ERT_UTIL_INCLUDE_DIR} ++ ${ERT_GEN_INCLUDE_DIR} ++ ) ++list (APPEND ERT_LIBRARY ++ ${ERT_LIBRARY_ECL} ++ ${ERT_LIBRARY_GEOMETRY} ++ ${ERT_LIBRARY_UTIL} ++ ) ++list (APPEND ERT_LIBRARIES ${ERT_LIBRARY}) ++list (APPEND ERT_INCLUDE_DIRS ${ERT_INCLUDE_DIR}) ++ ++# if we didn't find any files, then don't proceed through the entire dependency list ++include (FindPackageHandleStandardArgs) ++if (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND") ++ find_package_handle_standard_args (ERT ++ DEFAULT_MSG ++ ERT_INCLUDE_DIR ERT_LIBRARY ++ ) ++ # write unsuccessful result to the cache, as the check_c_source_compiles ++ # would do if it failed ++ set (HAVE_ERT) ++ set (HAVE_ERT "${HAVE_ERT}" CACHE INTERNAL "Did an ERT sample program compile?") ++ return () ++endif (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND") ++ ++# these system variables are probed for, and used in HEADER files (sic) ++list (APPEND ERT_CONFIG_VARS ++ HAVE_ISFINITE ++ HAVE_GLOB ++ HAVE_FORK ++ HAVE_GETUID ++ HAVE_LOCKF ++ HAVE_OPENDIR ++ HAVE_PROC ++ HAVE_READLINKAT ++ HAVE_SYMLINK ++ HAVE_VA_COPY ++ ) ++include (CheckSymbolExists) ++include (CheckFunctionExists) ++check_symbol_exists (isfinite math.h HAVE_ISFINITE) ++check_function_exists (glob HAVE_GLOB) ++check_function_exists (fork HAVE_FORK) ++check_function_exists (getuid HAVE_GETUID) ++check_function_exists (lockf HAVE_LOCKF) ++check_function_exists (opendir HAVE_OPENDIR) ++check_function_exists (readlinkat HAVE_READLINKAT) ++check_function_exists (symlink HAVE_SYMLINK) ++check_symbol_exists (va_copy stdarg.h HAVE_VA_COPY) ++ ++if (UNIX) ++ set (HAVE_PROC 1) ++else (UNIX) ++ set (HAVE_PROC) ++endif (UNIX) ++ ++# dependencies ++ ++# compression library ++find_package (ZLIB ${ERT_QUIET}) ++if (ZLIB_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${ZLIB_LIBRARIES}) ++endif (ZLIB_FOUND) ++ ++# numerics ++find_package (BLAS ${ERT_QUIET}) ++if (BLAS_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${BLAS_LIBRARIES}) ++ list (APPEND ERT_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) ++endif (BLAS_FOUND) ++find_package (LAPACK ${ERT_QUIET}) ++if (LAPACK_FOUND) ++ list (APPEND ERT_INCLUDE_DIRS ${LAPACK_INCLUDE_DIRS}) ++ list (APPEND ERT_LIBRARIES ${LAPACK_LIBRARIES}) ++ list (APPEND ERT_LINKER_FLAGS ${LAPACK_LINKER_FLAGS}) ++endif (LAPACK_FOUND) ++ ++# math library (should exist on all unices; automatically linked on Windows) ++if (UNIX) ++ find_library (MATH_LIBRARY ++ NAMES "m" ++ ) ++ list (APPEND ERT_LIBRARIES ${MATH_LIBRARY}) ++endif (UNIX) ++ ++# see if we can compile a minimum example ++# CMake logical test doesn't handle lists (sic) ++if (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ include (CMakePushCheckState) ++ include (CheckCSourceCompiles) ++ cmake_push_check_state () ++ set (CMAKE_REQUIRED_INCLUDES ${ERT_INCLUDE_DIR}) ++ set (CMAKE_REQUIRED_LIBRARIES ${ERT_LIBRARIES}) ++ check_c_source_compiles ( ++ "#include ++int main (void) { ++ int sz; ++ sz = ecl_util_get_sizeof_ctype (ECL_INT_TYPE); ++ return 0; ++}" HAVE_ERT) ++ cmake_pop_check_state () ++else (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ # write unsuccessful result to the cache, as the check_c_source_compiles ++ # would do if it failed ++ set (HAVE_ERT) ++ set (HAVE_ERT "${HAVE_ERT}" CACHE INTERNAL "Did an ERT sample program compile?") ++endif (NOT (ERT_INCLUDE_DIR MATCHES "-NOTFOUND" OR ERT_LIBRARIES MATCHES "-NOTFOUND")) ++ ++# if the test program didn't compile, but was required to do so, bail ++# out now and display an error; otherwise limp on ++find_package_handle_standard_args (ERT ++ DEFAULT_MSG ++ ERT_INCLUDE_DIR ERT_LIBRARY HAVE_ERT ++ ) diff --git a/redhat/02_install_docdir.patch b/redhat/02_install_docdir.patch new file mode 100644 index 0000000000..4ce5f295f1 --- /dev/null +++ b/redhat/02_install_docdir.patch @@ -0,0 +1,24 @@ +diff --git a/ApplicationCode/CMakeLists.txt b/ApplicationCode/CMakeLists.txt +index 7995ceb..4930b98 100644 +--- a/ApplicationCode/CMakeLists.txt ++++ b/ApplicationCode/CMakeLists.txt +@@ -8,6 +8,10 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/ApplicationCode/Adm/RIVersionInfo.h.cmake + ${CMAKE_BINARY_DIR}/Generated/RIVersionInfo.h + ) + ++if(NOT CMAKE_INSTALL_DOCDIR) ++ set(CMAKE_INSTALL_DOCDIR share/doc/resinsight) ++endif(NOT CMAKE_INSTALL_DOCDIR) ++ + + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} +@@ -313,7 +317,7 @@ else (PRIVATE_INSTALL) + ) + # license go in /usr/share/doc + install (FILES ${RESINSIGHT_LICENSE_FILES} +- DESTINATION share/doc/ResInsight ++ DESTINATION ${CMAKE_INSTALL_DOCDIR} + ) + # no bundled libraries for system install + # application icon diff --git a/redhat/03_remove_internal_header_include.patch b/redhat/03_remove_internal_header_include.patch new file mode 100644 index 0000000000..a72e206495 --- /dev/null +++ b/redhat/03_remove_internal_header_include.patch @@ -0,0 +1,24 @@ +diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp b/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp +index 7a2aef0..c552574 100644 +--- a/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp ++++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/Ert-Test.cpp +@@ -23,7 +23,6 @@ + + #include + #include +-#include + #include + #include + #include +diff --git a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +index 2c77fd6..b6eeba7 100644 +--- a/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseOutputFileTools.cpp +@@ -20,7 +20,6 @@ + + #include "util.h" + #include "ecl_file.h" +-#include "ecl_intehead.h" + #include "ecl_kw_magic.h" + + #include diff --git a/redhat/04_ert_api_changes.patch b/redhat/04_ert_api_changes.patch new file mode 100644 index 0000000000..2c24d7f185 --- /dev/null +++ b/redhat/04_ert_api_changes.patch @@ -0,0 +1,39 @@ +diff --git a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +index 40b3e7a..27bb973 100644 +--- a/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseRestartFilesetAccess.cpp +@@ -53,7 +53,7 @@ bool RifEclipseRestartFilesetAccess::open(const QStringList& fileSet) + { + progInfo.setProgressDescription(fileSet[i]); + +- ecl_file_type* ecl_file = ecl_file_open(fileSet[i].toAscii().data()); ++ ecl_file_type* ecl_file = ecl_file_open(fileSet[i].toAscii().data(), 0); + if (!ecl_file) return false; + + m_ecl_files.push_back(ecl_file); +diff --git a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +index 8fecb28..73be912 100644 +--- a/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp ++++ b/ApplicationCode/FileInterface/RifEclipseUnifiedRestartFileAccess.cpp +@@ -53,7 +53,7 @@ bool RifEclipseUnifiedRestartFileAccess::open(const QStringList& fileSet) + { + QString fileName = fileSet[0]; + +- m_ecl_file = ecl_file_open(fileName.toAscii().data()); ++ m_ecl_file = ecl_file_open(fileName.toAscii().data(), 0); + if (!m_ecl_file) return false; + + return true; +diff --git a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +index bd2ec9b..e9d0afe 100644 +--- a/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp ++++ b/ApplicationCode/FileInterface/RifReaderEclipseOutput.cpp +@@ -439,7 +439,7 @@ bool RifReaderEclipseOutput::buildMetaData(RigReservoir* reservoir) + QString initFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_INIT_FILE); + if (initFileName.size() > 0) + { +- ecl_file_type* ecl_file = ecl_file_open(initFileName.toAscii().data()); ++ ecl_file_type* ecl_file = ecl_file_open(initFileName.toAscii().data(), 0); + if (!ecl_file) return false; + + progInfo.incrementProgress(); diff --git a/redhat/resinsight.spec b/redhat/resinsight.spec new file mode 100644 index 0000000000..cde8ef0998 --- /dev/null +++ b/redhat/resinsight.spec @@ -0,0 +1,62 @@ +# +# spec file for package resinsight +# + +Name: resinsight +Version: 0.9.2 +Release: 0 +Summary: ResInsight - the 3D reservoir viewer and post processor +License: GPL-3.0+ +Group: Science +Url: http://opm-project.org +Source0: %{name}-%{version}.orig.tar.gz +Patch0: 01_use_system_ert.patch +Patch1: 02_install_docdir.patch +Patch2: 03_remove_internal_header_include.patch +Patch3: 04_ert_api_changes.patch +BuildRequires: lapack-devel octave-devel qt qt-devel ert.ecl-devel +BuildRequires: gcc gcc-c++ +BuildRequires: cmake28 +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +ResInsight is a 3D viewer and post processing tool for reservoir models. +It has been co-developed by Statoil and Ceetron with the aim to provide +a versatile tool for professionals who need to visualize and process +reservoir models. + +%package octave +Summary: ResInsight plugins for Octave +Group: Scientific +Requires: %{name} = %{version} + +%description octave +This package contains the ResInsight octave plugins. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 + +%build +cmake28 -DPRIVATE_INSTALL=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/resinsight-0.9.2 +make + +%install +make install DESTDIR=${RPM_BUILD_ROOT} + +%clean +rm -rf %{buildroot} + +%post -n resinsight -p /sbin/ldconfig + +%postun -n resinsight -p /sbin/ldconfig + +%files +%{_bindir}/* +%{_datadir}/* + +%files octave +%{_libdir}/*