From cf9dc85fc93251b0aaf0ed612b600a13d4022c43 Mon Sep 17 00:00:00 2001 From: Michael Gmelin Date: Sat, 8 Feb 2020 15:03:50 +0000 Subject: [PATCH] [NEW PORT] security/spm: spm - Simple password manager --- security/Makefile | 1 + security/spm/Makefile | 30 ++++++++++++++++++++++++++++++ security/spm/distinfo | 3 +++ security/spm/files/patch-spm | 33 +++++++++++++++++++++++++++++++++ security/spm/pkg-descr | 8 ++++++++ 5 files changed, 75 insertions(+) create mode 100644 security/spm/Makefile create mode 100644 security/spm/distinfo create mode 100644 security/spm/files/patch-spm create mode 100644 security/spm/pkg-descr diff --git a/security/Makefile b/security/Makefile index 39682fb54901..658320f62b74 100644 --- a/security/Makefile +++ b/security/Makefile @@ -1194,6 +1194,7 @@ SUBDIR += sops SUBDIR += spass SUBDIR += spass-qt5 + SUBDIR += spm SUBDIR += spybye SUBDIR += sqlmap SUBDIR += sqlninja diff --git a/security/spm/Makefile b/security/spm/Makefile new file mode 100644 index 000000000000..67c37cec8ebe --- /dev/null +++ b/security/spm/Makefile @@ -0,0 +1,30 @@ +# $FreeBSD$ + +PORTNAME= spm +PORTVERSION= 0.20200208 +CATEGORIES= security +MASTER_SITES= https://notabug.org/kl3/spm/archive/ +DISTNAME= f920ab3f68 + +MAINTAINER= grembo@FreeBSD.org +COMMENT= Simple password manager + +LICENSE= GPLv3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= gpg2:security/gnupg \ + tree:sysutils/tree + +PLIST_FILES= bin/spm \ + man/man1/spm.1.gz + +WRKSRC= ${WRKDIR}/spm +NO_ARCH= yes +NO_BUILD= yes + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/bin/${PORTNAME} + ${INSTALL_MAN} ${WRKSRC}/spm.1 ${STAGEDIR}${MANPREFIX}/man/man1 + +.include diff --git a/security/spm/distinfo b/security/spm/distinfo new file mode 100644 index 000000000000..3f9120b06af2 --- /dev/null +++ b/security/spm/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1581170074 +SHA256 (f920ab3f68.tar.gz) = f5f23f98fae345717e8193fe0e629fe4dbed0eec32e4813cf9d5f0c0b6616fdb +SIZE (f920ab3f68.tar.gz) = 15367 diff --git a/security/spm/files/patch-spm b/security/spm/files/patch-spm new file mode 100644 index 000000000000..652e654126d6 --- /dev/null +++ b/security/spm/files/patch-spm @@ -0,0 +1,33 @@ +See: +https://notabug.org/mcz/spm/commit/8c3120fd44df117e5947d2705ba0d87443be831c.diff +--- spm.orig 2017-10-22 12:27:00 UTC ++++ spm +@@ -21,6 +21,7 @@ umask u=rwx,go= + ## Variables + GPG_OPTS='--quiet --yes --batch' + STORE_DIR="${PASSWORD_STORE_DIR:-${HOME}/.spm}" ++STORE_KEY="${PASSWORD_STORE_KEY:-}" + + ## Helper + usage() { +@@ -41,10 +42,10 @@ check() { + } + + gpg() { +- if [ -z "${PASSWORD_STORE_KEY}" ]; then ++ if [ -z "${STORE_KEY}" ]; then + gpg2 ${GPG_OPTS} --default-recipient-self "${@}" + else +- gpg2 ${GPG_OPTS} --recipient "${PASSWORD_STORE_KEY}" "${@}" ++ gpg2 ${GPG_OPTS} --recipient "${STORE_KEY}" "${@}" + fi + } + +@@ -53,6 +54,7 @@ readpw() { + IFS= read -r "${2}" + [ -t 0 ] && stty echo + [ -z "${2}" ] && usage 'empty password' ++ return 0 + } + + find() { diff --git a/security/spm/pkg-descr b/security/spm/pkg-descr new file mode 100644 index 000000000000..6f694b0c27a3 --- /dev/null +++ b/security/spm/pkg-descr @@ -0,0 +1,8 @@ +spm is a single fully POSIX shell compliant script utilizing gpg2(1) in +combination with basic tools such as find(1) and tree(1). Passwords are +stored as PGP encrypted files with directories funtioning as (sub)groups. +spm reads/writes passwords via standard input/output allowing you to build +flexible and powerful management tools. Refer to the manual page for +various examples or read its source code to see how it works. + +WWW: https://notabug.org/kl3/spm