# Maintainer: Bhanupong Petchlert pkgname=pacman-mirrorup pkgver=0.5.0 pkgrel=1 pkgdesc="A service to retrieve the best and latest Pacman mirror list based on user's geography" arch=('x86_64') url="https://github.com/bpetlert/pacman-mirrorup" license=('MIT') depends=('systemd') makedepends=(cargo) provides=("${pkgname}") conflicts=("${pkgname}") source=("${pkgname}-${pkgver}.tar.gz::https://github.com/bpetlert/${pkgname}/archive/${pkgver}.tar.gz") sha256sums=('e0637a620adbe67a2a40911920e8f125a908805dd3bbb0641aa246085bc87aaf') prepare() { cd "${pkgname}-${pkgver}" cargo fetch --locked --target "$CARCH-unknown-linux-gnu" } build() { cd "${pkgname}-${pkgver}" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target cargo build --frozen --release } package() { cd "${pkgname}-${pkgver}" install -Dm755 "target/release/pacman-mirrorup" "$pkgdir/usr/bin/pacman-mirrorup" install -Dm644 "pacman-mirrorup.service" "$pkgdir/usr/lib/systemd/system/pacman-mirrorup.service" install -Dm644 "pacman-mirrorup.timer" "$pkgdir/usr/lib/systemd/system/pacman-mirrorup.timer" install -Dm644 "README.adoc" "$pkgdir/usr/share/doc/${pkgname}/README.adoc" install -Dm644 "LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE" }