move from unstable: srelay

This commit is contained in:
Leonid Pliushch 2021-10-08 18:56:55 +03:00
parent e1c0b46459
commit e6c36ba517
No known key found for this signature in database
GPG Key ID: 45F2964132545795
7 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,27 @@
Copyright (C) 2001-2010 Tomo.M (author).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

31
packages/srelay/build.sh Normal file
View File

@ -0,0 +1,31 @@
TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/socks-relay
TERMUX_PKG_DESCRIPTION="A Free SOCKS proxy server"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
TERMUX_PKG_VERSION=0.4.8p3
TERMUX_PKG_REVISION=5
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/sourceforge/socks-relay/srelay-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=efa38cb3e9e745a05ccb4b59fcf5d041184f15dbea8eb80c1b0ce809bb00c924
TERMUX_PKG_DEPENDS="libcrypt"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_CONFFILES="
etc/srelay.conf
etc/srelay.passwd
"
termux_step_pre_configure() {
export CPPFLAGS="${CPPFLAGS} -DLINUX"
}
termux_step_make_install() {
install -Dm755 srelay "${TERMUX_PREFIX}/bin/srelay"
install -Dm644 srelay.conf "${TERMUX_PREFIX}/etc/srelay.conf"
install -Dm644 srelay.passwd "${TERMUX_PREFIX}/etc/srelay.passwd"
install -Dm644 srelay.8 "${TERMUX_PREFIX}/share/man/man8/srelay.8"
}
termux_step_install_license() {
install -Dm600 -t "$TERMUX_PREFIX/share/doc/srelay" \
"$TERMUX_PKG_BUILDER_DIR"/LICENSE.txt
}

View File

@ -0,0 +1,12 @@
diff -uNr srelay-0.4.8p1/auth-pwd.c srelay-0.4.8p1.mod/auth-pwd.c
--- srelay-0.4.8p1/auth-pwd.c 2017-12-25 05:10:37.000000000 +0200
+++ srelay-0.4.8p1.mod/auth-pwd.c 2018-06-26 00:56:00.422622988 +0300
@@ -33,6 +33,8 @@
*/
#include "srelay.h"
+
+#undef LINUX
#if defined(FREEBSD) || defined(MACOSX)
#include <pwd.h>
#elif defined(LINUX) || defined(SOLARIS)

View File

@ -0,0 +1,45 @@
diff -uNr srelay-0.4.8p1/configure srelay-0.4.8p1.mod/configure
--- srelay-0.4.8p1/configure 2017-12-25 05:10:37.000000000 +0200
+++ srelay-0.4.8p1.mod/configure 2018-06-26 00:55:42.529288733 +0300
@@ -3998,41 +3998,6 @@
elif test "$OS" = "SOLARIS"; then
LDFLAGS="$LDFLAGS -lpthread"
fi
- if test "$cross_compiling" = yes; then :
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <pthread.h>
-void
-init_routine()
-{
- return;
-}
-main()
-{
- pthread_once_t once_control = PTHREAD_ONCE_INIT;
- pthread_once(&once_control, &init_routine);
- return(0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- $as_echo "#define USE_THREAD 1" >>confdefs.h
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
fi
fi

View File

@ -0,0 +1,11 @@
diff -uNr srelay-0.4.8p1/main.c srelay-0.4.8p1.mod/main.c
--- srelay-0.4.8p1/main.c 2017-12-25 05:10:37.000000000 +0200
+++ srelay-0.4.8p1.mod/main.c 2018-06-26 00:55:42.539288734 +0300
@@ -33,6 +33,7 @@
*/
#include <sys/stat.h>
+#include <asm/ioctls.h>
#include "srelay.h"
/* prototypes */

View File

@ -0,0 +1,12 @@
diff -uNr srelay-0.4.8p1/readconf.c srelay-0.4.8p1.mod/readconf.c
--- srelay-0.4.8p1/readconf.c 2017-12-25 05:10:37.000000000 +0200
+++ srelay-0.4.8p1.mod/readconf.c 2018-06-26 00:55:42.542622067 +0300
@@ -34,6 +34,8 @@
#include "srelay.h"
+#include <crypt.h>
+
/* prototypes */
int setport __P((u_int16_t *, char *));
void add_entry __P((ROUTE_INFO *, ROUTE_INFO *, int));

View File

@ -0,0 +1,21 @@
diff -uNr srelay-0.4.8p1/srelay.h srelay-0.4.8p1.mod/srelay.h
--- srelay-0.4.8p1/srelay.h 2017-12-25 05:10:37.000000000 +0200
+++ srelay-0.4.8p1.mod/srelay.h 2018-06-26 00:55:42.545955400 +0300
@@ -106,13 +106,13 @@
#define version "srelay 0.4.8p1 2017/12/25 (Tomo.M)"
#ifndef SYSCONFDIR
-# define SYSCONFDIR "/usr/local/etc"
+# define SYSCONFDIR "@TERMUX_PREFIX@/etc"
#endif
#define CONFIG SYSCONFDIR "/srelay.conf"
#define PWDFILE SYSCONFDIR "/srelay.passwd"
-#define PIDFILE "/var/run/srelay.pid"
-#define WORKDIR0 "/var/run"
-#define WORKDIR1 "/var/tmp"
+#define PIDFILE "@TERMUX_PREFIX@/var/run/srelay.pid"
+#define WORKDIR0 "@TERMUX_PREFIX@/var/run"
+#define WORKDIR1 "@TERMUX_PREFIX@/var/tmp"
#define S4DEFUSR "user"