# Maintainer: Cyrille Pontvieux <cyrille@enialis.net>
pkgname=ezchlog
pkgver=1.0.1
pkgrel=1
pkgdesc="Easy git branch friendly changelogs"
arch=('x86_64' 'armv7h' 'aarch64')
url="https://gitlab.com/jrdasm/ezchlog"
license=('MIT')
makedepends=('cargo' 'upx')
source=("https://gitlab.com/jrdasm/$pkgname/-/archive/v$pkgver/$pkgname-v$pkgver.tar.gz")
sha256sums=('a7fbea8de02cf6dd351070c55c3c026ec3b3c34a4f66a0bed5608f147f2c6961')

build() {
	cd "$pkgname-v$pkgver"
  sed -i '/^Python version$/,/^Add a changelog$/{/^Add a changelog$/!d}' README.md
	cargo build --locked --release
  upx --lzma --best -o $pkgname target/release/$pkgname
}

package() {
	cd "$pkgname-v$pkgver"
  install -D -t "$pkgdir/usr/bin" $pkgname
  install -D -t "$pkgdir/usr/share/doc/$pkgname" README.md
}
