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')
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=('94f16f724f032589072d8165710aa5027ae1bdb665614b4660e49bb802b3d27b'
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 # The makefile seems to not be able to execute npm properly, so run the make assets target manually
39 cd web/ui/module/codemirror-promql
43 cd $srcdir/prometheus-$pkgver/web/ui
44 GOOS= GOARCH= go generate -x -v
46 cd $srcdir/prometheus-$pkgver
47 # Build the react app, normally a part of the assets target
48 #make web/ui/static/react
57 -ldflags "-linkmode external $LDFLAGS" \
64 -ldflags "-linkmode external $LDFLAGS" \
75 install -Dm644 prometheus.service "$pkgdir"/usr/lib/systemd/system/prometheus.service
76 install -Dm644 prometheus.sysusers "$pkgdir"/usr/lib/sysusers.d/prometheus.conf
77 install -Dm644 prometheus.conf "${pkgdir}"/etc/conf.d/prometheus
81 install -Dm755 -t "$pkgdir"/usr/bin prometheus promtool
82 install -Dm640 -g210 -t "$pkgdir"/etc/prometheus documentation/examples/prometheus.yml
83 install -dm750 -o210 -g210 "$pkgdir"/var/lib/prometheus
86 install -dm755 "$pkgdir"/usr/share/prometheus/web/ui
87 cp -R web/ui/{static,templates} "$pkgdir"/usr/share/prometheus/web/ui/
90 install -Dm644 -t "$pkgdir"/usr/share/doc/prometheus/examples documentation/examples/prometheus*.yml
91 cp -R consoles console_libraries "$pkgdir"/usr/share/doc/prometheus/examples