summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a2aa7145dbe9abb6d877379ee9e78f7f3aeab7ea (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
49
50
51
# Maintainer: Sebastian Wiesner <sebastian@swsnr.de>

pkgname=wol-rs
pkgver=0.5.1
pkgrel=2
pkgdesc='Wake up remote hosts with Wake On LAN magic packets'
arch=('i686' 'x86_64')
url="https://codeberg.org/swsnr/wol.rs"
license=('EUPL-1.2')
depends=()
conflicts=('wol')
makedepends=('rust' 'cargo' 'git' 'openssh')
options=()
source=("git+${url}.git#tag=v${pkgver}")
sha256sums=('e781a9fe5fd09300867f931b409a159a7b8d5aa945048623abca026bc2a6f817')

verify() {
    cat > "${srcdir}/allowed-signers" <<EOF
sebastian@swsnr.de ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBmga3fwFXxHTireSwL/YLdNpOuQcJXB8hW4FwOc6SCm
EOF
    git -C "wol.rs" -c gpg.ssh.allowedSignersFile="${srcdir}/allowed-signers" \
        verify-tag "v${pkgver}"
}

build() {
    cd "wol.rs" || return 1

    # Dump completions and manpage
    cargo build --release --frozen --features cli,manpage,completions

    target/release/wol --print-manpage | gzip > wol.1.gz

    # We do not generate bash completions, because this conflicts with the
    # bash-completions package which includes completions for the old C wol tool.
    for shell in zsh fish; do
        target/release/wol --print-completions="${shell}" > "complete.${shell}"
    done

    # Final build without embedded manpage and completions
    cargo build --release --frozen --features cli
 }

package() {
    cd "wol.rs" || return 1

    install -Dm755 "target/release/wol" "${pkgdir}/usr/bin/wol"
    install -Dm644 wol.1.gz "${pkgdir}/usr/share/man/man1/wol.1.gz"
    install -Dm644 complete.zsh "${pkgdir}/usr/share/zsh/site-functions/_wol"
    install -Dm644 complete.fish "${pkgdir}/usr/share/fish/vendor_completions.d/wol.fish"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}