From cffd94aae48dac005d820dd667498bbbb09ab117 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Mon, 27 Jun 2016 20:40:05 +0200 Subject: build: correct sandboxing paths cannot start with "/" or PREFIX will be omitted. PREFIX must be set before the project() call. --- CMakeLists.txt | 12 ++++++------ compile_debug.sh | 2 +- compile_release.sh | 2 +- install_release.sh | 2 +- src/ipcpd/local/CMakeLists.txt | 2 +- src/ipcpd/shim-eth-llc/CMakeLists.txt | 2 +- src/ipcpd/shim-udp/CMakeLists.txt | 2 +- src/irmd/CMakeLists.txt | 2 +- src/lib/CMakeLists.txt | 2 +- src/nsmd/CMakeLists.txt | 2 +- src/tools/cbr/CMakeLists.txt | 2 +- src/tools/echo/CMakeLists.txt | 2 +- src/tools/irm/CMakeLists.txt | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba900645..7b5f5e85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 2.8.12.2) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/usr/lib" isSystemDir) +IF("${isSystemDir}" STREQUAL "-1") + SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/usr/lib") +ENDIF("${isSystemDir}" STREQUAL "-1") + project(ouroboros C) include(GitVersionGen) @@ -23,12 +29,6 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/usr/lib" isSystemDir) -IF("${isSystemDir}" STREQUAL "-1") - SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/usr/lib") -ENDIF("${isSystemDir}" STREQUAL "-1") - message(STATUS "Package name is: ${PACKAGE_NAME}") message(STATUS "Package description is: ${PACKAGE_DESCRIPTION}") message(STATUS "Package version is: ${PACKAGE_VERSION}") diff --git a/compile_debug.sh b/compile_debug.sh index 3ea1e039..484f1076 100755 --- a/compile_debug.sh +++ b/compile_debug.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="/usr/local/ouroboros" + PREFIX="/usr/local/ouroboros/" fi BUILDDIR=build diff --git a/compile_release.sh b/compile_release.sh index 58a16e52..0b1c1a96 100755 --- a/compile_release.sh +++ b/compile_release.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="" + PREFIX="/" fi BUILDDIR=build diff --git a/install_release.sh b/install_release.sh index f5d08bb5..d2de5526 100755 --- a/install_release.sh +++ b/install_release.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="" + PREFIX="/" fi BUILDDIR=build diff --git a/src/ipcpd/local/CMakeLists.txt b/src/ipcpd/local/CMakeLists.txt index 8052f513..cc19aad0 100644 --- a/src/ipcpd/local/CMakeLists.txt +++ b/src/ipcpd/local/CMakeLists.txt @@ -26,7 +26,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(ipcpd-local -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS ipcpd-local RUNTIME DESTINATION /sbin) +install(TARGETS ipcpd-local RUNTIME DESTINATION sbin) # Enable once ipcp-local has tests # add_subdirectory(tests) diff --git a/src/ipcpd/shim-eth-llc/CMakeLists.txt b/src/ipcpd/shim-eth-llc/CMakeLists.txt index 951deadc..a3f96735 100644 --- a/src/ipcpd/shim-eth-llc/CMakeLists.txt +++ b/src/ipcpd/shim-eth-llc/CMakeLists.txt @@ -34,4 +34,4 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(ipcpd-shim-eth-llc -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS ipcpd-shim-eth-llc RUNTIME DESTINATION /sbin) +install(TARGETS ipcpd-shim-eth-llc RUNTIME DESTINATION sbin) diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/shim-udp/CMakeLists.txt index edf5252d..6430661c 100644 --- a/src/ipcpd/shim-udp/CMakeLists.txt +++ b/src/ipcpd/shim-udp/CMakeLists.txt @@ -84,7 +84,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(ipcpd-shim-udp -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS ipcpd-shim-udp RUNTIME DESTINATION /sbin) +install(TARGETS ipcpd-shim-udp RUNTIME DESTINATION sbin) # Enable once ipcp-shim-udp has tests # add_subdirectory(tests) diff --git a/src/irmd/CMakeLists.txt b/src/irmd/CMakeLists.txt index 1b373c99..a402b242 100644 --- a/src/irmd/CMakeLists.txt +++ b/src/irmd/CMakeLists.txt @@ -19,7 +19,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(irmd -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS irmd RUNTIME DESTINATION /sbin) +install(TARGETS irmd RUNTIME DESTINATION sbin) # Enable once irmd has tests # add_subdirectory(tests) diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt index 8803fc3b..2a75ef17 100644 --- a/src/lib/CMakeLists.txt +++ b/src/lib/CMakeLists.txt @@ -50,7 +50,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(ouroboros -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS ouroboros LIBRARY DESTINATION /usr/lib) +install(TARGETS ouroboros LIBRARY DESTINATION usr/lib) target_include_directories(ouroboros PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/nsmd/CMakeLists.txt b/src/nsmd/CMakeLists.txt index 8539c79c..b916170b 100644 --- a/src/nsmd/CMakeLists.txt +++ b/src/nsmd/CMakeLists.txt @@ -18,7 +18,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(nsmd -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS nsmd RUNTIME DESTINATION /sbin) +install(TARGETS nsmd RUNTIME DESTINATION sbin) # Enable once nsmd has tests # add_subdirectory(tests) diff --git a/src/tools/cbr/CMakeLists.txt b/src/tools/cbr/CMakeLists.txt index e54ffff6..232bea36 100644 --- a/src/tools/cbr/CMakeLists.txt +++ b/src/tools/cbr/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(cbr ${SOURCE_FILES}) target_link_libraries(cbr LINK_PUBLIC ouroboros) -install(TARGETS cbr RUNTIME DESTINATION /usr/bin) +install(TARGETS cbr RUNTIME DESTINATION usr/bin) diff --git a/src/tools/echo/CMakeLists.txt b/src/tools/echo/CMakeLists.txt index ec8ed7ba..42bcdbfe 100644 --- a/src/tools/echo/CMakeLists.txt +++ b/src/tools/echo/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(echo-app ${SOURCE_FILES}) target_link_libraries(echo-app LINK_PUBLIC ouroboros) -install(TARGETS echo-app RUNTIME DESTINATION /usr/bin) +install(TARGETS echo-app RUNTIME DESTINATION usr/bin) diff --git a/src/tools/irm/CMakeLists.txt b/src/tools/irm/CMakeLists.txt index 42fabcb0..d1f227a8 100644 --- a/src/tools/irm/CMakeLists.txt +++ b/src/tools/irm/CMakeLists.txt @@ -20,4 +20,4 @@ add_executable (irm ${SOURCE_FILES}) target_link_libraries (irm LINK_PUBLIC ouroboros) -install(TARGETS irm RUNTIME DESTINATION /sbin) +install(TARGETS irm RUNTIME DESTINATION sbin) -- cgit v1.2.3 From e552ad819aa9ba007464f5dcd6e4aa466f2c4ed9 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 28 Jun 2016 10:26:47 +0200 Subject: build: addresses comments on cffd94a --- CMakeLists.txt | 12 ++++++------ compile_debug.sh | 2 +- compile_release.sh | 2 +- install_debug.sh | 2 +- install_release.sh | 2 +- src/ipcpd/normal/CMakeLists.txt | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b5f5e85..ba900645 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,6 @@ cmake_minimum_required(VERSION 2.8.12.2) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/usr/lib" isSystemDir) -IF("${isSystemDir}" STREQUAL "-1") - SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/usr/lib") -ENDIF("${isSystemDir}" STREQUAL "-1") - project(ouroboros C) include(GitVersionGen) @@ -29,6 +23,12 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/usr/lib" isSystemDir) +IF("${isSystemDir}" STREQUAL "-1") + SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/usr/lib") +ENDIF("${isSystemDir}" STREQUAL "-1") + message(STATUS "Package name is: ${PACKAGE_NAME}") message(STATUS "Package description is: ${PACKAGE_DESCRIPTION}") message(STATUS "Package version is: ${PACKAGE_VERSION}") diff --git a/compile_debug.sh b/compile_debug.sh index 484f1076..3ea1e039 100755 --- a/compile_debug.sh +++ b/compile_debug.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="/usr/local/ouroboros/" + PREFIX="/usr/local/ouroboros" fi BUILDDIR=build diff --git a/compile_release.sh b/compile_release.sh index 0b1c1a96..58a16e52 100755 --- a/compile_release.sh +++ b/compile_release.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="/" + PREFIX="" fi BUILDDIR=build diff --git a/install_debug.sh b/install_debug.sh index 10e50706..ef6b8a30 100755 --- a/install_debug.sh +++ b/install_debug.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="/usr/local/ouroboros/" + PREFIX="/usr/local/ouroboros" fi BUILDDIR=build diff --git a/install_release.sh b/install_release.sh index d2de5526..f5d08bb5 100755 --- a/install_release.sh +++ b/install_release.sh @@ -6,7 +6,7 @@ if (($# == 1 )) then PREFIX=`echo "$1"|sed -e "s,\/$,,"` else - PREFIX="/" + PREFIX="" fi BUILDDIR=build diff --git a/src/ipcpd/normal/CMakeLists.txt b/src/ipcpd/normal/CMakeLists.txt index 5c14c87a..74bd19ec 100644 --- a/src/ipcpd/normal/CMakeLists.txt +++ b/src/ipcpd/normal/CMakeLists.txt @@ -28,7 +28,7 @@ if (CMAKE_BUILD_TYPE MATCHES Debug) MACRO_ADD_COMPILE_FLAGS(ipcpd-normal -DCONFIG_OUROBOROS_DEBUG) endif (CMAKE_BUILD_TYPE MATCHES Debug) -install(TARGETS ipcpd-normal RUNTIME DESTINATION /sbin) +install(TARGETS ipcpd-normal RUNTIME DESTINATION sbin) # Enable once ipcp-normal has tests # add_subdirectory(tests) -- cgit v1.2.3