summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce86422b4fbe3eee52e849a84f932c10b23b5682 (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
# Maintainer: Edu4rdSHL <edu4rdshl@protonmail.com>

pkgname=rusnapshot-git
_pkgname=rusnapshot
pkgver=34.c32742b
pkgrel=1
pkgdesc='Simple and handy btrfs snapshoting tool. Supports scheduled snapshots
    and restoring. Backed with SQLite. (git version)'
arch=('x86_64' 'i686' 'arm' 'armv6h' 'armv7h' 'aarch64')
url='https://github.com/Edu4rdSHL/rusnapshot'
license=('GPL3')
depends=('sqlite' 'btrfs-progs')
makedepends=('rust' 'git')
conflicts=("$_pkgname")
provides=("$_pkgname")
source=("git+https://github.com/Edu4rdSHL/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd "$_pkgname"

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd "$_pkgname"

  cargo build --release --locked
}

check() {
  cd "$_pkgname"

  cargo test --release --locked
}

package() {
  cd "$_pkgname"

  install -dm 755 "${pkgdir}/etc/$_pkgname"
  install -dm 755 "${pkgdir}/var/lib/$_pkgname"

  install -Dm 755 "target/release/$_pkgname" -t "${pkgdir}/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  cp -R examples/* -t "$pkgdir/usr/share/doc/$pkgname"
}