Install sysvinit script on Debian/Ubuntu

On Debian/Ubuntu systems, install the sysvinit script (in addition to
the systemd service file).
This commit is contained in:
Benjamin Drung 2017-05-30 11:11:39 +02:00
parent bafe130dd1
commit 4fb2096c3a

View File

@ -84,6 +84,8 @@ if (FASTNETMON_PROFILER)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FASTNETMON_PROFILE_FLAGS}")
endif()
execute_process(COMMAND sh -c ". /etc/os-release; echo $ID" OUTPUT_VARIABLE OS_ID ERROR_QUIET)
### Executables definition
# Main tool
@ -607,6 +609,10 @@ install(FILES man/fastnetmon_client.1 DESTINATION /usr/share/man/man1)
configure_file(fastnetmon.service.in "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fastnetmon.service" DESTINATION ${CMAKE_INSTALL_SYSTEMD_SERVICEDIR})
if (${OS_ID} MATCHES debian|ubuntu)
install(FILES fastnetmon_init_script_debian_6_7 DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/init.d RENAME fastnetmon)
endif()
# Configure cpack package builder
# Run it with: cd build; cpack -G DEB ..
set(CPACK_PACKAGE_NAME "fastnetmon")