1 # Maintainer: Johannes Löthberg <johannes@kyriasis.com>
7 pkgdesc='An open-source systems monitoring and alerting toolkit'
8 url='https://prometheus.io'
13 makedepends=('go' 'git' 'npm' 'nodejs' 'yamllint' 'typescript' 'yarn')
16 backup=('etc/prometheus/prometheus.yml' 'etc/conf.d/prometheus')
18 source=("prometheus-v$pkgver.tar.gz::https://github.com/prometheus/prometheus/archive/v$pkgver.tar.gz"
23 sha256sums=('0cd8860e5f10d0ecb35d20d23252ddc459e8319882dc163bf71b723e3bcafd71'
24 'f358986865bd3d06dc47a265aeb3b5ef64aa644e831f07731c2fc7af64d9e98f'
25 '2747fabb4e56b808361eb7dd7acf9729ab8973d1ebe2f857dd56f6c71f71e45f'
26 '6d32deb125381cbebac11b6953a7d9a65eb7e50f209dc1e22c63facf678a3070')
31 LDFLAGS="-extldflags $LDFLAGS \
32 -X github.com/prometheus/common/version.Version=$pkgver \
33 -X github.com/prometheus/common/version.Revision=$pkgver \
34 -X github.com/prometheus/common/version.Branch=tarball \
35 -X github.com/prometheus/common/version.BuildUser=someone@builder \
36 -X github.com/prometheus/common/version.BuildDate=$(date -u '+%Y%m%d-%H:%M:%S' --date=@${SOURCE_DATE_EPOCH})"
38 cd $srcdir/prometheus-$pkgver/web/ui
39 GOOS= GOARCH= go generate -x -v
41 cd $srcdir/prometheus-$pkgver
43 make ui-install # run install first as otherwise the makefile has a race condition......
51 -ldflags "-linkmode external $LDFLAGS" \
58 -ldflags "-linkmode external $LDFLAGS" \
65 GODEBUG=x509sha1=1 go test -short ./...
69 install -Dm644 prometheus.service "$pkgdir"/usr/lib/systemd/system/prometheus.service
70 install -Dm644 prometheus.sysusers "$pkgdir"/usr/lib/sysusers.d/prometheus.conf
71 install -Dm644 prometheus.conf "${pkgdir}"/etc/conf.d/prometheus
75 install -Dm755 -t "$pkgdir"/usr/bin prometheus promtool
76 install -Dm640 -g210 -t "$pkgdir"/etc/prometheus documentation/examples/prometheus.yml
77 install -dm750 -o210 -g210 "$pkgdir"/var/lib/prometheus
80 install -dm755 "$pkgdir"/usr/share/prometheus/web/ui
81 cp -R web/ui/static "$pkgdir"/usr/share/prometheus/web/ui/
84 install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus/examples documentation/examples/prometheus*.yml
85 cp -R consoles console_libraries "$pkgdir"/usr/share/doc/prometheus/examples