mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 16:25:01 +03:00
adjust systemd paths according to installation path
This commit is contained in:
@ -16,24 +16,6 @@ macro(install_wrapper_script component target)
|
||||
)
|
||||
endmacro(install_wrapper_script)
|
||||
|
||||
macro(install_systemd_service component file_path binary_path)
|
||||
get_filename_component(file_name ${file_path} NAME)
|
||||
get_filename_component(binary_directory ${binary_path} DIRECTORY)
|
||||
|
||||
file(READ ${file_path} FILE_CONTENT)
|
||||
string(REPLACE "[DIRECTORY]" ${binary_directory} FILE_CONTENT ${FILE_CONTENT})
|
||||
string(REPLACE "[BINARY]" ${binary_path} FILE_CONTENT ${FILE_CONTENT})
|
||||
file(WRITE ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name} ${FILE_CONTENT})
|
||||
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name}
|
||||
COMPONENT ${component}
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endmacro(install_systemd_service)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-D_DEBUG -DDEBUG)
|
||||
endif()
|
||||
|
@ -23,4 +23,11 @@ install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnbridge" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
||||
install_systemd_service("vpnbridge" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnbridge.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnbridge.service ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnbridge.service)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnbridge.service
|
||||
COMPONENT "vpnbridge"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
@ -23,4 +23,11 @@ install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnclient" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
install_systemd_service("vpnclient" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnclient.service)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnclient.service
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
@ -23,4 +23,11 @@ install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnserver" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
|
||||
install_systemd_service("vpnserver" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnserver.service)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/tmp/systemd/softether-vpnserver.service
|
||||
COMPONENT "vpnserver"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user