Fix two problems when building on NetBSD-6.x. Mention upstream bug reports filed for them. Addresses PR 50521 by Uwe Toenjes. While here, add reload command to rc.d script and bump PKGREVISION.diff -r1.106 -r1.107 pkgsrc/net/tor/Makefile
(wiz)
@@ -1,28 +1,31 @@ | @@ -1,28 +1,31 @@ | |||
1 | # $NetBSD: Makefile,v 1.106 2015/12/08 13:19:38 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.107 2015/12/11 12:13:00 wiz Exp $ | |
2 | 2 | |||
3 | DISTNAME= tor-0.2.7.5 | 3 | DISTNAME= tor-0.2.7.5 | |
4 | PKGREVISION= 1 | |||
4 | CATEGORIES= net security | 5 | CATEGORIES= net security | |
5 | MASTER_SITES= http://www.torproject.org/dist/ | 6 | MASTER_SITES= http://www.torproject.org/dist/ | |
6 | 7 | |||
7 | MAINTAINER= athaba@users.sourceforge.net | 8 | MAINTAINER= athaba@users.sourceforge.net | |
8 | HOMEPAGE= http://www.torproject.org/ | 9 | HOMEPAGE= http://www.torproject.org/ | |
9 | COMMENT= Anonymizing overlay network for TCP | 10 | COMMENT= Anonymizing overlay network for TCP | |
10 | LICENSE= modified-bsd | 11 | LICENSE= modified-bsd | |
11 | 12 | |||
12 | .include "../../mk/bsd.prefs.mk" | 13 | .include "../../mk/bsd.prefs.mk" | |
13 | 14 | |||
14 | USE_LANGUAGES= c99 | 15 | USE_LANGUAGES= c99 | |
15 | USE_PKGLOCALEDIR= yes | 16 | USE_PKGLOCALEDIR= yes | |
17 | # https://trac.torproject.org/projects/tor/ticket/17818 | |||
18 | USE_TOOLS+= gmake | |||
16 | GNU_CONFIGURE= yes | 19 | GNU_CONFIGURE= yes | |
17 | 20 | |||
18 | CONFIGURE_ENV+= CPP=${CPP:Q} | 21 | CONFIGURE_ENV+= CPP=${CPP:Q} | |
19 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR} | 22 | CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFBASEDIR} | |
20 | 23 | |||
21 | TEST_TARGET= check | 24 | TEST_TARGET= check | |
22 | 25 | |||
23 | TOR_USER?= tor | 26 | TOR_USER?= tor | |
24 | TOR_GROUP?= tor | 27 | TOR_GROUP?= tor | |
25 | PKG_GECOS.${TOR_USER}= Torifier | 28 | PKG_GECOS.${TOR_USER}= Torifier | |
26 | PKG_HOME.${TOR_USER}= ${VARBASE}/chroot/tor | 29 | PKG_HOME.${TOR_USER}= ${VARBASE}/chroot/tor | |
27 | BUILD_DEFS+= VARBASE | 30 | BUILD_DEFS+= VARBASE | |
28 | PKG_SYSCONFSUBDIR= tor | 31 | PKG_SYSCONFSUBDIR= tor |
@@ -1,6 +1,7 @@ | @@ -1,6 +1,7 @@ | |||
1 | $NetBSD: distinfo,v 1.68 2015/12/08 13:19:38 wiz Exp $ | 1 | $NetBSD: distinfo,v 1.69 2015/12/11 12:13:00 wiz Exp $ | |
2 | 2 | |||
3 | SHA1 (tor-0.2.7.5.tar.gz) = ff099ddea9b33788d6f6ad8ed7f38479be197086 | 3 | SHA1 (tor-0.2.7.5.tar.gz) = ff099ddea9b33788d6f6ad8ed7f38479be197086 | |
4 | RMD160 (tor-0.2.7.5.tar.gz) = 964a3d0080684e159a85a2e257a4051667279e5d | 4 | RMD160 (tor-0.2.7.5.tar.gz) = 964a3d0080684e159a85a2e257a4051667279e5d | |
5 | SHA512 (tor-0.2.7.5.tar.gz) = c57b3ee6ecc36456182c7130db671c5581914cddf973c9460625cd5ecd10d128f3e4832f1520269f6ab145cc0dcb218df2a19fb659b778fb31d9f69de5362678 | 5 | SHA512 (tor-0.2.7.5.tar.gz) = c57b3ee6ecc36456182c7130db671c5581914cddf973c9460625cd5ecd10d128f3e4832f1520269f6ab145cc0dcb218df2a19fb659b778fb31d9f69de5362678 | |
6 | Size (tor-0.2.7.5.tar.gz) = 4838541 bytes | 6 | Size (tor-0.2.7.5.tar.gz) = 4838541 bytes | |
7 | SHA1 (patch-src_common_compat__pthreads.c) = 6c1be2f8e66e3796272eaad2d8a37ada6aa5e6ff |
@@ -1,44 +1,46 @@ | @@ -1,44 +1,46 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: tor.in,v 1.4 2015/12/08 13:19:38 wiz Exp $ | 3 | # $NetBSD: tor.in,v 1.5 2015/12/11 12:13:00 wiz Exp $ | |
4 | # | 4 | # | |
5 | # PROVIDE: tor | 5 | # PROVIDE: tor | |
6 | # REQUIRE: DAEMON NETWORKING | 6 | # REQUIRE: DAEMON NETWORKING | |
7 | # KEYWORD: shutdown | 7 | # KEYWORD: shutdown | |
8 | # | 8 | # | |
9 | # You will need to set some variables in /etc/rc.conf to start tor: | 9 | # You will need to set some variables in /etc/rc.conf to start tor: | |
10 | # | 10 | # | |
11 | # tor=YES | 11 | # tor=YES | |
12 | 12 | |||
13 | if [ -f /etc/rc.subr ] | 13 | if [ -f /etc/rc.subr ] | |
14 | then | 14 | then | |
15 | . /etc/rc.subr | 15 | . /etc/rc.subr | |
16 | fi | 16 | fi | |
17 | 17 | |||
18 | name="tor" | 18 | name="tor" | |
19 | rcvar=$name | 19 | rcvar=$name | |
20 | command="@PREFIX@/bin/tor" | 20 | command="@PREFIX@/bin/tor" | |
21 | required_files="@PKG_SYSCONFDIR@/torrc" | 21 | required_files="@PKG_SYSCONFDIR@/torrc" | |
22 | start_cmd="tor_start" | 22 | start_cmd="tor_start" | |
23 | stop_cmd="tor_stop" | 23 | stop_cmd="tor_stop" | |
24 | pidfile="@PKG_HOME@/${name}.pid" | 24 | pidfile="@PKG_HOME@/${name}.pid" | |
25 | restart_cmd="tor_stop ; tor_start" | 25 | restart_cmd="tor_stop ; tor_start" | |
26 | extra_commands="reload" | |||
26 | 27 | |||
27 | tor_start () | 28 | tor_start () | |
28 | { | 29 | { | |
29 | ${command} --User @TOR_USER@ --RunAsDaemon 1 \ | 30 | ${command} --User @TOR_USER@ --RunAsDaemon 1 \ | |
30 | --DataDirectory @PKG_HOME@ --PIDFile ${pidfile} | 31 | --DataDirectory @PKG_HOME@ --PIDFile ${pidfile} | |
31 | } | 32 | } | |
32 | 33 | |||
33 | tor_stop() | 34 | tor_stop() | |
34 | { | 35 | { | |
35 | kill `cat ${pidfile}` 2>/dev/null | 36 | kill `cat ${pidfile}` 2>/dev/null | |
36 | } | 37 | } | |
37 | 38 | |||
38 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ] | 39 | if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ] | |
39 | then | 40 | then | |
40 | load_rc_config $name | 41 | load_rc_config $name | |
41 | run_rc_command "$1" | 42 | run_rc_command "$1" | |
42 | else | 43 | else | |
43 | eval ${start_cmd} | 44 | eval ${start_cmd} | |
44 | fi | 45 | fi | |
46 |
$NetBSD: patch-src_common_compat__pthreads.c,v 1.1 2015/12/11 12:13:00 wiz Exp $
Disable a function that is not there on NetBSD before 7.
https://trac.torproject.org/projects/tor/ticket/17819
--- src/common/compat_pthreads.c.orig 2015-11-13 13:33:25.000000000 +0000
+++ src/common/compat_pthreads.c
@@ -186,12 +186,14 @@ tor_cond_init(tor_cond_t *cond)
}
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#if !defined(__NetBSD__) || (defined(__NetBSD__) && __NetBSD_Version__ > 699999999)
/* Use monotonic time so when we timedwait() on it, any clock adjustment
* won't affect the timeout value. */
if (pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC)) {
return -1;
}
#endif
+#endif
if (pthread_cond_init(&cond->cond, &condattr)) {
return -1;
}