From 65560567c373a82560e5e3dd0e7ba7dedd915ae6 Mon Sep 17 00:00:00 2001 From: mpromonet Date: Sat, 8 Dec 2018 14:44:43 +0000 Subject: [PATCH] for #118: update service template to fix path to get index.html --- CMakeLists.txt | 10 +++++----- v4l2rtspserver.service.in | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2488f9b..58db923 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,8 +83,6 @@ if (NOT LIBLIVE555_INCLUDE_DIR) message(STATUS "Installing live555") EXEC_PROGRAM("wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz -O - | tar xzf -") EXEC_PROGRAM("cd live && ./genMakefiles linux-gdb && make CPLUSPLUS_COMPILER=${CMAKE_CXX_COMPILER} C_COMPILER=${CMAKE_C_COMPILER} LINK='${CMAKE_CXX_COMPILER} -o' CPPFLAGS=-DALLOW_RTSP_SERVER_PORT_REUSE=1 PREFIX=${CMAKE_FIND_ROOT_PATH} install") -else (NOT LIBLIVE555_INCLUDE_DIR) - SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}liblivemedia-dev,) endif (NOT LIBLIVE555_INCLUDE_DIR) find_path(LIBLIVE555_INCLUDE_DIR liveMedia/liveMedia.hh) @@ -116,18 +114,20 @@ if (SYSTEMD_FOUND) message(STATUS "SystemD directory '${SYSTEMD_SERVICES_INSTALL_DIR}'") configure_file(v4l2rtspserver.service.in ${CMAKE_CURRENT_BINARY_DIR}/v4l2rtspserver.service @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/v4l2rtspserver.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR} COMPONENT data) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/v4l2rtspserver.service DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}) endif (SYSTEMD_FOUND) # package -install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin COMPONENT bin) +install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) +install (FILES index.html DESTINATION share/${PROJECT_NAME}/) +install (FILES hls.js/dist/hls.min.js DESTINATION share/${PROJECT_NAME}/hls.js/dist/) SET(CPACK_GENERATOR "DEB") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michel Promonet") SET(CPACK_PACKAGE_CONTACT "michel.promonet@free.fr") SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) STRING(REGEX REPLACE ",$" "" CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}") -set(CPACK_DEB_COMPONENT_INSTALL "ON") +SET(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) if(VERSION) SET(CPACK_PACKAGE_VERSION "${VERSION}") endif() diff --git a/v4l2rtspserver.service.in b/v4l2rtspserver.service.in index a437304..7b82002 100644 --- a/v4l2rtspserver.service.in +++ b/v4l2rtspserver.service.in @@ -1,6 +1,13 @@ [Unit] Description=V4L2 RTSP server +After=network.target [Service] Type=simple +Restart=always +RestartSec=1 ExecStart=@CMAKE_INSTALL_PREFIX@/bin/v4l2rtspserver +WorkingDirectory=@CMAKE_INSTALL_PREFIX@/share/v4l2rtspserver + +[Install] +WantedBy=multi-user.target