pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/tsocks



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed Nov 11 16:22:54 UTC 2020

Modified Files:
        pkgsrc/net/tsocks: Makefile
        pkgsrc/net/tsocks/files: tsocks.sh

Log Message:
tsocks: Add support for Darwin.

Uses different variable names and .dylib instead of .so, taken from the
MacPorts version of this script.  Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/net/tsocks/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/tsocks/files/tsocks.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/tsocks/Makefile
diff -u pkgsrc/net/tsocks/Makefile:1.21 pkgsrc/net/tsocks/Makefile:1.22
--- pkgsrc/net/tsocks/Makefile:1.21     Fri Mar 20 11:58:11 2020
+++ pkgsrc/net/tsocks/Makefile  Wed Nov 11 16:22:54 2020
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.21 2020/03/20 11:58:11 nia Exp $
-#
+# $NetBSD: Makefile,v 1.22 2020/11/11 16:22:54 jperkin Exp $
 
 DISTNAME=      tsocks-1.8beta5
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=tsocks/}
 
@@ -22,12 +21,20 @@ CONFIGURE_ARGS+=    --with-conf=${PKG_SYSCO
 
 EGDIR=                 ${PREFIX}/share/examples/tsocks
 
+.include "../../mk/bsd.prefs.mk"
+
 SUBST_CLASSES+=                tsocks
 SUBST_STAGE.tsocks=    post-configure
 SUBST_MESSAGE.tsocks=  Generating tsocks wrapper script.
 SUBST_FILES.tsocks=    tsocks
-SUBST_VARS.tsocks=     SH
-SUBST_VARS.tsocks+=    PREFIX
+SUBST_VARS.tsocks=     PREFIX SH
+.if ${OPSYS} == "Darwin"
+SUBST_SED.tsocks=      -e 's,@PRELOAD_VAR@,DYLD_INSERT_LIBRARIES,g'
+SUBST_SED.tsocks+=     -e 's,@SOEXT@,dylib,g'
+.else
+SUBST_SED.tsocks=      -e 's,@PRELOAD_VAR@,LD_PRELOAD,g'
+SUBST_SED.tsocks+=     -e 's,@SOEXT@,so,g'
+.endif
 
 INSTALLATION_DIRS+=    ${EGDIR}
 

Index: pkgsrc/net/tsocks/files/tsocks.sh
diff -u pkgsrc/net/tsocks/files/tsocks.sh:1.2 pkgsrc/net/tsocks/files/tsocks.sh:1.3
--- pkgsrc/net/tsocks/files/tsocks.sh:1.2       Thu Jul 26 12:27:18 2007
+++ pkgsrc/net/tsocks/files/tsocks.sh   Wed Nov 11 16:22:54 2020
@@ -1,6 +1,6 @@
-#! @SH@
+#!@SH@
 
-libtsocks="@PREFIX@/lib/libtsocks.so"
+libtsocks="@PREFIX@/lib/libtsocks.@SOEXT@"
 
 usage() {
        echo "usage:"
@@ -10,23 +10,26 @@ usage() {
 }
 
 tsocks_on() {
-       case $LD_PRELOAD in
+       case $@PRELOAD_VAR@ in
        *"$libtsocks"*)
                ;;
-       "")     LD_PRELOAD="$libtsocks"
+       "")     @PRELOAD_VAR@="$libtsocks"
                ;;
-       *)      LD_PRELOAD="$LD_PRELOAD $libtsocks"
+       *)      @PRELOAD_VAR@="$@PRELOAD_VAR@ $libtsocks"
                ;;
        esac
-       export LD_PRELOAD
+       export @PRELOAD_VAR@
+       if [ "@PRELOAD_VAR@" = "DYLD_INSERT_LIBRARIES" ]; then
+               export DYLD_FORCE_FLAT_NAMESPACE=1
+       fi
 }
 
 tsocks_off() {
-       LD_PRELOAD=`echo $LD_PRELOAD | sed 's,$libtsocks[ :]?,,'`
-       if [ "$LD_PRELOAD" ]; then
-               export LD_PRELOAD
+       @PRELOAD_VAR@=`echo $@PRELOAD_VAR@ | sed 's,$libtsocks[ :]?,,'`
+       if [ "$@PRELOAD_VAR@" ]; then
+               export @PRELOAD_VAR@
        else
-               unset LD_PRELOAD
+               unset @PRELOAD_VAR@
        fi
 }
 
@@ -43,7 +46,10 @@ off)
        ;;
 
 show | sh)
-       echo "LD_PRELOAD=\"$LD_PRELOAD\""
+       echo "@PRELOAD_VAR@=\"$@PRELOAD_VAR@\""
+       if [ "@PRELOAD_VAR@" = "DYLD_INSERT_LIBRARIES" ]; then
+               echo "DYLD_FORCE_FLAT_NAMESPACE=${DYLD_FORCE_FLAT_NAMESPACE}"
+       fi
        ;;
 -h | -?)
        usage



Home | Main Index | Thread Index | Old Index