aboutsummaryrefslogblamecommitdiffstats
path: root/community/prometheus/APKBUILD
blob: f765ae38dcddae5cb6c9280511c9fd24e6a00d0d (plain) (tree)
1
2
3
4
5
6
7
8
9

                                          

             

                                                                   
                        
                    
                                                             
                                
                          
                             



                                                                                                 
         
 
         




                                    



                         
 



                                                 
                                           























                                                              











                                                                                     

 
                                                                                                                                                                      
                                                                                                                                                  
                                                                                                                                                   
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=prometheus
pkgver=2.18.0
pkgrel=0
pkgdesc="The Prometheus monitoring system and time series database"
url="https://github.com/prometheus/prometheus"
arch="all !mips !mips64"
license="Apache-2.0"
options="!check" # Broken by integrations we don't care about
install="prometheus.pre-install"
makedepends="go yarn bash"
subpackages="$pkgname-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/prometheus/prometheus/archive/v$pkgver.tar.gz
	prometheus.confd
	prometheus.initd
	"

build() {
	cd web/ui/react-app
	yarn --frozen-lockfile
	yarn lint
	cd ../../../
	./scripts/build_react_app.sh
	cd web/ui
	go generate -x -v
	cd ../../
	gofmt -w ./web/ui

	go build \
		-trimpath \
		-mod=vendor \
		-ldflags "-extldflags $LDFLAGS" \
		-tags netgo,builtinassets \
		./cmd/prometheus
	go build \
		-trimpath \
		-mod=vendor \
		-ldflags "-extldflags $LDFLAGS" \
		./cmd/promtool
}

check() {
	go test ./...
}

package() {
	install -Dm755 prometheus "$pkgdir"/usr/bin/prometheus
	install -Dm755 promtool "$pkgdir"/usr/bin/promtool

	install -Dm644 "$srcdir"/prometheus.confd \
		"$pkgdir"/etc/conf.d/prometheus
	install -Dm755 "$srcdir"/prometheus.initd \
		"$pkgdir"/etc/init.d/prometheus
	install -dm644 "$pkgdir"/var/lib/prometheus/data

	install -Dm644 -t "$pkgdir"/etc/prometheus \
		documentation/examples/prometheus.yml

	mkdir -p "$pkgdir"/etc/prometheus/console_libraries
	for file in console_libraries/*
	do
		install -Dm644 -t "$pkgdir"/etc/prometheus/console_libraries/ "$file"
	done

	mkdir -p "$pkgdir"/etc/prometheus/consoles
	for file in consoles/*
	do
		install -Dm644 -t "$pkgdir"/etc/prometheus/consoles/ "$file"
	done
}

sha512sums="d325f72706f2cc7894c675e8c50d5e3cbe105896c4588ccf6b8f95562b0038dd6621721c1e40fcb9ede7d962d25a7cf72726f619a95c6462dcba9b071705625a  prometheus-2.18.0.tar.gz
24b34e586238d5b331639aa5c43b6a927692f251af2cea2787335eab30d2fc7d46975059595db4697ae0dc1d35b5e23cfc4e4b2e424442c209a05283ca22a239  prometheus.confd
70762af1c3aa04725a5e33407228f139e2a328c52a57bd17538901784cace8bea02d9fc8cdd7806c1713c2b2319655104204a06c4c3e8dc1ccdaaa2fd8215252  prometheus.initd"