arch-pkgs/commitizen/PKGBUILD

63 lines
1.7 KiB
Text
Raw Normal View History

# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Jayson Reis <santosdosreis@gmail.com>
pkgname=commitizen
pkgver=2.20.1
pkgrel=1
pkgdesc="A tool for enforcing descriptive commit messages and version/changelog management"
arch=('any')
url="https://github.com/commitizen-tools/commitizen"
license=('MIT')
depends=(
'python'
'python-questionary'
'python-decli'
'python-colorama'
'python-termcolor'
'python-packaging'
'python-tomlkit'
'python-jinja'
'python-pyaml'
'python-argcomplete'
'python-prompt_toolkit'
)
makedepends=(
'python-install'
'python-build'
'python-poetry'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('def54ac6f1f36d05c211cda21b6a5e00788ae5d186f0f92e62a4dd5c82ed9c29a44183d863b8228b7b199274c9b8ad0459ef510627e962b12246e5124dc0c67f')
b2sums=('0612face428eed02423e37f457b2249ab8e8b9c07fd20f9b2ac47176bf2f7f4e236d05e1cc9455b23a39ae6db579bc6ecd8e536c0335423cb1b82bb5e31c35e4')
prepare () {
cd "$pkgname-$pkgver"
# create completions
mkdir completions
register-python-argcomplete --shell bash cz > completions/bash
register-python-argcomplete --shell fish cz > completions/fish
}
build() {
cd "$pkgname-$pkgver"
python -m build --wheel --skip-dependency-check --no-isolation
}
package() {
cd "$pkgname-$pkgver"
python -m install \
--optimize=1 \
--destdir="$pkgdir" \
dist/*.whl
# license
install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
# shell completions
install -vDm644 completions/bash "$pkgdir/usr/share/bash-completion/completions/cz"
install -vDm644 completions/fish "$pkgdir/usr/share/fish/vendor_completions.d/cz.fish"
}