summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9956200eb2eff6c82cf0fbf699b06d304bbca469 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Maintainer: libertylocked <libertylocked@disroot.org>

pkgname=bitwarden-cli-git
_pkgname=bitwarden-cli
pkgver=1.3.0.r21.gbd38107
pkgrel=1
pkgdesc='Bitwarden Command-line Interface'
arch=('x86_64')
url='https://github.com/bitwarden/cli'
license=('GPL3')
makedepends=('nodejs' 'npm')
provides=('bitwarden-cli')
conflicts=('bitwarden-cli')
options=('!strip')
source=("${pkgname}::git+https://github.com/bitwarden/cli.git"
        'jslib::git+https://github.com/bitwarden/jslib.git')
sha512sums=('SKIP'
            'SKIP')

pkgver() {
  cd "${pkgname}"
  git describe --long --tags | sed 's/^v//' | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${pkgname}"
  git submodule init
  git config submodule.jslib.url $srcdir/jslib
  git submodule update
}

build() {
  cd "${pkgname}"

  # Download modules
  npm install

  # Build prod bundle
  npm run build:prod

  # Build binary
  npm run package:lin
}

package() {
  cd "${pkgname}"
  install -dm755 "${pkgdir}/usr/bin"
  install -Dm755 "dist/linux/bw" "${pkgdir}/usr/bin/bw"
}