1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-05 01:55:52 +00:00

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)
This commit is contained in:
Kurt Jaeger 2015-03-29 19:56:10 +00:00
parent 52131930a1
commit 98b7d72b51
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=382623
15 changed files with 100 additions and 238 deletions

View File

@ -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>

View File

@ -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

View File

@ -1,9 +0,0 @@
--- Makefile.am.orig 2011-03-05 18:38:11.000000000 +0200
+++ Makefile.am 2013-03-20 10:13:28.517831100 +0200
@@ -2,4 +2,6 @@
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
+ACLOCAL_AMFLAGS= -I m4
+
SUBDIRS = src doc test

View File

@ -1,9 +0,0 @@
--- Makefile.in.orig 2011-10-24 20:23:39.000000000 +0000
+++ Makefile.in 2013-07-23 21:02:35.000000000 +0000
@@ -238,4 +238,4 @@
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --add-missing'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --add-missing \
&& exit 0; \

View File

@ -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

View File

@ -1,20 +0,0 @@
--- configure.in.orig 2011-10-24 22:30:58.000000000 +0300
+++ configure.in 2013-03-20 10:10:59.362840661 +0200
@@ -3,13 +3,14 @@
##############################################################################
# Process this file with autoconf to produce a configure script.
-AC_INIT()
+AC_INIT([torsocks], [1.2])
+AC_CONFIG_MACRO_DIR([m4])
# Create a config.g file to store defines generated by configure
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADER([config.h])
# Automake initialization
-AM_INIT_AUTOMAKE(torsocks, 1.2)
+AM_INIT_AUTOMAKE()
# Get hostname and other information.
AC_CANONICAL_HOST

View File

@ -1,13 +0,0 @@
--- doc/Makefile.am.orig 2011-10-26 21:30:26.000000000 +0300
+++ doc/Makefile.am 2011-11-13 09:08:17.999745756 +0200
@@ -2,7 +2,9 @@
# Install configuration file
confdir = $(CONFDIR)/
-dist_conf_DATA = torsocks.conf
+dist_conf_DATA = torsocks.conf.sample
+datarootdir = ${prefix}/share/torsocks
+
# Install man pages
dist_man_MANS = torsocks.1 torsocks.8 usewithtor.1 torsocks.conf.5

View File

@ -1,10 +0,0 @@
--- src/Makefile.am.orig 2011-10-24 22:26:34.000000000 +0300
+++ src/Makefile.am 2011-11-09 12:36:55.697224889 +0200
@@ -1,6 +1,6 @@
# Makefile used by configure to create real Makefile
-libdir = @libdir@/torsocks
+libdir = @prefix@/lib
# Install invocation scripts
bin_SCRIPTS = torsocks usewithtor

View File

@ -1,11 +0,0 @@
--- src/Makefile.in.orig 2011-10-24 23:23:39.000000000 +0300
+++ src/Makefile.in 2011-11-09 12:41:22.805940562 +0200
@@ -196,7 +196,7 @@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
-libdir = @libdir@/torsocks
+libdir = @prefix@/lib
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@

View File

@ -1,11 +0,0 @@
--- src/torsocks.in.orig 2010-12-11 18:28:08.000000000 +0200
+++ src/torsocks.in 2011-01-12 17:01:34.460490482 +0200
@@ -68,7 +68,7 @@
exit
fi
-LIBDIR="@prefix@/lib/torsocks"
+LIBDIR="@prefix@/lib"
LIB_NAME="libtorsocks"
SHLIB_EXT="@SHLIB_EXT@"
SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}"

View File

@ -1,28 +0,0 @@
--- src/usewithtor.in.orig 2009-11-08 14:35:11.000000000 +0200
+++ src/usewithtor.in 2009-11-13 17:10:26.726475549 +0200
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# ***************************************************************************
# * *
# * $Id: usewithtor.in,v 1.3 2008-07-06 15:17:35 hoganrobert Exp $*
@@ -26,8 +26,8 @@
# * Original copyright notice from tsocks source file follows: *
# ***************************************************************************
-# Wrapper script for use of the tsocks(8) transparent socksification library
-# See the tsocks(1) and torify(1) manpages.
+# Wrapper script for use of the torsocks(8) transparent socksification library
+# See the torsocks(1) and torify(1) manpages.
# Copyright (c) 2004, 2006 Peter Palfrader
# Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006
@@ -35,7 +35,7 @@
# May be distributed under the same terms as Tor itself
-# Define and ensure we have tsocks
+# Define and ensure we have torsocks
# XXX: what if we don't have which?
TORSOCKS="`which torsocks`"
PROG=

View File

@ -1,8 +0,0 @@
--- test/Makefile.am.orig 2011-11-13 09:40:52.593544321 +0200
+++ test/Makefile.am 2011-11-13 09:41:18.074140449 +0200
@@ -5,3 +5,5 @@
CLEANFILES= test_torsocks
dist_data_DATA = run_tests.sh expectedresults.txt
+
+datarootdir = ${prefix}/share/torsocks/test

View File

@ -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.
======================================================================

View File

@ -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

View File

@ -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