for #118: update service template to fix path to get index.html

This commit is contained in:
mpromonet 2018-12-08 14:44:43 +00:00
parent 95b0976fde
commit 65560567c3
2 changed files with 12 additions and 5 deletions

View File

@ -83,8 +83,6 @@ if (NOT LIBLIVE555_INCLUDE_DIR)
message(STATUS "Installing live555") message(STATUS "Installing live555")
EXEC_PROGRAM("wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz -O - | tar xzf -") 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") 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) endif (NOT LIBLIVE555_INCLUDE_DIR)
find_path(LIBLIVE555_INCLUDE_DIR liveMedia/liveMedia.hh) find_path(LIBLIVE555_INCLUDE_DIR liveMedia/liveMedia.hh)
@ -116,18 +114,20 @@ if (SYSTEMD_FOUND)
message(STATUS "SystemD directory '${SYSTEMD_SERVICES_INSTALL_DIR}'") message(STATUS "SystemD directory '${SYSTEMD_SERVICES_INSTALL_DIR}'")
configure_file(v4l2rtspserver.service.in ${CMAKE_CURRENT_BINARY_DIR}/v4l2rtspserver.service @ONLY) 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) endif (SYSTEMD_FOUND)
# package # 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_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michel Promonet") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Michel Promonet")
SET(CPACK_PACKAGE_CONTACT "michel.promonet@free.fr") SET(CPACK_PACKAGE_CONTACT "michel.promonet@free.fr")
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
STRING(REGEX REPLACE ",$" "" CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}") 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) if(VERSION)
SET(CPACK_PACKAGE_VERSION "${VERSION}") SET(CPACK_PACKAGE_VERSION "${VERSION}")
endif() endif()

View File

@ -1,6 +1,13 @@
[Unit] [Unit]
Description=V4L2 RTSP server Description=V4L2 RTSP server
After=network.target
[Service] [Service]
Type=simple Type=simple
Restart=always
RestartSec=1
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/v4l2rtspserver ExecStart=@CMAKE_INSTALL_PREFIX@/bin/v4l2rtspserver
WorkingDirectory=@CMAKE_INSTALL_PREFIX@/share/v4l2rtspserver
[Install]
WantedBy=multi-user.target