pull/928/merge
Nils Werner 4 days ago committed by GitHub
commit a85a2aafac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 21
      clamdscan/CMakeLists.txt
  2. 8
      clamdscan/clamav-clamdscan@.service.in
  3. 11
      clamdscan/clamav-clamdscan@.timer.in
  4. 21
      clamscan/CMakeLists.txt
  5. 8
      clamscan/clamav-clamscan@.service.in
  6. 11
      clamscan/clamav-clamscan@.timer.in
  7. 17
      cmake/FindSYSTEMD.cmake

@ -47,3 +47,24 @@ if(WIN32)
else()
install(TARGETS clamdscan DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
endif()
if(SYSTEMD_FOUND)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/clamav-clamdscan@.service.in
${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.service @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/clamav-clamdscan@.timer.in
${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.timer @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.service
DESTINATION ${SYSTEMD_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.service
DESTINATION ${SYSTEMD_USER_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.timer
DESTINATION ${SYSTEMD_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamdscan@.timer
DESTINATION ${SYSTEMD_USER_UNIT_DIR} COMPONENT programs)
endif()

@ -0,0 +1,8 @@
[Unit]
Description=ClamAV clamdscan %f
Documentation=man:clamdscan(1) man:clamdscan.conf(5) https://docs.clamav.net/
[Service]
Nice=19
IOSchedulingClass=idle
ExecStart=@prefix@/bin/clamdscan --infected --multiscan --fdpass %f

@ -0,0 +1,11 @@
[Unit]
Description=Weekly ClamAV clamdscan %f
[Timer]
OnCalendar=weekly
AccuracySec=1h
RandomizedDelaySec=1h
Persistent=true
[Install]
WantedBy=timers.target

@ -46,3 +46,24 @@ if(WIN32)
else()
install(TARGETS clamscan DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
endif()
if(SYSTEMD_FOUND)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/clamav-clamscan@.service.in
${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.service @ONLY)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/clamav-clamscan@.timer.in
${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.timer @ONLY)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.service
DESTINATION ${SYSTEMD_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.service
DESTINATION ${SYSTEMD_USER_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.timer
DESTINATION ${SYSTEMD_UNIT_DIR} COMPONENT programs)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/clamav-clamscan@.timer
DESTINATION ${SYSTEMD_USER_UNIT_DIR} COMPONENT programs)
endif()

@ -0,0 +1,8 @@
[Unit]
Description=ClamAV clamscan %f
Documentation=man:clamscan(1) man:clamscan.conf(5) https://docs.clamav.net/
[Service]
Nice=19
IOSchedulingClass=idle
ExecStart=@prefix@/bin/clamscan --recursive=yes --infected --suppress-ok-results %f

@ -0,0 +1,11 @@
[Unit]
Description=Weekly ClamAV clamscan %f
[Timer]
OnCalendar=weekly
AccuracySec=1h
RandomizedDelaySec=1h
Persistent=true
[Install]
WantedBy=timers.target

@ -110,16 +110,29 @@ pkg_check_modules(SYSTEMD_PROGRAM QUIET systemd)
if (SYSTEMD_PROGRAM_FOUND)
if ("${SYSTEMD_UNIT_DIR}" STREQUAL "")
# Use pkg-config to look up the systemd unit install directory
# Use pkg-config to look up the systemd system unit install directory
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE}
--variable=systemdsystemunitdir systemd
OUTPUT_VARIABLE SYSTEMD_UNIT_DIR)
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_UNIT_DIR "${SYSTEMD_UNIT_DIR}")
endif()
message(STATUS "systemd services install dir: ${SYSTEMD_UNIT_DIR}")
message(STATUS "systemd system services install dir: ${SYSTEMD_UNIT_DIR}")
if ("${SYSTEMD_USER_UNIT_DIR}" STREQUAL "")
# Use pkg-config to look up the systemd user unit install directory
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE}
--variable=systemduserunitdir systemd
OUTPUT_VARIABLE SYSTEMD_USER_UNIT_DIR)
string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_USER_UNIT_DIR "${SYSTEMD_USER_UNIT_DIR}")
endif()
message(STATUS "systemd user services install dir: ${SYSTEMD_USER_UNIT_DIR}")
else()
if (SYSTEMD_UNIT_DIR)
message (FATAL_ERROR "SYSTEMD_UNIT_DIR was defined but pkg-config was not able to find systemd!")
endif()
if (SYSTEMD_USER_UNIT_DIR)
message (FATAL_ERROR "SYSTEMD_USER_UNIT_DIR was defined but pkg-config was not able to find systemd!")
endif()
endif()

Loading…
Cancel
Save