From 999ea232fe0015831a6a6bf887275e811fb52ed1 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Thu, 6 Feb 2025 12:46:34 +0100 Subject: [PATCH] security/tor: sync with upstream Taken from: FreeBSD --- security/tor/Makefile | 15 ++++++++++++--- security/tor/files/tor.in | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/security/tor/Makefile b/security/tor/Makefile index 36ac1a1b85c..fbc3533067d 100644 --- a/security/tor/Makefile +++ b/security/tor/Makefile @@ -1,5 +1,6 @@ PORTNAME= tor DISTVERSION= 0.4.8.13 +PORTREVISION= 2 CATEGORIES= security net MASTER_SITES= TOR @@ -8,7 +9,6 @@ COMMENT= Anonymizing overlay network for TCP WWW= https://www.torproject.org/ LICENSE= BSD3CLAUSE -LICENSE_FILE= ${WRKSRC}/LICENSE USES= compiler:c11 cpe gmake pkgconfig # should be compiler:c99 or compiler:gnu99 USE_CSTD= gnu99 # until this bug report is closed: https://trac.torproject.org/projects/tor/ticket/27900 @@ -21,11 +21,11 @@ CONFIGURE_ENV= TOR_CPPFLAGS_libevent="-I${LOCALBASE}/include" \ TOR_LDFLAGS_libevent="-L${LOCALBASE}/lib/" \ TOR_LIBEVENT_LIBS="${TOR_LIBEVENT_LIBS}" -OPTIONS_DEFINE= MANPAGES DOCS STATIC_TOR TCMALLOC +OPTIONS_DEFINE= DOCS MANPAGES POW STATIC_TOR TCMALLOC OPTIONS_GROUP= COMPRESSION TRACING OPTIONS_GROUP_COMPRESSION= ZSTD LZMA OPTIONS_GROUP_TRACING= LTTNG USDT LOG_DEBUG -OPTIONS_DEFAULT=MANPAGES ZSTD LZMA +OPTIONS_DEFAULT= MANPAGES POW LZMA ZSTD OPTIONS_SUB= yes STATIC_TOR_DESC= Build a static tor COMPRESSION_DESC= Supported compression libraries @@ -41,6 +41,9 @@ USERS= _tor CONFLICTS_INSTALL= tor-devel +POW_DESC= Enable PoW (Proof of Work) module (licence changes to GPL) +POW_CONFIGURE_ENABLE= gpl # gpl enables POW + STATIC_TOR_USES= ssl:build STATIC_TOR_USES_OFF= ssl @@ -69,6 +72,12 @@ BUILD_DEPENDS+= asciidoc:textproc/asciidoc CONFIGURE_ARGS+= --disable-asciidoc .endif +.if ${PORT_OPTIONS:MPOW} +LICENSE= GPLv3 +.else +LICENSE_FILE= ${WRKSRC}/LICENSE # BSD license file +.endif + .if !defined(USE_GCC) && \ empty(PORT_OPTIONS:MSTATIC_TOR) CONFIGURE_ARGS+= --enable-gcc-hardening diff --git a/security/tor/files/tor.in b/security/tor/files/tor.in index 0e1c8f3cae0..9088d42842a 100644 --- a/security/tor/files/tor.in +++ b/security/tor/files/tor.in @@ -12,6 +12,7 @@ # tor_instances (str): List of instances. Default: "" # tor_conf (str): Points to your torrc file. # Default: %%PREFIX%%/etc/tor/torrc +# tor_flags (str): Additional flags. Common to all instances. # tor_user (str): Tor daemon user. Default: %%USER%% # tor_group (str): Tor group. Default: %%GROUP%% # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid @@ -36,6 +37,7 @@ load_rc_config ${name} : ${tor_enable="NO"} : ${tor_instances=""} : ${tor_conf="%%PREFIX%%/etc/tor/torrc"} +: ${tor_flags=""} : ${tor_user="%%USER%%"} : ${tor_group="%%GROUP%%"} : ${tor_pidfile="/var/run/tor/tor.pid"} @@ -109,7 +111,7 @@ required_files=${tor_conf} required_dirs=${tor_datadir} pidfile=${tor_pidfile} command="%%PREFIX%%/bin/${name}" -command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir}" +command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} ${tor_flags}" extra_commands="reload" # clear user setting in conf file: it should be done through the command line