PKGBUILDs/community/consul/PKGBUILD

93 lines
3.8 KiB
Bash
Raw Normal View History

2018-05-24 02:06:16 +00:00
# Maintainer: Thore Bödecker <foxxx0@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch to fix ARM build
2019-03-01 13:52:37 +00:00
# - remove export GOARCH='amd64'
2018-05-24 02:06:16 +00:00
pkgname=consul
2019-06-29 20:32:55 +00:00
pkgver=1.5.2
2018-06-26 12:47:02 +00:00
pkgrel=1
2018-05-24 02:06:16 +00:00
pkgdesc="A tool for service discovery, monitoring and configuration."
arch=('x86_64')
2018-09-14 13:48:14 +00:00
_gocli_commit='3d22a244be8aa6fb16ac24af0e195c08b7d973aa' # HEAD
2018-05-24 02:06:16 +00:00
url="https://www.consul.io"
license=('MPL2')
depends=('glibc')
2018-09-14 13:48:14 +00:00
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}"
2018-05-24 02:06:16 +00:00
'consul.service'
'consul.default'
'consul.sysusers'
'example.json'
'fix-build-version-info.patch'
2019-06-29 20:32:55 +00:00
'consul-ldflags.patch'
2019-03-01 13:52:37 +00:00
'unparallelize-or-disable-flaky-tests.patch'
2019-06-29 20:32:55 +00:00
'0001-fix-ARM-build.patch'
)
2018-05-24 02:06:16 +00:00
install=consul.install
2018-09-14 13:48:14 +00:00
backup=('etc/default/consul')
2019-06-29 20:32:55 +00:00
sha512sums=('e0820592abc5e119f74c8bf3d11a23726ee6dda7d193864a4486d64deef0bfd6ae4c9170b57d6f978e7ddfeb425229a019c45a8edcdea0938bce9315f2444fd6'
2018-05-24 02:06:16 +00:00
'SKIP'
'c70b9d1556f6c7ecb2e915ab685f289cef0e31198bd2e50c74a0483bbfb387beec67334f539a90adbf68b61b07946e98b300ab8a8e26e53b35f4ab4894adeb04'
'ec5a800529a297c709fa383c094ecf106351cf0f8ac7b613b972d415d77fe001088902d7ab805e63e78a8e6360323fec1b795db5a4446df1e21b9b4ed31e7079'
'ef872aedb2bc022a29292b7972a792b22e684c1ccb904a2b2cfec6d8966c28fb19be1452ce060821c419f1b646b236ba2e783175595e4bb6926d164c27a15c87'
'c4292b8f56ee955ed7385a49843fd90d6434029891b3e1e724cb2fc841514c06e2554a26d3937c114371b18c2168c4e64319eb2cbd726ee8b35870df19089348'
2019-06-29 20:32:55 +00:00
'8442826050639bf4a8799d5bdeb9778b5dbf45c7c557292209691a08d207ece6106e7f6711ccb1e252b7d1dbbff14f0deb72b4f07e664a304b91092d0afa447b'
'0d779e78bb5f5edafddcc3de1a754a6c39e3ce6dd7aa1387f491803f977b4a7d5e9a1eaa17d212be89109b191c91c2cdf4dd9728cffb3b724b28d20248ce8e12'
2019-03-01 13:52:37 +00:00
'b59b2733d598ae6648c198f26f23961d4c1ea8c693a1a5b1c16a0951400c3bb9a9d2d5efe4f0a5cca9ae3b1f225a8eb4133c9011c4125589e936c7dcdc4b2495'
2019-06-29 20:32:55 +00:00
'3f6c2d7e13bb13ee1614463f81a33eedbce8237b2e5189c78e3e12b00c38497a1f17eae8298d3276c4df8bf5e1f950ac62718f6a4ec5c07a94de2210efbc26bc')
2018-05-24 02:06:16 +00:00
prepare() {
export GOPATH="${srcdir}"
export PATH="$PATH:$GOPATH/bin"
mkdir -p "src/github.com/mitchellh"
mkdir -p "src/github.com/hashicorp"
2018-09-14 13:48:14 +00:00
mv "${pkgname}-${pkgver}" "${srcdir}/src/github.com/hashicorp/${pkgname}"
mv "gocli" "${srcdir}/src/github.com/mitchellh/cli"
2018-05-24 02:06:16 +00:00
2018-09-14 13:48:14 +00:00
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
2018-05-24 02:06:16 +00:00
2019-03-01 13:52:37 +00:00
local filename
for filename in "${source[@]}"; do
if [[ "$filename" =~ \.patch$ ]]; then
msg2 "Applying patch ${filename##*/}"
patch -p1 -N -l -i "$srcdir/${filename##*/}"
fi
done
2018-05-24 02:06:16 +00:00
}
build() {
2018-09-14 13:48:14 +00:00
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
2019-03-01 13:52:37 +00:00
export GOOS='linux'
make linux
2018-09-14 13:48:14 +00:00
}
2018-05-24 02:06:16 +00:00
2018-09-14 13:48:14 +00:00
check() {
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
2019-03-01 13:52:37 +00:00
# weird race conditions when being run overparallelized
export GOMAXPROCS="2"
export GOOS='linux'
export GOTEST_FLAGS="-p 2 -parallel 2"
2019-06-29 20:32:55 +00:00
export TRAVIS='true'
2019-03-01 13:52:37 +00:00
make -j1 test
2018-05-24 02:06:16 +00:00
}
package() {
2018-09-14 13:48:14 +00:00
cd "${srcdir}/src/github.com/hashicorp/${pkgname}"
2018-05-24 02:06:16 +00:00
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"
2018-09-14 13:48:14 +00:00
install -D -m644 -o 0 -g 0 "${srcdir}/example.json" "${pkgdir}/usr/share/doc/consul/config.example.json"
2018-06-26 12:47:02 +00:00
install -Dm755 "bin/consul" "${pkgdir}/usr/bin/consul"
2018-05-24 02:06:16 +00:00
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: