dbms: renamed init.d and cron script [#METR-12543]

This commit is contained in:
Pavel Kartavyy 2014-09-12 14:37:18 +04:00
parent 126bfa0750
commit 6ad87c955c

View File

@ -18,25 +18,27 @@
macro (CREATE_INIT_SCRIPT daemonname)
set(package_name ${daemonname}-metrika-yandex)
set(filename ${daemonname}-metrika-yandex)
# опционально принимаем package_name вторым аргументом
# опционально принимаем filename вторым аргументом
set(extra_args ${ARGN})
list(LENGTH extra_args num_extra_args)
if (${num_extra_args} GREATER 0)
list(GET extra_args 0 optional_arg)
set(package_name ${optional_arg})
set(filename ${optional_arg})
endif()
set(tmp_file_name ${filename}.init)
add_custom_target(${daemonname}-init.target ALL
COMMAND sed -e 's,[@]DAEMON[@],${daemonname},g' < ${PROJECT_SOURCE_DIR}/tools/init.d/template > ${CMAKE_CURRENT_BINARY_DIR}/${package_name}
COMMAND sed -i 's,[@]CRONFILE[@],${package_name},g' ${CMAKE_CURRENT_BINARY_DIR}/${package_name}
COMMAND chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/${package_name}
COMMAND sed -e 's,[@]DAEMON[@],${daemonname},g' < ${PROJECT_SOURCE_DIR}/tools/init.d/template > ${CMAKE_CURRENT_BINARY_DIR}/${tmp_file_name}
COMMAND sed -i 's,[@]CRONFILE[@],${filename},g' ${CMAKE_CURRENT_BINARY_DIR}/${tmp_file_name}
COMMAND chmod a+x ${CMAKE_CURRENT_BINARY_DIR}/${tmp_file_name}
COMMENT "Building ${daemonname}"
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${package_name}
FILES ${CMAKE_CURRENT_BINARY_DIR}/${tmp_file_name}
DESTINATION /etc/init.d
RENAME ${filename}
PERMISSIONS OWNER_EXECUTE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
endmacro (CREATE_INIT_SCRIPT)