pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

torsocks: Import torsocks-2.2.0 as wip/torsocks



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Mon Jan 29 15:25:17 2018 +0100
Changeset:	ee9caad0bb9e21a7a5d94dab1d465b469dcb2087

Modified Files:
	Makefile
Added Files:
	torsocks/DESCR
	torsocks/Makefile
	torsocks/PLIST
	torsocks/TODO
	torsocks/distinfo

Log Message:
torsocks: Import torsocks-2.2.0 as wip/torsocks

Torsocks allows you to use most applications in a safe way with
Tor. It ensures that DNS requests are handled safely and explicitly
rejects any traffic other then TCP from the application you're
using.

Torsocks is an ELF shared library that is loaded before all others.
The library overrides every needed Internet communication libc
function calls such as connect(2) or gethostbyname(3).

This process is transparent to the user and if torsocks detects
any communication that can't go through the Tor network such as
UDP traffic for instance, the connection is denied. If, in some
way, there is no way for torsocks to provide the Tor anonymity
guarantee with your application, torsocks will force the application
to quit and stop everything.

This package is based on wip/torsocks-git.
Several TODO notes probably also applies to torsocks-git.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ee9caad0bb9e21a7a5d94dab1d465b469dcb2087

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile          |  1 +
 torsocks/DESCR    | 15 ++++++++++++
 torsocks/Makefile | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 torsocks/PLIST    | 11 +++++++++
 torsocks/TODO     |  6 +++++
 torsocks/distinfo |  6 +++++
 6 files changed, 107 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 443141355b..df717ab494 100644
--- a/Makefile
+++ b/Makefile
@@ -4352,6 +4352,7 @@ SUBDIR+=	tor-dev
 SUBDIR+=	torcs
 SUBDIR+=	torque2d
 SUBDIR+=	torque3d
+SUBDIR+=	torsocks
 SUBDIR+=	torsocks-git
 SUBDIR+=	tortunnel
 SUBDIR+=	totem
