security/tor: sync with upstream

Taken from: FreeBSD
This commit is contained in:
Franco Fichtner 2025-02-06 12:46:34 +01:00
parent 357fe7479e
commit 999ea232fe
2 changed files with 15 additions and 4 deletions

View file

@ -1,5 +1,6 @@
PORTNAME= tor PORTNAME= tor
DISTVERSION= 0.4.8.13 DISTVERSION= 0.4.8.13
PORTREVISION= 2
CATEGORIES= security net CATEGORIES= security net
MASTER_SITES= TOR MASTER_SITES= TOR
@ -8,7 +9,6 @@ COMMENT= Anonymizing overlay network for TCP
WWW= https://www.torproject.org/ WWW= https://www.torproject.org/
LICENSE= BSD3CLAUSE LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= compiler:c11 cpe gmake pkgconfig # should be compiler:c99 or compiler:gnu99 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 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_LDFLAGS_libevent="-L${LOCALBASE}/lib/" \
TOR_LIBEVENT_LIBS="${TOR_LIBEVENT_LIBS}" 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 TRACING
OPTIONS_GROUP_COMPRESSION= ZSTD LZMA OPTIONS_GROUP_COMPRESSION= ZSTD LZMA
OPTIONS_GROUP_TRACING= LTTNG USDT LOG_DEBUG OPTIONS_GROUP_TRACING= LTTNG USDT LOG_DEBUG
OPTIONS_DEFAULT=MANPAGES ZSTD LZMA OPTIONS_DEFAULT= MANPAGES POW LZMA ZSTD
OPTIONS_SUB= yes OPTIONS_SUB= yes
STATIC_TOR_DESC= Build a static tor STATIC_TOR_DESC= Build a static tor
COMPRESSION_DESC= Supported compression libraries COMPRESSION_DESC= Supported compression libraries
@ -41,6 +41,9 @@ USERS= _tor
CONFLICTS_INSTALL= tor-devel 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= ssl:build
STATIC_TOR_USES_OFF= ssl STATIC_TOR_USES_OFF= ssl
@ -69,6 +72,12 @@ BUILD_DEPENDS+= asciidoc:textproc/asciidoc
CONFIGURE_ARGS+= --disable-asciidoc CONFIGURE_ARGS+= --disable-asciidoc
.endif .endif
.if ${PORT_OPTIONS:MPOW}
LICENSE= GPLv3
.else
LICENSE_FILE= ${WRKSRC}/LICENSE # BSD license file
.endif
.if !defined(USE_GCC) && \ .if !defined(USE_GCC) && \
empty(PORT_OPTIONS:MSTATIC_TOR) empty(PORT_OPTIONS:MSTATIC_TOR)
CONFIGURE_ARGS+= --enable-gcc-hardening CONFIGURE_ARGS+= --enable-gcc-hardening

View file

@ -12,6 +12,7 @@
# tor_instances (str): List of instances. Default: "" # tor_instances (str): List of instances. Default: ""
# tor_conf (str): Points to your torrc file. # tor_conf (str): Points to your torrc file.
# Default: %%PREFIX%%/etc/tor/torrc # Default: %%PREFIX%%/etc/tor/torrc
# tor_flags (str): Additional flags. Common to all instances.
# tor_user (str): Tor daemon user. Default: %%USER%% # tor_user (str): Tor daemon user. Default: %%USER%%
# tor_group (str): Tor group. Default: %%GROUP%% # tor_group (str): Tor group. Default: %%GROUP%%
# tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid # tor_pidfile (str): Tor pid file. Default: /var/run/tor/tor.pid
@ -36,6 +37,7 @@ load_rc_config ${name}
: ${tor_enable="NO"} : ${tor_enable="NO"}
: ${tor_instances=""} : ${tor_instances=""}
: ${tor_conf="%%PREFIX%%/etc/tor/torrc"} : ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
: ${tor_flags=""}
: ${tor_user="%%USER%%"} : ${tor_user="%%USER%%"}
: ${tor_group="%%GROUP%%"} : ${tor_group="%%GROUP%%"}
: ${tor_pidfile="/var/run/tor/tor.pid"} : ${tor_pidfile="/var/run/tor/tor.pid"}
@ -109,7 +111,7 @@ required_files=${tor_conf}
required_dirs=${tor_datadir} required_dirs=${tor_datadir}
pidfile=${tor_pidfile} pidfile=${tor_pidfile}
command="%%PREFIX%%/bin/${name}" 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" extra_commands="reload"
# clear user setting in conf file: it should be done through the command line # clear user setting in conf file: it should be done through the command line