summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d04aaf73ed2e861f93bc7555c4c3ff15e4aa56e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer: mexus <gilaldpellaeon@gmail.com>
#
# Template — not a usable PKGBUILD on its own.
# To publish to the AUR:
#   1. Copy the contents of this directory into the AUR repo.
#   2. Run `./prepare.sh` (uses the latest GitHub release) or
#      `./prepare.sh X.Y.Z` to pin a version. The script renders this template,
#      runs updpkgsums, and writes .SRCINFO.
#   3. Commit & push.
pkgname=pacrank-bin
pkgver=0.4.1
pkgrel=1
pkgdesc="Pick the fastest Archlinux mirrors (prebuilt binary)"
arch=('x86_64')
url="https://github.com/mexus/pacrank"
license=('Apache-2.0' 'MIT')
provides=('pacrank')
conflicts=('pacrank')
depends=('gcc-libs' 'glibc')
optdepends=('sudo: required at runtime to rewrite /etc/pacman.d/mirrorlist')
source=(
    "pacrank-$pkgver-$CARCH.tar.gz::$url/releases/download/v$pkgver/pacrank-$CARCH-unknown-linux-gnu.tar.gz"
    "LICENSE-MIT-$pkgver::$url/raw/v$pkgver/LICENSE-MIT"
    "LICENSE-APACHE-$pkgver::$url/raw/v$pkgver/LICENSE-APACHE"
)
sha256sums=('6e368cd680a6e657cb065990da201ae32c2e53887cfe942309ec35b9cfd6bab6'
            '1f4501dd650e746acbfb3b11a4143ec4334751180817115a41b8583b60909548'
            '8e026767a7a93aa2d295f7a0b912d438aae888004d42a45c9510954a9efdb3d2')

package() {
    install -Dm755 "$srcdir/pacrank" "$pkgdir/usr/bin/pacrank"

    # Generate shell completions from the freshly installed binary.
    install -d "$pkgdir/usr/share/bash-completion/completions" \
               "$pkgdir/usr/share/zsh/site-functions" \
               "$pkgdir/usr/share/fish/vendor_completions.d"
    "$pkgdir/usr/bin/pacrank" --generate-completions bash \
        > "$pkgdir/usr/share/bash-completion/completions/pacrank"
    "$pkgdir/usr/bin/pacrank" --generate-completions zsh \
        > "$pkgdir/usr/share/zsh/site-functions/_pacrank"
    "$pkgdir/usr/bin/pacrank" --generate-completions fish \
        > "$pkgdir/usr/share/fish/vendor_completions.d/pacrank.fish"

    install -Dm644 "$srcdir/LICENSE-MIT-$pkgver" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE-MIT"
    install -Dm644 "$srcdir/LICENSE-APACHE-$pkgver" \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE-APACHE"
}