Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Mar 2015 19:56:11 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r382623 - in head/net/torsocks: . files
Message-ID:  <201503291956.t2TJuBEm002136@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Sun Mar 29 19:56:10 2015
New Revision: 382623
URL: https://svnweb.freebsd.org/changeset/ports/382623
QAT: https://qat.redports.org/buildarchive/r382623/

Log:
  net/torsocks: 1.2 -> 2.0.0
  
  - Changes:
    https://github.com/dgoulet/torsocks/blob/master/ChangeLog
  - Submitter takes maintainership
  - Repository moved from google to github (and further)
  
  PR:		195715
  Submitted by:	yuri@rawbw.com
  Approved by:	<andy.lavr@gmail.com> (maintainer timeout)

Added:
  head/net/torsocks/files/patch-compatibility-2.0.0   (contents, props changed)
Deleted:
  head/net/torsocks/files/patch-Makefile.am
  head/net/torsocks/files/patch-Makefile.in
  head/net/torsocks/files/patch-configure.in
  head/net/torsocks/files/patch-doc_Makefile.am
  head/net/torsocks/files/patch-src_Makefile.am
  head/net/torsocks/files/patch-src_Makefile.in
  head/net/torsocks/files/patch-src_torsocks.in
  head/net/torsocks/files/patch-src_usewithtor.in
  head/net/torsocks/files/patch-tests_Makefile.am
Modified:
  head/net/torsocks/Makefile
  head/net/torsocks/distinfo
  head/net/torsocks/files/pkg-message.in
  head/net/torsocks/pkg-descr
  head/net/torsocks/pkg-plist

Modified: head/net/torsocks/Makefile
==============================================================================
--- head/net/torsocks/Makefile	Sun Mar 29 19:45:39 2015	(r382622)
+++ head/net/torsocks/Makefile	Sun Mar 29 19:56:10 2015	(r382623)
@@ -2,111 +2,53 @@
 # $FreeBSD$
 
 PORTNAME=	torsocks
-PORTVERSION=	1.2
-PORTREVISION=	3
+PORTVERSION=	2.0.0
 CATEGORIES=	net security
-MASTER_SITES=	GOOGLE_CODE \
-		http://tor.reactor-xg.kiev.ua/files/
+MASTER_SITES=	GH
+DISTNAME=	${GH_ACCOUNT}-${PORTNAME}-${GH_TAGNAME}
 
-MAINTAINER=	andy.lavr@gmail.com
-COMMENT=	Most SOCKS-friendly applications way with Tor
+MAINTAINER=	yuri@rawbw.com
+COMMENT=	Easy way to make any app work through Tor
 
 LICENSE=	GPLv2
 
+USE_GITHUB=	yes
+GH_ACCOUNT=	dgoulet
+GH_PROJECT=	torsocks
+GH_TAGNAME=	96f7a0d
+
 USE_AUTOTOOLS=	aclocal autoconf libtoolize
 ACLOCAL_ARGS=	-I ${LOCALBASE}/share/aclocal
 
-USES=		gmake libtool
+USES=		autoreconf gmake libtool
 USE_LDCONFIG=	yes
 INSTALL_TARGET=	install-strip
 
 SUB_FILES=	pkg-message
 
