From bcf029e498d319ec35ce2d3479eab9056a61432c Mon Sep 17 00:00:00 2001 From: Koro Date: Wed, 22 Aug 2018 00:18:08 +0000 Subject: [PATCH] Add Tinyproxy package. --- packages/tinyproxy/build.sh | 10 ++++++++++ packages/tinyproxy/child.c.patch | 11 +++++++++++ packages/tinyproxy/configure.patch | 11 +++++++++++ packages/tinyproxy/heap.c.patch | 14 ++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 packages/tinyproxy/build.sh create mode 100644 packages/tinyproxy/child.c.patch create mode 100644 packages/tinyproxy/configure.patch create mode 100644 packages/tinyproxy/heap.c.patch diff --git a/packages/tinyproxy/build.sh b/packages/tinyproxy/build.sh new file mode 100644 index 000000000..f7ea1bc34 --- /dev/null +++ b/packages/tinyproxy/build.sh @@ -0,0 +1,10 @@ +TERMUX_PKG_HOMEPAGE=https://tinyproxy.github.io/ +TERMUX_PKG_DESCRIPTION="A light-weight HTTP proxy daemon for POSIX operating systems." +TERMUX_PKG_VERSION=1.8.4 +TERMUX_PKG_SHA256=a41f4ddf0243fc517469cf444c8400e1d2edc909794acda7839f1d644e8a5000 +TERMUX_PKG_SRCURL=https://github.com/tinyproxy/tinyproxy/releases/download/${TERMUX_PKG_VERSION}/tinyproxy-${TERMUX_PKG_VERSION}.tar.xz +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-regexcheck" + +termux_step_pre_configure() { + LDFLAGS+=" -llog" +} diff --git a/packages/tinyproxy/child.c.patch b/packages/tinyproxy/child.c.patch new file mode 100644 index 000000000..2f5e5ac7c --- /dev/null +++ b/packages/tinyproxy/child.c.patch @@ -0,0 +1,11 @@ +--- ../tinyproxy-1.8.4/src/child.c 2015-12-07 14:19:00.000000000 +0000 ++++ ./src/child.c 2018-08-21 21:56:40.448440799 +0000 +@@ -75,7 +75,7 @@ + + static void _child_lock_init (void) + { +- char lock_file[] = "/tmp/tinyproxy.servers.lock.XXXXXX"; ++ char lock_file[] = "@TERMUX_PREFIX@/tmp/tinyproxy.servers.lock.XXXXXX"; + + /* Only allow u+rw bits. This may be required for some versions + * of glibc so that mkstemp() doesn't make us vulnerable. diff --git a/packages/tinyproxy/configure.patch b/packages/tinyproxy/configure.patch new file mode 100644 index 000000000..73a0fa72b --- /dev/null +++ b/packages/tinyproxy/configure.patch @@ -0,0 +1,11 @@ +--- ../tinyproxy-1.8.4/configure 2016-01-01 16:42:38.000000000 +0000 ++++ ./configure 2018-08-21 21:39:57.888597020 +0000 +@@ -6987,7 +6987,7 @@ + + + +-DESIRED_FLAGS="-fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wlogical-op -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=c89 -ansi -pedantic -Wc++-compat -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common" ++DESIRED_FLAGS="-fdiagnostics-show-option -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Wfloat-equal -Wundef -Wformat=2 -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Waggregate-return -Winit-self -Wpacked --std=gnu89 -pedantic -Wc++-compat -Wno-long-long -Wno-overlength-strings -Wdeclaration-after-statement -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-qual -Wcast-align -Wwrite-strings -Wp,-D_FORTIFY_SOURCE=2 -fno-common" + + if test -n "${MAINTAINER_MODE_FALSE}"; then + DESIRED_FLAGS="-Werror $DESIRED_FLAGS" diff --git a/packages/tinyproxy/heap.c.patch b/packages/tinyproxy/heap.c.patch new file mode 100644 index 000000000..3988d6381 --- /dev/null +++ b/packages/tinyproxy/heap.c.patch @@ -0,0 +1,14 @@ +--- ../tinyproxy-1.8.4/src/heap.c 2015-12-07 14:19:00.000000000 +0000 ++++ ./src/heap.c 2018-08-21 21:58:46.821559832 +0000 +@@ -109,9 +109,9 @@ + { + int fd; + void *ptr; +- char buffer[32]; ++ char buffer[128]; + +- static const char *shared_file = "/tmp/tinyproxy.shared.XXXXXX"; ++ static const char *shared_file = "@TERMUX_PREFIX@/tmp/tinyproxy.shared.XXXXXX"; + + assert (size > 0); +