summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDenis Zheleztsov2019-10-14 11:49:14 +0300
committerDenis Zheleztsov2019-10-14 11:56:57 +0300
commitd89393fd1399c024cb9ecdd26273ff6765ceb953 (patch)
tree448d852e42aa2cc755b67656211f7535c4a07d81 /PKGBUILD
downloadaur-go-pm-git.tar.gz
Initial
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD52
1 files changed, 52 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..26e37e38f4a9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,52 @@
+pkgname=pm
+_pkgname=pm
+pkgver=20191014.21_37aa6fc
+pkgrel=1
+pkgdesc="Simple secure password manager written in Go"
+arch=('x86_64')
+license=('GPL')
+depends=(
+ 'sqlite'
+ 'gnupg'
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "$_pkgname::git+https://github.com/himidori/pm"
+)
+md5sums=('SKIP')
+
+pkgver() {
+ if [[ "$PKGVER" ]]; then
+ echo "$PKGVER"
+ return
+ fi
+
+ cd "$srcdir/$_pkgname"
+ local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local count=$(git rev-list --count HEAD)
+ local commit=$(git rev-parse --short HEAD)
+ echo "$date.${count}_$commit"
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+ export GOPATH="$srcdir/go"
+ export GOBIN="$srcdir/go/bin"
+
+ echo ":: Updating git submodules"
+ git submodule update --init
+
+ echo ":: Building binary"
+ go get -v -t ./... # -v \
+ # -gcflags "-trimpath $GOPATH/src"
+}
+
+package() {
+ find "$srcdir/go/bin/" -type f -executable | while read filename; do
+ install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
+ done
+}