summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4d409f8bb429d090b2bf581446d6d1980427ac76 (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
52
53
# Maintainer: Arne Beer <public@arne.beer>

pkgname=pueue-git
pkgver=3.4.1.r56.gafcd28d
pkgrel=1
arch=('any')
pkgdesc='A task manager and scheduler for shell commands'
license=('MIT')
options=('!lto')
makedepends=('git' 'cargo')
conflicts=('pueue')
provides=('pueue')
url='https://github.com/Nukesor/pueue'
source=("$pkgname"::"git+https://github.com/Nukesor/pueue.git")
sha256sums=('SKIP')

pkgver() {
  cd "$pkgname"
  version=$(git describe --long --tags --abbrev=7 | sed -r 's/([^-]*-g)/r\1/;s/-/./g')
  # Strip the `v` from the created version tag
  echo ${version:1}
}

build() {
    cd $pkgname

    # Build the daemon and client
    cargo build --release --locked

    mkdir -p ./utils/completions
    ./target/release/pueue completions bash ./utils/completions
    ./target/release/pueue completions fish ./utils/completions
    ./target/release/pueue completions zsh ./utils/completions
}

package() {
    cd $pkgname

    # Install binaries
    install -Dm755 "target/release/pueue" "${pkgdir}/usr/bin/pueue"
    install -Dm755 "target/release/pueued" "${pkgdir}/usr/bin/pueued"

    # Place systemd user service
    install -Dm644 "utils/pueued.service" "${pkgdir}/usr/lib/systemd/user/pueued.service"

    # Install zsh completions file
    install -Dm644 "utils/completions/_pueue" "${pkgdir}/usr/share/zsh/site-functions/_pueue"
    install -Dm644 "utils/completions/pueue.bash" "${pkgdir}/usr/share/bash-completion/completions/pueue.bash"
    install -Dm644 "utils/completions/pueue.fish" "${pkgdir}/usr/share/fish/completions/pueue.fish"

    # Install License
    install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/pueue/LICENSE"
}