-OPTIONS_DEFINE=	OLDMETHOD NODEBUG DOCS
-
-OPTIONS_SINGLE=		DNS
-OPTIONS_SINGLE_DNS=	DEFAULT SOCKSDNS HOSTNAMES
-
-SOCKSDNS_DESC=	Use socks server for DNS lookups
-OLDMETHOD_DESC=	Do not use RTLD_NEXT parameter to dlsym
-NODEBUG_DESC=	Disable output of error messages
-HOSTNAMES_DESC=	Enable DNS lookups of socks server
-DOCS_DESC=	Install examples and docs
-DEFAULT_DESC=	DNS lookups default
-
-OPTIONS_DEFAULT=	DOCS DEFAULT
-
-PORTDOCS=	INSTALL README TODO ChangeLog
+OPTIONS_DEFINE=	DOCS
+OPTIONS_DEFAULT=	DOCS
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MSOCKSDNS}
-CONFIGURE_ARGS+=	--enable-socksdns
-
-pre-everything::
-	@${ECHO_MSG}
-	@${ECHO_MSG} "You can use the SOCKSDNS option."
-	@${ECHO_MSG} "This option causes torsocks to intercept"
-	@${ECHO_MSG} "DNS lookups and attempt to force them"
-	@${ECHO_MSG} "to use TCP instead of UDP and thus"
-	@${ECHO_MSG} "be proxied through the socks server."
-	@${ECHO_MSG}
-.endif
-
-.if ${PORT_OPTIONS:MOLDMETHOD}
-CONFIGURE_ARGS+=	--enable-oldmethod
-
-pre-everything::
-	@${ECHO_MSG}
-	@${ECHO_MSG} "You can use the OLDMETHOD option."
-	@${ECHO_MSG} "This forces torsocks not to use the"
-	@${ECHO_MSG} "RTLD_NEXT parameter to dlsym to get the"
-	@${ECHO_MSG} "address of the connect() method torsocks"
-	@${ECHO_MSG} "overrides, instead it loads a reference"
-	@${ECHO_MSG} "to the libc shared library and then uses dlsym()."
-	@${ECHO_MSG}
-.endif
-
-.if ${PORT_OPTIONS:MNODEBUG}
-CONFIGURE_ARGS+=	--disable-debug
-
-pre-everything::
-	@${ECHO_MSG}
-	@${ECHO_MSG} "You can use the NODEBUG option."
-	@${ECHO_MSG} "This configuration option tells torsocks"
-	@${ECHO_MSG} "to never output error messages to stderr."
-	@${ECHO_MSG}
-.endif
-
-.if ${PORT_OPTIONS:MHOSTNAMES}
-CONFIGURE_ARGS+=	--enable-hostnames
-
-pre-everything::
-	@${ECHO_MSG}
-	@${ECHO_MSG} "You can use the HOSTNAMES option."
-	@${ECHO_MSG} "This enables DNS lookups on names"
-	@${ECHO_MSG} "provided as socks servers in the config"
-	@${ECHO_MSG} "file. This option is not allowed"
-	@${ECHO_MSG} "if socks dns is enabled since torsocks"
-	@${ECHO_MSG} "can't send a socks dns request to resolve"
-	@${ECHO_MSG} "the location of the socks server."
-	@${ECHO_MSG}
+.if ${PORT_OPTIONS:MDOCS}
+PORTDOCS=	ChangeLog DEBUG SOCKS5 socks-extensions.txt
 .endif
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|@prefix@|${PREFIX}|' ${WRKSRC}/src/torsocks.in
-	@${REINPLACE_CMD} -e 's|MAP_ANONYMOUS|MAP_ANON|' ${WRKSRC}/src/dead_pool.c
-	@${MV} ${WRKSRC}/doc/torsocks.conf ${WRKSRC}/doc/torsocks.conf.sample
-	@${MV} ${WRKSRC}/configure.in ${WRKSRC}/configure.ac
-	@${MKDIR} ${WRKSRC}/m4
+	${REINPLACE_CMD} -e 's,(defined(__linux__) || defined(__darwin__) || (defined(__FreeBSD_kernel__) && defined(__i386__))),defined(__FreeBSD__),' ${WRKSRC}/src/lib/syscall.c
+	${REINPLACE_CMD} -e 's,(defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(__x86_64),defined(badbadbad),' ${WRKSRC}/src/lib/syscall.c
+
+post-build:
+	@${ECHO}
+	@${ECHO} "Please run 'make check' (requires bash)."
+	@${ECHO} "One testcase is known to fail."
+	@${ECHO}
 
 post-install:
