torsocks bump version, fix lib dependency (#758)

This commit is contained in:
Schrijvers Luc
2016-08-10 19:45:06 +02:00
committed by waddlesplash
parent 0f483ca87b
commit 8092beeeec
2 changed files with 217 additions and 0 deletions

View File

@@ -0,0 +1,147 @@
From b2d9d9150de1c1dcf04d69dc603ae73c333a2b39 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 7 Aug 2016 18:28:11 +0200
Subject: patch the source to include networking support, and put the lib in
the right place
diff --git a/Makefile.am b/Makefile.am
index 0ef8147..d030409 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 --git a/configure.in b/configure.in
index f0bbcdb..da2aa01 100644
--- a/configure.in
+++ b/configure.in
@@ -82,31 +82,20 @@ dnl more than once (since we do our search with an empty libs
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.
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)
AC_CHECK_FUNC(gethostbyname, AC_DEFINE([HAVE_GETHOSTBYNAME],[],[Description]), [
diff --git a/src/torsocks.in b/src/torsocks.in
index 4eaed8f..f07832e 100755
--- a/src/torsocks.in
+++ b/src/torsocks.in
@@ -29,34 +29,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'
#
@@ -79,7 +79,7 @@ if [ $# = 0 ] ; then
exit
fi
-LIBDIR="@prefix@/lib/torsocks"
+LIBDIR="@libdir@"
LIB_NAME="libtorsocks"
SHLIB_EXT="@SHLIB_EXT@"
SHLIB="${LIBDIR}/${LIB_NAME}.${SHLIB_EXT}"
@@ -113,7 +113,7 @@ case "$1" in
#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@/libtorsocks\.@SHLIB_EXT@ *##"`
if [ -z "$@LDPRELOAD@" ]
then
unset @LDPRELOAD@
--
2.7.0
From 182622b8795a153797c72fde2e7069f6995e3acf Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sun, 7 Aug 2016 21:45:26 +0200
Subject: move the libs to the proper place
diff --git a/src/Makefile.am b/src/Makefile.am
index e3a01c9..3d7bcc4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
# Makefile used by configure to create real Makefile
-libdir = @libdir@/torsocks
+libdir = @libdir@
# Install invocation scripts
bin_SCRIPTS = torsocks usewithtor
--
2.7.0

View File

@@ -0,0 +1,70 @@
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"
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"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/dgoulet/torsocks/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="09debf9e35d70802fdb0e56335bacab65e84fad615f68d7006539713c1698123"
PATCHES="torsocks-$portVersion.patchset"
GLOBAL_WRITABLE_FILES="settings/torsocks.conf manual"
ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
torsocks$secondaryArchSuffix = $portVersion
cmd:torsocks$secondaryArchSuffix
cmd:usewithtor$secondaryArchSuffix
lib:libtorsocks$secondaryArchSuffix = 1.0.0 compat >= 0
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
torsocks${secondaryArchSuffix}_devel = $portVersion compat >= 1.0
devel:libtorsocks$secondaryArchSuffix = 1.0.0 compat >= 0
"
REQUIRES_devel="
torsocks$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:autoreconf
cmd:make
"
BUILD()
{
autoreconf -vfi
runConfigure ./configure --datadir=$dataDir/torsocks/
make
}
INSTALL()
{
make install
rm $libDir/*.la
prepareInstalledDevelLib libtorsocks
packageEntries devel \
$developDir
#link the .so lib so torsocks can find it in $libDir
ln -s -r $libDir/libtorsocks.so.1.0.0 $libDir/libtorsocks.so
}