mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
Merge PR #764: adjust systemd paths according to installation path
This commit is contained in:
commit
ddf4c28789
@ -20,6 +20,8 @@ build_script:
|
|||||||
exit %errorlevel%
|
exit %errorlevel%
|
||||||
- sh: >-
|
- sh: >-
|
||||||
./configure && make package -C tmp
|
./configure && make package -C tmp
|
||||||
|
dpkg -i build/softether-vpn*.deb
|
||||||
|
systemctl restart softether-vpnserver
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: output\pkg\*\*
|
- path: output\pkg\*\*
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
script:
|
script:
|
||||||
- ./configure
|
- ./configure
|
||||||
- make package -C tmp
|
- make package -C tmp
|
||||||
|
- dpkg -i build/softether-vpn*.deb
|
||||||
|
|
||||||
bionic:
|
bionic:
|
||||||
<<: *ubuntu_def
|
<<: *ubuntu_def
|
||||||
|
@ -32,6 +32,7 @@ Check_Include_File(sys/auxv.h HAVE_SYS_AUXV)
|
|||||||
configure_file("${SoftEtherVPN_SOURCE_DIR}/AUTHORS.TXT" "${SoftEtherVPN_SOURCE_DIR}/src/bin/hamcore/authors.txt" COPYONLY)
|
configure_file("${SoftEtherVPN_SOURCE_DIR}/AUTHORS.TXT" "${SoftEtherVPN_SOURCE_DIR}/src/bin/hamcore/authors.txt" COPYONLY)
|
||||||
|
|
||||||
set(BUILD_DIRECTORY ${SoftEtherVPN_SOURCE_DIR}/build)
|
set(BUILD_DIRECTORY ${SoftEtherVPN_SOURCE_DIR}/build)
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
@ -45,6 +46,8 @@ set(CPACK_PACKAGE_DESCRIPTION_FILE "${SoftEtherVPN_SOURCE_DIR}/description")
|
|||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
|
||||||
|
|
||||||
# DEB
|
# DEB
|
||||||
|
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/postinst" "#!/bin/sh\nldconfig")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst")
|
||||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||||
|
@ -16,24 +16,6 @@ macro(install_wrapper_script component target)
|
|||||||
)
|
)
|
||||||
endmacro(install_wrapper_script)
|
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")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
add_definitions(-D_DEBUG -DDEBUG)
|
add_definitions(-D_DEBUG -DDEBUG)
|
||||||
endif()
|
endif()
|
||||||
|
@ -23,4 +23,11 @@ install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
|||||||
)
|
)
|
||||||
|
|
||||||
install_wrapper_script("vpnbridge" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
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_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_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()
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=SoftEther VPN Bridge
|
Description=SoftEther VPN Bridge
|
||||||
After=network.target auditd.service
|
After=network.target auditd.service
|
||||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/do_not_run
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
EnvironmentFile=-[DIRECTORY]
|
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge
|
||||||
ExecStart=[BINARY] start
|
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge start
|
||||||
ExecStop=[BINARY] stop
|
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge stop
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
|||||||
ProtectHome=yes
|
ProtectHome=yes
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
ReadOnlyDirectories=/
|
ReadOnlyDirectories=/
|
||||||
ReadWriteDirectories=-[DIRECTORY]
|
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge
|
||||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=SoftEther VPN Client
|
Description=SoftEther VPN Client
|
||||||
After=network.target auditd.service
|
After=network.target auditd.service
|
||||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/do_not_run
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
EnvironmentFile=-[DIRECTORY]
|
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient
|
||||||
ExecStart=[BINARY] start
|
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient start
|
||||||
ExecStop=[BINARY] stop
|
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient stop
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
|||||||
ProtectHome=yes
|
ProtectHome=yes
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
ReadOnlyDirectories=/
|
ReadOnlyDirectories=/
|
||||||
ReadWriteDirectories=-[DIRECTORY]
|
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient
|
||||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=SoftEther VPN Server
|
Description=SoftEther VPN Server
|
||||||
After=network.target auditd.service
|
After=network.target auditd.service
|
||||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/do_not_run
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
EnvironmentFile=-[DIRECTORY]
|
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver
|
||||||
ExecStart=[BINARY] start
|
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver start
|
||||||
ExecStop=[BINARY] stop
|
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver stop
|
||||||
KillMode=process
|
KillMode=process
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
|||||||
ProtectHome=yes
|
ProtectHome=yes
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
ReadOnlyDirectories=/
|
ReadOnlyDirectories=/
|
||||||
ReadWriteDirectories=-[DIRECTORY]
|
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver
|
||||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
Loading…
Reference in New Issue
Block a user