Jobboerse/dist/arch/PKGBUILD
Lukas Drescher 9cbca723f8 Add email.receive config option
- Prepare ver 0.6.0 for release
- Fix some minor typos
2026-03-18 01:49:57 +01:00

91 lines
2.4 KiB
Bash

# Maintainer: Bennet Bleßmann <ben@fs-infmath.uni-kiel.de>
# Based on the PKGBUILD for FS-Protokoll by: Einhard Leichtfuß <alguien@respiranto.de>
# shellcheck disable=SC2034 # unused variables pkgname, pkgver etc.
export GIT_CONFIG_GLOBAL=/dev/null
_reponame=Jobboerse
_pkgname="${_reponame,,}"
_features=()
pkgname="${_reponame,,}"
pkgver=0.6.0
pkgrel=1
pkgdesc="FS-InfMath Job-Offer Page"
arch=('x86_64') # Other architectures may work
url="https://www.fs-infmath.uni-kiel.de/git/FS-InfMath/${_reponame}"
license=('Apache') # Or MIT (see Cargo.toml).
depends=()
makedepends=('git' 'git-lfs' 'cargo')
checkdepends=('cargo')
backup=("etc/${_pkgname}/config.toml")
source=("git+${url}.git#tag=version-${pkgver}")
sha512sums=('SKIP')
prepare()
{
cd "$_reponame"
# Download git-lfs files
git remote | grep -q lfs-remote || git remote add lfs-remote "${url}.git"
git lfs install --local
git lfs pull lfs-remote
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
_oldIFS="${IFS}"
IFS=","
_feature_list="${_features[*]}"
IFS="${_oldIFS}"
build()
{
cd "$_reponame"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --frozen --release ${_features[@]:+--features} ${_features[@]:+"$_feature_list"}
}
check()
{
cd "$_reponame"
export RUSTUP_TOOLCHAIN=stable
# we only have limited diskspace of 2GB for build and check files on /tmp on metabo
# without --release here we exceed that, this also means we want a different target dir to not override the
# release profile binary with a bench profile binary
# see <https://wiki.archlinux.org/title/Rust_package_guidelines> for reference
export CARGO_TARGET_DIR=target-check
cargo test --release --frozen ${_features[@]:+--features} ${_features[@]:+"$_feature_list"}
}
package()
{
cd "$_reponame"
# shellcheck disable=SC2154 # use of unassigned variable pkgdir
install -Dm0755 \
"target/release/${_pkgname}" \
"${pkgdir}/usr/bin/${_pkgname}"
install -dm0755 "${pkgdir}/usr/lib/${_pkgname}/"
cp -r "packages/jobboerse/static/" "packages/jobboerse/templates/" "${pkgdir}/usr/lib/${_pkgname}/"
install -Dm0644 -t "${pkgdir}/usr/share/doc/${_pkgname}" \
README.md \
Changelog.md
install -Dm0644 \
"packages/jobboerse/config/dist-config.toml" \
"${pkgdir}/etc/${_pkgname}/config.toml"
install -Dm0644 \
"jobboerse.service" \
"${pkgdir}/usr/lib/systemd/system/jobboerse.service"
}