1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 07:44:57 +03:00

Fix systemd unit file generation

This commit is contained in:
Ron Isaacson
2020-06-30 01:22:37 -04:00
parent eeaac4e78c
commit 40ed982079
7 changed files with 36 additions and 33 deletions

View File

@ -23,6 +23,24 @@ if(UNIX)
RENAME ${component}
)
endmacro(install_wrapper_script)
# Same approach for systemd unit files
#
macro(install_unit_file component)
file(GENERATE OUTPUT ${BUILD_DIRECTORY}/softether-${component}.service
CONTENT "# placeholder\n"
)
install(CODE "set(DIR \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}\")\nconfigure_file(${TOP_DIRECTORY}/systemd/softether-${component}.service ${BUILD_DIRECTORY}/softether-${component}.service)"
COMPONENT ${component}
)
install(FILES ${BUILD_DIRECTORY}/softether-${component}.service
COMPONENT ${component}
DESTINATION ${CMAKE_INSTALL_SYSTEMD_UNITDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endmacro(install_unit_file)
endif()
if(BUILD_TYPE STREQUAL "Debug")

View File

@ -41,11 +41,6 @@ if(UNIX)
install_wrapper_script("vpnbridge")
if(NOT "${CMAKE_INSTALL_SYSTEMD_UNITDIR}" STREQUAL "")
configure_file(${TOP_DIRECTORY}/systemd/softether-vpnbridge.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnbridge.service)
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnbridge.service
COMPONENT "vpnbridge"
DESTINATION ${CMAKE_INSTALL_SYSTEMD_UNITDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install_unit_file("vpnbridge")
endif()
endif()

View File

@ -41,11 +41,6 @@ if(UNIX)
install_wrapper_script("vpnclient")
if(NOT "${CMAKE_INSTALL_SYSTEMD_UNITDIR}" STREQUAL "")
configure_file(${TOP_DIRECTORY}/systemd/softether-vpnclient.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service)
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service
COMPONENT "vpnclient"
DESTINATION ${CMAKE_INSTALL_SYSTEMD_UNITDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install_unit_file("vpnclient")
endif()
endif()

View File

@ -41,11 +41,6 @@ if(UNIX)
install_wrapper_script("vpnserver")
if(NOT "${CMAKE_INSTALL_SYSTEMD_UNITDIR}" STREQUAL "")
configure_file(${TOP_DIRECTORY}/systemd/softether-vpnserver.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnserver.service)
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnserver.service
COMPONENT "vpnserver"
DESTINATION ${CMAKE_INSTALL_SYSTEMD_UNITDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install_unit_file("vpnserver")
endif()
endif()