summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorlibertylocked2018-10-15 17:36:37 -0400
committerlibertylocked2018-10-15 17:36:37 -0400
commitf4a7e433fdcd3d2d8ce376469bbdd34741e0697b (patch)
tree083e2cf601f2c3e95a963dfc23e8a6fde9c558e8
parent6f858ad30276d980254511cd575fe4052790bd32 (diff)
downloadaur-f4a7e433fdcd3d2d8ce376469bbdd34741e0697b.tar.gz
Make pkgbuild build bw from source
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore2
-rw-r--r--PKGBUILD38
-rw-r--r--bw.sh2
4 files changed, 48 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 43998f5da869..10555747b6ef 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,21 @@
-# Generated by mksrcinfo v8
-# Mon Aug 20 16:46:34 UTC 2018
pkgbase = bitwarden-cli
pkgdesc = The command line vault (Windows, macOS, & Linux). bitwarden.com
pkgver = 1.3.0
- pkgrel = 1
+ pkgrel = 2
url = https://bitwarden.com
arch = x86_64
license = GPL3
+ makedepends = nodejs
+ makedepends = npm
+ depends = nodejs
+ conflicts = bitwarden-cli-git
options = !strip
- source_x86_64 = https://github.com/bitwarden/cli/releases/download/v1.3.0/bw-linux-1.3.0.zip
- sha512sums_x86_64 = b2b7cce07085009e3d26ad2da70310d3af0a3e6129d399278e494eb455a930d6953c1c57f85659ac0eac35747da91005f3a50d5a260ff8e6e57a9d756e96e978
+ source = bitwarden-cli-git-repo::git+https://github.com/bitwarden/cli.git#tag=v1.3.0
+ source = jslib-git-repo::git+https://github.com/bitwarden/jslib.git
+ source = bw.sh
+ sha512sums = SKIP
+ sha512sums = SKIP
+ sha512sums = 71729c0ee95429ab03fa586de6bbf8ebad29d6d5544775564bb35eaa68cc4a915007db54b5928e99234bfe7828491829a5d32750f641056a0b68e05aa842f9ee
pkgname = bitwarden-cli
diff --git a/.gitignore b/.gitignore
index 16d66072650d..8108ffef0a03 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
pkg/
src/
+bitwarden-cli-git-repo/
+jslib-git-repo/
*.tar.xz
*.zip
diff --git a/PKGBUILD b/PKGBUILD
index 18a45dbb950a..39e81a7010fd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,43 @@
+# Maintainer: libertylocked <libertylocked@disroot.org>
# Contributor: Stephen Brown II <Stephen [dot] Brown2 [at] gmail.com>
pkgname=bitwarden-cli
+_pkgname=bitwarden-cli
pkgver=1.3.0
-pkgrel=1
+pkgrel=2
pkgdesc="The command line vault (Windows, macOS, & Linux). bitwarden.com"
arch=('x86_64')
url="https://bitwarden.com"
license=('GPL3')
+makedepends=('nodejs' 'npm')
+depends=('nodejs')
+conflicts=('bitwarden-cli-git')
options=('!strip')
-source_x86_64=("https://github.com/bitwarden/cli/releases/download/v${pkgver}/bw-linux-${pkgver}.zip")
-sha512sums_x86_64=('b2b7cce07085009e3d26ad2da70310d3af0a3e6129d399278e494eb455a930d6953c1c57f85659ac0eac35747da91005f3a50d5a260ff8e6e57a9d756e96e978')
+source=("${_pkgname}-git-repo::git+https://github.com/bitwarden/cli.git#tag=v${pkgver}"
+ 'jslib-git-repo::git+https://github.com/bitwarden/jslib.git'
+ 'bw.sh')
+sha512sums=('SKIP'
+ 'SKIP'
+ '71729c0ee95429ab03fa586de6bbf8ebad29d6d5544775564bb35eaa68cc4a915007db54b5928e99234bfe7828491829a5d32750f641056a0b68e05aa842f9ee')
-package(){
- install -D "${srcdir}/bw" "${pkgdir}/usr/bin/bw"
+prepare() {
+ cd "${_pkgname}-git-repo"
+ git submodule init
+ git config submodule.jslib.url $srcdir/jslib-git-repo
+ git submodule update
+}
+
+build() {
+ cd "${_pkgname}-git-repo"
+ npm install
+ npm run build:prod
+}
+
+package() {
+ cd "${_pkgname}-git-repo"
+
+ install -dm755 "${pkgdir}/usr/lib/${_pkgname}"
+ cp -a build/. "${pkgdir}/usr/lib/${_pkgname}/"
+
+ install -dm755 "${pkgdir}/usr/bin"
+ install -Dm755 "${srcdir}/bw.sh" "${pkgdir}/usr/bin/bw"
}
diff --git a/bw.sh b/bw.sh
new file mode 100644
index 000000000000..6814da8ae156
--- /dev/null
+++ b/bw.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+node /usr/lib/bitwarden-cli/bw.js $@