FS-Protokoll/dist/arch/devel/PKGBUILD
Einhard Leichtfuß 0446c980dc
Improve PKGBUILD(s)
- Move current VCS PKGBUILD to devel/ subdir.
- Create a non-VCS PKGBUILD (using git tag).
- Change License field to Apache.
  - Advantage: no need to include actual license.
  - Also, the FSF recommends Apache over MIT.
- Add README.md and Changelog.md to package.
2022-03-09 10:24:44 +01:00

64 lines
1.2 KiB
Bash

# Maintainer: Einhard Leichtfuß <alguien@respiranto.de>
_reponame=FS-Protokoll
_pkgname="${_reponame,,}"
_builtname="${_pkgname/-/_}"
pkgname=${_pkgname}-git
pkgver=0.6.1.r0.g267392f
pkgrel=1
pkgdesc="Convert FS meeting protocols"
arch=('any')
url="https://www.fs-infmath.uni-kiel.de/git/FS-InfMath/${_reponame}"
license=('Apache') # Or MIT (see fs_protokoll_{bin,lib}/Cargo.toml).
depends=()
makedepends=('git' 'cargo')
checkdepends=('cargo')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("git+${url}.git")
sha512sums=('SKIP')
pkgver()
{
cd "$_reponame"
git describe --long --tags \
| sed -E 's/^version-//; s/([^-]*-g)/r\1/; s/-/./g'
}
prepare()
{
cd "$_reponame"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build()
{
cd "$_reponame"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release --all-features
}
check()
{
cd "$_reponame"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features
}
package()
{
cd "$_reponame"
install -Dm0755 \
"target/release/${_builtname}" \
"${pkgdir}/usr/lib/${_pkgname}/${_pkgname}"
install -Dm0755 -t "${pkgdir}/usr/share/doc/${_pkgname}" \
README.md \
Changelog.md
}