aboutsummaryrefslogtreecommitdiffstats
path: root/community/makepasswd
diff options
context:
space:
mode:
authortcely <tcely@users.noreply.github.com>2019-05-14 02:44:54 -0400
committerKevin Daudt <kdaudt@alpinelinux.org>2019-05-14 15:53:36 +0000
commit5d4b28f96725dd477699826e07dd9fb6afc7dca7 (patch)
treefc0d6f3e62b45102aa1ea63271d037c3cf8b9891 /community/makepasswd
parent0c78a437f68fd0b4ba681dc39961037bdc39a421 (diff)
downloadaports-5d4b28f96725dd477699826e07dd9fb6afc7dca7.tar.bz2
aports-5d4b28f96725dd477699826e07dd9fb6afc7dca7.tar.xz
community/makepasswd: modernize
Diffstat (limited to 'community/makepasswd')
-rw-r--r--community/makepasswd/APKBUILD33
1 files changed, 24 insertions, 9 deletions
diff --git a/community/makepasswd/APKBUILD b/community/makepasswd/APKBUILD
index 4e97a81f45..97e4c21145 100644
--- a/community/makepasswd/APKBUILD
+++ b/community/makepasswd/APKBUILD
@@ -4,7 +4,7 @@ pkgname=makepasswd
pkgver=0.5.4
pkgrel=0
pkgdesc="Generates (pseudo-)random passwords of a desired length"
-url="http://people.defora.org/~khorben/projects/makepasswd/"
+url="https://www.defora.org/os/project/117/makepasswd"
arch="all"
license="GPL-3.0"
depends=""
@@ -13,20 +13,35 @@ install=""
subpackages="$pkgname-doc"
source="https://www.defora.org/os/download/download/4438/$pkgname-$pkgver.tar.gz"
-builddir="$srcdir"/$pkgname-$pkgver
-
build() {
- cd "$builddir"
- make || return 1
- cd doc
- make || return 1
+ make
+ make -C doc
}
package() {
- cd "$builddir"
install -D -p -m 755 src/makepasswd "$pkgdir"/usr/bin/makepasswd
install -D -p -m 644 doc/makepasswd.1 \
- "$pkgdir"/usr/share/man/man1/$pkgname.1 || return 1
+ "$pkgdir"/usr/share/man/man1/$pkgname.1
+}
+
+check() {
+ local expected output
+
+ # Generated expected hash with:
+ # {
+ # printf -- '%s %s\n' testing "$(printf testing | openssl enc -a)" ;
+ # printf testing | openssl dgst -md5 | awk '{$1="testing "; print; quit;}' ;
+ # for a in des md5 sha256 ; do printf -- '%s ' testing; mkpasswd -m "$a" testing foobar ; done ;
+ # } | sha512sum
+ #
+ expected='11d0cc3117bb6074adefaded0ed5f2a50fdc6b5448d832dd25b742edb499f225fe2469f7ae7f8859921640f2f31c62d6b2c82d7ea9471fb28a152a011aac7406'
+ output="$(mktemp -q -p .)"
+
+ local a; for a in base64 md5 des shmd5 sha256; do
+ ./src/makepasswd -e "${a}" -s 'foobar' -p 'testing'
+ done > "$output"
+
+ printf -- '%s %s\n' "${expected}" "${output}" | sha512sum -c
}
sha512sums="c8721826c7329b2c4e7fc2226e31a081347b66a76827ca669547125fed2175035ecd6b7d46aacdf8ae6ee140281caf31e5bdbecdd2807723800596fd0140aaa0 makepasswd-0.5.4.tar.gz"