# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # torsocks # torsocks/files # torsocks/files/patch-Makefile.am # torsocks/files/patch-configure.in # torsocks/files/patch-usewithtor.in # torsocks/files/patch-tsocks.c # torsocks/files/pkg-message.in # torsocks/pkg-descr # torsocks/distinfo # torsocks/Makefile # torsocks/pkg-plist # echo c - torsocks mkdir -p torsocks > /dev/null 2>&1 echo c - torsocks/files mkdir -p torsocks/files > /dev/null 2>&1 echo x - torsocks/files/patch-Makefile.am sed 's/^X//' >torsocks/files/patch-Makefile.am << 'c15ae1c37c2bf8c505d80f0439adf068' X--- src/Makefile.am.orig 2009-02-07 11:48:12.000000000 +0100 X+++ src/Makefile.am 2009-02-18 17:29:26.000000000 +0100 X@@ -1,7 +1,7 @@ X # Makefile used by configure to create real Makefile X X-LIBS = -ldl -lc -lresolv X-libdir = @prefix@/lib/torsocks X+LIBS = -lc X+libdir = @prefix@/lib X X # Install helper programs X #bin_PROGRAMS = validateconf inspectsocks saveme X@@ -16,7 +16,7 @@ X X # Install configuration file X usewithtorconfdir = $(CONFDIR)/ X-usewithtorconf_DATA = torsocks.conf X+usewithtorconf_DATA = torsocks.conf.sample X X # Install invocation scripts X bin_SCRIPTS = torsocks usewithtor c15ae1c37c2bf8c505d80f0439adf068 echo x - torsocks/files/patch-configure.in sed 's/^X//' >torsocks/files/patch-configure.in << '9aa12cd95cef9318f1a22a6399c83927' X--- configure.in.orig 2009-02-12 15:59:50.000000000 +0200 X+++ configure.in 2009-02-12 17:27:16.000000000 +0200 X@@ -123,11 +123,9 @@ X dnl Checks for libraries. X dnl Replace `main' with a function in -ldl: X X-AC_CHECK_LIB(dl, dlsym, [ tempdso="yes" ],tempdso="no") X-if test "$tempdso" = "no"; then X- AC_CHECK_LIB(c, dlsym,,AC_MSG_ERROR("dlsym() not found in libc or libdl." \ X- "Check your system for libc.so and/or libdl.so.")) X-fi X+dnl Checks for libraries. X+AC_CHECK_LIB(c, dlsym,,AC_MSG_ERROR(""dlsym() not found in libc." \ X+ "Check your system for libc.so.")) X X AC_CHECK_LIB(resolv, res_query, [ tempres="no" ],tempres="yes") X if test "$tempres" = "no"; then X@@ -356,8 +354,8 @@ X dnl Find the correct res_querydomain prototype on this machine X AC_MSG_CHECKING(for correct res_querydomain prototype) X PROTO= X-PROTO1='const char *name, const char *domain, int class, int type, unsigned char *answer, int anslen' X-for testproto in "${PROTO1}" X+PROTO1='const char *name, const char *domain, int class, int type, u_char *answer, int anslen' X+for PROTO in "${PROTO1}" X do X if test "${PROTO}" = ""; then X AC_TRY_COMPILE([ X@@ -376,8 +374,8 @@ X AC_MSG_CHECKING(for correct res_send prototype) X PROTO= X PROTO1='const char *msg, int msglen, char *answer, int anslen' X-PROTO2='const unsigned char *msg, int msglen, unsigned char *answer, int anslen' X-for testproto in "${PROTO1}" \ X+PROTO2='const u_char *msg, int msglen, u_char *answer, int anslen' X+for PROTO in "${PROTO1}" \ X "${PROTO2}" X do X if test "${PROTO}" = ""; then X@@ -397,8 +395,8 @@ X dnl Find the correct res_search prototype on this machine X AC_MSG_CHECKING(for correct res_search prototype) X PROTO= X-PROTO1='const char *dname, int class, int type,unsigned char *answer, int anslen' X-for testproto in "${PROTO1}" X+PROTO1='const char *dname, int class, int type, u_char *answer, int anslen' X+for PROTO in "${PROTO1}" X do X if test "${PROTO}" = ""; then X AC_TRY_COMPILE([ X@@ -417,8 +415,8 @@ X dnl Find the correct res_query prototype on this machine X AC_MSG_CHECKING(for correct res_query prototype) X PROTO= X-PROTO1='const char *dname, int class, int type,unsigned char *answer, int anslen' X-for testproto in "${PROTO1}" X+PROTO1='const char *dname, int class, int type, u_char *answer, int anslen' X+for PROTO in "${PROTO1}" X do X if test "${PROTO}" = ""; then X AC_TRY_COMPILE([ X@@ -462,7 +460,7 @@ X dnl Find the correct poll prototype on this machine X AC_MSG_CHECKING(for correct poll prototype) X PROTO= X-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout' \ X+for testproto in 'struct pollfd *ufds, u_long nfds, int timeout' \ X 'struct pollfd *ufds, nfds_t nfds, int timeout' X do X if test "${PROTO}" = ""; then 9aa12cd95cef9318f1a22a6399c83927 echo x - torsocks/files/patch-usewithtor.in sed 's/^X//' >torsocks/files/patch-usewithtor.in << '7e2437d4065537893960f1204c37ff70' X--- src/usewithtor.in.orig 2009-02-12 15:59:50.000000000 +0200 X+++ src/usewithtor.in 2009-02-12 19:49:41.000000000 +0200 X@@ -1,3 +1,5 @@ X+#!/bin/sh X+# X # *************************************************************************** X # * * X # * $Id: usewithtor.in,v 1.3 2008-07-06 15:17:35 hoganrobert Exp $* X@@ -26,7 +28,6 @@ X # *************************************************************************** X X X-#! /bin/sh X X # Wrapper script for use of the torsocks(8) transparent socksification library X # See the torsocks(1) and usewithtor(1) manpages. 7e2437d4065537893960f1204c37ff70 echo x - torsocks/files/patch-tsocks.c sed 's/^X//' >torsocks/files/patch-tsocks.c << '562546270ba6253b7dce35431f73ffce' X--- src/tsocks.c.orig 2009-02-12 15:59:50.000000000 +0200 X+++ src/tsocks.c 2009-02-12 23:18:14.870533468 +0200 X@@ -164,7 +164,7 @@ X void tsocks_init(void) { X X #define LOAD_ERROR(s,l) { \ X- char *error; \ X+ const char *error; \ X error = dlerror(); \ X show_msg(l, "The symbol %s() was not found in any shared " \ X "library. The error reported was: %s!\n", s, \ 562546270ba6253b7dce35431f73ffce echo x - torsocks/files/pkg-message.in sed 's/^X//' >torsocks/files/pkg-message.in << '219c83bb9f5113a2909a62582df43774' XSimple setup file was copied to %%PREFIX%%/etc/torsocks.conf.sample XAn example of a more complex setup file can be found in X%%PREFIX%%/share/examples/torsocks/ X XOnce you have installed torsocks, just launch it like so: X usewithtor [application] X XSo, for example you can use ssh to a some.ssh.com by doing: X usewithtor ssh username@some.ssh.com -l X Xor launch pidgin by doing: X usewithtor pidgin 219c83bb9f5113a2909a62582df43774 echo x - torsocks/pkg-descr sed 's/^X//' >torsocks/pkg-descr << 'd6e9d608b3a2a616320c54433acf8060' XIt is new generation of TSOCKS. X XTorsocks allows you to use most socks-friendly applications in Xa safe way with Tor. It ensures that DNS requests are handled Xsafely and explicitly rejects UDP traffic from the application Xyou're using. X XWWW: http://code.google.com/p/torsocks/ d6e9d608b3a2a616320c54433acf8060 echo x - torsocks/distinfo sed 's/^X//' >torsocks/distinfo << 'd72135cf3f893b64aa04d62ad008a62e' XMD5 (torsocks-1.0-gamma.tar.gz) = a55f99cf78654a990d0646fc767567ca XSHA256 (torsocks-1.0-gamma.tar.gz) = d13dbd7d97745ecac6cf3ecc3800535faa3c08f5b9b33f214e210afd7658aae6 XSIZE (torsocks-1.0-gamma.tar.gz) = 482415 d72135cf3f893b64aa04d62ad008a62e echo x - torsocks/Makefile sed 's/^X//' >torsocks/Makefile << 'ef4798915525efa4f3898912a1d4b1f7' X# New ports collection makefile for: torsocks X# Date created: 13 February 2009 X# Whom: Andrei Lavreniyuk X# X# $FreeBSD$ X XPORTNAME= torsocks XPORTVERSION= 1.0 XCATEGORIES= net security XMASTER_SITES= GOOGLE_CODE \ X http://tor.reactor-xg.kiev.ua/files/ XDISTNAME= ${PORTNAME}-${PORTVERSION}-gamma X XMAINTAINER= andy.lavr@gmail.com XCOMMENT= Most SOCKS-friendly applications way with Tor X XUSE_AUTOTOOLS= libtool:15 aclocal:110 autoconf:262 XACLOCAL_ARGS= -I ${LOCALBASE}/share/aclocal X XUSE_GMAKE= yes XUSE_LDCONFIG= yes X XMAN1= torsocks.1 usewithtor.1 XMAN5= torsocks.conf.5 XMAN8= torsocks.8 X XSUB_FILES= pkg-message X XOPTIONS= TORDNS "Use tordns" on \ X SOCKSDNS "Use socks server for DNS lookups" off \ X OLDMETHOD "Do not use RTLD_NEXT parameter to dlsym" off \ X NODEBUG "Disable output of error messages" off \ X HOSTNAMES "Disable DNS lookups of socks server" off X X.include X X.if defined(WITHOUT_TORDNS) XCONFIGURE_ARGS+= --disable-tordns X.endif X X.if defined(WITH_SOCKSDNS) XCONFIGURE_ARGS+= --enable-socksdns X.endif X X.if defined(WITH_OLDMETHOD) XCONFIGURE_ARGS+= --enable-oldmethod X.endif X X.if defined(WITH_NODEBUG) XCONFIGURE_ARGS+= --disable-debug X.endif X X.if defined(WITH_HOSTNAMES) XCONFIGURE_ARGS+= --enable-hostnames X.endif X X.if defined(WITH_SOCKSDNS) && !defined(WITH_HOSTNAMES) XBROKEN= HOSTNAMES option is necessary if SOCKSDNS option is enabled X.endif X Xpre-everything:: X.if !defined(WITHOUT_TORDNS) X @${ECHO_MSG} X @${ECHO_MSG} "You can deselect the TORDNS option." X @${ECHO_MSG} "This option disables tordns, which causes" X @${ECHO_MSG} "names to be looked up in a way designed to" X @${ECHO_MSG} "work well with Tor." X @${ECHO_MSG} X.endif X X.if !defined(WITH_SOCKSDNS) X @${ECHO_MSG} X @${ECHO_MSG} "You can use the SOCKSDNS option." X @${ECHO_MSG} "This option causes torsocks to intercept" X @${ECHO_MSG} "DNS lookups and attempt to force them" X @${ECHO_MSG} "to use TCP instead of UDP and thus" X @${ECHO_MSG} "be proxied through the socks server." X @${ECHO_MSG} X.endif X X.if !defined(WITH_OLDMETHOD) X @${ECHO_MSG} X @${ECHO_MSG} "You can use the OLDMETHOD option." X @${ECHO_MSG} "This forces torsocks not to use the" X @${ECHO_MSG} "RTLD_NEXT parameter to dlsym to get the" X @${ECHO_MSG} "address of the connect() method torsocks" X @${ECHO_MSG} "overrides, instead it loads a reference" X @${ECHO_MSG} "to the libc shared library and then uses dlsym()." X @${ECHO_MSG} X.endif X X.if !defined(WITH_NODEBUG) X @${ECHO_MSG} X @${ECHO_MSG} "You can use the NODEBUG option." X @${ECHO_MSG} "This configuration option tells torsocks" X @${ECHO_MSG} "to never output error messages to stderr." X @${ECHO_MSG} X.endif X X.if !defined(WITH_HOSTNAMES) X @${ECHO_MSG} X @${ECHO_MSG} "You can use the HOSTNAMES option." X @${ECHO_MSG} "This disables DNS lookups on names" X @${ECHO_MSG} "provided as socks servers in the config" X @${ECHO_MSG} "file. This option is necessary" X @${ECHO_MSG} "if socks dns is enabled since torsocks" X @${ECHO_MSG} "can't send a socks dns request to resolve" X @${ECHO_MSG} "the location of the socks server." X @${ECHO_MSG} X.endif X Xpost-patch: X @${REINPLACE_CMD} -e 's|@prefix@|${PREFIX}|' ${WRKSRC}/src/torsocks.in X @${REINPLACE_CMD} -e 's|MAP_ANONYMOUS|MAP_ANON|' ${WRKSRC}/src/dead_pool.c X @${MV} ${WRKSRC}/src/torsocks.conf ${WRKSRC}/src/torsocks.conf.sample X Xpost-install: X.if !defined(NOPORTEXAMPLES) X @${MKDIR} ${EXAMPLESDIR} X ${INSTALL_DATA} ${WRKSRC}/src/*.example ${EXAMPLESDIR} X.endif X.if !defined(NOPORTDOCS) X @${MKDIR} ${DOCSDIR} X ${INSTALL_DATA} ${WRKSRC}/INSTALL ${DOCSDIR} X.endif X @${CAT} ${PKGMESSAGE} X X.include ef4798915525efa4f3898912a1d4b1f7 echo x - torsocks/pkg-plist sed 's/^X//' >torsocks/pkg-plist << 'ba89a773954534ba4a690a39d72647c3' Xbin/torsocks Xbin/usewithtor Xetc/torsocks.conf.sample Xlib/libtorsocks.a Xlib/libtorsocks.la Xlib/libtorsocks.so Xlib/libtorsocks.so.1 X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.complex.example X%%PORTEXAMPLES%%%%EXAMPLESDIR%%/tsocks.conf.simple.example X%%PORTDOCS%%%%DOCSDIR%%/INSTALL X%%PORTEXAMPLES%%@dirrm %%EXAMPLESDIR%% X%%PORTDOCS%%@dirrm %%DOCSDIR%% ba89a773954534ba4a690a39d72647c3 exit