aboutsummaryrefslogtreecommitdiff
path: root/security/softether/Makefile
diff options
context:
space:
mode:
authorKoichiro Iwao <meta@FreeBSD.org>2019-02-27 06:34:44 +0000
committerKoichiro Iwao <meta@FreeBSD.org>2019-02-27 06:34:44 +0000
commit09a66268dfddb630f0f9076aea3eba79f62b2ec2 (patch)
treeca0984b3f5b40ecd97d554a2c1838b1971e52172 /security/softether/Makefile
parentdc73dfedce5a43bd0c502c641c32fa30d0ff2f07 (diff)
downloadports-09a66268dfddb630f0f9076aea3eba79f62b2ec2.tar.gz
ports-09a66268dfddb630f0f9076aea3eba79f62b2ec2.zip
security/softether{,-devel}: do not spit out anything on libexec directory
SoftEther client, bridge, server daemon unintendedly had spit on libexec directory up to this update. Spit out all runtime files, directories and logs on SE_DBDIR or SE_LOGDIR. While here, - Avoid all hardcoded use of /var/db/softether, /var/log/softether Respect SE_DBDIR and SE_LOGDIR defined in Makefile - Substitute these directories in pkg-message as well - Regenerate some patches - Bump PORTREVISION to force rebuild Sponsored by: HAW International, Inc.
Notes
Notes: svn path=/head/; revision=494024
Diffstat (limited to 'security/softether/Makefile')
-rw-r--r--security/softether/Makefile60
1 files changed, 54 insertions, 6 deletions
diff --git a/security/softether/Makefile b/security/softether/Makefile
index ec7510f91a3a..e2acd1caa4d7 100644
--- a/security/softether/Makefile
+++ b/security/softether/Makefile
@@ -2,7 +2,7 @@
PORTNAME= softether
DISTVERSION= 4.25-9656
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= https://www.softether-download.com/files/softether/v${DISTVERSION}-rtm-2018.01.15-tree/Source_Code/
DISTNAME= ${PORTNAME}-src-v${DISTVERSION}-rtm
@@ -22,7 +22,6 @@ USE_RC_SUBR= softether_bridge softether_client softether_server
DOS2UNIX_FILES= ChangeLog LICENSE README *.TXT \
src/Cedar/*.* src/Mayaqua/*.*
-SUB_FILES= vpncmd
OPTIONS_DEFINE= DOCS UNLOCK
@@ -39,9 +38,11 @@ UNLOCK_EXTRA_PATCHES= ${FILESDIR}/extra-patch-unrestrict-enterprise-functions
CONFLICTS_INSTALL= softether-devel-4.* softether5
PORTDOCS= AUTHORS.TXT ChangeLog LICENSE README THIRD_PARTY.TXT WARNING.TXT
-LOGDIR?= /var/log/softether
-PLIST_SUB= LOGDIR="${LOGDIR}"
-SUB_LIST= LOGDIR="${LOGDIR}"
+SE_DBDIR?= /var/db/${PORTNAME}
+SE_LOGDIR?= /var/log/${PORTNAME}
+PLIST_SUB= SE_DBDIR="${SE_DBDIR}" SE_LOGDIR="${SE_LOGDIR}"
+SUB_LIST= SE_DBDIR="${SE_DBDIR}" SE_LOGDIR="${SE_LOGDIR}"
+SUB_FILES= pkg-message vpncmd
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
@@ -54,6 +55,52 @@ ALL_TARGET= build
.include <bsd.port.options.mk>
post-patch:
+ # SoftEther scatters logs, config files and PID files in PREFIX/libexec
+ # directory. To write them in the right place, replace it.
+ ${REINPLACE_CMD} \
+ -e "s|@vpn_server_template|${SE_DBDIR}/vpn_server_template|" \
+ -e "s|@vpn_server|${SE_DBDIR}/vpn_server|" \
+ -e "s|@vpn_bridge|${SE_DBDIR}/vpn_bridge|" \
+ -e "s|@vpn_gate_svc|${SE_DBDIR}/vpn_gate_svc|" \
+ -e "s|@vpn_gate_relay|${SE_DBDIR}/vpn_gate_relay|" \
+ ${WRKSRC}/src/Cedar/Server.c
+
+ ${REINPLACE_CMD} \
+ -e "s|@adminip|${SE_DBDIR}/adminip|" \
+ -e "s|@etherlogger|${SE_DBDIR}/etherlogger|" \
+ -e "s|@vpn_client|${SE_DBDIR}/vpn_client|" \
+ -e "s|@vpn_router|${SE_DBDIR}/vpn_router|" \
+ -e "s|@custom|${SE_DBDIR}/custom|" \
+ -e "s|@backup|${SE_DBDIR}/backup|" \
+ -e "s|@save_binary|${SE_DBDIR}/save_binary|" \
+ -e "s|@lang|${SE_DBDIR}/lang|" \
+ -e "s|@azureserver|${SE_DBDIR}/azureserver|" \
+ -e "s|@server_log|${SE_DIR}/server|" \
+ -e "s|@security_log|${SE_LOGDIR}/security|" \
+ -e "s|@packet_log|${SE_LOGDIR}/packet|" \
+ -e "s|@secure_nat_log|${SE_LOGDIR}/secure_nat|" \
+ -e "s|@client_log|${SE_LOGDIR}/client|" \
+ -e "s|@tiny_log|${SE_LOGDIR}/tiny|" \
+ -e "s|@carrier_log|${SE_LOGDIR}/carrier|" \
+ -e "s|@etherlogger_log|${SE_LOGDIR}/etherlogger|" \
+ ${WRKSRC}/src/Cedar/Cedar.h \
+ ${WRKSRC}/src/Cedar/Client.h \
+ ${WRKSRC}/src/Cedar/Nat.h \
+ ${WRKSRC}/src/Cedar/Server.c \
+ ${WRKSRC}/src/Mayaqua/Cfg.c \
+ ${WRKSRC}/src/Mayaqua/Cfg.h \
+ ${WRKSRC}/src/Mayaqua/Table.h
+
+ ${REINPLACE_CMD} \
+ -e "s|abort_error_log\.txt|${SE_LOGDIR}/abort_error_log.txt|" \
+ ${WRKSRC}/src/Mayaqua/Kernel.c
+
+ ${REINPLACE_CMD} \
+ -e "s|%%SE_DBDIR%%|${SE_DBDIR}|g" \
+ ${WRKSRC}/src/Cedar/Protocol.c \
+ ${WRKSRC}/src/Mayaqua/Unix.c \
+ ${WRKSRC}/src/Mayaqua/Network.c
+
# skip configure at all and copy the corresponding Makefile in place
.if ${ARCH} != "amd64"
@${CP} ${WRKSRC}/src/makefiles/freebsd_32bit.mak ${WRKSRC}/Makefile
@@ -78,7 +125,8 @@ do-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/${i}
.endfor
@${MKDIR} ${STAGEDIR}${DOCSDIR}
- @${MKDIR} ${STAGEDIR}${LOGDIR}
+ @${MKDIR} ${STAGEDIR}${SE_DBDIR}
+ @${MKDIR} ${STAGEDIR}${SE_LOGDIR}
.for doc in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR}
.endfor