View | Details | Raw Unified | Return to bug 224467
Collapse All | Expand All

(-)finance/dash/Makefile (+149 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	dash
4
DISTVERSIONPREFIX=	v
5
DISTVERSION=	0.12.2.1
6
CATEGORIES=	finance net-p2p
7
8
MAINTAINER=	arcade@b1t.name
9
COMMENT=	Virtual Peer-to-Peer Currency Client
10
11
LICENSE=	MIT
12
LICENSE_FILE=	${WRKSRC}/COPYING
13
14
ONLY_FOR_ARCHS=	amd64 i386 ia64
15
ONLY_FOR_ARCHS_REASON=	does not support big-endian architectures
16
17
LIB_DEPENDS=	libboost_date_time.so:devel/boost-libs \
18
		libevent.so:devel/libevent
19
20
BROKEN_powerpc64=	fails to compile: util.cpp: undefined reference to boost::program_options::to_internal
21
22
USES=		autoreconf compiler:c++11-lib gmake libtool pkgconfig shebangfix ssl
23
USE_GITHUB=	yes
24
GH_ACCOUNT=	dashpay
25
GNU_CONFIGURE=	yes
26
SHEBANG_FILES=	src/test/*.py
27
28
CONFIGURE_ENV=	CRYPTO_CFLAGS="-I${OPENSSLINC}" CRYPTO_LIBS="-L${OPENSSLLIB} -lcrypto" \
29
		SSL_CFLAGS="-I${OPENSSLINC}" SSL_LIBS="-L${OPENSSLLIB} -lssl" \
30
		OBJCXX="${CXX}" OBJCXXFLAGS="${CXXFLAGS}"
31
MAKE_ENV+=	V=1
32
33
OPTIONS_DEFINE=		HARDENING DEBUG TESTS
34
OPTIONS_DEFAULT=	HARDENING
35
36
FLAVORS=        daemon cli qt
37
38
.if ${FLAVOR:Udaemon} == daemon
39
PKGNAMESUFFIX=	-daemon
40
COMMENT+=	(Daemon)
41
42
CONFIGURE_ARGS=	--with-daemon \
43
		--without-gui \
44
		--without-libs \
45
		--without-qrencode \
46
		--without-utils
47
48
OPTIONS_DEFINE+=	UPNP WALLET ZMQ
49
OPTIONS_DEFAULT+=	UPNP WALLET
50
51
PLIST_FILES=	bin/dashd
52
USE_RC_SUBR=	dashd
53
54
TESTS_PLIST_FILES=	bin/test_dash
55
.endif
56
57
.if ${FLAVOR:U} == cli
58
PKGNAMESUFFIX=	-cli
59
COMMENT+=	(CLI and Utilities)
60
61
CONFIGURE_ARGS=	--without-daemon \
62
		--without-gui \
63
		--without-libs \
64
		--without-qrencode \
65
		--with-utils \
66
		--disable-wallet
67
68
TESTS_PLIST_FILES=	bin/test_dash
69
70
PLIST_FILES=	bin/dash-cli bin/dash-tx
71
.endif
72
73
.if ${FLAVOR:U} == qt
74
PKGNAMESUFFIX=	-qt
75
COMMENT+=	(Qt UI)
76
77
USES+=		desktop-file-utils
78
USE_QT5=	core gui network widgets \
79
		buildtools_build linguisttools_build qmake_build
80
81
CONFIGURE_ARGS=	--without-libs \
82
		--with-gui=qt5 \
83
		--without-daemon \
84
		--without-utils
85
86
OPTIONS_DEFINE+=	DBUS QRCODES UPNP WALLET ZMQ
87
OPTIONS_DEFAULT+=	DBUS QRCODES UPNP WALLET
88
89
BUILD_DEPENDS+=	protoc:devel/protobuf
90
LIB_DEPENDS+=	libprotobuf.so:devel/protobuf
91
92
DBUS_CONFIGURE_WITH=	dbus
93
DBUS_USE=		QT5=dbus
94
95
TESTS_USE=		QT5=testlib
96
TESTS_PLIST_FILES=	bin/test_dash-qt \
97
			bin/test_dash
98
99
PLIST_FILES=	bin/dash-qt share/applications/dash-qt.desktop \
100
		share/pixmaps/dash128.png
101
.endif
102
103
HARDENING_DESC=	Attempt to harden binaries (PIE for ASLR, NX Stack)
104
TESTS_DESC=	Build test binary and unit tests
105
QRCODES_DESC=	Display QR Codes
106
WALLET_DESC=	Wallet Management Support
107
ZMQ_DESC=	Block and transaction broadcasting with ZeroMQ
108
109
HARDENING_CONFIGURE_ENABLE=	hardening
110
111
DEBUG_CONFIGURE_ENABLE=		debug
112
DEBUG_INSTALL_TARGET_OFF=	install-strip
113
114
TESTS_CONFIGURE_ENABLE=	tests bench
115
TESTS_PLIST_FILES+=	bin/bench_dash
116
117
UPNP_CONFIGURE_WITH=	miniupnpc
118
UPNP_LIB_DEPENDS=	libminiupnpc.so:net/miniupnpc
119
UPNP_CPPFLAGS=		-I${LOCALBASE}/include
120
UPNP_LIBS=		-L${LOCALBASE}/lib
121
122
QRCODES_CONFIGURE_WITH=	qrencode
123
QRCODES_LIB_DEPENDS=	libqrencode.so:graphics/libqrencode
124
125
WALLET_CONFIGURE_ENABLE=	wallet
126
WALLET_CXXFLAGS=		-I${BDB_INCLUDE_DIR}
127
WALLET_LIBS=			-L${BDB_LIB_DIR}
128
WALLET_USES=			bdb:48
129
130
ZMQ_CONFIGURE_ENABLE=	zmq
131
ZMQ_BUILD_DEPENDS=	libzmq4>0:net/libzmq4
132
ZMQ_RUN_DEPENDS=	libzmq4>0:net/libzmq4
133
134
.if ${FLAVOR:U} == qt
135
post-install:
136
	${INSTALL} ${WRKSRC}/contrib/debian/dash-qt.desktop \
137
		${STAGEDIR}${PREFIX}/share/applications
138
	@${REINPLACE_CMD} -i '' -e 's,=/usr,=${PREFIX},' \
139
		${STAGEDIR}${PREFIX}/share/applications/dash-qt.desktop
140
	${INSTALL} ${WRKSRC}/share/pixmaps/dash128.png \
141
		${STAGEDIR}${PREFIX}/share/pixmaps/dash128.png
142
.endif
143
144
### for ALL
145
regression-test: build
146
	# To use this sucessfully, remove --without-daemon and --without-utils from CONFIGURE_ARGS above.
147
	@cd ${WRKSRC} && ${GMAKE} check
148
149
.include <bsd.port.mk>
(-)finance/dash/distinfo (+2 lines)
Line 0 Link Here
1
SHA256 (dashpay-dash-v0.12.2.1_GH0.tar.gz) = 29e11f7189155da2595fddc0add5b8757255cd96cc4fe0a885b5f649f159163f
2
SIZE (dashpay-dash-v0.12.2.1_GH0.tar.gz) = 7243314
(-)finance/dash/files/dashd.in (+172 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# PROVIDE: dashd
4
# REQUIRE: LOGIN cleanvar
5
# KEYWORD: shutdown
6
7
#
8
# Add the following lines to /etc/rc.conf to enable :
9
# dashd_enable (bool):	Set to "NO" by default.
10
#				Set it to "YES" to enable dashd
11
# dashd_user (str)		Set to "dash" by default.
12
# dashd_group (str)		Set to "dash" by default.
13
# dashd_conf (str)		Set to "%%PREFIX%%/etc/dashd.conf" by default.
14
# dashd_data (str)		Set to "/var/lib/dashd" by default.
15
# dashdlimits_enable (bool)	Set to "NO" by default.
16
#				Set it to "YES" to enable dashdlimits
17
# dashdlimits_args		Set to "-e -U ${dashd_user}" by default
18
19
20
. /etc/rc.subr
21
22
name="dashd"
23
rcvar=dashd_enable
24
25
start_precmd="dashd_precmd"
26
start_cmd="dashd_start"
27
restart_precmd="dashd_checkconfig"
28
reload_precmd="dashd_checkconfig"
29
configtest_cmd="dashd_checkconfig"
30
status_cmd="dashd_status"
31
stop_cmd="dashd_stop"
32
stop_postcmd="dashd_wait"
33
command="%%PREFIX%%/bin/dashd"
34
cli_command="%%PREFIX%%/bin/dash-cli"
35
daemon_command="/usr/sbin/daemon"
36
#pidfile="/var/run/${name}.pid"
37
extra_commands="configtest"
38
39
40
: ${dashd_enable:="NO"}
41
: ${dashdlimits_enable:="NO"}
42
43
load_rc_config ${name}
44
45
: ${dashd_user:="dash"}
46
: ${dashd_group:="dash"}
47
: ${dashd_data_dir:="/var/db/dashd"}
48
: ${dashd_config_file:="%%PREFIX%%/etc/dash.conf"}
49
: ${dashdlimits_args:="-e -U ${dashd_user}"}
50
51
# set up dependant variables
52
procname="${command}"
53
pidfile="${dashd_data_dir}/dashd.pid"
54
required_files="${dashd_config_file}"
55
56
57
dashd_checkconfig()
58
{
59
  echo "Performing sanity check on dashd configuration:"
60
  if [ ! -d "${dashd_data_dir}" ]
61
  then
62
    echo "Missing data directory: ${dashd_data_dir}"
63
    exit 1
64
  fi
65
  chown -R "${dashd_user}:${dashd_group}" "${dashd_data_dir}"
66
67
  if [ ! -f "${dashd_config_file}" ]
68
  then
69
    echo "Missing configuration file: ${dashd_config_file}"
70
    exit 1
71
  fi
72
  if [ ! -x "${command}" ]
73
  then
74
    echo "Missing executable: ${command}"
75
    exit 1
76
  fi
77
  return 0
78
}
79
80
dashd_cleanup()
81
{
82
  rm -f "${pidfile}"
83
}
84
85
dashd_precmd()
86
{
87
  dashd_checkconfig
88
89
  pid=$(check_pidfile "${pidfile}" "${procname}")
90
  if [ -z "${pid}" ]
91
  then
92
    echo "Dashd is not running"
93
    rm -f "${pidfile}"
94
  fi
95
96
  if checkyesno dashdlimits_enable
97
  then
98
    eval $(/usr/bin/limits ${dashdlimits_args}) 2>/dev/null
99
  else
100
    return 0
101
  fi
102
}
103
104
dashd_status()
105
{
106
  local pid
107
  pid=$(check_pidfile "${pidfile}" "${procname}")
108
  if [ -z "${pid}" ]
109
  then
110
    echo "Dashd is not running"
111
    return 1
112
  else
113
    echo "Dashd running, pid: ${pid}"
114
  fi
115
}
116
117
dashd_start()
118
{
119
  echo "Starting dashd:"
120
  cd "${dashd_data_dir}" || return 1
121
  ${daemon_command} -u "${dashd_user}" -p "${pidfile}" \
122
    ${command} \
123
    -conf="${dashd_config_file}" \
124
    -datadir="${dashd_data_dir}" 2> /tmp/dashd.stderr > /tmp/dashd.stdout
125
}
126
127
dashd_stop()
128
{
129
  echo "Stopping dashd:"
130
  pid=$(check_pidfile "${pidfile}" "${procname}")
131
  if [ -z "${pid}" ]
132
  then
133
    echo "Dashd is not running"
134
    return 1
135
  else
136
    ${cli_command} -conf="${dashd_config_file}" -datadir="${dashd_data_dir}" stop
137
  fi
138
}
139
140
dashd_wait()
141
{
142
  local n=60
143
  echo "Waiting for dashd shutdown:"
144
  while :
145
  do
146
    printf '.'
147
    pid=$(check_pidfile "${pidfile}" "${procname}")
148
    if [ -z "${pid}" ]
149
    then
150
      printf '\n'
151
      break
152
    fi
153
    sleep 1
154
    n=$((${n} - 1))
155
    if [ ${n} -eq 0 -a -f "${pidfile}" ]
156
    then
157
      printf "\nForce shutdown"
158
      kill -9 $(cat "${pidfile}")
159
      for n in 1 2 3
160
      do
161
        printf '.'
162
        sleep 1
163
      done
164
      printf '\n'
165
      break
166
    fi
167
  done
168
  rm -f "${pidfile}"
169
  echo "Shutdown complete"
170
}
171
172
run_rc_command "$1"
(-)finance/dash/files/patch-configure.ac (+12 lines)
Line 0 Link Here
1
--- configure.ac.orig	2017-12-17 15:10:45 UTC
2
+++ configure.ac
3
@@ -356,6 +356,9 @@ case $host in
4
      TARGET_OS=linux
5
      LEVELDB_TARGET_FLAGS="-DOS_LINUX"
6
      ;;
7
+   *freebsd*)
8
+     LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
9
+     ;;
10
    *)
11
      OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
12
      LEVELDB_TARGET_FLAGS="-DOS_${OTHER_OS}"
(-)finance/dash/files/patch-src_leveldb_helpers_memenv_memenv.cc (+11 lines)
Line 0 Link Here
1
--- src/leveldb/helpers/memenv/memenv.cc.orig	2017-11-11 07:02:45 UTC
2
+++ src/leveldb/helpers/memenv/memenv.cc
3
@@ -2,6 +2,8 @@
4
 // Use of this source code is governed by a BSD-style license that can be
5
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
6
 
7
+#define __STDC_LIMIT_MACROS
8
+
9
 #include "helpers/memenv/memenv.h"
10
 
11
 #include "leveldb/env.h"
(-)finance/dash/pkg-descr (+7 lines)
Line 0 Link Here
1
Dash is a free open source peer-to-peer electronic cash system that
2
is completely decentralized, without the need for a central server or
3
trusted parties. Users hold the crypto keys to their own money and
4
transact directly with each other, with the help of a P2P network to
5
check for double-spending.
6
7
WWW: http://www.dash.org/

Return to bug 224467