PKGBUILDs/community/consul/PKGBUILD
2018-09-14 13:48:14 +00:00

83 lines
3.4 KiB
Bash

# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix ARM build
pkgname=consul
pkgver=1.2.3
pkgrel=1
pkgdesc="A tool for service discovery, monitoring and configuration."
arch=('x86_64')
_gocli_commit='3d22a244be8aa6fb16ac24af0e195c08b7d973aa' # HEAD
url="https://www.consul.io"
license=('MPL2')
depends=('glibc')
makedepends=('git' 'go-pie' 'procps-ng' 'zip')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/hashicorp/consul/archive/v${pkgver}.tar.gz"
"gocli::git+https://github.com/mitchellh/cli#commit=${_gocli_commit}"
'consul.service'
'consul.default'
'consul.sysusers'
'example.json'
'fix-build-version-info.patch'
'0001-fix-ARM-build.patch')
install=consul.install
backup=('etc/default/consul')
sha512sums=('71a7dbfc031df4a96faf2ddd829f289e96adefd0e0087208bbdd26e742a24e3da05fceea4181eb915703ad3323ed5b02bf74eb3fdfbed1e9a1afa2f74acb2a34'
'SKIP'
'c70b9d1556f6c7ecb2e915ab685f289cef0e31198bd2e50c74a0483bbfb387beec67334f539a90adbf68b61b07946e98b300ab8a8e26e53b35f4ab4894adeb04'
'ec5a800529a297c709fa383c094ecf106351cf0f8ac7b613b972d415d77fe001088902d7ab805e63e78a8e6360323fec1b795db5a4446df1e21b9b4ed31e7079'
'ef872aedb2bc022a29292b7972a792b22e684c1ccb904a2b2cfec6d8966c28fb19be1452ce060821c419f1b646b236ba2e783175595e4bb6926d164c27a15c87'
'c4292b8f56ee955ed7385a49843fd90d6434029891b3e1e724cb2fc841514c06e2554a26d3937c114371b18c2168c4e64319eb2cbd726ee8b35870df19089348'
'6709e51ff57fbe8118e7c9b38c99ef096a62d0c88ac2694e8c86065052cd2600f65dd9ac7f4a7e60712c26d15355f938cd9d98684955f4a02b2d5adfe1c2c04e'
'b9be57fc21ffccd5083ceccd96937d8d1e83b9e411b0ad1c4b79daad74aa11746afa360b937724cd6d559a9d679774e0abbaefe519bca6ad0b94462c57159f58')
prepare() {
export GOPATH="${srcdir}"
export PATH="$PATH:$GOPATH/bin"
mkdir -p "src/github.com/mitchellh"
mkdir -p "src/github.com/hashicorp"
mv "${pkgname}-${pkgver}" "${srcdir}/src/github.com/hashicorp/${pkgname}"
mv "gocli" "${srcdir}/src/github.com/mitchellh/cli"
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
# use proper release build version string (w/o '-dev' suffix)
patch -p1 -N -l -i "${srcdir}/fix-build-version-info.patch"
# disable syslog test (requires running syslog service)
rm ./logger/syslog_test.go
# fix ARM build
patch -p1 -i "${srcdir}/0001-fix-ARM-build.patch"
}
build() {
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
# weird race conditions when being run with more than 1 thread...
taskset --cpu-list 0 make linux
}
check() {
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
# weird race conditions when being run with more than 1 thread...
taskset --cpu-list 0 make test
}
package() {
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
install -D -d -m750 -o 208 -g 208 "${pkgdir}/var/lib/consul"
install -D -d -m750 -o 0 -g 208 "${pkgdir}/etc/consul.d"
install -D -m644 "${srcdir}/consul.default" "${pkgdir}/etc/default/consul"
install -D -m644 -o 0 -g 0 "${srcdir}/example.json" "${pkgdir}/usr/share/doc/consul/config.example.json"
install -Dm755 "bin/consul" "${pkgdir}/usr/bin/consul"
install -Dm644 "${srcdir}/consul.service" "${pkgdir}/usr/lib/systemd/system/consul.service"
install -Dm644 "${srcdir}/consul.sysusers" "${pkgdir}/usr/lib/sysusers.d/consul.conf"
}
# vim:set ts=2 sw=2 et: