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

Collapse All | Expand All

(-)Makefile (-19 / +30 lines)
Lines 15-30 Link Here
15
USES=		cpe gmake
15
USES=		cpe gmake
16
CPE_VENDOR=	torproject
16
CPE_VENDOR=	torproject
17
GNU_CONFIGURE=	yes
17
GNU_CONFIGURE=	yes
18
CONFIGURE_ARGS=	--with-openssl-dir="${OPENSSLBASE}" --disable-asciidoc
18
CONFIGURE_ARGS=	--with-openssl-dir=${OPENSSLBASE} --disable-asciidoc
19
CONFIGURE_ENV=	TOR_CPPFLAGS_libevent="-I${LOCALBASE}/include" \
20
		TOR_LDFLAGS_libevent="-L${LOCALBASE}/lib/" \
21
		TOR_LIBEVENT_LIBS="${TOR_LIBEVENT_LIBS}"
22
19
23
OPTIONS_DEFINE=	BUFFEREVENTS INSTR_DOWNLOADS \
20
OPTIONS_DEFINE=	BUFFEREVENTS INSTR_DOWNLOADS  \
24
		STATIC_TOR TCMALLOC TOR2WEB TRANSPARENT
21
		STATIC_TOR TCMALLOC TOR2WEB TRANSPARENT