-.if ${PORT_OPTIONS:MDOCS}
-	${INSTALL_DATA} ${WRKSRC}/doc/*.sample ${STAGEDIR}${PREFIX}/etc
-	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-.for f in ${PORTDOCS}
-	${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR}
-.endfor
-.endif
+	${MV} ${STAGEDIR}${PREFIX}/etc/tor/torsocks.conf ${STAGEDIR}${PREFIX}/etc/tor/torsocks.conf.sample
+
+check: build
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} check
 
 .include <bsd.port.mk>

Modified: head/net/torsocks/distinfo
==============================================================================
--- head/net/torsocks/distinfo	Sun Mar 29 19:45:39 2015	(r382622)
+++ head/net/torsocks/distinfo	Sun Mar 29 19:56:10 2015	(r382623)
@@ -1,2 +1,2 @@
-SHA256 (torsocks-1.2.tar.gz) = bea57d3624d723724fd1e260f0e6b2a354c0da742c023aa994c7692270d111d4
-SIZE (torsocks-1.2.tar.gz) = 456453
+SHA256 (dgoulet-torsocks-96f7a0d_GH0.tar.gz) = 12d84d9a7c1a12555f39e5d9db3707307f39f3e1e7b9a8b3a8ecefaac8e8a599
+SIZE (dgoulet-torsocks-96f7a0d_GH0.tar.gz) = 96317

Added: head/net/torsocks/files/patch-compatibility-2.0.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/torsocks/files/patch-compatibility-2.0.0	Sun Mar 29 19:56:10 2015	(r382623)
@@ -0,0 +1,43 @@
+--- configure.ac
++++ configure.ac
+@@ -126,6 +126,10 @@ AS_CASE([$host_os],
+ 			libc_name="libc.so.6"
+ 		fi
+ 	],
++	[freebsd*],
++	[
++		libc_name=`ldd /usr/bin/yes | grep 'libc\.' | cut -d ' ' -f 3 | tr -d '\t'`
++	],
+ 	[libc_name="libc.so"]
+ )
+ AC_DEFINE_UNQUOTED([LIBC_NAME],["${libc_name}"], [Description])
+--- src/common/compat.h.orig	2014-08-11 09:44:46.000000000 -0700
++++ src/common/compat.h	2015-03-24 15:19:54.396135000 -0700
+@@ -95,6 +95,10 @@
+ #define TSOCKS_NR_CLOSE     SYS_close
+ #define TSOCKS_NR_MMAP      SYS_mmap
+ #define TSOCKS_NR_MUNMAP    SYS_munmap
++#if defined(__FreeBSD__)
++#define TSOCKS_NR_GETPID    SYS_getpid
++#define TSOCKS_NR_FORK      SYS_fork
++#endif
+ 
+ #endif /* __FreeBSD__, __FreeBSD_kernel__, __darwin__, __NetBSD__ */
+ 
+--- src/lib/syscall.c	2014-08-11 09:44:46.000000000 -0700
++++ src/lib/syscall.c	2015-03-24 15:24:10.695024000 -0700
+@@ -156,6 +156,14 @@
+ 	case TSOCKS_NR_MUNMAP:
+ 		ret = handle_munmap(args);
+ 		break;
++#if defined(__FreeBSD__)
++	case TSOCKS_NR_FORK:
++		ret = tsocks_libc_syscall(TSOCKS_NR_FORK);
++		break;
++	case TSOCKS_NR_GETPID:
++		ret = tsocks_libc_syscall(TSOCKS_NR_GETPID);
++		break;
++#endif
+ 	default:
+ 		/*
+ 		 * Deny call since we have no idea if this call can leak or not data

Modified: head/net/torsocks/files/pkg-message.in
==============================================================================
--- head/net/torsocks/files/pkg-message.in	Sun Mar 29 19:45:39 2015	(r382622)
+++ head/net/torsocks/files/pkg-message.in	Sun Mar 29 19:56:10 2015	(r382623)
@@ -1,10 +1,21 @@
-Simple setup file was copied to %%PREFIX%%/etc/torsocks.conf.sample
+======================================================================
+You installed torsocks, which is part of the Tor Project.
+If you have non-local or non-standard Tor SOCKS server location,
+please edit %%PREFIX%%/etc/tor/torsocks.conf
 
-Once you have installed torsocks, just launch it like so: 
-	usewithtor [application] 
+To run most programs through Tor launch them like this:
+	torsocks [any executable]
+For example you can use ssh to a some.host.com by doing:
+	torsocks ssh username@some.host.com -l <user>
+or launch pidgin by doing:
+	torsocks pidgin
 
-So, for example you can use ssh to a some.ssh.com by doing: 
-	usewithtor ssh username@some.ssh.com -l <user>
-
-or launch pidgin by doing: 
-	usewithtor pidgin
+==SECURITY WARNING==
+Please note that torsocks does not in general guarantee that all
+network connections made using torsocks will always go through
+Tor, and not directly through the unsecured network. There are many
+ways how general programs can purposefully or inadvertently defeat
+torsocks. One way is to reset the environment variable for the child
+process. You can use ex. wireshark to see where network packets are
+actually sent by the program in question.
+======================================================================

Modified: head/net/torsocks/pkg-descr
==============================================================================
--- head/net/torsocks/pkg-descr	Sun Mar 29 19:45:39 2015	(r382622)
+++ head/net/torsocks/pkg-descr	Sun Mar 29 19:56:10 2015	(r382623)
@@ -1,8 +1,10 @@
-It is new generation of TSOCKS.
+This is new generation of TSOCKS.
 
 Torsocks allows you to use most socks-friendly applications in
 a safe way with Tor. It ensures that DNS requests are handled
 safely and explicitly rejects UDP traffic from the application
 you're using.
 
-WWW: http://code.google.com/p/torsocks/
+See also https://gitweb.torproject.org/torsocks.git
+
+WWW: https://github.com/dgoulet/torsocks

Modified: head/net/torsocks/pkg-plist
==============================================================================
--- head/net/torsocks/pkg-plist	Sun Mar 29 19:45:39 2015	(r382622)
+++ head/net/torsocks/pkg-plist	Sun Mar 29 19:56:10 2015	(r382623)
@@ -1,26 +1,9 @@
 bin/torsocks
-bin/usewithtor
-etc/torsocks.conf.sample
-lib/libtorsocks.a
-lib/libtorsocks.so
-lib/libtorsocks.so.1
-lib/libtorsocks.so.1.0.0
+@sample etc/tor/torsocks.conf.sample
+lib/torsocks/libtorsocks.a
+lib/torsocks/libtorsocks.so
+lib/torsocks/libtorsocks.so.0
+lib/torsocks/libtorsocks.so.0.0.0
 man/man1/torsocks.1.gz
-man/man1/usewithtor.1.gz
 man/man5/torsocks.conf.5.gz
 man/man8/torsocks.8.gz
-%%DATADIR%%/DEBUG
-%%DATADIR%%/README
-%%DATADIR%%/README.TORDNS
-%%DATADIR%%/SOCKS4.protocol
-%%DATADIR%%/SOCKS5
-%%DATADIR%%/compilewarnings.patch
-%%DATADIR%%/conffile.patch
-%%DATADIR%%/getaddrbyhost.patch
-%%DATADIR%%/getpeername.patch
-%%DATADIR%%/infiniteloop.patch
-%%DATADIR%%/localaddresses.patch
-%%DATADIR%%/socks-extensions.txt
-%%DATADIR%%/tordns.patch
-%%DATADIR%%/test/expectedresults.txt
-%%DATADIR%%/test/run_tests.sh



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503291956.t2TJuBEm002136>