aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2019-08-27 21:44:17 +0800
committerAlex Dupre <ale@FreeBSD.org>2019-08-27 21:44:17 +0800
commitbf8943b55d80c290aabc90d3f663d130cf660b50 (patch)
treee6ad0ce9e5894535e362bcbe8b70c348850eee85 /net-p2p
parent2281e4af35fb62751fbe07e15f39487b49bef9cc (diff)
downloadfreebsd-ports-gnome-bf8943b55d80c290aabc90d3f663d130cf660b50.tar.gz
freebsd-ports-gnome-bf8943b55d80c290aabc90d3f663d130cf660b50.tar.zst
freebsd-ports-gnome-bf8943b55d80c290aabc90d3f663d130cf660b50.zip
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
Diffstat (limited to 'net-p2p')
-rw-r--r--net-p2p/litecoin-daemon/Makefile15
-rw-r--r--net-p2p/litecoin-utils/Makefile10
-rw-r--r--net-p2p/litecoin/Makefile60
-rw-r--r--net-p2p/litecoin/distinfo6
-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
-rw-r--r--net-p2p/litecoin/pkg-help18
8 files changed, 224 insertions, 86 deletions
diff --git a/net-p2p/litecoin-daemon/Makefile b/net-p2p/litecoin-daemon/Makefile
index 61b458a82cfd..8d0b4204039f 100644
--- a/net-p2p/litecoin-daemon/Makefile
+++ b/net-p2p/litecoin-daemon/Makefile
@@ -7,17 +7,19 @@ COMMENT= Virtual Peer-to-Peer Currency (Daemon)
SLAVE_PORT= yes
-NOT_FOR_ARCHS= powerpc64 sparc64
+NOT_FOR_ARCHS= powerpc powerpc64 sparc64
NOT_FOR_ARCHS_REASON= configure: error: Big Endian not supported
+OPTIONS_DEFINE= DEBUG HARDENING TESTS UPNP ZMQ
+# WALLET_BDBMODERN is a choice for WALLET, introduced via OPTIONS_RADIO=WALLET
+# from ${MASTERDIR}/Makefile
+OPTIONS_DEFAULT= HARDENING UPNP WALLET_BDBMODERN ZMQ
+
USES+= cpe
CPE_VENDOR= bitcoin
CPE_PRODUCT= bitcoind
CPE_VERSION= ${PORTVERSION:R}
-OPTIONS_DEFINE= DEBUG HARDENING TESTS UPNP WALLET ZMQ
-OPTIONS_DEFAULT= HARDENING WALLET ZMQ
-
USERS= litecoin
GROUPS= litecoin
@@ -25,8 +27,7 @@ CONFIGURE_ARGS= --with-daemon \
--without-gui \
--without-libs \
--without-qrencode \
- --without-utils \
- --disable-reduce-exports
+ --without-utils
PLIST_FILES= bin/litecoind
PLIST_FILES+= man/man1/litecoind.1.gz
@@ -35,6 +36,6 @@ PLIST_FILES+= "@sample etc/litecoin.conf.sample"
USE_RC_SUBR= litecoind
post-install:
- ${INSTALL_DATA} ${WRKSRC}/contrib/debian/examples/bitcoin.conf ${STAGEDIR}${PREFIX}/etc/litecoin.conf.sample
+ ${INSTALL_DATA} ${WRKSRC}/share/examples/litecoin.conf ${STAGEDIR}${PREFIX}/etc/litecoin.conf.sample
.include "${MASTERDIR}/Makefile"
diff --git a/net-p2p/litecoin-utils/Makefile b/net-p2p/litecoin-utils/Makefile
index 9d0b46b4d8df..444042577fa8 100644
--- a/net-p2p/litecoin-utils/Makefile
+++ b/net-p2p/litecoin-utils/Makefile
@@ -4,22 +4,24 @@ MASTERDIR= ${.CURDIR}/../litecoin
PKGNAMESUFFIX= -utils
COMMENT= Virtual Peer-to-Peer Currency (CLI and Utilities)
-
SLAVE_PORT= yes
-NOT_FOR_ARCHS= powerpc64 sparc64
+NOT_FOR_ARCHS= powerpc powerpc64 sparc64
NOT_FOR_ARCHS_REASON= configure: error: Big Endian not supported
OPTIONS_DEFINE= DEBUG HARDENING TESTS
+OPTIONS_RADIO=
OPTIONS_DEFAULT= HARDENING TESTS
+PKGHELP= ${NONEXISTENT}
+
CONFIGURE_ARGS= --without-daemon \
--without-gui \
--without-libs \
--without-qrencode \
+ --without-miniupnpc \
--with-utils \
- --disable-wallet \
- --disable-reduce-exports
+ --disable-wallet
PLIST_FILES= bin/litecoin-cli bin/litecoin-tx \
man/man1/litecoin-cli.1.gz man/man1/litecoin-tx.1.gz
diff --git a/net-p2p/litecoin/Makefile b/net-p2p/litecoin/Makefile
index d7bf399296de..66c7721aa2a9 100644
--- a/net-p2p/litecoin/Makefile
+++ b/net-p2p/litecoin/Makefile
@@ -1,24 +1,21 @@
# $FreeBSD$
PORTNAME= litecoin
-PORTVERSION= 0.16.3
+PORTVERSION= 0.17.1
DISTVERSIONPREFIX= v
-PORTREVISION= 12
+PORTREVISION?= 0
CATEGORIES= net-p2p finance
MAINTAINER= hsw@bitmark.com
COMMENT?= Virtual Peer-to-Peer Currency Client (QT)
LICENSE= MIT
-LICENSE_FILE= ${WRKSRC}/COPYING
-
-NOT_FOR_ARCHS= powerpc powerpc64 sparc64
-NOT_FOR_ARCHS_REASON= fails to configure: "Big Endian not supported"
LIB_DEPENDS= libboost_date_time.so:devel/boost-libs \
libevent.so:devel/libevent
-USES+= autoreconf compiler:c++11-lib gmake libtool pkgconfig qt:5 ssl
+USES= autoreconf compiler:c++11-lib gmake libtool pkgconfig qt:5 shebangfix ssl
+
USE_GITHUB= yes
GNU_CONFIGURE= yes
@@ -32,24 +29,26 @@ USE_QT= core gui network widgets \
BUILD_DEPENDS+= protoc:devel/protobuf
LIB_DEPENDS+= libprotobuf.so:devel/protobuf
-TESTS_USES= qt:5
TESTS_USE= QT=testlib
TESTS_PLIST_FILES= bin/test_litecoin-qt \
bin/test_litecoin
.endif
-OPTIONS_DEFINE?= DBUS DEBUG HARDENING QRCODES TESTS UPNP WALLET ZMQ
-OPTIONS_DEFAULT?= DBUS HARDENING QRCODES UPNP WALLET ZMQ
+OPTIONS_DEFINE?= DBUS DEBUG HARDENING QRCODES TESTS UPNP ZMQ
+OPTIONS_RADIO?= WALLET
+OPTIONS_RADIO_WALLET?= WALLET_BDB48 WALLET_BDBMODERN
+OPTIONS_DEFAULT?= DBUS HARDENING QRCODES UPNP WALLET_BDBMODERN ZMQ
OPTIONS_SUB= yes
HARDENING_DESC= Attempt to harden binaries (PIE for ASLR, NX Stack)
QRCODES_DESC= Display QR Codes
TESTS_DESC= Build test binary and unit tests
WALLET_DESC= Wallet Management Support
+WALLET_BDB48_DESC= Wallet using BDB 4.8
+WALLET_BDBMODERN_DESC= Wallet using modern BDB 5.x or 6.x
ZMQ_DESC= Block and transaction broadcasting with ZeroMQ
DBUS_CONFIGURE_WITH= dbus
-DBUS_USES= qt:5
DBUS_USE= QT=dbus
DEBUG_CONFIGURE_ENABLE= debug
@@ -71,11 +70,6 @@ UPNP_LIBS= -L${LOCALBASE}/lib
QRCODES_CONFIGURE_WITH= qrencode
QRCODES_LIB_DEPENDS= libqrencode.so:graphics/libqrencode
-WALLET_CONFIGURE_ENABLE= wallet
-WALLET_CXXFLAGS= -I${BDB_INCLUDE_DIR}
-WALLET_LIBS= -L${BDB_LIB_DIR}
-WALLET_USES= bdb:48
-
ZMQ_CONFIGURE_ENABLE= zmq
ZMQ_BUILD_DEPENDS= libzmq4>0:net/libzmq4
ZMQ_RUN_DEPENDS= libzmq4>0:net/libzmq4
@@ -89,28 +83,38 @@ CONFIGURE_ARGS?= --without-libs \
CONFIGURE_ENV= CRYPTO_CFLAGS="-I${OPENSSLINC}" CRYPTO_LIBS="-L${OPENSSLLIB} -lcrypto" \
SSL_CFLAGS="-I${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl" \
- OBJCXX="${CXX}" OBJCXXFLAGS="${CXXFLAGS}" V=1
+ OBJCXX="${CXX}" OBJCXXFLAGS="${CXXFLAGS}"
MAKE_ENV+= V=1
PLIST_FILES?= bin/litecoin-qt man/man1/litecoin-qt.1.gz \
- share/applications/litecoin-qt.desktop share/pixmaps/litecoin128.png
+ share/applications/litecoin-qt.desktop share/pixmaps/litecoin.png
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MWALLET_BDB48}
+CONFIGURE_ARGS+= --enable-wallet
+USES+= bdb:48
+.elif ${PORT_OPTIONS:MWALLET_BDBMODERN}
+CONFIGURE_ARGS+= --enable-wallet --with-incompatible-bdb
+USES+= bdb:5+
+.else
+CONFIGURE_ARGS+= --disable-wallet
+.endif
.include <bsd.port.pre.mk>
-.if defined(SLAVE_PORT) && ${SLAVE_PORT} == "no"
+.if ${PORT_OPTIONS:MWALLET_BDB48} || ${PORT_OPTIONS:MWALLET_BDBMODERN}
+CPPFLAGS+= -I${BDB_INCLUDE_DIR}
+LIBS+= -L${BDB_LIB_DIR}
+.endif
-post-patch:
- @${REINPLACE_CMD} -e 's|bitcoin|litecoin|g' \
- -e 's|Bitcoin|Litecoin|g' \
- ${WRKSRC}/contrib/debian/bitcoin-qt.desktop
+.if defined(SLAVE_PORT) && ${SLAVE_PORT} == "no"
post-install:
- @${REINPLACE_CMD} -e 's,=/usr,=${PREFIX},' \
- ${WRKSRC}/contrib/debian/bitcoin-qt.desktop
- ${INSTALL} ${WRKSRC}/contrib/debian/bitcoin-qt.desktop \
- ${STAGEDIR}${PREFIX}/share/applications/litecoin-qt.desktop
+ ${INSTALL} ${FILESDIR}/litecoin-qt.desktop \
+ ${STAGEDIR}${PREFIX}/share/applications/
${INSTALL} ${WRKSRC}/share/pixmaps/bitcoin128.png \
- ${STAGEDIR}${PREFIX}/share/pixmaps/litecoin128.png
+ ${STAGEDIR}${PREFIX}/share/pixmaps/litecoin.png
.endif
diff --git a/net-p2p/litecoin/distinfo b/net-p2p/litecoin/distinfo
index e71df13d23c1..ac04b4eb34f8 100644
--- a/net-p2p/litecoin/distinfo
+++ b/net-p2p/litecoin/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1537577883
-SHA256 (litecoin-project-litecoin-v0.16.3_GH0.tar.gz) = 7788800eb4a433696a464563384cbdf83a47eebb8698325c75314171833227c8
-SIZE (litecoin-project-litecoin-v0.16.3_GH0.tar.gz) = 5776885
+TIMESTAMP = 1562572626
+SHA256 (litecoin-project-litecoin-v0.17.1_GH0.tar.gz) = 6e05514a480990f1ff1e7c81b5443d741f4016c03ab5c1ef44bf4b169af88bee
+SIZE (litecoin-project-litecoin-v0.17.1_GH0.tar.gz) = 4717718
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"
diff --git a/net-p2p/litecoin/pkg-help b/net-p2p/litecoin/pkg-help
new file mode 100644
index 000000000000..2112225e4f18
--- /dev/null
+++ b/net-p2p/litecoin/pkg-help
@@ -0,0 +1,18 @@
+The wallet is stored in a Berkeley database file (BDB) (usually
+~/.litecoin/wallets/wallet.dat).
+
+Litecoin Core can use either BDB 4.8, 5.x or 6.x to create and access the
+wallet file.
+
+Wallets created using BDB 4.8 are also accessible by BDB 5.x and 6.x.
+
+Wallets created using BDB 5.x or 6.x are not accessible by BDB 4.8.
+
+Opening and using a wallet created by 4.8 with a higher major version (5.x
+or 6.x) does not change its format, so it will still be accessible to 4.8
+afterwards. But encrypting an unencrypted wallet recreates it, so encrypting
+a 4.8 wallet with Litecoin Core linked against BDB 5.x or 6.x will render it
+unreadable for Litecoin Core linked against BDB 4.8.
+
+If you do not plan on copying the wallet file to another machine that uses
+BDB 4.8 then it is recommended to use the modern versions of BDB 5.x or 6.x.