upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / cocogitto / trunk / PKGBUILD
blobcaf33b4e73c15004bc6357d733cb3093b10265fa
1 # Maintainer: Caleb Maclennan <caleb@alerque.com
2 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
4 pkgname=cocogitto
5 _bin=cog
6 pkgver=5.3.1
7 pkgrel=2
8 pkgdesc='Set of CLI tools for the conventional commit and semver specifications'
9 arch=(x86_64)
10 url="https://github.com/$pkgname/$pkgname"
11 license=(MIT)
12 depends=(git
13          gcc-libs
14          libgit2.so
15          zlib)
16 makedepends=(cargo)
17 _archive="$pkgname-$pkgver"
18 source=("$url/archive/$pkgver/$_archive.tar.gz")
19 sha256sums=('ac6847ce55ba284184d0792afb53c6579da415600bc1b01c180dd87ad34597d0')
21 prepare() {
22         cd "$_archive"
23         cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
24         mkdir {completions,man}
27 build() {
28         cd "$_archive"
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"
41         done
44 check() {
45         cd "$_archive"
46         # Test suite is not atomic, relies on user environment such as git user configs
47         # cargo test --frozen
50 package() {
51         cd "$_archive"
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" {} \;