From 3c2bf3e7ddd2bf3483370a9177c51f0d25b73b45 Mon Sep 17 00:00:00 2001 From: Lucy Phipps Date: Tue, 21 Jul 2020 04:33:53 +0100 Subject: [PATCH] new package: Electric Fence --- packages/electric-fence/Makefile.patch | 33 ++++++++++++++++++++++++++ packages/electric-fence/build.sh | 7 ++++++ packages/electric-fence/ef.sh | 9 +++++++ 3 files changed, 49 insertions(+) create mode 100644 packages/electric-fence/Makefile.patch create mode 100644 packages/electric-fence/build.sh create mode 100644 packages/electric-fence/ef.sh diff --git a/packages/electric-fence/Makefile.patch b/packages/electric-fence/Makefile.patch new file mode 100644 index 000000000..4feb6e1eb --- /dev/null +++ b/packages/electric-fence/Makefile.patch @@ -0,0 +1,33 @@ +diff --git a/../electric-fence/Makefile b/./Makefile +index 4e0dd5b6c..c839255de 100644 +--- a/../electric-fence/Makefile ++++ b/./Makefile +@@ -6,10 +6,9 @@ endif + + LIBS= -lpthread + +-prefix=/usr + BIN_INSTALL_DIR= $(prefix)/bin + LIB_INSTALL_DIR= $(prefix)/lib +-MAN_INSTALL_DIR= $(prefix)/man/man3 ++MAN_INSTALL_DIR= $(prefix)/share/man/man3 + + + CC= cc +@@ -32,14 +31,14 @@ all: libefence.a libefence.so.0.0 tstheap eftest + @ echo + + install: libefence.a libefence.3 libefence.so.0.0 +- $(INSTALL) -m 755 ef.sh $(BIN_INSTALL_DIR)/ef ++ $(INSTALL) -m 755 $(TERMUX_PKG_BUILDER_DIR)/ef.sh $(BIN_INSTALL_DIR)/ef + $(INSTALL) -m 644 libefence.a $(LIB_INSTALL_DIR) + $(INSTALL) -m 755 libefence.so.0.0 $(LIB_INSTALL_DIR) + - rm -f $(LIB_INSTALL_DIR)/libefence.so.0 + ln -s libefence.so.0.0 $(LIB_INSTALL_DIR)/libefence.so.0 + - rm -f $(LIB_INSTALL_DIR)/libefence.so + ln -s libefence.so.0.0 $(LIB_INSTALL_DIR)/libefence.so +- $(INSTALL) -m 644 efence.3 $(MAN_INSTALL_DIR)/libefence.3 ++ $(INSTALL) -Dm 644 libefence.3 $(MAN_INSTALL_DIR)/libefence.3 + + clean: + - rm -f $(OBJECTS) tstheap.o eftest.o tstheap eftest \ diff --git a/packages/electric-fence/build.sh b/packages/electric-fence/build.sh new file mode 100644 index 000000000..411e9989b --- /dev/null +++ b/packages/electric-fence/build.sh @@ -0,0 +1,7 @@ +TERMUX_PKG_HOMEPAGE=https://elinux.org/Electric_Fence +TERMUX_PKG_DESCRIPTION="Electric Fence (eFence) malloc memory debugger" +TERMUX_PKG_LICENSE=GPL-2.0 +TERMUX_PKG_VERSION=2.2.5 +TERMUX_PKG_SRCURL=https://deb.debian.org/debian/pool/main/e/electric-fence/electric-fence_${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=8aa8d1e5772a169098f0aba6e647295c12561a6851ef9b378a54020e8086bcc6 +TERMUX_PKG_BUILD_IN_SRC=true diff --git a/packages/electric-fence/ef.sh b/packages/electric-fence/ef.sh new file mode 100644 index 000000000..50395791e --- /dev/null +++ b/packages/electric-fence/ef.sh @@ -0,0 +1,9 @@ +#!/data/data/com.termux/files/usr/bin/sh +#edited from https://aur.archlinux.org/cgit/aur.git/tree/ef.sh?h=electricfence +if [ "$1" = "" ]; then + echo "$0: Usage: ef [executable] [arguments]." + echo " Runs the executable under the Electric Fence malloc debugger." + exit +fi + +LD_PRELOAD="libefence.so.0.0${LD_PRELOAD:+:$LD_PRELOAD}" exec "$@"