commit 4339765642b6d9c24065b51e93cfe6c7a4b3b4a4
parent 5c12ac1d7f79c6e54fba0311881a76a1f4abce1e
Author: Frederic Cambus <fred@statdns.com>
Date: Sun, 10 Jan 2016 14:22:51 +0100
Renaming 'GEOIPDATA' and 'DATADIR' variables to 'GEOIPDIR'
Diffstat:
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -5,7 +5,7 @@
# http://www.logswan.org #
# #
# Created: 2015-05-31 #
-# Last Updated: 2016-01-09 #
+# Last Updated: 2016-01-10 #
# #
# Logswan is released under the BSD 3-Clause license. #
# See LICENSE file for details. #
@@ -18,6 +18,7 @@ project(logswan C)
include(CheckFunctionExists)
+# Check if system has strtonum
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_OPENBSD_SOURCE)
check_function_exists(strtonum HAVE_STRTONUM)
@@ -39,10 +40,10 @@ if(NOT HAVE_STRTONUM)
set (SRC ${SRC} compat/strtonum.c)
endif()
-SET(GEOIPDATA ${CMAKE_INSTALL_PREFIX}/share/GeoIP CACHE PATH "Path to GeoIP data files")
+SET(GEOIPDIR ${CMAKE_INSTALL_PREFIX}/share/GeoIP CACHE PATH "Path to GeoIP data files")
add_definitions(-Wall -Wextra -Werror -std=c99 -pedantic)
-add_definitions(-DDATADIR="${GEOIPDATA}/")
+add_definitions(-DGEOIPDIR="${GEOIPDIR}/")
add_executable(logswan ${SRC} ${DEPS})
target_link_libraries(logswan ${GEOIP_LIBRARIES} ${JANSSON_LIBRARIES} m)
diff --git a/README.md b/README.md
@@ -89,9 +89,9 @@ Logswan packages are available for :
By default, Logswan looks for GeoIP databases in `${CMAKE_INSTALL_PREFIX}/share/GeoIP`, which points to `/usr/local/share/GeoIP` by default.
-A custom directory can be set using the `DATADIR` variable when invoking CMake :
+A custom directory can be set using the `GEOIPDIR` variable when invoking CMake :
- cmake -DDATADIR=/var/db/GeoIP .
+ cmake -DGEOIPDIR=/var/db/GeoIP .
The free GeoLite databases can be downloaded here : http://dev.maxmind.com/geoip/legacy/geolite/
diff --git a/src/logswan.c b/src/logswan.c
@@ -5,7 +5,7 @@
/* http://www.logswan.org */
/* */
/* Created: 2015-05-31 */
-/* Last Updated: 2016-01-09 */
+/* Last Updated: 2016-01-10 */
/* */
/* Logswan is released under the BSD 3-Clause license. */
/* See LICENSE file for details. */
@@ -110,8 +110,8 @@ int main (int argc, char *argv[]) {
begin = clock();
/* Initializing GeoIP */
- geoip = GeoIP_open(DATADIR "GeoIP.dat", GEOIP_MEMORY_CACHE);
- geoipv6 = GeoIP_open(DATADIR "GeoIPv6.dat", GEOIP_MEMORY_CACHE);
+ geoip = GeoIP_open(GEOIPDIR "GeoIP.dat", GEOIP_MEMORY_CACHE);
+ geoipv6 = GeoIP_open(GEOIPDIR "GeoIPv6.dat", GEOIP_MEMORY_CACHE);
/* Get log file size */
stat(intputFile, &logFileSize);