25
22
26
BUFFEREVENTS_DESC=	Use libevent's buffered IO
23
BUFFEREVENTS_DESC=	Use libevent's buffered IO
27
INSTR_DOWNLOADS_DESC=	Instrument downloads for analysis
24
INSTR_DOWNLOADS_DESC=	Instrument downloads for analysis
25
OBFSPROXY_DESC=		Pluggable transport proxy written in Python
28
STATIC_TOR_DESC=	Build a static tor
26
STATIC_TOR_DESC=	Build a static tor
29
TCMALLOC_DESC=		Use the tcmalloc memory allocation library
27
TCMALLOC_DESC=		Use the tcmalloc memory allocation library
30
TOR2WEB_DESC=		Faster but non-anonymous hidden services
28
TOR2WEB_DESC=		Faster but non-anonymous hidden services
Lines 32-37 Link Here
32
30
33
OPTIONS_DEFAULT=	THREADS TRANSPARENT
31
OPTIONS_DEFAULT=	THREADS TRANSPARENT
34
32
33
OPTIONS_GROUP=	TRANSPORT
34
OPTIONS_GROUP_TRANSPORT=	OBFSPROXY
35
35
USE_OPENSSL=	yes
36
USE_OPENSSL=	yes
36
37
37
USE_RC_SUBR=	tor
38
USE_RC_SUBR=	tor
Lines 44-49 Link Here
44
45
45
.include <bsd.port.options.mk>
46
.include <bsd.port.options.mk>
46
47
48
.if (${OSVERSION} < 1000015)
49
WITH_OPENSSL_PORT=	yes
50
.endif
51
47
.if !defined(USE_GCC) && empty(CC:T:M*gcc4*) && \
52
.if !defined(USE_GCC) && empty(CC:T:M*gcc4*) && \
48
empty(PORT_OPTIONS:MSTATIC_TOR) && empty(ARCH:Mia64)
53
empty(PORT_OPTIONS:MSTATIC_TOR) && empty(ARCH:Mia64)
49
CONFIGURE_ARGS+=	--enable-gcc-hardening
54
CONFIGURE_ARGS+=	--enable-gcc-hardening
Lines 63-73 Link Here
63
CONFIGURE_ARGS+=	--disable-instrument-downloads
68
CONFIGURE_ARGS+=	--disable-instrument-downloads
64
.endif
69
.endif
65
70
71
.if ${PORT_OPTIONS:MOBFSPROXY}
72
BUILD_DEPENDS +=	${LOCALBASE}/bin/obfsproxy:${PORTSDIR}/security/obfsproxy
73
.endif
74
66
.if ${PORT_OPTIONS:MSTATIC_TOR}
75
.if ${PORT_OPTIONS:MSTATIC_TOR}
67
BUILD_DEPENDS +=	${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent2
76
BUILD_DEPENDS +=	${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent2
68
CONFIGURE_ARGS+=	--enable-static-tor \
77
CONFIGURE_ARGS+=	--enable-static-tor \
69
			--with-zlib-dir=/usr/lib --disable-linker-hardening
78
			--disable-linker-hardening \
70
TOR_LIBEVENT_LIBS=	${LOCALBASE}/lib/libevent.a
79
			--with-libevent-dir=${LOCALBASE}/lib \
80
			--with-zlib-dir=/usr/lib
71
.if ${PORT_OPTIONS:MBUFFEREVENTS}
81
.if ${PORT_OPTIONS:MBUFFEREVENTS}
72
TOR_LIBEVENT_LIBS:=	${LOCALBASE}/lib/libevent_openssl.a ${TOR_LIBEVENT_LIBS}
82
TOR_LIBEVENT_LIBS:=	${LOCALBASE}/lib/libevent_openssl.a ${TOR_LIBEVENT_LIBS}
73
.endif
83
.endif
Lines 82-93 Link Here
82
92
83
.if ${PORT_OPTIONS:MTCMALLOC}
93
.if ${PORT_OPTIONS:MTCMALLOC}
84
CONFIGURE_ARGS+=	--with-tcmalloc
94
CONFIGURE_ARGS+=	--with-tcmalloc
95
LDFLAGS+=		"-L${LOCALBASE}/lib"
85
.if ${PORT_OPTIONS:MSTATIC_TOR}
96
.if ${PORT_OPTIONS:MSTATIC_TOR}
97
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.a:${PORTSDIR}/devel/google-perftools
98
.endif
86
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.so:${PORTSDIR}/devel/google-perftools
99
BUILD_DEPENDS +=	${LOCALBASE}/lib/libtcmalloc.so:${PORTSDIR}/devel/google-perftools
87
.else
88
LIB_DEPENDS+=		libtcmalloc.so:${PORTSDIR}/devel/google-perftools
100
LIB_DEPENDS+=		libtcmalloc.so:${PORTSDIR}/devel/google-perftools
89
.endif
101
.endif
90
.endif
91
102
92
.if ${PORT_OPTIONS:MTOR2WEB}
103
.if ${PORT_OPTIONS:MTOR2WEB}
93
CONFIGURE_ARGS+=	--enable-tor2web-mode
104
CONFIGURE_ARGS+=	--enable-tor2web-mode
Lines 99-117 Link Here
99
CONFIGURE_ARGS+=	--disable-transparent
110
CONFIGURE_ARGS+=	--disable-transparent
100
.endif
111
.endif
101
112
102
post-patch:
113
.if ! ${PORT_OPTIONS:MTOR2WEB}
103
	@${REINPLACE_CMD} -E -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
114
check regression-test test: build
104
		-e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
115
	@cd ${BUILD_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
105
		${WRKSRC}/configure
116
		${MAKE_ARGS} check
117
.endif
106
118
119
# post-patch:
120
#	@${REINPLACE_CMD} -E -e "s@-ltcmalloc@${LOCALBASE}/lib/libtcmalloc.so@" \
121
#		-e "s@(-z) (relro|now)@-Wl,\1,\2@g" \
122
#		${WRKSRC}/configure
123
107
post-configure:
124
post-configure:
108
	@${REINPLACE_CMD} -e '\|^nodist_man1_MANS =|s|$$|$$(install_mans:=.1)|' \
125
	@${REINPLACE_CMD} -e '\|^nodist_man1_MANS =|s|$$|$$(install_mans:=.1)|' \
109
		${WRKSRC}/Makefile
126
		${WRKSRC}/Makefile
110
127
111
.if ! ${PORT_OPTIONS:MTOR2WEB}
112
check regression-test test: build
113
	@cd ${BUILD_WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
114
	${MAKE_ARGS} check
115
116
.endif
117
.include <bsd.port.mk>
128
.include <bsd.port.mk>
(-)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 (-9 / +9 lines)
Lines 6-21 Link Here
6
the net/torsocks port. After installing tor for the first time, or after
6
the net/torsocks port. After installing tor for the first time, or after
7
a major update of tor, you should:
7
a major update of tor, you should:
8
8
9
rm -r /var/db/tor /var/run/tor
9
	# rm -r /var/db/tor /var/log/tor /var/run/tor
10
mkdir -p /var/db/tor/data /var/run/tor
10
	# touch /var/log/tor
11
touch /var/log/tor
11
	# mkdir -p /var/db/tor /var/run/tor
12
chown -R _tor:_tor /var/db/tor /var/log/tor /var/run/tor
12
	# chown -R _tor:_tor /var/db/tor /var/log/tor /var/run/tor
13
chmod -R 700 /var/db/tor
13
	# chmod -R 700 /var/db/tor /var/log/tor /var/run/tor
14
14
15
before starting the tor server. Tor users are strongly advised to prevent traffic
15
Before starting the tor server. Tor users are strongly advised to prevent traffic
16
analysis that exploits sequential IP IDs by setting:
16
analysis that exploits sequential IP ID by setting:
17
17
18
sysctl net.inet.ip.random_id=1
18
	# sysctl net.inet.ip.random_id=1
19
19
20
(see sysctl.conf(5)).
20
Please read sysctl.conf(5) for more information and details.
21
================================================================================
21
================================================================================
(-)files/tor.in (-1 / +1 lines)
Lines 38-44 Link Here
38
required_dirs=${tor_datadir}
38
required_dirs=${tor_datadir}
39
pidfile=${tor_pidfile}
39
pidfile=${tor_pidfile}
40
command="%%PREFIX%%/bin/${name}"
40
command="%%PREFIX%%/bin/${name}"
41
command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --+Log ${tor_loglevel}\ file\ ${tor_logfile}"
41
command_args="-f ${tor_conf} --PidFile ${tor_pidfile} --RunAsDaemon 1 --DataDirectory ${tor_datadir} --Log ${tor_loglevel}\ file\ ${tor_logfile}"
42
extra_commands="log reload"
42
extra_commands="log reload"
43
log_cmd="${name}_log"
43
log_cmd="${name}_log"
44
44

Return to bug 203014