summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6ac3d8861920795730a0505f0716bd8d5defc6e (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=2
pkgdesc='Bitwarden Command-line Interface'
arch=('x86_64')
url='https://github.com/bitwarden/cli'
license=('GPL3')
makedepends=('nodejs' 'npm')
depends=('nodejs')
provides=('bitwarden-cli')
conflicts=('bitwarden-cli')
options=('!strip')
source=("${_pkgname}-git-repo::git+https://github.com/bitwarden/cli.git"
        'jslib-git-repo::git+https://github.com/bitwarden/jslib.git'
        'bw.sh')
sha512sums=('SKIP'
            'SKIP'
            '71729c0ee95429ab03fa586de6bbf8ebad29d6d5544775564bb35eaa68cc4a915007db54b5928e99234bfe7828491829a5d32750f641056a0b68e05aa842f9ee')

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

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"
}