[TASK] add archlinux

This commit is contained in:
Martin Geno 2017-04-06 17:14:09 +02:00
parent c9ccf4d10a
commit 26a118d737
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
6 changed files with 56 additions and 1 deletions

View File

@ -23,7 +23,7 @@ webroot = "/var/www/html/meshviewer"
enable = true
# state-version of nodes.json to store cached data,
# these is the directly collected respondd data
state_path = "/var/lib/collector/state.json"
state_path = "/var/lib/yanic/state.json"
# Export nodes and graph periodically
save_interval = "5s"

3
contrib/packages/archlinux/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
pkg/
src/
yanic*.pkg.tar

View File

@ -0,0 +1,37 @@
# $Id$
# Maintainer Geno <geno+ffhb@fireorbit.de>
pkgname=yanic
pkgver=0.1
pkgrel=1
pkgdesc='Yet an nother node info collector'
url='https://github.com/FreifunkBremen/yanic'
arch=('x86_64' 'i686')
makedepends=('git' 'go')
backup=("etc/yanic.conf")
source=("yanic.conf"
"yanic.service")
md5sums=('SKIP'
'SKIP')
install='yanic.install'
prepare () {
msg2 "patch config to default http"
sed -e 's/\/var\/www\/html\//\/srv\/http\//g' yanic.conf > yanic-tmp.conf
sed -e 's/\/opt\/go\/bin/\/usr\/bin/g' yanic.service > yanic-tmp.service
}
build() {
msg2 "GOPATH setup"
export GOPATH="$srcdir/gopath"
export PATH+=":$GOPATH/bin"
go get -v -u github.com/FreifunkBremen/yanic/cmd/...
}
package() {
install -Dm644 yanic-tmp.conf "$pkgdir/etc/yanic.conf"
install -Dm644 yanic-tmp.service "$pkgdir/usr/lib/systemd/system/yanic.service"
install -Dsm755 "$GOPATH/bin/yanic" "$pkgdir/usr/bin/yanic"
install -Dsm755 "$GOPATH/bin/yanic-query" "$pkgdir/usr/bin/yanic-query"
}

View File

@ -0,0 +1 @@
../../../config_example.toml

View File

@ -0,0 +1,13 @@
post_install() {
getent group yanic >/dev/null || groupadd yanic
getent passwd yanic >/dev/null || useradd -d /var/lib/yanic -g yanic -r -M -s /bin/false yanic
mkdir -p /srv/http/meshviewer/data /var/lib/yanic
chown yanic:yanic /var/lib/yanic /etc/yanic.conf
chown yanic:http /srv/http/meshviewer/data
chown http:http /srv/http/meshviewer
}
post_upgrade() {
systemctl daemon-reload
}

View File

@ -0,0 +1 @@
../../init/linux-systemd/yanic.service