mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-17 09:10:08 +02:00
148 lines
4.8 KiB
Plaintext
148 lines
4.8 KiB
Plaintext
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
|
|
|