add(main): new package wgetpaste

This commit is contained in:
ifurther 2022-09-08 18:43:51 +08:00 committed by Leonid Pliushch
parent 85a4bd8d5a
commit 075b5e705e
2 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://github.com/zlin/wgetpaste
TERMUX_PKG_DESCRIPTION="wgetpaste is a shell script that allows its users to upload log."
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.32
TERMUX_PKG_SRCURL=https://github.com/zlin/wgetpaste/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=7f0dec4812b0bb203380d395f91e9c042e27d2be0d1578e36a3d28ab8f24d626
TERMUX_PKG_DEPENDS="wget"
TERMUX_PKG_SUGGESTS="xclip"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_make_install() {
install -Dm 755 -t "$TERMUX_PREFIX/bin" wgetpaste
install -Dm644 _wgetpaste $TERMUX_PREFIX/share/zsh/site-functions/_wgetpaste
}

View File

@ -0,0 +1,61 @@
--- a/wgetpaste
+++ b/wgetpaste
@@ -334,7 +334,7 @@
noxclip() {
cat <<EOF >&2
Could not find xclip on your system. In order to use --x$1 you must either
-emerge x11-misc/xclip or define x_$1() globally in /etc/wgetpaste.conf or
+emerge x11-misc/xclip or define x_$1() globally in @TERMUX_PREFIX@/etc/wgetpaste.conf or
per user in ~/.wgetpaste.conf to use another program (such as e.g. xcut or
klipper) to $2 your clipboard.
@@ -532,11 +532,11 @@
--debug be *very* verbose (implies -v)
-h, --help show this help
- -g, --ignore-configs ignore /etc/wgetpaste.conf, ~/.wgetpaste.conf etc.
+ -g, --ignore-configs ignore @TERMUX_PREFIX@/etc/wgetpaste.conf, ~/.wgetpaste.conf etc.
--version show version information
Defaults (DEFAULT_{NICK,LANGUAGE,EXPIRATION}[_\${SERVICE}] and DEFAULT_SERVICE)
-can be overridden globally in /etc/wgetpaste.conf or /etc/wgetpaste.d/*.conf or
+can be overridden globally in @TERMUX_PREFIX@/etc/wgetpaste.conf or @TERMUX_PREFIX@/etc/wgetpaste.d/*.conf or
per user in any of ~/.wgetpaste.conf or ~/.wgetpaste.d/*.conf.
An additional http header can be passed by setting HEADER_\${SERVICE} in any of the
@@ -823,7 +823,7 @@
if [[ ! $IGNORECONFIGS ]]; then
# compatibility code
local f deprecated=
- for f in {/etc/,~/.}wgetpaste{.d/*.bash,}; do
+ for f in {@TERMUX_PREFIX@/etc/,~/.}wgetpaste{.d/*.bash,}; do
if [[ -f $f ]]; then
if [[ -z $deprecated ]]; then
echo "The config files for wgetpaste have changed to *.conf.$N" >&2
@@ -835,7 +835,7 @@
done
[[ -n $deprecated ]] && echo >&2
# new locations override old ones in case they collide
- for f in {/etc/,~/.}wgetpaste{.d/*,}.conf; do
+ for f in {@TERMUX_PREFIX@/etc/,~/.}wgetpaste{.d/*,}.conf; do
if [[ -f $f ]]; then
source "$f" || die "Failed to source $f"
fi
@@ -922,7 +922,7 @@
# create tmpfile for use with tee
if [[ $TEE ]]; then
- TMPF=$(mktemp /tmp/wgetpaste.XXXXXX)
+ TMPF=$(mktemp @TERMUX_PREFIX@/tmp/wgetpaste.XXXXXX)
[[ -f $TMPF ]] || die "Could not create a temporary file for use with tee."
fi
@@ -1026,7 +1026,7 @@
else
# create temp file (wget is much more reliable reading
# large input via --post-file rather than --post-data)
- [[ -f $TMPF ]] || TMPF=$(mktemp /tmp/wgetpaste.XXXXXX)
+ [[ -f $TMPF ]] || TMPF=$(mktemp @TERMUX_PREFIX@/tmp/wgetpaste.XXXXXX)
if [[ -f $TMPF ]]; then
postdata > "$TMPF" || die "Failed to write to temporary file: \"$TMPF\"."
WGETARGS="--post-file=$TMPF"