# Maintainer: Bhanupong Petchlert pkgname=pacman-mirrorup pkgver=1.0.2 pkgrel=1 pkgdesc="A program 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=('GPL-3.0-or-later') depends=() makedepends=(cargo) options=(!lto) source=("${pkgname}-${pkgver}.tar.gz::https://github.com/bpetlert/${pkgname}/archive/${pkgver}.tar.gz") b2sums=('7e9eef0bf7df86d00eab7a1df3b446949825bd787668421bafbfddc3c2a5ef462541ae774ef0d0d3279bcf36c206fea28f108fd5b89cef76e184d6642b265ace') prepare() { cd "${pkgname}-${pkgver}" export RUSTUP_TOOLCHAIN=stable cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } 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" }