From 7a215374481480733bd56ee7f019e94cf2753851 Mon Sep 17 00:00:00 2001 From: jmmv Date: Wed, 3 Dec 2003 12:57:20 +0000 Subject: Initial import of tsocks, version 1.7: tsocks allows non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use SOCKS without any modification. It does this by intercepting the calls that applications make to establish network connections and negotating them through a SOCKS server as necessary. tsocks is based on the 'shared library interceptor' concept. Through use of the LD_PRELOAD environment variable, tsocks is automatically loaded into the process space of every executed program. --- net/tsocks/DESCR | 8 +++++++ net/tsocks/Makefile | 40 +++++++++++++++++++++++++++++++++ net/tsocks/PLIST | 10 +++++++++ net/tsocks/distinfo | 6 +++++ net/tsocks/files/tsocks.sh | 9 ++++++++ net/tsocks/patches/patch-aa | 54 +++++++++++++++++++++++++++++++++++++++++++++ net/tsocks/patches/patch-ab | 49 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 176 insertions(+) create mode 100644 net/tsocks/DESCR create mode 100644 net/tsocks/Makefile create mode 100644 net/tsocks/PLIST create mode 100644 net/tsocks/distinfo create mode 100644 net/tsocks/files/tsocks.sh create mode 100644 net/tsocks/patches/patch-aa create mode 100644 net/tsocks/patches/patch-ab (limited to 'net/tsocks') diff --git a/net/tsocks/DESCR b/net/tsocks/DESCR new file mode 100644 index 00000000000..cae7b63a3a4 --- /dev/null +++ b/net/tsocks/DESCR @@ -0,0 +1,8 @@ +tsocks allows non SOCKS aware applications (e.g telnet, ssh, ftp etc) to use +SOCKS without any modification. It does this by intercepting the calls that +applications make to establish network connections and negotating them through +a SOCKS server as necessary. + +tsocks is based on the 'shared library interceptor' concept. Through use of +the LD_PRELOAD environment variable, tsocks is automatically loaded into the +process space of every executed program. diff --git a/net/tsocks/Makefile b/net/tsocks/Makefile new file mode 100644 index 00000000000..117f378fed7 --- /dev/null +++ b/net/tsocks/Makefile @@ -0,0 +1,40 @@ +# $NetBSD: Makefile,v 1.1.1.1 2003/12/03 12:57:20 jmmv Exp $ +# + +DISTNAME= tsocks-1.7 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tsocks/} + +MAINTAINER= jmmv@NetBSD.org +HOMEPAGE= http://tsocks.sourceforge.net/ +COMMENT= Transparent SOCKS proxying library + +GNU_CONFIGURE= YES +USE_BUILDLINK2= YES +USE_GMAKE= YES + +CONFIGURE_ARGS+= --with-conf=${PKG_SYSCONFDIR}/tsocks.conf + +EGDIR= ${PREFIX}/share/examples/tsocks + +SUBST_CLASSES+= tsocks +SUBST_STAGE.tsocks= post-configure +SUBST_MESSAGE.tsocks= "Generating tsocks wrapper script." +SUBST_FILES.tsocks= tsocks +SUBST_SED.tsocks= -e "s|@SH@|${SH}|g" -e "s|@PREFIX@|${PREFIX}|g" + +post-extract: + ${RM} -f ${WRKSRC}/config.cache + ${CP} ${FILESDIR}/tsocks.sh ${WRKSRC}/tsocks + +post-configure: subst-tsocks + +post-install: + ${INSTALL_SCRIPT} ${WRKSRC}/tsocks ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${EGDIR} + ${INSTALL_DATA} ${WRKSRC}/tsocks.conf.complex.example \ + ${EGDIR}/tsocks.conf.complex + ${INSTALL_DATA} ${WRKSRC}/tsocks.conf.simple.example \ + ${EGDIR}/tsocks.conf.simple + +.include "../../mk/bsd.pkg.mk" diff --git a/net/tsocks/PLIST b/net/tsocks/PLIST new file mode 100644 index 00000000000..93486241a8f --- /dev/null +++ b/net/tsocks/PLIST @@ -0,0 +1,10 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2003/12/03 12:57:20 jmmv Exp $ +bin/tsocks +lib/libtsocks.so +lib/libtsocks.so.1 +lib/libtsocks.so.${PKGVERSION} +man/man5/tsocks.conf.5 +man/man8/tsocks.8 +share/examples/tsocks/tsocks.conf.complex +share/examples/tsocks/tsocks.conf.simple +@dirrm share/examples/tsocks diff --git a/net/tsocks/distinfo b/net/tsocks/distinfo new file mode 100644 index 00000000000..fbc77fe03ba --- /dev/null +++ b/net/tsocks/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1.1.1 2003/12/03 12:57:20 jmmv Exp $ + +SHA1 (tsocks-1.7.tar.gz) = b375215b63d93f4f317973f21cbcf4f9bd34720e +Size (tsocks-1.7.tar.gz) = 70992 bytes +SHA1 (patch-aa) = 3037e70481db197831f85fde0095629d5cfcc538 +SHA1 (patch-ab) = dbb8df3763f3176af0f58d7d63644183b33f51eb diff --git a/net/tsocks/files/tsocks.sh b/net/tsocks/files/tsocks.sh new file mode 100644 index 00000000000..448860e2191 --- /dev/null +++ b/net/tsocks/files/tsocks.sh @@ -0,0 +1,9 @@ +#!@SH@ + +if [ $# -eq 0 ]; then + echo "usage: `basename $0` command" 1>&2 + exit 1 +fi + +LD_PRELOAD="@PREFIX@/lib/libtsocks.so"; export LD_PRELOAD +exec $* diff --git a/net/tsocks/patches/patch-aa b/net/tsocks/patches/patch-aa new file mode 100644 index 00000000000..e8ae16d5a10 --- /dev/null +++ b/net/tsocks/patches/patch-aa @@ -0,0 +1,54 @@ +$NetBSD: patch-aa,v 1.1.1.1 2003/12/03 12:57:20 jmmv Exp $ + +--- Makefile.in.orig 2001-03-13 23:59:42.000000000 +0100 ++++ Makefile.in +@@ -38,19 +38,19 @@ TARGETS= ${SHLIB} ${UTIL_LIB} ${SAVE} ${ + all: ${TARGETS} + + ${COMMON}.o: ${COMMON}.c +- ${SHCC} ${CFFLAGS} ${INCLUDES} -c -o ${COMMON}.o ${COMMON}.c ++ ${SHCC} ${CFLAGS} ${INCLUDES} -c -o ${COMMON}.o ${COMMON}.c + + ${PARSER}.o: ${PARSER}.c +- ${SHCC} ${CFFLAGS} ${INCLUDES} -c -o ${PARSER}.o ${PARSER}.c ++ ${SHCC} ${CFLAGS} ${INCLUDES} -c -o ${PARSER}.o ${PARSER}.c + + ${VALIDATECONF}: ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o +- ${SHCC} ${CFFLAGS} ${LIBS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o ++ ${SHCC} ${CFLAGS} ${LIBS} ${INCLUDES} -o ${VALIDATECONF} ${VALIDATECONF}.c ${COMMON}.o ${PARSER}.o + + ${INSPECT}: ${INSPECT}.c ${COMMON}.o +- ${SHCC} ${CFFLAGS} ${LIBS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o ++ ${SHCC} ${CFLAGS} ${LIBS} ${INCLUDES} -o ${INSPECT} ${INSPECT}.c ${COMMON}.o + + ${SAVE}: ${SAVE}.c +- ${SHCC} ${CFFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c ++ ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c + + ${SHLIB}: ${SHOBJS} ${COMMON}.o ${PARSER}.o + ${SHCC} ${CFLAGS} ${SPECIALLIBS} ${LIBS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${SHOBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} +@@ -65,19 +65,19 @@ ${SHLIB}: ${SHOBJS} ${COMMON}.o ${PARSER + install: ${TARGETS} installlib installman + + installlib: +- ${INSTALL} ${STATICLIB} ${SHLIB} ${libdir} ++ ${BSD_INSTALL_DATA} ${STATICLIB} ${SHLIB} ${libdir} + ln -sf ${SHLIB} ${libdir}/${LIB_NAME}.so.${SHLIB_MAJOR} + ln -sf ${LIB_NAME}.so.${SHLIB_MAJOR} ${libdir}/${LIB_NAME}.so + + installman: + if [ ! -d "${mandir}/man8" ] ; then \ +- ${INSTALL} -o root -g root -d ${mandir}/man8; \ ++ ${BSD_INSTALL_MAN_DIR} ${mandir}/man8; \ + fi; +- ${INSTALL_DATA} -o root -g root tsocks.8 ${mandir}/man8/ ++ ${BSD_INSTALL_MAN} tsocks.8 ${mandir}/man8/ + if [ ! -d "${mandir}/man5" ] ; then \ +- ${INSTALL} -o root -g root -d ${mandir}/man5; \ ++ ${BSD_INSTALL_MAN_DIR} -d ${mandir}/man5; \ + fi; +- ${INSTALL_DATA} -o root -g root tsocks.conf.5 ${mandir}/man5/ ++ ${BSD_INSTALL_MAN} tsocks.conf.5 ${mandir}/man5/ + + clean: + -rm -f *.so *.so.* *.o *~ ${TARGETS} diff --git a/net/tsocks/patches/patch-ab b/net/tsocks/patches/patch-ab new file mode 100644 index 00000000000..2c9fa8eda0d --- /dev/null +++ b/net/tsocks/patches/patch-ab @@ -0,0 +1,49 @@ +$NetBSD: patch-ab,v 1.1.1.1 2003/12/03 12:57:20 jmmv Exp $ + +--- configure.orig 2001-03-12 13:47:41.000000000 +0100 ++++ configure +@@ -536,7 +536,6 @@ fi + + + +-test "$libdir" = "\${exec_prefix}/lib" && libdir="/lib" + + # Check whether --enable-socksdns or --disable-socksdns was given. + if test "${enable_socksdns+set}" = set; then +@@ -1272,7 +1271,7 @@ fi + done + + +-for ac_func in strcspn strdup strerror strspn strtol ++for ac_func in strcspn strdup strerror strspn strtol dlopen + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 + echo "configure:1279: checking for $ac_func" >&5 +@@ -1323,9 +1322,11 @@ if eval "test \"`echo '$ac_cv_func_'$ac_ + EOF + + else ++if [ ${ac_func} != "dlopen" ]; then + echo "$ac_t""no" 1>&6 + { echo "configure: error: "Required function not found"" 1>&2; exit 1; } + fi ++fi + done + + +@@ -1733,6 +1734,7 @@ fi + SIMPLELIBS=${LIBS} + LIBS= + ++if [ $ac_cv_func_dlopen != "yes" ]; then + echo $ac_n "checking for dlsym in -ldl""... $ac_c" 1>&6 + echo "configure:1738: checking for dlsym in -ldl" >&5 + ac_lib_var=`echo dl'_'dlsym | sed 'y%./+-%__p_%'` +@@ -1780,6 +1782,7 @@ else + echo "$ac_t""no" 1>&6 + { echo "configure: error: "libdl is required"" 1>&2; exit 1; } + fi ++fi + + + echo $ac_n "checking for RTLD_NEXT from dlfcn.h""... $ac_c" 1>&6 -- cgit v1.2.3