blob: 996e17b1acf32c3c94803a593d510db6c9d3d7df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
Configure the systemd unit anyway, it will then be installed by systemd_dounit
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -728,47 +728,12 @@ if(NOT WIN32)
message(STATUS " rc.d: YES (${RCD_DIR})")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
- # Linux - check for systemd
- find_package(PkgConfig QUIET)
- if(PkgConfig_FOUND)
- pkg_check_modules(SYSTEMD QUIET systemd)
- endif()
-
- if(SYSTEMD_FOUND)
- # systemd is available - install systemd service
- # Get systemd unit directory
- pkg_get_variable(SYSTEMD_UNIT_DIR systemd systemdsystemunitdir)
- if(NOT SYSTEMD_UNIT_DIR)
- # Fallback to common location
- set(SYSTEMD_UNIT_DIR "/lib/systemd/system")
- endif()
-
# Configure and install systemd service file
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/scripts/3proxy.service.in
${CMAKE_CURRENT_BINARY_DIR}/3proxy.service
@ONLY
)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/3proxy.service
- DESTINATION ${SYSTEMD_UNIT_DIR}
- )
-
- message(STATUS " systemd: YES (${SYSTEMD_UNIT_DIR})")
- else()
- # No systemd - install init.d script
- configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/scripts/init.d/3proxy.in
- ${CMAKE_CURRENT_BINARY_DIR}/3proxy.init
- @ONLY
- )
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/3proxy.init
- DESTINATION /etc/init.d
- RENAME 3proxy
- PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
- )
-
- message(STATUS " systemd: NO (using init.d)")
- endif()
else()
# Other Unix - install init.d script
configure_file(
|