View | Details | Raw Unified | Return to bug 203014 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-43 / +36 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	tor
4
PORTNAME=	tor
5
DISTVERSION=	0.2.6.7
5
DISTVERSION=	0.2.7.4-rc
6
CATEGORIES=	security net ipv6
6
CATEGORIES=	security net ipv6
7
MASTER_SITES=	TOR
7
MASTER_SITES=	TOR
8
PKGNAMESUFFIX=	-devel
8
PKGNAMESUFFIX=	-devel
Lines 15-33 Link Here
15
15
16
USES=		cpe gmake
16
USES=		cpe gmake
17
CPE_VENDOR=	torproject
17
CPE_VENDOR=	torproject
18
#CPE_VERSION=	${DISTVERSION:C/-.*//}
19
#CPE_UPDATE=	${DISTVERSION:C/.*-//}
20
GNU_CONFIGURE=	yes
18
GNU_CONFIGURE=	yes
21
CONFIGURE_ARGS=	--with-openssl-dir="${OPENSSLBASE}" --disable-asciidoc
19
CONFIGURE_ARGS=	--with-openssl-dir=${OPENSSLBASE} --disable-asciidoc
22
CONFIGURE_ENV=	TOR_CPPFLAGS_libevent="-I${LOCALBASE}/include" \
23
		TOR_LDFLAGS_libevent="-L${LOCALBASE}/lib/" \
24
		TOR_LIBEVENT_LIBS="${TOR_LIBEVENT_LIBS}"
25
20
26
OPTIONS_DEFINE=	BUFFEREVENTS INSTR_DOWNLOADS \
21
OPTIONS_DEFINE=	BUFFEREVENTS INSTR_DOWNLOADS \
27
		STATIC_TOR TCMALLOC TOR2WEB TRANSPARENT
22
		STATIC_TOR TCMALLOC TOR2WEB TRANSPARENT
