2.0.2-2: libplist 2.3.0
[arch-packages.git] / alertmanager / trunk / PKGBUILD
blobbf8ad8a8d3fc81adb5cfa0a07e1b968d7d4c8401
1 # Maintainer: Jelle van der Waa <jelle@archlinux.org>
3 pkgname=alertmanager
4 pkgver=0.25.0
5 pkgrel=1
6 pkgdesc="Service which handles alerts sent by client applications such as the Prometheus server"
7 url="https://github.com/prometheus/alertmanager"
8 arch=(x86_64)
9 depends=(glibc)
10 license=('Apache')
11 makedepends=(go git)
12 options=(!lto)
13 backup=('etc/alertmanager/alertmanager.yml' 'etc/conf.d/alertmanager')
14 source=($pkgname-$pkgver.tar.gz::https://github.com/prometheus/alertmanager/archive/v${pkgver}.tar.gz
15         alertmanager.service
16         alertmanager.sysusers
17         alertmanager.conf)
18 sha512sums=('5628592694b684f5dd2097232720b472fbcfd474546da5270214c2d3c2c146aefd322e0432bb8de4606133dd27d0cfdacc6eb500a8b0bac55cd7023645cc0d1f'
19             'b16f14f0a1ff6462f263cfd10e62509adc2dbebdd10fa31d240892619fbef17dc593a33f0fbd0f32adb43d565f676fdc90bbd69a3a447d2a46deeef5f9916ae4'
20             '469f321f40b0dd6e1cc6d0791032c476449bb2ab2364d57b06d0e0309d09710be8751ded64d84e29dd6e28e96b71ef69e2bee6c71282500a9074a9d7ada8bdf0'
21             'dcb3d8a29e705c39b13cc8b876975ff1af88e86ba6d76c524aeba188acd2f97fea0278632bee7fd5f66cc0fe780aa9f4a6a98696025ca84c767eb5eae831de2f')
23 build() {
24   cd $pkgname-$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-%H:%M:%S)" \
36     ./cmd/alertmanager
38   go build \
39     -trimpath \
40     -buildmode=pie \
41     -mod=readonly \
42     -modcacherw \
43     -ldflags "-extldflags ${LDFLAGS} \
44       -X github.com/prometheus/common/version.Version=$pkgver \
45       -X github.com/prometheus/common/version.Revision=$pkgver \
46       -X github.com/prometheus/common/version.Branch=tarball \
47       -X github.com/prometheus/common/version.BuildUser=someone@builder \
48       -X github.com/prometheus/common/version.BuildDate=$(date -d@"$SOURCE_DATE_EPOCH" +%Y%m%d-%H:%M:%S)" \
49     ./cmd/amtool
52 package() {
53   cd $pkgname-$pkgver
54   install -Dm755 $pkgname "$pkgdir/usr/bin/$pkgname"
55   install -Dm755 amtool "$pkgdir/usr/bin/amtool"
57   install -Dm644 examples/ha/${pkgname}.yml "${pkgdir}/etc/${pkgname}/${pkgname}.yml"
58   install -d -m755 "${pkgdir}/etc/${pkgname}/template/"
60   install -d -m750 -o 211 -g 211 "${pkgdir}/var/lib/${pkgname}"
62   install -Dm0644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
63   install -Dm644 "$srcdir/alertmanager.sysusers" "$pkgdir/usr/lib/sysusers.d/alertmanager.conf"
64   install -Dm644 "$srcdir/alertmanager.conf" "$pkgdir/etc/conf.d/alertmanager"