diff options
Diffstat (limited to 'dev-db/pgrouting/files/no-contrib-when-use-extension.patch')
-rw-r--r-- | dev-db/pgrouting/files/no-contrib-when-use-extension.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/dev-db/pgrouting/files/no-contrib-when-use-extension.patch b/dev-db/pgrouting/files/no-contrib-when-use-extension.patch new file mode 100644 index 000000000000..e26af3ef0da3 --- /dev/null +++ b/dev-db/pgrouting/files/no-contrib-when-use-extension.patch @@ -0,0 +1,76 @@ +diff -Naur pgrouting-2.0.0.orig/CMakeLists.txt pgrouting-2.0.0/CMakeLists.txt +--- pgrouting-2.0.0.orig/CMakeLists.txt 2013-09-24 16:38:31.000000000 -0400 ++++ pgrouting-2.0.0/CMakeLists.txt 2014-11-07 06:48:11.555026180 -0500 +@@ -170,16 +170,13 @@ + OUTPUT_VARIABLE SHARE_DIR) + + if(SHARE_DIR) +- # Always install in "contrib" directory of PostgreSQL +- set(CONTRIB_DIR "${SHARE_DIR}/contrib/pgrouting-${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}") +- message(STATUS "Contrib directory for SQL files is set to ${CONTRIB_DIR}") +- + # Install as extension if supported by the version of PostgreSQL + if(USE_PG_EXTENSION) + set(SHARE_DIR "${SHARE_DIR}/extension") + message(STATUS "Extension directory for SQL files is set to ${SHARE_DIR}") +- #else(USE_PG_EXTENSION) +- # set(SHARE_DIR "/usr/share/pgrouting") ++ else(USE_PG_EXTENSION) ++ set(CONTRIB_DIR "${SHARE_DIR}/contrib/pgrouting-${PGROUTING_VERSION_MAJOR}.${PGROUTING_VERSION_MINOR}") ++ message(STATUS "Contrib directory for SQL files is set to ${CONTRIB_DIR}") + endif(USE_PG_EXTENSION) + else(SHARE_DIR) + message(FATAL_ERROR "pg_config --sharedir failed to return a value. Please check your PostgreSQL installation!") +@@ -347,22 +344,24 @@ + + install(FILES ${LIBS_TO_INSTALL} DESTINATION ${LIB_DIR}) + +-install(FILES ++if(USE_PG_EXTENSION) ++ install(FILES + "${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql" + "${CMAKE_BINARY_DIR}/lib/pgrouting.control" + "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql" + DESTINATION "${SHARE_DIR}") +- +-# The following probably could be done better +-# The idea is to also have a "pgrouting-x.x" directory in PostgreSQL contrib +-configure_file("${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql" ++else(USE_PG_EXTENSION) ++ # The following probably could be done better ++ # The idea is to also have a "pgrouting-x.x" directory in PostgreSQL contrib ++ configure_file("${CMAKE_BINARY_DIR}/lib/pgrouting--${PGROUTING_VERSION_STRING}.sql" + "${CMAKE_BINARY_DIR}/lib/pgrouting.sql" COPYONLY) + +-install(FILES ++ install(FILES + "${CMAKE_BINARY_DIR}/lib/pgrouting.sql" + "${CMAKE_BINARY_DIR}/lib/pgrouting.control" + "${CMAKE_BINARY_DIR}/lib/pgrouting_legacy.sql" + DESTINATION "${CONTRIB_DIR}") ++endif(USE_PG_EXTENSION) + + # TODO: The following probably should be done better + if(WITH_DD) +@@ -372,12 +371,14 @@ + configure_file("${PGROUTING_SOURCE_DIR}/src/driving_distance/sql/routing_dd_legacy.sql" + "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" COPYONLY) + +- install(FILES +- "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" +- DESTINATION "${SHARE_DIR}") +- +- install(FILES +- "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" +- DESTINATION "${CONTRIB_DIR}") ++ if(USE_PG_EXTENSION) ++ install(FILES ++ "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" ++ DESTINATION "${SHARE_DIR}") ++ else(USE_PG_EXTENSION) ++ install(FILES ++ "${CMAKE_BINARY_DIR}/lib/pgrouting_dd_legacy.sql" ++ DESTINATION "${CONTRIB_DIR}") ++ endif(USE_PG_EXTENSION) + endif(WITH_DD) + |