1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00

mail/postsrsd: Update to 1.4, avoid secret in pkg

Update to 1.4 (1)
While here, avoid creating postsrsd.secret in package and improve rc script (2)

PR:		211098 (2)
PR:		217340 (1)
Submitted by:	Miroslav Lachman (2)
Submitted by:	Peter Putzer (1)
Approved by:	Krzysztof <ports@bsdserwis.com> (maintainer) (1)(2)
This commit is contained in:
Steve Wills 2017-02-27 14:52:12 +00:00
parent ca935ac942
commit a7513c19d9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=434961
7 changed files with 28 additions and 60 deletions

View File

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= postsrsd
PORTVERSION= 1.3
PORTREVISION= 2
PORTVERSION= 1.4
CATEGORIES= mail
MAINTAINER= ports@bsdserwis.com
@ -31,6 +30,6 @@ OPTIONS_DEFINE= DOCS
DOCS_CMAKE_ON= -DENABLE_DOCS:STRING="ON"
PLIST_FILES= sbin/postsrsd man/man8/postsrsd.8.gz etc/postsrsd.secret
PLIST_FILES= sbin/postsrsd man/man8/postsrsd.8.gz
.include <bsd.port.mk>

View File

@ -1,2 +1,3 @@
SHA256 (roehling-postsrsd-1.3_GH0.tar.gz) = 0f72c41052204a17c35a22a7651430156ca1dbcb98b1bfe48e44ec76248b62fc
SIZE (roehling-postsrsd-1.3_GH0.tar.gz) = 26409
TIMESTAMP = 1488207086
SHA256 (roehling-postsrsd-1.4_GH0.tar.gz) = f3230d57c36ba4688cc3beb90fbb0f199a06381e4df2edbc4ef541a9e8a574ff
SIZE (roehling-postsrsd-1.4_GH0.tar.gz) = 26555

View File

