diff --git a/mail/postsrsd/Makefile b/mail/postsrsd/Makefile index cf906a7d0d4a..bf7cd417785b 100644 --- a/mail/postsrsd/Makefile +++ b/mail/postsrsd/Makefile @@ -1,51 +1,56 @@ PORTNAME= postsrsd -PORTVERSION= 2.0.8 +DISTVERSION= 2.0.8 +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}" 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-install: + ${INSTALL_DATA} ${WRKSRC}/doc/postsrsd.conf ${STAGEDIR}${PREFIX}/etc/postsrsd.conf.sample + .include diff --git a/mail/postsrsd/files/postsrsd.in b/mail/postsrsd/files/postsrsd.in index a4625245439c..1e0617568447 100644 --- a/mail/postsrsd/files/postsrsd.in +++ b/mail/postsrsd/files/postsrsd.in @@ -1,66 +1,68 @@ #!/bin/sh # PROVIDE: postsrsd # REQUIRE: DAEMON # BEFORE: mail # KEYWORD: shutdown # Define these postsrsd_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/postsrsd # # postsrsd_enable (bool): Set to "NO" by default. # Set it to "YES" to enable postsrsd. # postsrsd_uid (str): Set username to run postsrsd. +# postsrsd_secret (str): Secret file file. See postsrsd(8) # postsrsd_flags (str): Flags passed to start command. . /etc/rc.subr name="postsrsd" rcvar=postsrsd_enable start_precmd="postsrsd_prepcmd" stop_postcmd="postsrsd_postcmd" command="%%PREFIX%%/sbin/postsrsd" _piddir="/var/run/postsrsd" pidfile="${_piddir}/${name}.pid" load_rc_config $name # # DO NOT CHANGE THESE DEFAULT VALUES HERE # : ${postsrsd_enable="NO"} : ${postsrsd_uid="mailnull"} +: ${postsrsd_secret="%%PREFIX%%/etc/postsrsd.secret"} # Options other than above can be set with $postsrsd_flags. # see postsrsd documentation for detail. [ -n "${postsrsd_uid}" ] && _uid_prefix="-u" command_args=" -D ${_uid_prefix} ${postsrsd_uid} -p ${pidfile} ${cmd_args} ${postsrsd_flags}" postsrsd_prepcmd () { if [ ! -d ${_piddir} ] ; then mkdir -p ${_piddir} fi if [ -n "${postsrsd_uid}" ] ; then chown ${postsrsd_uid} ${_piddir} fi if [ ! -f "${postsrsd_secret}" ] ; then env -i tr -cd "[:alnum:]" < /dev/urandom | head -c 24 > "${postsrsd_secret}" fi } postsrsd_postcmd() { # just if the directory is empty rmdir ${_piddir} > /dev/null 2>&1 } # to let rc.subr kill them all unset pidfile run_rc_command "$1"