summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3fe1da0366c30016367465d4c2be3f95b2e7ed0f (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
54
55
56
# Maintainer: Matt Geskey <matt@celtra.com>
pkgname=kolide-launcher-git
pkgver=v0.13.5.r38.g854c6846
pkgrel=1
pkgdesc="osquery command and control"
url="https://www.kolide.co/"
arch=('x86_64' 'i686')
license=('MIT')
depends=('osquery')
makedepends=('go')
#install="kolide.install"
source=("${pkgname}::git+https://github.com/kolide/launcher.git" 
        "launcher.conf"
        "kolide-launcher.service"
)
backup=("etc/kolide/launcher.conf")
sha256sums=("SKIP"
            "424544443f3165e37622b8e1f3ca4280c39d85bf46c061477891ec75a38bc5e1"
            "f8f6e60c417aff696c531ef000035feb982f76a5a0767aed5501819aa44255fb"
)

pkgver() {
	cd "${srcdir}/${pkgname}"

	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd "${srcdir}/${pkgname}"

	install -m755 -d "${srcdir}/go/src/github.com/kolide"
	ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/kolide/launcher"
}

build() {
	cd "${srcdir}/go/src/github.com/kolide/launcher"

	mkdir -p build

	export GOPATH="${srcdir}/go"
	export PATH="${GOPATH}/bin:${PATH}"

	make deps
	make
}

package() {
	cd "${srcdir}/go/src/github.com/kolide/launcher"

	install -Dm755 "build/launcher" "${pkgdir}/usr/bin/kolide-launcher"
	install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/kolide/LICENSE"

	install -m755 -d "${pkgdir}/var/lib/kolide"
	install -Dm644 "${srcdir}/launcher.conf" "${pkgdir}/etc/kolide/launcher.conf"
	install -Dm644 "${srcdir}/kolide-launcher.service" "${pkgdir}/usr/lib/systemd/system/kolide-launcher.service"
}