torsocks: Import and fix torsocks recipe

Closes #80.
This commit is contained in:
Theodore Kokkoris
2015-01-13 22:42:51 +02:00
parent 6ecd5bb36b
commit 9e1d4b3513
2 changed files with 194 additions and 0 deletions

View File

@@ -0,0 +1,112 @@
diff -ur torsocks-1.2/configure.in torsocks-1.2-haiku/configure.in
--- torsocks-1.2/configure.in 2011-10-24 22:30:58.009175040 +0300
+++ torsocks-1.2-haiku/configure.in 2015-01-13 21:59:38.462684160 +0200
@@ -82,30 +82,19 @@
dnl list) but that isn't a problem
OLDLIBS="${LIBS}"
LIBS=
-CONNECTLIB=
-for LIB in c socket; do
- AC_CHECK_LIB("${LIB}",connect,[
- CONNECTLIB="${LIB}"
- break
- ],)
-done
-LIBS="${OLDLIBS} -l${CONNECTLIB}"
-if test "${CONNECTLIB}" = ""; then
- AC_MSG_ERROR('Could not find library containing connect()')
-fi
-
+AC_SEARCH_LIBS(connect,[c socket network],,[AC_MSG_ERROR('Could not find library containing connect()')])
dnl Check for socket
AC_CHECK_FUNC(socket,, [
- AC_CHECK_LIB(socket, socket,,AC_MSG_ERROR("socket function not found"))])
+ AC_SEARCH_LIBS(socket, [socket network],[],[AC_MSG_ERROR("socket function not found")])])
dnl Check for a function to convert an ascii ip address
-dnl to a sin_addr.
+dnl to a sin_addr.
AC_CHECK_FUNC(inet_aton, AC_DEFINE([HAVE_INET_ATON],[],[Description]), [
AC_CHECK_FUNC(inet_addr, AC_DEFINE([HAVE_INET_ADDR],[],[Description]), [
- AC_CHECK_LIB(nsl, inet_addr, [ AC_DEFINE([HAVE_INET_ADDR],[],[Description])
- LIBS="${LIBS} -lnsl" ], [
- AC_MSG_ERROR("Neither inet_aton or inet_addr present")])])])
+ AC_SEARCH_LIBS(inet_aton, [nsl network], [
+ AC_DEFINE([HAVE_INET_ADDR],[],[Description])
+ LIBS="${LIBS} ${ac_cv_search_inet_aton}"], [AC_MSG_ERROR("Neither inet_aton or inet_addr present")])])])
dnl Look for gethostbyname (needed by torsocks)
diff -ur torsocks-1.2/Makefile.am torsocks-1.2-haiku/Makefile.am
--- torsocks-1.2/Makefile.am 2011-03-05 18:38:11.007864320 +0200
+++ torsocks-1.2-haiku/Makefile.am 2015-01-13 21:59:38.463994880 +0200
@@ -2,4 +2,4 @@
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
-SUBDIRS = src doc test
+SUBDIRS = src doc
diff -ur torsocks-1.2/src/torsocks.in torsocks-1.2-haiku/src/torsocks.in
--- torsocks-1.2/src/torsocks.in 2011-10-24 00:12:13.014942208 +0300
+++ torsocks-1.2-haiku/src/torsocks.in 2015-01-13 22:01:14.478412800 +0200
@@ -28,34 +28,34 @@
#
# There are three forms of usage for this script:
#
-# @prefix@/bin/torsocks program [program arguments...]
+# @bindir@/torsocks program [program arguments...]
#
# This form sets the users @LDPRELOAD@ environment variable so that torsocks(8)
# will be loaded to socksify the application then executes the specified
# program (with the provided arguments). The following simple example might
# be used to telnet to www.foo.org via a torsocks.conf(5) configured socks server:
#
-# @prefix@/bin/torsocks telnet www.foo.org
+# @bindir@/torsocks telnet www.foo.org
#
# The second form allows for torsocks(8) to be switched on and off for a
# session (that is, it adds and removes torsocks from the @LDPRELOAD@ environment
# variable). This form must be _sourced_ into the user's existing session
# (and will only work with bourne shell users):
#
-# . @prefix@/bin/torsocks on
+# . @bindir@/torsocks on
# telnet www.foo.org
-# . @prefix@/bin/torsocks off
+# . @bindir@/torsocks off
#
# Or
#
-# source @prefix@/bin/torsocks on
+# source @bindir@/torsocks on
# telnet www.foo.org
-# source @prefix@/bin/torsocks off
+# source @bindir@/torsocks off
#
# The third form creates a new shell with @LDPRELOAD@ set and is achieved
# simply by running the script with no arguments
#
-# @prefix@/bin/torsocks
+# @bindir@/torsocks
#
# When finished the user can simply terminate the shell with 'exit'
#
@@ -73,7 +73,7 @@
exit
fi
-LIBDIR="@prefix@/lib/torsocks"
+LIBDIR="@libdir@/torsocks"
LIB_NAME="libtorsocks"
SHLIB_EXT="@SHLIB_EXT@"
SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}"
@@ -101,7 +101,7 @@
#replace '/' with '\/' in @prefix@
# escprefix=`echo '@prefix@' |sed 's/\\//\\\\\//g'`
# export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s/$escprefix\/lib\/torsocks\/libtorsocks.so \?//"`
- export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s#@prefix@/lib/torsocks/libtorsocks\.@SHLIB_EXT@ *##"`
+ export @LDPRELOAD@=`echo -n $@LDPRELOAD@ | sed "s#@libdir@/torsocks/libtorsocks\.@SHLIB_EXT@ *##"`
if [ -z "$@LDPRELOAD@" ]
then
unset @LDPRELOAD@

View File

@@ -0,0 +1,82 @@
SUMMARY="A transparent socks proxy for use with tor"
DESCRIPTION="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."
HOMEPAGE="https://www.torproject.org"
SRC_URI="http://torsocks.googlecode.com/files/torsocks-1.2.tar.gz"
CHECKSUM_SHA256="bea57d3624d723724fd1e260f0e6b2a354c0da742c023aa994c7692270d111d4"
REVISION="1"
ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
torsocks = $portVersion
cmd:torsocks$secondaryArchSuffix
cmd:usewithtor$secondaryArchSuffix
lib:libtorsocks$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:make
"
LICENSE="GNU GPL v2"
COPYRIGHT="
2000-2008 Shaun Clowes
2008-2011 Robert Hogan
2005 Total Information Security Ltd.
2010 Alex Rosenberg
2004, 2006 Peter Palfrader
2000 Alessandro Iurlano
2004 Tomasz Kojm
"
PATCHES="torsocks-1.2.patch"
GLOBAL_WRITABLE_FILES="
settings/torsocks.conf manual
"
BUILD()
{
libtoolize --force --copy --install
aclocal
autoconf
automake
runConfigure ./configure
make
}
INSTALL()
{
make install
# Documentation is put into $dataDir/torsocks
# as opposed to $dataDir
mkdir /temp
mv $dataDir/* /temp
mkdir $dataDir/torsocks
mv /temp/* $dataDir/torsocks
rm -r /temp
}