|
@@ -10,14 +10,18 @@ find_program(HELP2MAN help2man DOC "path to help2man executable")
|
10
|
10
|
find_program(DD dd DOC "path to dd executable")
|
11
|
11
|
find_program(BASE64 base64 DOC "path to base64 executable")
|
12
|
12
|
find_program(INSSERV insserv DOC "path to insserv executable")
|
|
13
|
+find_program(CHKCONFIG chkconfig DOC "path to chkconfig executable")
|
13
|
14
|
|
14
|
15
|
if(NOT DEFINED INIT_FLAVOR)
|
15
|
16
|
if(IS_DIRECTORY "/etc/init" AND EXISTS "/lib/init/upstart-job")
|
16
|
17
|
message(STATUS "Detected init flavor: upstart")
|
17
|
18
|
set(INIT_FLAVOR "upstart" CACHE STRING "Init daemon of this system")
|
18
|
|
- elseif(IS_DIRECTORY "/etc/init.d")
|
19
|
|
- message(STATUS "Detected init flavor: sysv")
|
20
|
|
- set(INIT_FLAVOR "sysv" CACHE STRING "Init daemon of this system")
|
|
19
|
+ elseif(IS_DIRECTORY "/etc/init.d" AND EXISTS "/lib/lsb/init-functions")
|
|
20
|
+ message(STATUS "Detected init flavor: sysv-lsb")
|
|
21
|
+ set(INIT_FLAVOR "sysv-lsb" CACHE STRING "Init daemon of this system")
|
|
22
|
+ elseif(IS_DIRECTORY "/etc/init.d" AND EXISTS "/etc/init.d/functions")
|
|
23
|
+ message(STATUS "Detected init flavor: sysv-redhat")
|
|
24
|
+ set(INIT_FLAVOR "sysv-redhat" CACHE STRING "Init daemon of this system")
|
21
|
25
|
else()
|
22
|
26
|
message(STATUS "Detected init flavor: none")
|
23
|
27
|
message(STATUS "System startup files will not be installed")
|
|
@@ -33,7 +37,8 @@ set(APPARMOR_PROFILE "${CMAKE_INSTALL_PREFIX}/sbin/${POSTSRSD}")
|
33
|
37
|
string(REGEX REPLACE "^/+" "" APPARMOR_PROFILE "${APPARMOR_PROFILE}")
|
34
|
38
|
string(REPLACE "/" "." APPARMOR_PROFILE "${APPARMOR_PROFILE}")
|
35
|
39
|
|
36
|
|
-configure_file(${PROJECT_NAME}.init.in ${PROJECT_NAME}.init @ONLY)
|
|
40
|
+configure_file(${PROJECT_NAME}.lsb_init.in ${PROJECT_NAME}.lsb_init @ONLY)
|
|
41
|
+configure_file(${PROJECT_NAME}.rh_init.in ${PROJECT_NAME}.rh_init @ONLY)
|
37
|
42
|
configure_file(${PROJECT_NAME}.upstart.in ${PROJECT_NAME}.upstart @ONLY)
|
38
|
43
|
configure_file(${PROJECT_NAME}.apparmor.in ${PROJECT_NAME}.apparmor @ONLY)
|
39
|
44
|
configure_file(postinstall.cmake.in postinstall.cmake @ONLY)
|