Skip to content

Commit

Permalink
[agroal#322] OpenBSD and FreeBSD configuration files
Browse files Browse the repository at this point in the history
Change the macros in the source header to use `/usr/local/etc`
only when FreeBSD is detected.

Close agroal#322
  • Loading branch information
fluca1978 committed Aug 25, 2022
1 parent dc175b7 commit c08b458
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ add_custom_command(
#
# Install configuration and documentation
#
install(FILES etc/pgagroal.conf DESTINATION etc/pgagroal)
install(FILES etc/pgagroal_hba.conf DESTINATION etc/pgagroal)
install(FILES etc/pgagroal.conf DESTINATION share/doc/pgagroal/etc)
install(FILES etc/pgagroal_hba.conf DESTINATION share/doc/pgagroal/etc)


install(DIRECTORY . DESTINATION share/doc/pgagroal FILES_MATCHING PATTERN "*.md" PATTERN "etc" EXCLUDE PATTERN "images" EXCLUDE PATTERN "man" EXCLUDE)
install(DIRECTORY images/ DESTINATION share/doc/pgagroal/images FILES_MATCHING PATTERN "*.png")
Expand Down
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ else()

if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
add_compile_options(-DHAVE_OPENBSD)
else()
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
add_compile_options(-DHAVE_FREEBSD)
endif()
endif()

#
Expand Down
6 changes: 3 additions & 3 deletions src/include/pgagroal.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ extern "C" {

#define MAIN_UDS ".s.pgagroal"

#ifdef HAVE_LINUX
#define PGAGROAL_DEFAULT_CONFIGURATION_PATH "/etc/pgagroal/"
#ifdef HAVE_FREEBSD
#define PGAGROAL_DEFAULT_CONFIGURATION_PATH "/usr/local/etc/pgagroal/"
#else
#define PGAGROAL_DEFAULT_CONFIGURATION_PATH "/usr/local/etc/pgagroal/"
#define PGAGROAL_DEFAULT_CONFIGURATION_PATH "/etc/pgagroal/"
#endif

#define PGAGROAL_DEFAULT_CONF_FILE PGAGROAL_DEFAULT_CONFIGURATION_PATH "pgagroal.conf"
Expand Down

0 comments on commit c08b458

Please sign in to comment.