blob: 2c00d08fee53085a7771cd5a3f455cd67b49c3cc (
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
50
51
52
53
|
# Maintainer: Wang Ruochen <arch@ruo-chen.wang>
pkgname=dosnap-git
_pkgname=${pkgname%-git}
pkgver=r27.9614499
pkgrel=1
pkgdesc="Automatically manage Btrfs snapshots"
arch=('x86_64')
url="https://github.com/weirane/dosnap"
license=('GPL')
depends=('btrfs-progs')
makedepends=('git' 'cargo')
provides=("$_pkgname")
conflicts=("$_pkgname")
replaces=()
backup=('etc/dosnap.toml')
options=()
install=
source=("$_pkgname::git+$url")
noextract=()
md5sums=('SKIP')
pkgver() {
cd "$srcdir/$_pkgname"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/$_pkgname"
cargo build --release --locked --target-dir=target
}
check() {
cd "$srcdir/$_pkgname"
cargo test --release --locked --target-dir=target
}
package() {
cd "$srcdir/$_pkgname"
local _bin=target/release/$_pkgname
install -Dm755 $_bin -t "$pkgdir/usr/bin"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
install -Dm644 dosnap.toml "$pkgdir/etc/dosnap.toml"
find ./systemd -name 'dosnap-*' -type f \
-exec install -Dm644 "{}" -t "$pkgdir/usr/lib/systemd/system" \;
install -d "$pkgdir/usr/share/zsh/site-functions" \
"$pkgdir/usr/share/bash-completion/completions" \
"$pkgdir/usr/share/fish/vendor_completions.d"
$_bin completion --shell zsh >"$pkgdir/usr/share/zsh/site-functions/_$_pkgname"
$_bin completion --shell bash >"$pkgdir/usr/share/bash-completion/completions/$_pkgname"
$_bin completion --shell fish >"$pkgdir/usr/share/fish/vendor_completions.d/$_pkgname.fish"
}
|