OCaml 4.14.0 rebuild
[arch-packages.git] / prometheus-mysqld-exporter / repos / extra-x86_64 / PKGBUILD
blob4e10d0cdbf998b3a2d5c0221a6f7e2521c86e28b
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
2 # Contributor: Jakob Gahde <j5lx@fmail.co.uk>
4 pkgname=prometheus-mysqld-exporter
5 pkgver=0.13.0
6 pkgrel=2
7 pkgdesc="Prometheus exporter for MySQL server metrics"
8 arch=('x86_64')
9 url="https://github.com/prometheus/mysqld_exporter"
10 license=('Apache')
11 depends=('glibc')
12 makedepends=('go')
13 options=(!lto)
14 backup=('etc/conf.d/prometheus-mysqld-exporter')
15 source=("mysql_exporter-${pkgver}.tar.gz::https://github.com/prometheus/mysqld_exporter/archive/v${pkgver}.tar.gz"
16         "prometheus-mysqld-exporter.service"
17         "prometheus-mysqld-exporter.conf")
18 sha512sums=('9e40d2cf3c634909c51655808f73666c423df71fef2a617b434ef47721c3a9beecc530a232259f546eb536e2c16eaea5b35b42b9777441fc1276062b13dde5ec'
19             '50619f4fa62c97c9c3533dc6a18024e2f2548e72b79e4cabae766d8b2135b4a5fdc9a6af87a279ecbae9101feac642851f2e239333a181b0db8d48af75eeac6c'
20             'c13a99a42e5a28e2be1287c337aa0f351dc8ffdbafb903e51a360d00aecf1d49d2b28b73e3741cdf681cb18c33546ae2088a8dab8bc4908b5c5ef008500b40fb')
22 build() {
23   cd "mysqld_exporter-${pkgver}"
25   go build \
26     -trimpath \
27     -buildmode=pie \
28     -mod=readonly \
29     -modcacherw \
30     -ldflags "-extldflags ${LDFLAGS}
31       -X github.com/prometheus/common/version.Version=${pkgver} \
32       -X github.com/prometheus/common/version.Revision=${pkgver} \
33       -X github.com/prometheus/common/version.Branch=tarball \
34       -X github.com/prometheus/common/version.BuildUser=someone@builder \
35       -X github.com/prometheus/common/version.BuildDate=$(date -d@"${SOURCE_DATE_EPOCH}" +%Y%m%d-%T)" \
36     .
39 package() {
40   install -Dm644 "prometheus-mysqld-exporter.service" \
41     "${pkgdir}/usr/lib/systemd/system/prometheus-mysqld-exporter.service"
42   install -Dm644 "prometheus-mysqld-exporter.conf" \
43     "${pkgdir}/etc/conf.d/prometheus-mysqld-exporter"
45   cd "mysqld_exporter-${pkgver}"
46   install -Dm755 "mysqld_exporter" "${pkgdir}/usr/bin/prometheus-mysqld-exporter"