diff --git a/mail/postsrsd/Makefile b/mail/postsrsd/Makefile index d35d5eff4005..a10067746a7a 100644 --- a/mail/postsrsd/Makefile +++ b/mail/postsrsd/Makefile @@ -1,60 +1,61 @@ PORTNAME= postsrsd DISTVERSION= 2.0.11 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= mail MAINTAINER= ports@bsdserwis.com COMMENT= Postfix Sender Rewriting Scheme daemon WWW= https://github.com/roehling/postsrsd LICENSE= BSD3CLAUSE GPLv3+ LICENSE_COMB= dual 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" SUB_FILES= pkg-message PLIST_FILES= \ sbin/postsrsd \ "@sample ${ETCDIR}.conf.sample" \ "@dir /var/db/${PORTNAME}" \ "@dir /var/run/${PORTNAME}" PORTDOCS= CHANGELOG.rst README.rst postsrsd.conf 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 post-patch: ${REINPLACE_CMD} -e '/^chroot-dir/ s/^/#/' ${WRKSRC}/doc/postsrsd.conf post-install: ${INSTALL_DATA} ${WRKSRC}/doc/postsrsd.conf ${STAGEDIR}${PREFIX}/etc/postsrsd.conf.sample ${MKDIR} ${STAGEDIR}/var/run/${PORTNAME} .include diff --git a/mail/postsrsd/files/patch-CMakeLists.txt b/mail/postsrsd/files/patch-CMakeLists.txt index 551653c47e84..067187f36c7c 100644 --- a/mail/postsrsd/files/patch-CMakeLists.txt +++ b/mail/postsrsd/files/patch-CMakeLists.txt @@ -1,86 +1,86 @@ --- CMakeLists.txt.orig 2023-08-25 21:10:07 UTC +++ CMakeLists.txt @@ -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}" ++ "/var/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(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) -add_autotools_dependency( - Confuse - LIBRARY_NAME confuse - EXPORTED_TARGET Confuse::Confuse -) +find_package(Confuse REQUIRED) 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}" ) -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() if(GENERATE_SRS_SECRET)