28
23
24
OPTIONS_DEFAULT=	THREADS TRANSPARENT
25
26
OPTIONS_GROUP=	TRANSPORT
27
OPTIONS_GROUP_TRANSPORT=	OBFSPROXY
28
29
BUFFEREVENTS_CONFIGURE_ENABLE=		bufferevents
30
INSTR_DOWNLOADS_CONFIGURE_ENABLE=	instrument-downloads
31
OBFSPROXY_BUILD_DEPENDS=		${LOCALBASE}/bin/obfsproxy:security/obfsproxy
32
TOR2WEB_CONFIGURE_ENABLE=		tor2web-mode
33
TRANSPARENT_CONFIGURE_ENABLE=		transparent
34
29
BUFFEREVENTS_DESC=	Use libevent's buffered IO
35
BUFFEREVENTS_DESC=	Use libevent's buffered IO
30
INSTR_DOWNLOADS_DESC=	Instrument downloads for analysis
36
INSTR_DOWNLOADS_DESC=	Instrument downloads for analysis
37
OBFSPROXY_DESC=		Pluggable transport proxy written in Python
31
STATIC_TOR_DESC=	Build a static tor
38
STATIC_TOR_DESC=	Build a static tor
32
TCMALLOC_DESC=		Use the tcmalloc memory allocation library
39
TCMALLOC_DESC=		Use the tcmalloc memory allocation library
33
TOR2WEB_DESC=		Faster but non-anonymous hidden services
40
TOR2WEB_DESC=		Faster but non-anonymous hidden services
Lines 35-40 Link Here
35
42
36
OPTIONS_DEFAULT=	THREADS TRANSPARENT
43
OPTIONS_DEFAULT=	THREADS TRANSPARENT
37
44
45
OPTIONS_GROUP=	TRANSPORT
46
OPTIONS_GROUP_TRANSPORT=	OBFSPROXY
47
38
USE_OPENSSL=	yes
48
USE_OPENSSL=	yes
39
49
40
USE_RC_SUBR=	tor
50
USE_RC_SUBR=	tor
Lines 47-52 Link Here
47
57
48
.include <bsd.port.options.mk>
58
.include <bsd.port.options.mk>
49
59
60
.if (${OSVERSION} < 1000015)
61
WITH_OPENSSL_PORT=	yes
62
.endif
63
50
.if !defined(USE_GCC) && empty(CC:T:M*gcc4*) && \
64
.if !defined(USE_GCC) && empty(CC:T:M*gcc4*) && \
51
empty(PORT_OPTIONS:MSTATIC_TOR) && empty(ARCH:Mia64)
65
empty(PORT_OPTIONS:MSTATIC_TOR) && empty(ARCH:Mia64)
52
CONFIGURE_ARGS+=	--enable-gcc-hardening
66
CONFIGURE_ARGS+=	--enable-gcc-hardening
Lines 54-82 Link Here
54
CONFIGURE_ARGS+=	--disable-gcc-hardening
68
CONFIGURE_ARGS+=	--disable-gcc-hardening
55
.endif
69
.endif
56
70
57
.if ${PORT_OPTIONS:MBUFFEREVENTS}
71
.if ${PORT_OPTIONS:MOBFSPROXY}
58
CONFIGURE_ARGS+=	--enable-bufferevents
72
BUILD_DEPENDS +=	${LOCALBASE}/bin/obfsproxy:security/obfsproxy
59
.else
60
CONFIGURE_ARGS+=	--disable-bufferevents
61
.endif
73
.endif
62
74
63
.if ${PORT_OPTIONS:MINSTR_DOWNLOADS}
64
CONFIGURE_ARGS+=	--enable-instrument-downloads
65
.else
66
CONFIGURE_ARGS+=	--disable-instrument-downloads
67
.endif
68
69
.if ${PORT_OPTIONS:MSTATIC_TOR}
75
.if ${PORT_OPTIONS:MSTATIC_TOR}
70
BUILD_DEPENDS +=	${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent2
76
BUILD_DEPENDS +=	${LOCALBASE}/lib/libevent.a:devel/libevent2
71
CONFIGURE_ARGS+=	--enable-static-tor \
77
CONFIGURE_ARGS+=	--enable-static-tor \
72
			--with-zlib-dir=/usr/lib --disable-linker-hardening
78
			--disable-linker-hardening \
73
TOR_LIBEVENT_LIBS=	${LOCALBASE}/lib/libevent.a
79
			--with-libevent-dir=${LOCALBASE}/lib \
80
			--with-zlib-dir=/usr/lib
74
.if ${PORT_OPTIONS:MBUFFEREVENTS}
81
.if ${PORT_OPTIONS:MBUFFEREVENTS}
75
TOR_LIBEVENT_LIBS:=	${LOCALBASE}/lib/libevent_openssl.a ${TOR_LIBEVENT_LIBS}
82
TOR_LIBEVENT_LIBS:=	${LOCALBASE}/lib/libevent_openssl.a ${TOR_LIBEVENT_LIBS}
76
.endif
83
.endif
77
.else
84
.else
78
CONFIGURE_ARGS+=	--enable-linker-hardening
85
CONFIGURE_ARGS+=	--enable-linker-hardening
79
LIB_DEPENDS+=		libevent.so:${PORTSDIR}/devel/libevent2
86
LIB_DEPENDS+=		libevent.so:devel/libevent2
80
TOR_LIBEVENT_LIBS=	-levent
87
TOR_LIBEVENT_LIBS=	-levent
81
.if ${PORT_OPTIONS:MBUFFEREVENTS}
88
.if ${PORT_OPTIONS:MBUFFEREVENTS}
82
TOR_LIBEVENT_LIBS:=	-levent_openssl ${TOR_LIBEVENT_LIBS}
89
TOR_LIBEVENT_LIBS:=	-levent_openssl ${TOR_LIBEVENT_LIBS}
Lines 85-120 Link Here
85
92
86
.if ${PORT_OPTIONS:MTCMALLOC}
93
.if ${PORT_OPTIONS:MTCMALLOC}
87
CONFIGURE_ARGS+=	--with-tcmalloc
94
CONFIGURE_ARGS+=	--with-tcmalloc
95
LDFLAGS+=		"-L${LOCALBASE}/lib"
88
.if ${PORT_OPTIONS:MSTATIC_TOR}
96
.if ${PORT_OPTIONS:MSTATIC_TOR}
89
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.so:${PORTSDIR}/devel/google-perftools
97
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.a:devel/google-perftools
90
.else
91
LIB_DEPENDS+=		libtcmalloc.so:${PORTSDIR}/devel/google-perftools
92
.endif
98
.endif
99
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.so:devel/google-perftools
100
LIB_DEPENDS+=		libtcmalloc.so:devel/google-perftools
93
.endif
101
.endif
94
102
95
.if ${PORT_OPTIONS:MTOR2WEB}
103
.if ! ${PORT_OPTIONS:MTOR2WEB}
96
CONFIGURE_ARGS+=	--enable-tor2web-mode
104
check regression-test test: build
105
	@cd ${BUILD_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
106
		${MAKE_ARGS} check
97
.endif
107
.endif
98
108
99
.if ${PORT_OPTIONS:MTRANSPARENT}
100
CONFIGURE_ARGS+=	--enable-transparent
101
.else
102
CONFIGURE_ARGS+=	--disable-transparent
103
.endif
104
105
post-patch:
106
	@${REINPLACE_CMD} -E -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
107
		-e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
108
		${WRKSRC}/configure
109
110
post-configure:
109
post-configure:
111
	@${REINPLACE_CMD} -e '\|^nodist_man1_MANS =|s|$$|$$(install_mans:=.1)|' \
110
	@${REINPLACE_CMD} -e '\|^nodist_man1_MANS =|s|$$|$$(install_mans:=.1)|' \
112
		${WRKSRC}/Makefile
111
		${WRKSRC}/Makefile
113
112
114
.if ! ${PORT_OPTIONS:MTOR2WEB}
115
check regression-test test: build
116
	@cd ${BUILD_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
117
	${MAKE_ARGS} check
118
119
.endif
120
.include <bsd.port.mk>
113
.include <bsd.port.mk>
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (tor-0.2.6.7.tar.gz) = 8c2be88a542ed1b22a8d3d595ec0acd0e28191de273dbcaefc64fdce92b89e6c
1
SHA256 (tor-0.2.7.4-rc.tar.gz) = 6741c3e6abfedb76be781b767b77f794ee1a0f554cc4ccf083e44d4d9dc8af67
2
SIZE (tor-0.2.6.7.tar.gz) = 3595669
2
SIZE (tor-0.2.7.4-rc.tar.gz) = 4830972
(-)files/patch-configure (-49 lines)
Lines 1-49 Link Here
1
--- configure.orig	2012-06-15 03:10:31.000000000 -0400
2
+++ configure	2012-06-17 08:46:34.000000000 -0400
3
@@ -6319,6 +6319,7 @@
4
 fi
5
 
6
 
7
+if false ; then
8
 trylibeventdir=""
9
 
10
 # Check whether --with-libevent-dir was given.
11
@@ -6645,6 +6646,7 @@
12
 LIBS="$tor_saved_LIBS"
13
 LDFLAGS="$tor_saved_LDFLAGS"
14
 CPPFLAGS="$tor_saved_CPPFLAGS"
15
+fi
16
 
17
 
18
 
19
@@ -6707,6 +6709,7 @@
20
 fi
21
 
22
 
23
+if false ; then
24
 if test "$enable_static_libevent" = "yes"; then
25
    if test "$tor_cv_library_libevent_dir" = "(system)"; then
26
      as_fn_error $? "\"You must specify an explicit --with-libevent-dir=x option when using --enable-static-libevent\"" "$LINENO" 5
27
@@ -6716,6 +6719,7 @@
28
 else
29
      TOR_LIBEVENT_LIBS="-levent"
30
 fi
31
+fi
32
 
33
 if test "$enable_bufferevents" = "yes" ; then
34
   if test "$ac_cv_header_event2_bufferevent_ssl_h" != "yes" ; then
35
@@ -6794,12 +6798,14 @@
36
 
37
 $as_echo "#define USE_BUFFEREVENTS 1" >>confdefs.h
38
 
39
+if false ; then
40
   if test "$enable_static_libevent" = "yes"; then
41
     TOR_LIBEVENT_LIBS="$TOR_LIBDIR_libevent/libevent_openssl.a $TOR_LIBEVENT_LIBS"
42
   else
43
     TOR_LIBEVENT_LIBS="-levent_openssl $TOR_LIBEVENT_LIBS"
44
   fi
45
 fi
46
+fi
47
 
48
 
49
 
(-)files/pkg-message.in (-12 / +5 lines)
Lines 3-21 Link Here
3
and edit %%PREFIX%%/etc/tor/torrc as desired. (However, note that the
3
and edit %%PREFIX%%/etc/tor/torrc as desired. (However, note that the
4
%%PREFIX%%/etc/rc.d/tor rc.subr script can override some torrc
4
%%PREFIX%%/etc/rc.d/tor rc.subr script can override some torrc
5
options: see that script for details.) To use the torify script, install
5
options: see that script for details.) To use the torify script, install
6
the net/torsocks port. After installing tor for the first time, or after
6
the net/torsocks port.
7
a major update of tor, you should:
8
7
9
rm -r /var/db/tor /var/run/tor
8
Before starting the tor server. Tor users are strongly advised to prevent traffic
10
mkdir -p /var/db/tor/data /var/run/tor
9
analysis that exploits sequential IP ID by setting:
11
touch /var/log/tor
12
chown -R _tor:_tor /var/db/tor /var/log/tor /var/run/tor
13
chmod -R 700 /var/db/tor
14
10
15
before starting the tor server. Tor users are strongly advised to prevent traffic
11
	# sysctl net.inet.ip.random_id=1
16
analysis that exploits sequential IP IDs by setting:
17
12
18
sysctl net.inet.ip.random_id=1
13
Please read sysctl.conf(5) for more information and details.
19
20
(see sysctl.conf(5)).
21
================================================================================
14
================================================================================
(-)files/tor.in (-9 / +30 lines)
Lines 13-22 Link Here
13
# tor_enable (bool):	Set it to "YES" to enable tor. Default: NO
13
# tor_enable (bool):	Set it to "YES" to enable tor. Default: NO
14
# tor_conf (str):	Points to your torrc file.
14
# tor_conf (str):	Points to your torrc file.
15
#			Default: %%PREFIX%%/etc/tor/torrc
15
#			Default: %%PREFIX%%/etc/tor/torrc
16
# tor_user (str):	Tor daemon user. Default: _tor
16
# tor_user (str):	Tor daemon user.	Default: _tor
17
# tor_datadir (str):	Tor datadir.  Default: /var/db/tor
17
# tor_group (str):	Tor daemon group.	Default: _tor
18
# tor_logfile (str):	Tor log file.  Default: /var/log/tor
18
# tor_datadir (str):	Tor data directory.	Default: /var/db/tor
19
# tor_loglevel (str):	Tor log severity level.  Default: notice
19
# tor_logdir (str):	Tor log directory.	Default: /var/log/tor
20
# tor_loglevel (str):	Tor log severity level.	Default: notice
20
#
21
#
21
22
22
. /etc/rc.subr
23
. /etc/rc.subr
Lines 29-50 Link Here
29
: ${tor_enable="NO"}
30
: ${tor_enable="NO"}
30
: ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
31
: ${tor_conf="%%PREFIX%%/etc/tor/torrc"}
31
: ${tor_user="_tor"}
32
: ${tor_user="_tor"}
32
: ${tor_pidfile="/var/run/tor/tor.pid"}
33
: ${tor_group="_tor"}
33
: ${tor_logfile="/var/log/tor"}
34
: ${tor_datadir="/var/db/tor"}
35
: ${tor_logdir="/var/log/tor"}
36
: ${tor_logfile="${tor_logdir}/tor.log"}
34
: ${tor_loglevel="notice"}
37
: ${tor_loglevel="notice"}
35
: ${tor_datadir="/var/db/tor"}
38
: ${tor_piddir="/var/run/tor"}
39
: ${tor_pidfile="${tor_piddir}/tor.pid"}
36
40
37
required_files=${tor_conf}
41
required_files=${tor_conf}
38
required_dirs=${tor_datadir}
42
# required_dirs="${tor_datadir} ${tor_logdir} ${tor_piddir}"
39
pidfile=${tor_pidfile}
43
pidfile=${tor_pidfile}
44
40
command="%%PREFIX%%/bin/${name}"
45
command="%%PREFIX%%/bin/${name}"
41
command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --+Log ${tor_loglevel}\ file\ ${tor_logfile}"
46
command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --Log ${tor_loglevel}\ file\ ${tor_logfile}"
42
extra_commands="log reload"
47
extra_commands="log reload"
43
log_cmd="${name}_log"
48
log_cmd="${name}_log"
49
start_precmd="${name}_prestart"
44
50
45
tor_log() {
51
tor_log() {
46
	cat ${tor_logfile}
52
	cat ${tor_logfile}
47
}
53
}
48
54
55
tor_prestart() {
56
	if [ ! -d "${tor_datadir}" ]; then
57
	  echo ${tor_datadir} not found. Creating it...
58
	  install -d -m 0700 -o ${tor_user} -g ${tor_group} ${tor_datadir}
59
	fi
60
	if [ ! -d "${tor_logdir}" ]; then
61
	  echo ${tor_logdir} not found. Creating it...
62
	  install -d -m 0700 -o ${tor_user} -g ${tor_group} ${tor_logdir}
63
	fi
64
	if [ ! -d "${tor_piddir}" ]; then
65
	  echo ${tor_piddir} not found. Creating it...
66
	  install -d -m 0700 -o ${tor_user} -g ${tor_group} ${tor_piddir}
67
	fi
68
}
69
49
run_rc_command "$1"
70
run_rc_command "$1"
50
71

Return to bug 203014