Add pass package (closes #147)
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 21 Mar 2016 23:11:52 +0000 (00:11 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 21 Mar 2016 23:12:23 +0000 (00:12 +0100)
packages/pass/build.sh [new file with mode: 0644]
packages/pass/src-password-store.sh.patch [new file with mode: 0644]

diff --git a/packages/pass/build.sh b/packages/pass/build.sh
new file mode 100644 (file)
index 0000000..aab0f1d
--- /dev/null
@@ -0,0 +1,8 @@
+TERMUX_PKG_HOMEPAGE=https://www.passwordstore.org/
+TERMUX_PKG_DESCRIPTION="Lightweight directory-based password manager"
+TERMUX_PKG_VERSION=1.6.5
+TERMUX_PKG_SRCURL=https://git.zx2c4.com/password-store/snapshot/password-store-${TERMUX_PKG_VERSION}.tar.xz
+TERMUX_PKG_BUILD_IN_SRC=yes
+TERMUX_PKG_DEPENDS="bash, coreutils, gpg, pwgen, tree"
+TERMUX_PKG_PLATFORM_INDEPENDENT=yes
+TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=$TERMUX_PREFIX"
diff --git a/packages/pass/src-password-store.sh.patch b/packages/pass/src-password-store.sh.patch
new file mode 100644 (file)
index 0000000..43920ab
--- /dev/null
@@ -0,0 +1,57 @@
+--- ../password-store-master/src/password-store.sh 2016-02-07 12:05:52.000000000 +0100
++++ ./src/password-store.sh    2016-03-07 21:29:27.667761280 +0100
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env bash
++#!/data/data/com.termux/files/usr/bin/env bash
+ # Copyright (C) 2012 - 2014 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
+ # This file is licensed under the GPLv2+. Please see COPYING for more information.
+@@ -12,7 +12,9 @@
+ which gpg2 &>/dev/null && GPG="gpg2"
+ [[ -n $GPG_AGENT_INFO || $GPG == "gpg2" ]] && GPG_OPTS+=( "--batch" "--use-agent" )
++TERMUXPREFIX=$PREFIX
+ PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
++
+ X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}"
+ CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}"
+ GENERATED_LENGTH="${PASSWORD_STORE_GENERATED_LENGTH:-25}"
+@@ -133,13 +135,13 @@
+       # variable. Specifically, it cannot store nulls nor (non-trivally) store
+       # trailing new lines.
+       local sleep_argv0="password store sleep on display $DISPLAY"
+-      pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
+-      local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)"
+-      echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard"
++      pgrep -f "^$sleep_argv0" | xargs kill 2>/dev/null && sleep 0.5
++      local before="$(termux-clipboard-get 2>/dev/null | base64)"
++      echo -n "$1" | termux-clipboard-set || die "Error: Could not copy data to the clipboard"
+       (
+-              ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
+-              local now="$(xclip -o -selection "$X_SELECTION" | base64)"
+-              [[ $now != $(echo -n "$1" | base64) ]] && before="$now"
++              ( exec -a "$sleep_argv0" coreutils --coreutils-prog=sleep "$CLIP_TIME" )
++              local now="$(termux-clipboard-get  | base64 )"
++              [[ $now != $(echo "$1" | base64) ]] && before="$now"
+               # It might be nice to programatically check to see if klipper exists,
+               # as well as checking for other common clipboard managers. But for now,
+@@ -150,7 +152,7 @@
+               # so we axe it here:
+               qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null
+-              echo "$before" | base64 -d | xclip -selection "$X_SELECTION"
++              echo "$before" | base64 -d| termux-clipboard-set
+       ) 2>/dev/null & disown
+       echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
+ }
+@@ -174,7 +176,8 @@
+               Are you sure you would like to continue?
+               _EOF
+               )"
+-              SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-/tmp}/$template")"
++                echo "mktemp -d ${TMPDIR:-$TERMUXPREFIX/tmp}/$template"
++              SECURE_TMPDIR="$(mktemp -d "${TMPDIR:-$TERMUXPREFIX/tmp}/$template")"
+               shred_tmpfile() {
+                       find "$SECURE_TMPDIR" -type f -exec $SHRED {} +
+                       rm -rf "$SECURE_TMPDIR"
\ No newline at end of file