summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 62b0a8cf70376200889a94b5da52ffe3bfadf67c (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
# Maintainer: larte <lauri.arte@gmail.com>
pkgname=k8stail
pkgver=0.5.1
pkgrel=1
pkgdesc="Watch kubernetes logstreams filtering with namespace and labels, like tail -f"
arch=('x86_64' 'i686')
url="https://github.com/dtan4/k8stail"
license=('MIT')
depends=('glibc')
makedepends=('go' 'go-bindata' 'make' 'glide')
_archive=k8stail-$pkgver
source=($_archive.tar.gz::https://github.com/dtan4/k8stail/archive/v$pkgver.tar.gz)
md5sums=('bd893081cbe9e9fbd29ccff7193c869b')


prepare() {
     cd $srcdir/$_archive
     msg2 "Patching makefile"
     sed -i -e 's/REVISION.*:=.*/REVISION := "aur-pkgbuild"/' Makefile

     msg2 "mkdir -p $srcdir/go/src/github.com/dtan4"
     mkdir -p $srcdir/go/src/github.com/dtan4

     msg2 "ln -sf $srcdir/$_archive $srcdir/go/src/github.com/dtan4/$archive"
     ln -sf $srcdir/$_archive $srcdir/go/src/github.com/dtan4/$archive
}

build() {
        cd $srcdir/go/src/github.com/dtan4/$_archive
        export GOPATH=$srcdir/go
        export GOBIN="$srcdir/bin"
        export PATH=$PATH:$GOPATH/bin

        make deps
        make install
        #GOPATH=$srcdir/go go install -ldflags="-s -w -X \"main.Version=$pkgver\" -X \"main.Revision=aur-pkgbuild\""
}

check() {
        cd $srcdir/go/src/github.com/dtan4/$_archive
        GOPATH="$srcdir/go" make test
}

package() {
   mkdir -p "$pkgdir/usr/bin"
   install -p -m755 "$srcdir/bin/$pkgname-$pkgver" "$pkgdir/usr/bin/k8stail"
   install -Dm644 $srcdir/$_archive/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE

}