diff --git a/torsocks/DESCR b/torsocks/DESCR
new file mode 100644
index 0000000000..4043c286d1
--- /dev/null
+++ b/torsocks/DESCR
@@ -0,0 +1,15 @@
+Torsocks allows you to use most applications in a safe way with
+Tor. It ensures that DNS requests are handled safely and explicitly
+rejects any traffic other then TCP from the application you're
+using.
+
+Torsocks is an ELF shared library that is loaded before all others.
+The library overrides every needed Internet communication libc
+function calls such as connect(2) or gethostbyname(3).
+
+This process is transparent to the user and if torsocks detects
+any communication that can't go through the Tor network such as
+UDP traffic for instance, the connection is denied. If, in some
+way, there is no way for torsocks to provide the Tor anonymity
+guarantee with your application, torsocks will force the application
+to quit and stop everything.
diff --git a/torsocks/Makefile b/torsocks/Makefile
new file mode 100644
index 0000000000..1aa64ac958
--- /dev/null
+++ b/torsocks/Makefile
@@ -0,0 +1,68 @@
+# $NetBSD: Makefile,v 1.4 2015/05/24 13:55:43 i3enedek Exp $
+
+DISTNAME=	torsocks_2.2.0.orig
+PKGNAME=	${DISTNAME:S/_/-/:S/.orig//}
+CATEGORIES=	net
+MASTER_SITES=	${MASTER_SITE_DEBIAN:=pool/main/t/torsocks/}
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://gitweb.torproject.org/torsocks.git
+COMMENT=	Library to torify applications
+LICENSE=	gnu-gpl-v2
+
+WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
+
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+
+CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=	--with-conf=${PKG_SYSCONFDIR}/torsocks.conf
+
+# XXX: Is this portable?
+CONFIGURE_ENV+=	LIBC_PATH=/lib/libc.so
+
+EGDIR=		${PREFIX}/share/examples/torsocks
+CONF_FILES=	${EGDIR}/torsocks.conf \
+		${PKG_SYSCONFDIR}/torsocks.conf
+
+SUBST_CLASSES+=			configure
+SUBST_STAGE.configure=		pre-configure
+SUBST_MESSAGE.configure=	Fixing non-standard test(1) == operator
+SUBST_FILES.configure=		configure
+SUBST_SED.configure=		-e '/test/ s/ == / = /g'
+
+SUBST_CLASSES+=			confdir
+SUBST_STAGE.confdir=		pre-configure
+SUBST_MESSAGE.confdir=		Adjusting confdir
+SUBST_FILES.confdir=		doc/Makefile.in
+SUBST_SED.confdir=		-e '/^confdir/ s;/tor;;'
+
+SUBST_CLASSES+=			conffile
+SUBST_STAGE.conffile=		pre-configure
+SUBST_MESSAGE.conffile=		Adjusting DEFAULT_CONF_FILE
+SUBST_FILES.conffile=		src/common/defaults.h
+SUBST_SED.conffile=		-e '/DEFAULT_CONF_FILE/ s;"/tor/";"/";'
+
+.include "../../mk/bsd.prefs.mk"
+
+# XXX: gethostbyaddr(3) in NetBSD < 7.0 prototype is:
+# XXX:     struct hostent *
+# XXX:     gethostbyaddr(const char *addr, socklen_t len, int type);
+# XXX: torsocks and The Open Group expects:
+# XXX:     struct hostent *
+# XXX:     gethostbyaddr(const void *addr, socklen_t len, int type);
+.if ${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-6].*)
+SUBST_CLASSES+=		lib
+SUBST_STAGE.lib=	pre-configure
+SUBST_MESSAGE.lib=	Fixing gethostbyaddr() prototype
+SUBST_FILES.lib=	src/lib/torsocks.h
+SUBST_SED.lib=		-e '/LIBC_GETHOSTBYADDR_SIG/ s/const void \*addr/const char *addr/'
+.endif
+
+post-install:
+	${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR}
+	${MV} ${DESTDIR}${PKG_SYSCONFDIR}/torsocks.conf \
+	    ${DESTDIR}${EGDIR}/torsocks.conf
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/torsocks/PLIST b/torsocks/PLIST
new file mode 100644
index 0000000000..539a2141e5
--- /dev/null
+++ b/torsocks/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD: PLIST,v 1.3 2014/08/15 20:59:39 leot1990 Exp $
+bin/torsocks
+lib/torsocks/libtorsocks.la
+man/man1/torsocks.1
+man/man5/torsocks.conf.5
+man/man8/torsocks.8
+share/doc/torsocks/ChangeLog
+share/doc/torsocks/DEBUG
+share/doc/torsocks/SOCKS5
+share/doc/torsocks/socks-extensions.txt
+share/examples/torsocks/torsocks.conf
diff --git a/torsocks/TODO b/torsocks/TODO
new file mode 100644
index 0000000000..ac58a616e0
--- /dev/null
+++ b/torsocks/TODO
@@ -0,0 +1,6 @@
+- Figure out getcap(1) usage in src/bin/torsocks.in, at least on NetBSD isn't
+  kosher to call `getcap /usr/bin/foo'
+- Is LIBC_PATH usage via CONFIGURE_ARGS correct, needed and portable?
+- Adjust any possible hardcoded path in man pages
+- Add support for tests
+- Test it via net/tor torify(1)
diff --git a/torsocks/distinfo b/torsocks/distinfo
new file mode 100644
index 0000000000..17b7ff32d1
--- /dev/null
+++ b/torsocks/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+SHA1 (torsocks_2.2.0.orig.tar.xz) = 53d8cb45b487571d39ab226e25cb538976a195a1
+RMD160 (torsocks_2.2.0.orig.tar.xz) = a16adc2120da9c846d4801ece60a43758a25f2e6
+SHA512 (torsocks_2.2.0.orig.tar.xz) = 89eb1263bfb0079ca5cb7fcc3a6fa1ecde1327df9ea98de48babfff1f8947b1e9db8407ead747fef0190671e7fff502025dcfcd9b6cba97abbaf25b5a575c62a
+Size (torsocks_2.2.0.orig.tar.xz) = 309916 bytes


Home | Main Index | Thread Index | Old Index