summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Freyermuth2017-10-02 17:31:32 +0200
committerJulien Freyermuth2017-10-02 17:31:32 +0200
commitec1b73f561adda29b7317f3fe3e07cdb9e562b2b (patch)
tree5cbbff37322ee9b727668a2969abf25a86c62035
downloadaur-ec1b73f561adda29b7317f3fe3e07cdb9e562b2b.tar.gz
First commit
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD67
-rw-r--r--multiplehogc-0.0.1.tar.gzbin0 -> 1990 bytes
-rw-r--r--multiplehogc.install22
4 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fe1335af2f65
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+# Generated by mksrcinfo v8
+# Mon Oct 2 15:31:22 UTC 2017
+pkgbase = multiplehogc
+ pkgdesc = Launch many intances of hogc
+ pkgver = 0.0.1
+ pkgrel = 1
+ url = https://github.com/Chipsterjulien/multiplehogc
+ install = multiplehogc.install
+ arch = any
+ license = WTFPL
+ makedepends = go
+ options = !strip
+ source = multiplehogc-0.0.1.tar.gz
+ sha512sums = e3e029334b6f64ebb70719f7210267d4e2288af2ecb7940b7bcb83f1e3ac43092fabe5bdbf2147ed42125aad41efe975bd39af04a35244608c6e929f1d758de5
+
+pkgname = multiplehogc
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d0bd7fbb0d76
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,67 @@
+# Maintainer: Chipster Julien <julien dot chipster @ archlinux dot fr>
+
+pkgname=multiplehogc
+pkgver=0.0.1
+pkgrel=1
+pkgdesc="Launch many intances of hogc"
+arch=('any')
+url="https://github.com/Chipsterjulien/multiplehogc"
+license=('WTFPL')
+makedepends=('go')
+options=('!strip')
+#backup=('etc/mailmotion/mailmotion.toml')
+source=("$pkgname-$pkgver.tar.gz")
+install=multiplehogc.install
+
+_builddir="$pkgname-$pkgver"
+
+build() {
+ GOPATH_exist=1
+ if [ -z $GOPATH ]; then
+ # path don't exit
+ GOPATH_exist=0
+
+ # create gopath directory
+ mkdir -p .gopath/{bin,src}
+ # export var
+ export GOPATH=~/.gopath
+ fi
+
+ # Getting some libs
+ echo "Install go-logging"
+ go get github.com/op/go-logging
+ echo "Install viper"
+ go get github.com/spf13/viper
+ echo "Install email"
+ go get github.com/jordan-wright/email
+
+ cd "$_builddir"
+
+ go build || return 1
+
+ if [ $GOPATH_exist == 0 ]; then
+ rm -rf ~/.gopath
+ export GOPATH=
+ fi
+}
+
+package() {
+ cd "$_builddir"
+
+ # multiplehogc.toml
+ install -Dm644 cfg/"$pkgname"_sample.toml \
+ "$pkgdir"/etc/$pkgname/"$pkgname"_sample.toml || return 1
+
+ # Create log directory
+ install -dm755 "$pkgdir"/var/log/$pkgname || return 1
+
+ # multiplehogc.service
+ install -Dm644 systemd/"$pkgname".service \
+ "$pkgdir"/usr/lib/systemd/system/"$pkgname".service || return 1
+
+ # multiplehogc binary
+ install -m755 -o root -g root -D "$srcdir"/$pkgname-$pkgver/$pkgname-$pkgver \
+ "$pkgdir"/usr/bin/$pkgname || return 1
+}
+
+sha512sums=('e3e029334b6f64ebb70719f7210267d4e2288af2ecb7940b7bcb83f1e3ac43092fabe5bdbf2147ed42125aad41efe975bd39af04a35244608c6e929f1d758de5')
diff --git a/multiplehogc-0.0.1.tar.gz b/multiplehogc-0.0.1.tar.gz
new file mode 100644
index 000000000000..5a61f1309aad
--- /dev/null
+++ b/multiplehogc-0.0.1.tar.gz
Binary files differ
diff --git a/multiplehogc.install b/multiplehogc.install
new file mode 100644
index 000000000000..c9478737c6d9
--- /dev/null
+++ b/multiplehogc.install
@@ -0,0 +1,22 @@
+post_install() {
+ pkgname=multiplehogc
+
+ # Fixing membership
+ chown http: /var/log/$pkgname
+ chown -R http: /etc/$pkgname
+
+ true
+}
+
+post_upgrade() {
+ chown http: /var/log/$pkgname
+ chown -R http: /etc/$pkgname
+
+ true
+}
+
+pre_remove() {
+ systemctl disable multiplehogc.service
+
+ true
+}