@ -25,8 +25,8 @@
find_library(LIBSOCKET socket)
find_library(LIBNSL nsl)
@@ -46,26 +47,6 @@ if(HAVE_TIME_H)
add_definitions(-DHAVE_TIME_H)
@@ -54,26 +55,6 @@ if(HAVE_SYS_TYPES_H)
add_definitions(-DHAVE_SYS_TYPES_H)
endif()
-if(NOT DEFINED INIT_FLAVOR)
@ -52,7 +52,7 @@
add_executable(${PROJECT_NAME} postsrsd.c sha1.c srs2.c)
if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
@@ -74,15 +55,7 @@ endif()
@@ -82,15 +63,7 @@ endif()
get_target_property(POSTSRSD ${PROJECT_NAME} LOCATION)
get_filename_component(POSTSRSD ${POSTSRSD} NAME_WE)
@ -68,7 +68,7 @@
configure_file(init/${PROJECT_NAME}.default.in ${PROJECT_NAME}.default @ONLY)
configure_file(postinstall.cmake.in postinstall.cmake @ONLY)
@@ -92,7 +65,7 @@ add_custom_command(TARGET ${PROJECT_NAME
@@ -100,7 +73,7 @@ add_custom_command(TARGET ${PROJECT_NAME
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
)
@ -77,7 +77,7 @@
endif()
if(USE_APPARMOR)
@@ -100,6 +73,8 @@ if(USE_APPARMOR)
@@ -108,6 +81,8 @@ if(USE_APPARMOR)
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION "sbin")

View File

@ -1,6 +1,11 @@
--- postinstall.cmake.in.orig 2015-12-13 08:56:05 UTC
+++ postinstall.cmake.in
@@ -7,51 +7,13 @@ set(INIT_FLAVOR "@INIT_FLAVOR@")
@@ -1,4 +1,3 @@
-set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
set(SYSCONF_DIR "@SYSCONF_DIR@")
set(SYSD_UNIT_DIR "@SYSD_UNIT_DIR@")
set(CHROOT_DIR "@CHROOT_DIR@")
@@ -7,51 +6,13 @@ set(INIT_FLAVOR "@INIT_FLAVOR@")
set(SECRET_FILE "@PROJECT_NAME@.secret")
set(DD "@DD@")
set(BASE64_ENCODE "@BASE64_ENCODE@")
@ -53,7 +58,7 @@
message(STATUS "Generating secret key")
execute_process(
COMMAND ${DD} if=/dev/urandom bs=18 count=1
@@ -60,7 +22,7 @@ if(GENERATE_SRS_SECRET AND DD AND BASE64
@@ -60,7 +21,7 @@ if(GENERATE_SRS_SECRET AND DD AND BASE64
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)

View File

@ -1,15 +0,0 @@
--- srs2.c.orig 2015-12-13 08:56:05 UTC
+++ srs2.c
@@ -21,7 +21,11 @@
#include <sys/types.h> /* tyepdefs */
#include <sys/time.h> /* timeval / timezone struct */
#include <string.h> /* memcpy, strcpy, memset */
-#include <alloca.h>
+#if defined(__FreeBSD__)
+# include <stdlib.h>
+#else
+# include <alloca.h>
+#endif
#ifdef USE_OPENSSL
#include <openssl/hmac.h>

View File

@ -1,11 +0,0 @@
--- srs2.h.orig 2015-12-13 08:56:05 UTC
+++ srs2.h
@@ -23,7 +23,7 @@
#ifdef __APPLE__
#include <sys/types.h>
#endif
-
+#include <time.h>
#ifndef __BEGIN_DECLS
#define __BEGIN_DECLS

View File

@ -52,29 +52,15 @@ load_rc_config $name
# Options other than above can be set with $postsrsd_flags.
# see postsrsd documentation for detail.
if [ "x${postsrsd_uid}" != "x" ];then
_uid_prefix="-u"
fi
if [ "x${postsrsd_domain}" != "x" ];then
postsrsd_domain="-d ${postsrsd_domain}"
fi
if [ "x${postsrsd_secret}" != "x" ];then
postsrsd_secret="-s ${postsrsd_secret}"
fi
if [ "x${postsrsd_forward_port}" != "x" ];then
postsrsd_forward_port="-f ${postsrsd_forward_port}"
fi
if [ "x${postsrsd_reverse_port}" != "x" ];then
postsrsd_reverse_port="-r ${postsrsd_reverse_port}"
fi
if [ "x${postsrsd_idle_timeout}" != "x" ];then
postsrsd_idle_timeout="-t ${postsrsd_idle_timeout}"
fi
if [ "x${postsrsd_exclude_domains}" != "x" ];then
postsrsd_exclude_domains="-X${postsrsd_exclude_domains}"
fi
[ -n "${postsrsd_uid}" ] && _uid_prefix="-u"
[ -n "${postsrsd_domain}" ] && cmd_args="-d ${postsrsd_domain}"
[ -n "${postsrsd_secret}" ] && cmd_args="${cmd_args} -s ${postsrsd_secret}"
[ -n "${postsrsd_forward_port}" ] && cmd_args="${cmd_args} -f ${postsrsd_forward_port}"
[ -n "${postsrsd_reverse_port}" ] && cmd_args="${cmd_args} -r ${postsrsd_reverse_port}"
[ -n "${postsrsd_idle_timeout}" ] && cmd_args="${cmd_args} -t ${postsrsd_idle_timeout}"
[ -n "${postsrsd_exclude_domains}" ] && cmd_args="${cmd_args} -X${postsrsd_exclude_domains}"
command_args=" -D ${_uid_prefix} ${postsrsd_uid} -p ${pidfile} ${postsrsd_domain} ${postsrsd_secret} ${postsrsd_forward_port} ${postsrsd_reverse_port} ${postsrsd_idle_timeout} ${postsrsd_exclude_domains} ${postsrsd_flags}"
command_args=" -D ${_uid_prefix} ${postsrsd_uid} -p ${pidfile} ${cmd_args} ${postsrsd_flags}"
postsrsd_prepcmd ()
{
@ -84,6 +70,9 @@ postsrsd_prepcmd ()
if [ -n "${postsrsd_uid}" ] ; then
chown ${postsrsd_uid} ${_piddir}
fi
if [ ! -f "${postsrsd_secret}" ] ; then
tr -cd "[:alnum:]" < /dev/urandom | head -c 24 > "${postsrsd_secret}"
fi
}
postsrsd_postcmd()