archrelease: copy trunk to extra-x86_64
[arch-packages.git] / prometheus-mysqld-exporter / repos / extra-x86_64 / PKGBUILD
blob77814c5294ef38d9745e81dab9de678ccc49d3dd
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.14.0
6 pkgrel=1
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=('91728055fd66d3ba2d8c6f48eac24dcdbe710e627cb3c28af100fec1656064aafedbcfcfcb8c2f164dab9c3870c1867728e33afd57889644b27ceaadf0c59629'
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"