From 2c51c4d186134829aa84c1c07373f20cd2ebd277 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 24 Feb 2017 02:20:02 +0100 Subject: Reorganize snap. Add daemon wrapper --- contrib/snap/daemon.bash | 12 ------- contrib/snap/log.bash | 3 -- contrib/snap/monerod-wrapper | 8 +++++ contrib/snap/monerod.conf | 9 ++++++ contrib/snap/snapcraft.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++ contrib/snap/wallet.bash | 7 ----- 6 files changed, 92 insertions(+), 22 deletions(-) delete mode 100755 contrib/snap/daemon.bash delete mode 100755 contrib/snap/log.bash create mode 100644 contrib/snap/monerod-wrapper create mode 100644 contrib/snap/monerod.conf create mode 100644 contrib/snap/snapcraft.yaml delete mode 100755 contrib/snap/wallet.bash (limited to 'contrib') diff --git a/contrib/snap/daemon.bash b/contrib/snap/daemon.bash deleted file mode 100755 index 41d1275de..000000000 --- a/contrib/snap/daemon.bash +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -e - -export LD_LIBRARY_PATH=${SNAP_LIBRARY_PATH}:${SNAP}/usr/lib/x86_64-linux-gnu -export HOME=${SNAP_DATA} -cd ${SNAP_DATA} - -ARGS= -if [ -e "${SNAP_DATA}/etc/monerod.conf" ]; then - ARGS="--config-file ${SNAP_DATA}/etc/monerod.conf" -fi - -exec ${SNAP}/bin/monerod --detach $ARGS diff --git a/contrib/snap/log.bash b/contrib/snap/log.bash deleted file mode 100755 index c81efeb2c..000000000 --- a/contrib/snap/log.bash +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -e - -exec tail -c +0 -F ${SNAP_DATA}/.bitmonero/bitmonero.log diff --git a/contrib/snap/monerod-wrapper b/contrib/snap/monerod-wrapper new file mode 100644 index 000000000..f7266e11c --- /dev/null +++ b/contrib/snap/monerod-wrapper @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ ! -d "$SNAP_USER_DATA/etc" ]; then + mkdir $SNAP_USER_DATA/etc/ + cp -R $SNAP/etc/monerod.conf $SNAP_USER_DATA/etc/monerod.conf +fi + +exec "$SNAP/bin/monerod" "$@" diff --git a/contrib/snap/monerod.conf b/contrib/snap/monerod.conf new file mode 100644 index 000000000..9b3d308ed --- /dev/null +++ b/contrib/snap/monerod.conf @@ -0,0 +1,9 @@ +# Configuration for monerod +# Syntax: any command line option may be specified as 'clioptionname=value'. +# See 'monerod --help' for all available options. + +# Overrided by snap: +# data-dir=/var/lib/monero +# log-file=/var/log/monero/monero.log + +log-level=0 diff --git a/contrib/snap/snapcraft.yaml b/contrib/snap/snapcraft.yaml new file mode 100644 index 000000000..8ed4413ac --- /dev/null +++ b/contrib/snap/snapcraft.yaml @@ -0,0 +1,75 @@ +name: monero +version: 0.10.2-1 +summary: "Monero: the secure, private, untraceable cryptocurrency https://getmonero.org" +description: | + Monero is a private, secure, untraceable, decentralised digital currency. + You are your bank, you control your funds, and nobody can trace your transfers + unless you allow them to do so. +grade: devel +confinement: strict + +apps: + monerod: + daemon: forking + command: | + monerod-wrapper --detach --data-dir ${SNAP_COMMON} --config-file ${SNAP_USER_DATA}/etc/monerod.conf + plugs: + - network + - network-bind + monero-wallet-rpc: + command: | + monero-wallet-rpc --log-file ${SNAP_USER_DATA} + plugs: + - home + - network + - network-bind + monero-wallet-cli: + command: | + monero-wallet-cli --log-file ${SNAP_USER_DATA} + plugs: + - home + - network + +parts: + cmake-build: + plugin: cmake + configflags: + - -DBDB_STATIC=1 + - -DUPNP_STATIC=1 + - -DBoost_USE_STATIC_LIBS=1 + - -DBoost_USE_STATIC_RUNTIME=1 + - -DARCH=default + source: . + build-packages: + - gcc + - pkg-config + - libunbound-dev + - libevent-dev + - libboost-all-dev + - libdb-dev + - libunwind-dev + - libminiupnpc-dev + - libldns-dev + - libexpat1-dev + - bison + - doxygen + - graphviz + stage-packages: + - libminiupnpc10 + - libunbound2 + - libunwind8 + prime: + - bin + - usr/lib/ + - -usr/lib/gcc + - -usr/share + + dist-files: + plugin: dump + source: . + organize: + contrib/snap/monerod.conf: etc/monerod.conf + wrapper: + plugin: dump + source: contrib/snap/ + stage: [monerod-wrapper] diff --git a/contrib/snap/wallet.bash b/contrib/snap/wallet.bash deleted file mode 100755 index 004f1371e..000000000 --- a/contrib/snap/wallet.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -export LD_LIBRARY_PATH=${SNAP_LIBRARY_PATH}:${SNAP}/usr/lib/x86_64-linux-gnu -export HOME=${SNAP_USER_DATA} -cd ${SNAP_USER_DATA} - -exec ${SNAP}/usr/bin/rlwrap ${SNAP}/bin/monero-wallet-cli "$@" -- cgit v1.2.3 From b4c90d56457712b2ec8f25b88a13f19b526927d6 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 24 Feb 2017 02:52:15 +0100 Subject: Add meta icon for snap --- contrib/snap/setup/gui/icon.png | Bin 0 -> 19132 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 contrib/snap/setup/gui/icon.png (limited to 'contrib') diff --git a/contrib/snap/setup/gui/icon.png b/contrib/snap/setup/gui/icon.png new file mode 100644 index 000000000..17b8bd47b Binary files /dev/null and b/contrib/snap/setup/gui/icon.png differ -- cgit v1.2.3 From 38b9226f44021360622406f69b2f644eba6615c5 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 24 Feb 2017 02:53:59 +0100 Subject: wrapper +x --- contrib/snap/monerod-wrapper | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 contrib/snap/monerod-wrapper (limited to 'contrib') diff --git a/contrib/snap/monerod-wrapper b/contrib/snap/monerod-wrapper old mode 100644 new mode 100755 -- cgit v1.2.3 From 5db8df7bb63edb5f862fceeb493b502f76d0a260 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 24 Feb 2017 03:28:22 +0100 Subject: Unify dist files and prime --- contrib/snap/snapcraft.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/snap/snapcraft.yaml b/contrib/snap/snapcraft.yaml index 8ed4413ac..11d480d10 100644 --- a/contrib/snap/snapcraft.yaml +++ b/contrib/snap/snapcraft.yaml @@ -69,7 +69,7 @@ parts: source: . organize: contrib/snap/monerod.conf: etc/monerod.conf - wrapper: - plugin: dump - source: contrib/snap/ - stage: [monerod-wrapper] + contrib/snap/monerod-wrapper: bin/monerod-wrapper + prime: + - etc + - bin -- cgit v1.2.3