upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / vaultwarden / trunk / PKGBUILD
bloba8d1074cf60071435f008797136b0c13fdc38015
1 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
2 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
3 # Contributor: Markus Richter <mqus at disroot dot org>
4 # Contributor: Timothée Ravier <tim@siosm.fr
6 pkgname=vaultwarden
7 pkgver=1.28.1
8 pkgrel=1
9 pkgdesc='Unofficial Bitwarden compatible server written in Rust'
10 arch=('x86_64')
11 url=https://github.com/dani-garcia/vaultwarden
12 license=('GPL3')
13 depends=(
14   'glibc'
15   'gcc-libs'
16   'mariadb-libs'
17   'openssl'
18   'postgresql-libs'
19   'sqlite'
21 makedepends=('git' 'rust')
22 optdepends=('vaultwarden-web: for the web app')
23 provides=('bitwarden_rs')
24 replaces=('bitwarden_rs')
25 backup=('etc/vaultwarden.env')
26 options=('!lto')
27 install=$pkgname.install
28 _commit='0b28ab3be101b58cf27b43da14bcf893fa37c1c8'
29 source=(
30   "$pkgname::git+$url#commit=$_commit"
31   'systemd.service'
32   'sysusers.conf'
33   'tmpfiles.conf'
35 b2sums=('SKIP'
36         'ff8e896f820b88f079d3d4f4c2eb394362569c921f53693e25d3badaf9fdca841e4d7665862e09d22421f544802f3a64014696fd92d7f0b923faf41f8d99e472'
37         '6580cf4031f262638abf11e529e8dfc489197afd6cd616c6a7810741e03c004706a5f9358f825aac6644c0ab6b251627ff988ed68f8264120b3575a655972390'
38         '9cdcd6c997c884eb3c1ad0c9b8cd91e68ec6762a27f9b80a7eb6c0cb1ffa4e500a654da6f17e9f985cc67add154efe737761f74e4e5f72892fc0e9d457314973')
40 pkgver() {
41   cd "$pkgname"
43   git describe --tags | sed 's/^v//'
46 prepare() {
47   cd "$pkgname"
49   # change various defaults
50   sed -i "s,# DATA_FOLDER=data,DATA_FOLDER=/var/lib/$pkgname,
51   s,web-vault/,/usr/share/webapps/$pkgname-web,
52   s,# WEB_VAULT_ENABLED=true,WEB_VAULT_ENABLED=false,
53   s,/path/to/log,/var/log/$pkgname.log,
54   /^# ROCKET_TLS/a ROCKET_LIMITS={json=10485760}" .env.template
56   # download dependencies
57   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
60 build() {
61   cd "$pkgname"
63   VW_VERSION="$pkgver" cargo build --release --frozen --features sqlite,mysql,postgresql
66 check() {
67   cd "$pkgname"
69   cargo test --frozen --features sqlite,mysql,postgresql
72 package() {
73   # systemd integration
74   install -vDm644 systemd.service "$pkgdir/usr/lib/systemd/system/$pkgname.service"
75   install -vDm644 sysusers.conf "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
76   install -vDm644 tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
78   cd "$pkgname"
80   # configuration
81   install -Dm644 .env.template "$pkgdir"/etc/$pkgname.env
83   # binary
84   install -vDm755 -t "$pkgdir/usr/bin" "target/release/$pkgname"
87 # vim:set ts=2 sw=2 et: