1 # Maintainer: Caleb Maclennan <caleb@alerque.com
2 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
8 pkgdesc='Set of CLI tools for the conventional commit and semver specifications'
10 url="https://github.com/$pkgname/$pkgname"
17 _archive="$pkgname-$pkgver"
18 source=("$url/archive/$pkgver/$_archive.tar.gz")
19 sha256sums=('ac6847ce55ba284184d0792afb53c6579da415600bc1b01c180dd87ad34597d0')
23 cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
24 mkdir {completions,man}
29 CFLAGS+=" -ffat-lto-objects"
30 cargo build --frozen --release
31 local compgen="target/release/$_bin generate-completions"
32 $compgen bash > "completions/$_bin"
33 $compgen fish > "completions/$_bin.fish"
34 $compgen zsh > "completions/_$_bin"
35 local mangen="target/release/$_bin generate-manpage"
36 $mangen cog > "man/$_bin.1"
37 for cmd in 'check' 'commit' 'edit' 'log' 'verify' \
38 'changelog' 'bump' 'init' 'install-hook' \
39 'generate-completions'; do
40 $mangen $cmd > "man/$_bin-$cmd.1"
46 # Test suite is not atomic, relies on user environment such as git user configs
52 install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_bin"
53 install -Dm0644 -t "$pkgdir/usr/share/bash-completion/completions/" "completions/$_bin"
54 install -Dm0644 -t "$pkgdir/usr/share/fish/vendor_completions.d/" "completions/$_bin.fish"
55 install -Dm0644 -t "$pkgdir/usr/share/zsh/site-functions/" "completions/_$_bin"
56 install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
57 install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
58 find man/ -type f -exec install -Dm0644 -t "$pkgdir/usr/share/man/man1" {} \;