summaryrefslogtreecommitdiff
path: root/net-p2p/litecoin/files
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2019-08-27 13:44:17 +0000
committerAlex Dupre <ale@FreeBSD.org>2019-08-27 13:44:17 +0000
commitbf8943b55d80c290aabc90d3f663d130cf660b50 (patch)
treee6ad0ce9e5894535e362bcbe8b70c348850eee85 /net-p2p/litecoin/files
parentFix build on gcc-based systems by adding c++11-lang to USES: (diff)
Update to 0.17.1 release and add the option (default enabled) to use
a newer BDB version (sync with bitcoin port). PR: 240058 Submitted by: ale Approved by: maintainer
Notes
Notes: svn path=/head/; revision=510014
Diffstat (limited to 'net-p2p/litecoin/files')
-rw-r--r--net-p2p/litecoin/files/litecoin-qt.desktop14
-rw-r--r--net-p2p/litecoin/files/litecoind.in176
-rw-r--r--net-p2p/litecoin/files/patch-src_leveldb_helpers_memenv_memenv.cc11
3 files changed, 157 insertions, 44 deletions
diff --git a/net-p2p/litecoin/files/litecoin-qt.desktop b/net-p2p/litecoin/files/litecoin-qt.desktop
new file mode 100644
index 000000000000..f12626c756af
--- /dev/null
+++ b/net-p2p/litecoin/files/litecoin-qt.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Version=1.0
+Name=Litecoin Core
+Comment=Connect to the Litecoin P2P Network
+Comment[de]=Verbinde mit dem Litecoin peer-to-peer Netzwerk
+Comment[fr]=Litecoin, monnaie virtuelle cryptographique pair à pair
+Comment[tr]=Litecoin, esten ese kriptografik sanal para birimi
+Exec=litecoin-qt %u
+Terminal=false
+Type=Application
+Icon=litecoin
+MimeType=x-scheme-handler/litecoin;
+Categories=Office;Finance;
+StartupWMClass=Litecoin-qt
diff --git a/net-p2p/litecoin/files/litecoind.in b/net-p2p/litecoin/files/litecoind.in
index 040043c434bb..3691daf3ec03 100644
--- a/net-p2p/litecoin/files/litecoind.in
+++ b/net-p2p/litecoin/files/litecoind.in
@@ -2,7 +2,7 @@
# $FreeBSD$
# PROVIDE: litecoind
-# REQUIRE: DAEMON cleanvar
+# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
@@ -10,53 +10,163 @@
# litecoind_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable litecoind
# litecoind_user (str) Set to "litecoin" by default.
-# Set it to preferred user
# litecoind_group (str) Set to "litecoin" by default.
-# Set it to preferred group
-# litecoind_data_dir (str) Set to "/var/lib/litecoin" by default.
-# Set it to preferred data dir
-# litecoind_config_file (str) Set to "%%PREFIX%%/etc/litecoind.conf" by default.
-# Set it to preferred config file
-# litecoind_log_file (str) Set to "/var/log/litecoind.log" by default.
-# Set it to preferred log file
+# litecoind_conf (str) Set to "%%PREFIX%%/etc/litecoind.conf" by default.
+# litecoind_data_dir (str) Set to "/var/db/litecoin" by default.
+# litecoindlimits_enable (bool) Set to "NO" by default.
+# Set it to "YES" to enable litecoindlimits
+# litecoindlimits_args Set to "-e -U ${litecoind_user}" by default
+
. /etc/rc.subr
-name=litecoind
-desc="Litecoin Daemon"
+name="litecoind"
rcvar=litecoind_enable
+start_precmd="litecoind_precmd"
+start_cmd="litecoind_start"
+restart_precmd="litecoind_checkconfig"
+reload_precmd="litecoind_checkconfig"
+configtest_cmd="litecoind_checkconfig"
+status_cmd="litecoind_status"
+stop_cmd="litecoind_stop"
+stop_postcmd="litecoind_wait"
+command="%%PREFIX%%/bin/litecoind"
+daemon_command="/usr/sbin/daemon"
+#pidfile="/var/run/${name}.pid"
+extra_commands="configtest"
+
+
+: ${litecoind_enable:="NO"}
+: ${litecoindlimits_enable:="NO"}
+
load_rc_config ${name}
-: ${litecoind_enable:=NO}
-: ${litecoind_user:=litecoin}
-: ${litecoind_group:=litecoin}
-: ${litecoind_data_dir:=/var/db/litecoin}
-: ${litecoind_config_file:=%%PREFIX%%/etc/litecoin.conf}
-: ${litecoind_log_file:=/var/log/litecoind.log}
+: ${litecoind_user:="litecoin"}
+: ${litecoind_group:="litecoin"}
+: ${litecoind_data_dir:="/var/db/litecoin"}
+: ${litecoind_config_file:="%%PREFIX%%/etc/litecoin.conf"}
+: ${litecoindlimits_args:="-e -U ${litecoind_user}"}
+# set up dependant variables
+procname="${command}"
+pidfile="${litecoind_data_dir}/litecoind.pid"
required_files="${litecoind_config_file}"
-litecoind_chdir="${litecoind_data_dir}"
-litecoind_env="HOME=${litecoind_data_dir}"
-pidfile="/var/run/${name}.pid"
-command="%%PREFIX%%/bin/litecoind"
-command_args="-daemon -pid=${pidfile} -conf=${litecoind_config_file} -datadir=${litecoind_data_dir} > ${litecoind_log_file} 2>&1"
-start_precmd=litecoind_startprecmd
-litecoind_startprecmd()
+litecoind_checkconfig()
+{
+ echo "Performing sanity check on litecoind configuration:"
+ if [ ! -d "${litecoind_data_dir}" ]
+ then
+ echo "Missing data directory: ${litecoind_data_dir}"
+ exit 1
+ fi
+ chown -R "${litecoind_user}:${litecoind_group}" "${litecoind_data_dir}"
+
+ if [ ! -f "${litecoind_config_file}" ]
+ then
+ echo "Missing configuration file: ${litecoind_config_file}"
+ exit 1
+ fi
+ if [ ! -x "${command}" ]
+ then
+ echo "Missing executable: ${command}"
+ exit 1
+ fi
+ return 0
+}
+
+litecoind_cleanup()
+{
+ rm -f "${pidfile}"
+}
+
+litecoind_precmd()
{
- if [ ! -e ${pidfile} ]; then
- install -o ${litecoind_user} -g ${litecoind_group} /dev/null ${pidfile};
- fi
+ litecoind_checkconfig
- if [ ! -e ${litecoind_log_file} ]; then
- install -o ${litecoind_user} -g ${litecoind_group} /dev/null ${litecoind_log_file};
- fi
+ pid=$(check_pidfile "${pidfile}" "${procname}")
+ if [ -z "${pid}" ]
+ then
+ echo "Litecoind is not running"
+ rm -f "${pidfile}"
+ fi
- if [ ! -d ${litecoind_data_dir} ]; then
- install -d -o ${litecoind_user} -g ${litecoind_group} ${litecoind_data_dir}
- fi
+ if checkyesno litecoindlimits_enable
+ then
+ eval $(/usr/bin/limits ${litecoindlimits_args}) 2>/dev/null
+ else
+ return 0
+ fi
+}
+
+litecoind_status()
+{
+ local pid
+ pid=$(check_pidfile "${pidfile}" "${procname}")
+ if [ -z "${pid}" ]
+ then
+ echo "Litecoind is not running"
+ return 1
+ else
+ echo "Litecoind running, pid: ${pid}"
+ fi
+}
+
+litecoind_start()
+{
+ echo "Starting litecoind:"
+ cd "${litecoind_data_dir}" || return 1
+ ${daemon_command} -u "${litecoind_user}" -p "${pidfile}" -f \
+ ${command} \
+ -conf="${litecoind_config_file}" \
+ -datadir="${litecoind_data_dir}"
+}
+
+litecoind_stop()
+{
+ echo "Stopping litecoind:"
+ pid=$(check_pidfile "${pidfile}" "${procname}")
+ if [ -z "${pid}" ]
+ then
+ echo "Litecoind is not running"
+ return 1
+ else
+ kill ${pid}
+ fi
+}
+
+litecoind_wait()
+{
+ local n=60
+ echo "Waiting for litecoind shutdown:"
+ while :
+ do
+ printf '.'
+ pid=$(check_pidfile "${pidfile}" "${procname}")
+ if [ -z "${pid}" ]
+ then
+ printf '\n'
+ break
+ fi
+ sleep 1
+ n=$((${n} - 1))
+ if [ ${n} -eq 0 -a -f "${pidfile}" ]
+ then
+ printf "\nForce shutdown"
+ kill -9 $(cat "${pidfile}")
+ for n in 1 2 3
+ do
+ printf '.'
+ sleep 1
+ done
+ printf '\n'
+ break
+ fi
+ done
+ rm -f "${pidfile}"
+ echo "Shutdown complete"
}
run_rc_command "$1"
diff --git a/net-p2p/litecoin/files/patch-src_leveldb_helpers_memenv_memenv.cc b/net-p2p/litecoin/files/patch-src_leveldb_helpers_memenv_memenv.cc
deleted file mode 100644
index 98e900ffdd58..000000000000
--- a/net-p2p/litecoin/files/patch-src_leveldb_helpers_memenv_memenv.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/leveldb/helpers/memenv/memenv.cc.orig 2015-07-10 17:23:55 UTC
-+++ src/leveldb/helpers/memenv/memenv.cc
-@@ -2,6 +2,8 @@
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file. See the AUTHORS file for names of contributors.
-
-+#define __STDC_LIMIT_MACROS
-+
- #include "helpers/memenv/memenv.h"
-
- #include "leveldb/env.h"