summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomZ2018-03-08 16:38:52 +0100
committerTomZ2018-03-08 19:56:45 +0100
commit32d62b7d7e740d87f291f9cefa3b88fa781aa21f (patch)
treedd34c151326cc3eb577d100927e1e75e9d14f306
parentb54211026369e580259f20954ef963afb7b9435e (diff)
downloadaur-32d62b7d7e740d87f291f9cefa3b88fa781aa21f.tar.gz
Make this actually compile and install Flowee.
This is a 'git' build.
-rw-r--r--.SRCINFO24
-rw-r--r--PKGBUILD49
-rw-r--r--flowee.conf6
-rw-r--r--flowee.install49
-rw-r--r--flowee.logrotate11
-rw-r--r--logs.conf20
6 files changed, 149 insertions, 10 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d5df16da418..e94b349a1d3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,27 @@
pkgbase = flowee
- pkgdesc = flowee
- pkgver = 1.0
+ pkgdesc = Flowee the Hub
+ pkgver = 0.1
pkgrel = 1
- url = https://flowee.org/
+ url = http://flowee.org/
+ install = flowee.install
arch = i686
arch = x86_64
- license = GPLv3
+ license = GPL
+ makedepends = boost
+ makedepends = cmake
+ depends = boost-libs
+ depends = libevent
+ depends = openssl
+ depends = miniupnpc
+ depends = zeromq
+ provides = flowee-hub
+ backup = etc/flowee/flowee.conf
+ source = git+https://github.com/floweethehub/hub.git#branch=master
+ source = flowee.logrotate
+ source = flowee.conf
+ sha256sums = SKIP
+ sha256sums = d09fe561ed2b5fa0abf40bb5bfce0d6294b3747f97b94b473d040bda7b212985
+ sha256sums = f10260c2c4453f07850a7e02dd8d859e65fcaf54ce93f5b69d18e757454fda45
pkgname = flowee
diff --git a/PKGBUILD b/PKGBUILD
index 93440488ee7..85d4ab4a409 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,52 @@
# Maintainer: Tom Zander
pkgname=flowee
+pkgver=ecc0613f
pkgrel=1
-pkgver=1.0
-pkgdesc='flowee'
+pkgdesc="Flowee the Hub"
arch=('i686' 'x86_64')
-url="https://flowee.org/"
-license=('GPLv3')
+url="http://flowee.org/"
+license=('GPL')
+depends=('boost-libs' 'libevent' 'openssl')
+makedepends=('boost' 'cmake')
+provides=('flowee-hub')
+backup=("etc/flowee/flowee.conf")
+install=flowee.install
+source=("git+https://github.com/floweethehub/hub.git#branch=master"
+ "flowee.logrotate"
+ "flowee.conf"
+ "logs.conf")
+sha256sums=('SKIP'
+ "d09fe561ed2b5fa0abf40bb5bfce0d6294b3747f97b94b473d040bda7b212985"
+ "bc14acf0d1b4064553756a1e81c0b943e842296f2a2af6442e480b846392e6bc"
+ "635bf93ae346f7a8f4baf61d2d8316aa24647e87d23847876302330cb1e1191b")
+
+pkgver() {
+ cd "$srcdir/hub"
+ git rev-parse --short HEAD
+}
+
+build() {
+ mkdir -p build
+ cd build
+ cmake -Dmark_release=true -Dbuild_tests=true -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$pkgdir/usr/ ../hub
+ make -j1 univalue
+ make
+}
+
+check() {
+ ./build/testing/test/test_hub
+}
package() {
- echo "Soon"
- exit 1
+ cd build
+ make install
+ cd "$pkgdir"
+ mv usr/etc .
+ chmod 775 etc/flowee
+ mv etc/flowee/flowee.conf etc/flowee/flowee-example.conf
+ install -Dm 664 "$srcdir/flowee.conf" -t "$pkgdir/etc/flowee"
+ install -Dm 664 "$srcdir/logs.conf" -t "$pkgdir/etc/flowee"
+ install -Dm 644 "$srcdir/hub/support/thehub.service" -t "$pkgdir/usr/lib/systemd/system"
}
diff --git a/flowee.conf b/flowee.conf
new file mode 100644
index 00000000000..193d7979cd5
--- /dev/null
+++ b/flowee.conf
@@ -0,0 +1,6 @@
+# Defaults that are also passed in by systemd
+datadir=/var/lib/flowee
+pid=/var/lib/flowee/hub.pid
+
+# make the cookie go to /etc/flowee
+rpccookiefile=/etc/flowee/.cookie
diff --git a/flowee.install b/flowee.install
new file mode 100644
index 00000000000..694e989c254
--- /dev/null
+++ b/flowee.install
@@ -0,0 +1,49 @@
+_bc_user=flowee
+_bc_group=flowee
+
+post_install() {
+ _mkuser
+ _dir="/var/lib/flowee"
+ _log="/var/log/flowee"
+ _cnf="/etc/flowee"
+ if test ! -d "$_dir"; then
+ mkdir -m 750 "$_dir"
+ # disable Copy-On-Write (btrfs directories only)
+ # This avoids lots of known db-corruption issues
+ _is_btrfs "$_dir" && chattr +C "$_dir"
+ fi
+ mkdir -p -m 770 "$_log"
+ chown -R $_bc_user:$_bc_group "$_dir" "$_cnf" "$_log"
+}
+
+post_upgrade() {
+ _mkuser
+}
+
+
+# ------------------------------------------------------------------------------
+# helper functions for creating flowee user / group
+# ------------------------------------------------------------------------------
+
+_mkuser() {
+ getent passwd $_bc_user &>/dev/null || {
+ echo -n "Creating flowee user... "
+ grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group
+ useradd -m -d /etc/flowee -g $_bc_group -s /usr/bin/nologin $_bc_user 2>/dev/null
+ echo "done"
+ }
+}
+
+# ------------------------------------------------------------------------------
+# helper functions for disabling btrfs Copy-On-Write (CoW)
+# https://wiki.archlinux.org/index.php/Btrfs#Copy-On-Write_.28CoW.29
+# ------------------------------------------------------------------------------
+
+# check if dir is btrfs
+_is_btrfs() {
+ if [[ $(findmnt --target $1 --output FSTYPE --noheadings) == 'btrfs' ]]; then
+ return 0
+ else
+ return 1
+ fi
+}
diff --git a/flowee.logrotate b/flowee.logrotate
new file mode 100644
index 00000000000..299e0fa9045
--- /dev/null
+++ b/flowee.logrotate
@@ -0,0 +1,11 @@
+/var/lib/flowee/debug.log
+{
+ rotate 5
+ copytruncate
+ daily
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+}
diff --git a/logs.conf b/logs.conf
new file mode 100644
index 00000000000..95e0b40b23d
--- /dev/null
+++ b/logs.conf
@@ -0,0 +1,20 @@
+# Flowee the Hub log config.
+# See for more details http://flowee.org/hub/log-config/
+
+channel file
+ # timestamp option takes [time, millisecond, date]. Any combination allowed. None of these 3 for no timestamps
+ option timestamp time millisecond
+ option path /var/log/flowee/hub.log
+
+# this makes the log go to the journal.
+channel console
+
+##### Set the verbosity of the logging per log-section
+# See for more details http://flowee.org/hub/log-sections/
+
+# silent only shows fatal
+# quiet only shows critical and fatal
+# info shows warning, info, critical and fatal
+# debug shows everything.
+
+ALL quiet