1234567891011121314151617181920212223242526272829303132333435 |
- message(STATUS "Updating RC: $ENV{DESTDIR}/etc/init.d/@PROJECT_NAME@")
- file(MAKE_DIRECTORY
- "$ENV{DESTDIR}/etc/rc0.d"
- "$ENV{DESTDIR}/etc/rc1.d"
- "$ENV{DESTDIR}/etc/rc2.d"
- "$ENV{DESTDIR}/etc/rc3.d"
- "$ENV{DESTDIR}/etc/rc4.d"
- "$ENV{DESTDIR}/etc/rc5.d"
- "$ENV{DESTDIR}/etc/rc6.d"
- )
- execute_process(
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc0.d/K20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc1.d/K20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc2.d/S20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc3.d/S20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc4.d/S20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc5.d/S20@PROJECT_NAME@
- COMMAND ln -sf ../init.d/@PROJECT_NAME@ rc6.d/K20@PROJECT_NAME@
- WORKING_DIRECTORY "$ENV{DESTDIR}/etc"
- )
- set(SECRET_FILE "@PROJECT_NAME@.secret")
- set(DD "@DD@")
- set(BASE64 "@BASE64@")
- if(DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}/etc/${SECRET_FILE}")
- message(STATUS "Generating secret key")
- execute_process(
- COMMAND ${DD} if=/dev/urandom bs=18 count=1
- COMMAND ${BASE64} -w0
- OUTPUT_FILE "@CMAKE_CURRENT_BINARY_DIR@/${SECRET_FILE}"
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- file(INSTALL "@CMAKE_CURRENT_BINARY_DIR@/${SECRET_FILE}" DESTINATION "/etc" FILE_PERMISSIONS OWNER_READ OWNER_WRITE)
- endif()
|