From e2ed24a6ed16a8e575914b19bc5310758d161b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Wed, 21 Oct 2020 22:18:49 +0200 Subject: [PATCH] go-ipfs: add runit service and use vcompletion --- srcpkgs/go-ipfs/files/ipfs/log/run | 2 ++ srcpkgs/go-ipfs/files/ipfs/run | 4 ++++ srcpkgs/go-ipfs/template | 9 +++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/go-ipfs/files/ipfs/log/run create mode 100755 srcpkgs/go-ipfs/files/ipfs/run diff --git a/srcpkgs/go-ipfs/files/ipfs/log/run b/srcpkgs/go-ipfs/files/ipfs/log/run new file mode 100644 index 00000000000..a402e8fae39 --- /dev/null +++ b/srcpkgs/go-ipfs/files/ipfs/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec vlogger -t ipfs diff --git a/srcpkgs/go-ipfs/files/ipfs/run b/srcpkgs/go-ipfs/files/ipfs/run new file mode 100755 index 00000000000..29690e65659 --- /dev/null +++ b/srcpkgs/go-ipfs/files/ipfs/run @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r conf ] && . ./conf +export IPFS_PATH=${IPFS_PATH:=/var/lib/ipfs} +exec chpst -u _ipfs ipfs daemon ${OPTS:=--init --enable-gc --migrate} 2>&1 diff --git a/srcpkgs/go-ipfs/template b/srcpkgs/go-ipfs/template index 96509787305..4f0a7e98403 100644 --- a/srcpkgs/go-ipfs/template +++ b/srcpkgs/go-ipfs/template @@ -1,7 +1,7 @@ # Template file for 'go-ipfs' pkgname=go-ipfs version=0.7.0 -revision=1 +revision=2 build_style=go go_import_path="github.com/ipfs/${pkgname}" go_package="${go_import_path}/cmd/ipfs" @@ -15,6 +15,10 @@ changelog="https://github.com/ipfs/go-ipfs/blob/master/CHANGELOG.md" distfiles="https://${go_import_path}/archive/v${version}.tar.gz" checksum=152986ebb30657ab706bee708fbe929114f5e8c39fbe602e3bbec93fe74c9123 +system_accounts="_ipfs" +make_dirs="/var/lib/ipfs 0700 _ipfs _ipfs" +_ipfs_homedir="/var/lib/ipfs" + pre_build() { if [ "$CROSS_BUILD" ]; then export CGO_ENABLED=0 @@ -22,8 +26,9 @@ pre_build() { } post_install() { - vinstall misc/completion/ipfs-completion.bash 644 usr/share/bash-completion/completions ipfs + vcompletion misc/completion/ipfs-completion.bash bash ipfs vlicense LICENSE-MIT vdoc README.md vdoc CHANGELOG.md + vsv ipfs }