summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e93af0b41339340ef7a4e6ab73c9461cc0192392 (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
# Maintainer: Joao Sa <me@joaomsa.com>

pkgname=powermonius-git
_gitname="powermonius"
_gourl="github.com/joaomsa/powermonius"
pkgver=r20.01e1d82
pkgrel=1
pkgdesc="Be parsimonius with power consumption. Run only what you need when on battery."
arch=('x86_64' 'i686')
url="https://github.com/joaomsa/powermonius"
license=('MIT')
depends=('upower')
makedepends=('git' 'go')
source=("git://github.com/joaomsa/powermonius")
sha256sums=('SKIP')

pkgver() {
    cd $_gitname
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    GOPATH="$srcdir" go get -fix -v -x ${_gourl}
}

package() {
    mkdir -p "$pkgdir/usr/bin"
    install -p -m755 "$srcdir/bin/"* "$pkgdir/usr/bin"

    # Package license (if available)
    for f in LICENSE COPYING LICENSE.* COPYING.*; do
      if [ -e "$srcdir/src/$_gourl/$f" ]; then
        install -Dm644 "$srcdir/src/$_gourl/$f" \
          "$pkgdir/usr/share/licenses/$_gitname/$f"
      fi
    done
}

# vim:set ts=2 sw=2 et: