From: Maksym Mamontov Date: Fri, 8 Nov 2024 10:53:38 +0000 (+0200) Subject: Merge remote-tracking branch 'github/master' X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/HEAD?hp=2574a28cbf000603bc31f61593dbf061ff56c1d5 Merge remote-tracking branch 'github/master' --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a3ff749..e887fc58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,9 @@ option ( BUILD_MOD_RPCCONFIG "Build XML-RPC configuretion STG module." OFF ) option ( BUILD_MOD_CAP_PCAP "Build PCap capture STG module." OFF ) option ( BUILD_MOD_CAP_NFQUEUE "Build NFQueue capture STG module." OFF ) +# Firebird is getting deprecated, negation option +option ( BUILD_NO_MOD_STORE_FIREBIRD "Do not build Firebird store STG module." OFF ) + # Grouping option ( BUILD_ALL_MODS "Build all modules." OFF ) option ( BUILD_ALL_LIBS "Build all libraries." OFF ) @@ -92,6 +95,10 @@ if ( BUILD_ALL_MODS ) set ( BUILD_MOD_CAP_PCAP ON ) endif ( BUILD_ALL_MODS ) +if ( BUILD_NO_MOD_STORE_FIREBIRD ) + set ( BUILD_MOD_STORE_FIREBIRD OFF ) +endif ( BUILD_NO_MOD_STORE_FIREBIRD ) + if ( BUILD_MOD_STORE_FIREBIRD OR BUILD_ALL_LIBS ) set ( BUILD_LIB_IBPP ON ) endif ( BUILD_MOD_STORE_FIREBIRD OR BUILD_ALL_LIBS ) diff --git a/README.md b/README.md index f4746736..5b220bb0 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,66 @@ [![Build Status](https://travis-ci.org/madf/stg.svg?branch=master)](https://travis-ci.org/madf/stg) A billing system for small home and office networks. + +## Dependencies + +* CMake - build system. +* Iconv - character encoding conversion. +* Expat (optional) - required by `mod_conf_sg` configuration plugin. +* xmlrpc-c (optional) - required by `mod_conf_rpc` configuration plugin. +* PCap (optional) - required by `mod_cap_pcap` traffic capture plugin. +* `libnetfilter_queue`, `libnfnetlink`, `libmnl` (optional) - required by `mod_cap_nfqueue` traffic capture plugin. +* Firebird (optional) - required by `mod_store_firebird` storage plugin. +* PostgreSQL (optional) - required by `mod_store_postgresql` storage plugin. +* MySQL Connector (optional) - required by `mod_store_mysql` storage plugin. +* boost (optional) - unit tests. + +## Compilation and Installation + +``` +mkdir build +cd build +cmake .. +make +make install +``` + +It will install everything in /usr/local by default. If you want to install with a different destdir: + +``` +$ make DESTDIR=/path/to/your/destdir install +``` + +It will automatically append usr/local to your destdir. So if you specify DESTDIR=foo you will result in the following directory structure: + +``` +foo/usr/local/bin +foo/usr/local/include +foo/usr/local/lib +``` + +If you want a custom install dir prefix use CMAKE_INSTALL_PREFIX at compile time: + +``` +$ cmake -DCMAKE_INSTALL_PREFIX=/your/prefix .. +$ make +$ make install +``` + +If you specify -DCMAKE_INSTALL_PREFIX=foo you will result in the following directory structure: + +``` +foo/bin +foo/include +foo/lib +``` + +### Notes for MacOS X + +1. It is not easy to use Firebird on MacOS X, so you may want to opt-out its storage plugin. Use `-DBUILD_NO_MOD_STORE_FIREBIRD=ON` as `cmake` command line option. +2. Homebrew XMLRPC-C version is too old. You may want to build it from scratch. In order to make it visible to CMake, pass `-DXMLRPC_C_CONFIG=/path/to/xmlrpc-c-config` to `cmake`. +3. CMake usually does not see MySQL Connector library installed by Homebrew. Pass `-DMySQLConnector_ROOT=/usr/local/opt/mysql-client/` to `cmake` to make it visible. + +## Documentation + +https://stg.net.ua/doc/index.html diff --git a/projects/stargazer/plugins/CMakeLists.txt b/projects/stargazer/plugins/CMakeLists.txt index 8adb6c5f..fc378ba6 100644 --- a/projects/stargazer/plugins/CMakeLists.txt +++ b/projects/stargazer/plugins/CMakeLists.txt @@ -155,6 +155,9 @@ if ( BUILD_MOD_RPCCONFIG ) configuration/rpcconfig/messages_methods.cpp ) target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} ) set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" ) + if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + set_target_properties ( mod_conf_rpc PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) + endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) if ( CLANG_TIDY_EXE ) set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" ) @@ -272,6 +275,9 @@ if ( BUILD_MOD_STORE_POSTGRESQL ) store/postgresql/postgresql_store_utils.cpp ) target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} ) set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" ) + if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) + set_target_properties ( mod_store_postgresql PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" ) + endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" ) if ( CLANG_TIDY_EXE ) set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )