1
0
Fork 0

added consul export sources

This commit is contained in:
Sangbum Kim 2016-03-31 22:50:55 +09:00
parent 20296ba592
commit fb31b1a876
5 changed files with 115 additions and 0 deletions

15
.SRCINFO Normal file
View File

@ -0,0 +1,15 @@
pkgbase = duff
pkgdesc = A command-line utility for quickly finding duplicates in a given set of files
pkgver = 0.5.2
pkgrel = 1
url = http://duff.sourceforge.net/
arch = i686
arch = x86_64
license = custom
depends = glibc
depends = sh
source = http://downloads.sourceforge.net/sourceforge/duff/duff-0.5.2.tar.gz
md5sums = 483f9216ebea14b090e0d71dbf7077ff
pkgname = duff

12
01-golang1_6.patch Normal file
View File

@ -0,0 +1,12 @@
--- a/Makefile.COMMON 2016-03-31 21:27:13.088391632 +0900
--- b/Makefile.COMMON 2016-03-31 21:27:13.088391632 +0900
+++ Makefile.COMMON 2016-03-31 21:40:00.450234289 +0900
@@ -44,7 +44,7 @@
GOOS ?= $(shell uname | tr A-Z a-z)
GOARCH ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m)))
-GO_VERSION ?= 1.5.1
+GO_VERSION ?= 1.6
GOURL ?= https://golang.org/dl
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH).tar.gz
GOPATH := $(CURDIR)/.build/gopath

45
PKGBUILD Normal file
View File

@ -0,0 +1,45 @@
# Maintainer: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Aaron Schaefer <aaron@elasticdog.com>
pkgname=consul-exporter
pkgver=0.2.0.r18.g673081d
pkgrel=1
pkgdesc="Export Consul service health to Prometheus."
arch=('i686' 'x86_64')
url="https://github.com/prometheus/consul_exporter"
license=('custom')
depends=('glibc' 'sh' 'go')
source=(
"$pkgname::git+https://github.com/prometheus/consul_exporter.git"
"01-golang1_6.patch"
"consul-exporter.service"
"consul-exporter.install")
install=consul-exporter.install
sha512sums=('SKIP'
'44c3236cc5925c89dce5af1e8620fceee8f2f0c3bcaccb3530865d25b9a67d9d2898d07f9782a6da9344e867a5f537285e8697aacfa05c19f96e705f167aeb4a')
pkgver() {
cd "$srcdir/$pkgname"
git describe --long --tags | sed -r 's/^go//;s/([^-]*-g)/r\1/;s/-/./g'
}
prepare(){
cd "$srcdir/$pkgname"
patch -p1 -i "$srcdir/01-golang1_6.patch"
mkdir -p "${srcdir}/gopath"
export GOPATH="${srcdir}/gopath"
}
build() {
cd ${srcdir}/${pkgname}
make
}
package() {
cd ${srcdir}/${pkgname}
install -D -m755 consul_exporter ${pkgdir}/usr/bin/${pkgname}
mkdir -p "${pkgdir}/usr/lib/systemd/system/"
install -pm 644 "${srcdir}/consul-exporter.service" "${pkgdir}/usr/lib/systemd/system/consul-exporter.service"
}

11
consul-exporter.install Normal file
View File

@ -0,0 +1,11 @@
post_install() {
systemctl daemon-reload
}
post_upgrade() {
post_install
}
post_remove() {
systemctl daemon-reload
}

32
consul-exporter.service Normal file
View File

@ -0,0 +1,32 @@
# Copyright 2014 Joukou Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[Unit]
Description=consul-exporter
Documentation=https://github.com/prometheus/consul_exporter
After=network.target
After=network-online.target
After=machines.target
[Service]
User=nobody
Group=nobody
Type=simple
Restart=on-failure
RestartSec=10s
ExecStart=/usr/bin/consul-exporter
[Install]
WantedBy=multi-user.target