Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This release is a new generation of postsrsd. This update includes: * support for redis * support for sqlite3 * disable installing postsrsd.secret - it is generated during first start of postsrsd (startup script) * add pkg-message which informs about changes in configuration * some cleanup suggested by portlint Changelog: https://github.com/roehling/postsrsd/releases/tag/2.0.8 PR: 273571
- Loading branch information
Showing
8 changed files
with
137 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,51 @@ | ||
PORTNAME= postsrsd | ||
DISTVERSION= 1.10 | ||
PORTVERSION= 2.0.8 | ||
PORTEPOCH= 1 | ||
CATEGORIES= mail | ||
|
||
MAINTAINER= ports@bsdserwis.com | ||
COMMENT= Postfix Sender Rewriting Scheme daemon | ||
WWW= https://github.com/roehling/postsrsd | ||
|
||
LICENSE= GPLv2+ | ||
LICENSE_FILE= ${WRKSRC}/LICENSE | ||
LICENSE= BSD3CLAUSE GPLv3+ | ||
LICENSE_COMB= dual | ||
|
||
BUILD_DEPENDS= help2man:misc/help2man | ||
LIB_DEPENDS= libconfuse.so:devel/libconfuse | ||
|
||
USES= cmake cpe pkgconfig | ||
|
||
CPE_VENDOR= ${PORTNAME}_project | ||
|
||
USE_GITHUB= yes | ||
GH_ACCOUNT= roehling | ||
USE_LDCONFIG= yes | ||
USE_RC_SUBR= ${PORTNAME} | ||
|
||
CMAKE_ARGS= --no-warn-unused-cli \ | ||
-DBUILD_TESTING=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=ALWAYS \ | ||
-DCMAKE_INCLUDE_PATH="${LOCALBASE}/include" \ | ||
-DCMAKE_LIBRARY_PATH="${LOCALBASE}/lib" | ||
|
||
PLIST_FILES= man/man8/postsrsd.8.gz \ | ||
sbin/postsrsd | ||
SUB_FILES= pkg-message | ||
|
||
PLIST_FILES= \ | ||
sbin/postsrsd \ | ||
"@dir /var/db/${PORTNAME}" | ||
|
||
PORTDOCS= README.md README_UPGRADE.md main.cf.ex | ||
PORTDOCS= CHANGELOG.rst README.rst postsrsd.conf | ||
|
||
OPTIONS_DEFINE= DOCS | ||
OPTIONS_DEFINE= DOCS REDIS SQLITE | ||
|
||
DOCS_CMAKE_BOOL= ENABLE_DOCS | ||
|
||
REDIS_DESC= Store envelope senders in redis | ||
REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis | ||
REDIS_CMAKE_BOOL= WITH_REDIS | ||
|
||
SQLITE_DESC= Use sqlite3 backebd for storing envelope senders | ||
SQLITE_USES= sqlite | ||
SQLITE_CMAKE_BOOL= WITH_SQLITE | ||
|
||
.include <bsd.port.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TIMESTAMP = 1488207086 | ||
SHA256 (roehling-postsrsd-1.10_GH0.tar.gz) = 4880bf12f1a75791f10a995e46a7fce26ee760d1d6942b4602244d2026d4e64a | ||
SIZE (roehling-postsrsd-1.10_GH0.tar.gz) = 34844 | ||
TIMESTAMP = 1693511528 | ||
SHA256 (roehling-postsrsd-2.0.8_GH0.tar.gz) = c2eb4af90ce42ec394adf7b9b94f700b851e3a6a6a8a2a843a57dc9f45260f8e | ||
SIZE (roehling-postsrsd-2.0.8_GH0.tar.gz) = 64185 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,86 @@ | ||
--- CMakeLists.txt.orig 2020-12-12 09:55:17 UTC | ||
--- CMakeLists.txt.orig 2023-08-25 21:10:07 UTC | ||
+++ CMakeLists.txt | ||
@@ -7,12 +7,15 @@ include(CTest) | ||
|
||
option(GENERATE_SRS_SECRET "Generate a random SRS secret if none exists during install" ON) | ||
option(USE_APPARMOR "Enable AppArmor profile" OFF) | ||
@@ -49,7 +49,7 @@ set(POSTSRSD_CONFIGDIR | ||
"The default directory where PostSRSd should look for configuration files" | ||
) | ||
set(POSTSRSD_DATADIR | ||
- "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/lib/${PROJECT_NAME}" | ||
+ "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/db/${PROJECT_NAME}" | ||
CACHE PATH "The default directory where PostSRSd should put runtime data" | ||
) | ||
set(POSTSRSD_CHROOTDIR | ||
@@ -73,24 +73,21 @@ option(WITH_REDIS | ||
OFF | ||
) | ||
add_feature_info(WITH_REDIS WITH_REDIS "use Redis as database backend") | ||
+set(DOC_DIR "share/doc/${PROJECT_NAME}" CACHE PATH "Path for documentation files") | ||
+option(MK_CHROOT_DIR "Chroot jail for daemon" OFF) | ||
option(USE_SELINUX "Enable SELinux policy module" OFF) | ||
|
||
+if(MK_CHROOT_DIR) | ||
set(CHROOT_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}" CACHE PATH "Chroot jail for daemon") | ||
+endif() | ||
set(SYSCONF_DIR "/etc" CACHE PATH "Global system configuration folder") | ||
set(SYSD_UNIT_DIR "${SYSCONF_DIR}/systemd/system" CACHE PATH "Systemd unit file folder") | ||
-set(CONFIG_DIR "${SYSCONF_DIR}/default" CACHE PATH "Location of startup configuration file") | ||
+set(CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc" CACHE PATH "Location of startup configuration file") | ||
set(DOC_DIR "share/doc/${PROJECT_NAME}" CACHE PATH "Path for documentation files") | ||
mark_as_advanced(CHROOT_DIR SYSCONF_DIR SYSD_UNIT_DIR CONFIG_DIR DOC_DIR) | ||
|
||
@@ -20,8 +23,6 @@ find_program(HELP2MAN help2man DOC "path to help2man e | ||
find_program(DD dd DOC "path to dd executable") | ||
find_program(BASE64 base64 DOC "path to base64 executable") | ||
find_program(OPENSSL openssl DOC "path to OpenSSL executable") | ||
-find_program(INSSERV insserv DOC "path to insserv executable") | ||
-find_program(CHKCONFIG chkconfig DOC "path to chkconfig executable") | ||
find_program(SYSTEMCTL systemctl DOC "path to systemctl executable") | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "SunOS") | ||
@@ -69,23 +70,6 @@ endif() | ||
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG) | ||
add_definitions(-DSIZEOF_UNSIGNED_LONG=${SIZEOF_UNSIGNED_LONG}) | ||
|
||
-if(NOT DEFINED INIT_FLAVOR) | ||
- if(SYSTEMCTL) | ||
- message(STATUS "Detected init flavor: systemd") | ||
- set(INIT_FLAVOR "systemd" CACHE STRING "Init daemon of this system") | ||
- elseif(IS_DIRECTORY "${SYSCONF_DIR}/init.d" AND EXISTS "${SYSCONF_DIR}/init.d/functions") | ||
- message(STATUS "Detected init flavor: sysv-redhat") | ||
- set(INIT_FLAVOR "sysv-redhat" CACHE STRING "Init daemon of this system") | ||
- elseif(IS_DIRECTORY "${SYSCONF_DIR}/init.d" AND EXISTS "/lib/lsb/init-functions") | ||
- message(STATUS "Detected init flavor: sysv-lsb") | ||
- set(INIT_FLAVOR "sysv-lsb" CACHE STRING "Init daemon of this system") | ||
- else() | ||
- message(STATUS "Detected init flavor: none") | ||
- message(STATUS "System startup files will not be installed") | ||
- set(INIT_FLAVOR "" CACHE STRING "Init daemon of this system") | ||
- endif() | ||
-endif() | ||
- | ||
add_definitions(-DPOSTSRSD_VERSION=\"${PROJECT_VERSION}\") | ||
add_executable(${PROJECT_NAME} postsrsd.c sha1.c srs2.c) | ||
|
||
@@ -95,16 +79,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "SunOS") | ||
endif() | ||
|
||
set(POSTSRSD "${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}") | ||
-set(APPARMOR_PROFILE "${CMAKE_INSTALL_PREFIX}/sbin/${POSTSRSD}") | ||
-string(REGEX REPLACE "^/+" "" APPARMOR_PROFILE "${APPARMOR_PROFILE}") | ||
-string(REPLACE "/" "." APPARMOR_PROFILE "${APPARMOR_PROFILE}") | ||
|
||
-configure_file(init/${PROJECT_NAME}.sysv-lsb.in ${PROJECT_NAME}.sysv-lsb @ONLY) | ||
-configure_file(init/${PROJECT_NAME}.sysv-redhat.in ${PROJECT_NAME}.sysv-redhat @ONLY) | ||
-configure_file(init/${PROJECT_NAME}.apparmor.in ${PROJECT_NAME}.apparmor @ONLY) | ||
-configure_file(init/${PROJECT_NAME}.systemd.in ${PROJECT_NAME}.systemd @ONLY) | ||
configure_file(init/${PROJECT_NAME}.default.in ${PROJECT_NAME}.default @ONLY) | ||
-configure_file(init/${PROJECT_NAME}-systemd-launcher.in ${PROJECT_NAME}-systemd-launcher @ONLY) | ||
option(TESTS_WITH_ASAN "Run test suite with AddressSanitizer" ON) | ||
option(DEVELOPER_BUILD "Add strict compiler options for development only" OFF) | ||
-option(GENERATE_SRS_SECRET "Generate and install a postsrsd.secret" ON) | ||
+option(GENERATE_SRS_SECRET "Generate and install a postsrsd.secret" OFF) | ||
add_feature_info( | ||
GENERATE_SRS_SECRET | ||
GENERATE_SRS_SECRET | ||
"generate missing ${CMAKE_INSTALL_FULL_SYSCONFDIR}/${PROJECT_NAME}.secret on install" | ||
) | ||
-option(INSTALL_SYSTEMD_SERVICE "Install the systemd postsrsd.service unit" ON) | ||
+option(INSTALL_SYSTEMD_SERVICE "Install the systemd postsrsd.service unit" OFF) | ||
add_feature_info( | ||
INSTALL_SYSTEMD_SERVICE INSTALL_SYSTEMD_SERVICE | ||
"install the systemd postsrsd.service unit" | ||
) | ||
-find_systemd_unit_destination(DETECTED_SYSTEMD_UNITDIR) | ||
-set(SYSTEMD_UNITDIR | ||
- "${DETECTED_SYSTEMD_UNITDIR}" | ||
- CACHE PATH "Install destination for the systemd postsrsd.service unit" | ||
-) | ||
find_systemd_sysusers_destination(DETECTED_SYSTEMD_SYSUSERSDIR) | ||
set(SYSTEMD_SYSUSERSDIR | ||
"${DETECTED_SYSTEMD_SYSUSERSDIR}" | ||
@@ -118,7 +115,6 @@ mark_as_advanced( | ||
TESTS_WITH_ASAN | ||
GENERATE_SRS_SECRET | ||
DEVELOPER_BUILD | ||
- SYSTEMD_UNITDIR | ||
POSTSRSD_CONFIGDIR | ||
POSTSRSD_CHROOTDIR | ||
POSTSRSD_DATADIR | ||
@@ -200,11 +196,7 @@ endif() | ||
set(THREADS_PREFER_PTHREAD_FLAG TRUE) | ||
find_package(Threads QUIET) | ||
|
||
configure_file(postinstall.cmake.in postinstall.cmake @ONLY) | ||
-add_autotools_dependency( | ||
- Confuse | ||
- LIBRARY_NAME confuse | ||
- EXPORTED_TARGET Confuse::Confuse | ||
-) | ||
+find_package(Confuse REQUIRED) | ||
|
||
@@ -118,7 +94,7 @@ add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${HELP2MAN} ARGS -s8 -o${PROJECT_NAME}.8 -n "Postfix Sender Rewriting Scheme daemon" -N -h-h -v-v ${CMAKE_CURRENT_BINARY_DIR}/${POSTSRSD} | ||
VERBATIM | ||
if(WITH_REDIS) | ||
set(DISABLE_TESTS | ||
@@ -221,6 +213,7 @@ if(WITH_REDIS) | ||
DIRECTORY "${hiredis_SOURCE_DIR}" PROPERTY EXCLUDE_FROM_ALL TRUE | ||
) | ||
endif() | ||
+ find_package(Hiredis REQUIRED) | ||
if(TARGET hiredis::hiredis_static) | ||
set(HIREDIS_TARGET hiredis::hiredis_static) | ||
elseif(TARGET hiredis::hiredis) | ||
@@ -364,13 +357,9 @@ install(TARGETS postsrsd RUNTIME DESTINATION ${CMAKE_I | ||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.conf" | ||
DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME}" | ||
) | ||
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.8 DESTINATION "share/man/man8") | ||
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.8 DESTINATION "man/man8") | ||
endif() | ||
|
||
if(USE_APPARMOR) | ||
@@ -135,6 +111,8 @@ if(USE_SELINUX) | ||
-if(INSTALL_SYSTEMD_SERVICE) | ||
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.service" | ||
- DESTINATION "${SYSTEMD_UNITDIR}" | ||
- ) | ||
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sysusers.d/${PROJECT_NAME}.conf" | ||
- DESTINATION "${SYSTEMD_SYSUSERSDIR}" | ||
- ) | ||
+ | ||
+if(ENABLE_DOCS) | ||
+ install(FILES README.rst CHANGELOG.rst doc/postsrsd.conf DESTINATION "${DOC_DIR}" ) | ||
endif() | ||
|
||
install(TARGETS ${PROJECT_NAME} DESTINATION "sbin") | ||
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-systemd-launcher DESTINATION "share/${PROJECT_NAME}") | ||
+if(ENABLE_DOCS) | ||
+ install(FILES README.md README_UPGRADE.md main.cf.ex DESTINATION "${DOC_DIR}") | ||
+endif() | ||
install(FILES README.md README_UPGRADE.md main.cf.ex DESTINATION "${DOC_DIR}") | ||
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/postinstall.cmake") | ||
if(GENERATE_SRS_SECRET) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/config.c.orig 2023-07-15 18:53:41 UTC | ||
+++ src/config.c | ||
@@ -21,6 +21,7 @@ | ||
#include "util.h" | ||
|
||
#include <errno.h> | ||
+#include <getopt.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- src/srs.c.orig 2023-07-15 18:53:41 UTC | ||
+++ src/srs.c | ||
@@ -21,6 +21,7 @@ | ||
|
||
#include <ctype.h> | ||
#include <string.h> | ||
+#include <strings.h> | ||
|
||
char* postsrsd_forward(const char* addr, const char* domain, srs_t* srs, | ||
database_t* db, domain_set_t* local_domains, bool* error, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ type: install | ||
message: <<EOM | ||
If you upgrading from postsrsd 1.x you should remember to check | ||
and modify postsrsd.conf file. postsrsd dropped support for command line | ||
parameters. | ||
Additional setup instructions and sample config file can be found at: | ||
%%DOCSDIR%% | ||
EOM | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters