|
@@ -1,4 +1,5 @@
|
1
|
1
|
set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
|
|
2
|
+set(SYSCONF_DIR "@SYSCONF_DIR@")
|
2
|
3
|
set(CHROOT_DIR "@CHROOT_DIR@")
|
3
|
4
|
set(CONFIG_DIR "@CONFIG_DIR@")
|
4
|
5
|
set(INIT_FLAVOR "@INIT_FLAVOR@")
|
|
@@ -18,24 +19,24 @@ if(INIT_FLAVOR AND NOT EXISTS "$ENV{DESTDIR}${CONFIG_DIR}/@PROJECT_NAME@")
|
18
|
19
|
endif()
|
19
|
20
|
|
20
|
21
|
if(INIT_FLAVOR STREQUAL "sysv-lsb")
|
21
|
|
- file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.lsb_init" TYPE PROGRAM DESTINATION "/etc/init.d" RENAME "@PROJECT_NAME@")
|
|
22
|
+ file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.lsb_init" TYPE PROGRAM DESTINATION "${SYSCONF_DIR}/init.d" RENAME "@PROJECT_NAME@")
|
22
|
23
|
if(INSSERV)
|
23
|
24
|
execute_process(
|
24
|
|
- COMMAND ${INSSERV} -p "$ENV{DESTDIR}/etc/init.d" @PROJECT_NAME@
|
|
25
|
+ COMMAND ${INSSERV} -p "$ENV{DESTDIR}${SYSCONF_DIR}/init.d" @PROJECT_NAME@
|
25
|
26
|
)
|
26
|
27
|
endif()
|
27
|
28
|
elseif(INIT_FLAVOR STREQUAL "sysv-redhat")
|
28
|
|
- file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.rh_init" TYPE PROGRAM DESTINATION "/etc/init.d" RENAME "@PROJECT_NAME@")
|
|
29
|
+ file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.rh_init" TYPE PROGRAM DESTINATION "${SYSCONF_DIR}/init.d" RENAME "@PROJECT_NAME@")
|
29
|
30
|
if(CHKCONFIG AND NOT "$ENV{DESTDIR}")
|
30
|
31
|
execute_process(
|
31
|
32
|
COMMAND ${CHKCONFIG} --add @PROJECT_NAME@
|
32
|
33
|
)
|
33
|
34
|
endif()
|
34
|
35
|
elseif(INIT_FLAVOR STREQUAL "upstart")
|
35
|
|
- file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "/etc/init" RENAME "@PROJECT_NAME@.conf")
|
|
36
|
+ file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "${SYSCONF_DIR}/init" RENAME "@PROJECT_NAME@.conf")
|
36
|
37
|
endif()
|
37
|
38
|
|
38
|
|
-if(GENERATE_SRS_SECRET AND DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}/etc/${SECRET_FILE}")
|
|
39
|
+if(GENERATE_SRS_SECRET AND DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}${SYSCONF_DIR}/${SECRET_FILE}")
|
39
|
40
|
message(STATUS "Generating secret key")
|
40
|
41
|
execute_process(
|
41
|
42
|
COMMAND ${DD} if=/dev/urandom bs=18 count=1
|
|
@@ -44,6 +45,6 @@ if(GENERATE_SRS_SECRET AND DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXIST
|
44
|
45
|
ERROR_QUIET
|
45
|
46
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
46
|
47
|
)
|
47
|
|
-file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/${SECRET_FILE}" DESTINATION "/etc" RENAME "${SECRET_FILE}" FILE_PERMISSIONS OWNER_READ OWNER_WRITE)
|
|
48
|
+file(INSTALL FILES "@CMAKE_CURRENT_BINARY_DIR@/${SECRET_FILE}" DESTINATION "${SYSCONF_DIR}" RENAME "${SECRET_FILE}" FILE_PERMISSIONS OWNER_READ OWNER_WRITE)
|
48
|
49
|
file(REMOVE "@CMAKE_CURRENT_BINARY_DIR@/${SECRET_FILE}")
|
49
|
50
|
endif()
|