Browse Source

* apply CMAKE_INSTALL_PREFIX to configs

master
Alex 'AdUser' Z 8 years ago
parent
commit
589e5d7a7b
  1. 11
      CMakeLists.txt
  2. 5
      configs/f2b.conf.in

11
CMakeLists.txt

@ -57,8 +57,15 @@ add_subdirectory(t)
set_property(DIRECTORY "t" PROPERTY COMPILE_FLAGS "-g;-ggdb;-Wall;-Wextra;-pedantic;-O0") set_property(DIRECTORY "t" PROPERTY COMPILE_FLAGS "-g;-ggdb;-Wall;-Wextra;-pedantic;-O0")
install(DIRECTORY "filters" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/f2b") install(DIRECTORY "filters" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/f2b")
install(DIRECTORY "configs/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/f2b") file(GLOB_RECURSE CONFIGS "*.conf.in")
install(FILES "configs/f2b.conf.sample" DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/f2b/" RENAME "f2b.conf") foreach(CONFIG ${CONFIGS})
string(REPLACE ".conf.in" ".conf" GENERATED ${CONFIG})
configure_file(${CONFIG} ${GENERATED})
endforeach()
install(DIRECTORY "configs/" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/f2b"
FILES_MATCHING PATTERN "*.conf")
install(FILES "configs/f2b.conf" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/f2b"
RENAME "f2b.conf.sample")
add_custom_target("dist" COMMAND add_custom_target("dist" COMMAND
"git" "archive" "--format=tar.gz" "git" "archive" "--format=tar.gz"

5
configs/f2b.conf.sample → configs/f2b.conf.in

@ -1,5 +1,5 @@
[main] [main]
includes = /etc/f2b/conf-enabled includes = ${CMAKE_INSTALL_FULL_SYSCONFDIR}/f2b/conf-enabled
pidfile = /var/run/f2b.pid pidfile = /var/run/f2b.pid
logdest = syslog logdest = syslog
loglevel = info loglevel = info
@ -17,9 +17,8 @@ incr_bantime = 0.0
incr_findtime = 0.0 incr_findtime = 0.0
maxretry = 5 maxretry = 5
source = files:/var/log/messages source = files:/var/log/messages
; filter = preg:/etc/f2b/filters/$someservice.preg
backend = exec-ipset:banned backend = exec-ipset:banned
[jail:ssh] [jail:ssh]
source = files:/var/log/auth.log source = files:/var/log/auth.log
filter = preg:/etc/f2b/filters/ssh.preg filter = preg:${CMAKE_INSTALL_FULL_DATAROOTDIR}/f2b/filters/ssh.preg
Loading…
Cancel
Save