aboutsummaryrefslogtreecommitdiffstats
path: root/net-p2p/zetacoin
diff options
context:
space:
mode:
authorSteve Wills <swills@FreeBSD.org>2014-01-18 10:47:18 +0800
committerSteve Wills <swills@FreeBSD.org>2014-01-18 10:47:18 +0800
commit3ef4dc17faa9a2d10ec5ada37ec4afe28f06a9fb (patch)
tree449dbb1c4baff24e539b581e15c2aaeef16342d2 /net-p2p/zetacoin
parent0202b2e246fd536f9084991b064aa4cd035fdf9f (diff)
downloadfreebsd-ports-gnome-3ef4dc17faa9a2d10ec5ada37ec4afe28f06a9fb.tar.gz
freebsd-ports-gnome-3ef4dc17faa9a2d10ec5ada37ec4afe28f06a9fb.tar.zst
freebsd-ports-gnome-3ef4dc17faa9a2d10ec5ada37ec4afe28f06a9fb.zip
Zetacoin is a free open source peer-to-peer electronic cash system that
is completely decentralized, without the need for a central server or trusted parties. Users hold the crypto keys to their own money and transact directly with each other, with the help of a P2P network to check for double-spending. WWW: https://github.com/zetacoin/zetacoin PR: ports/184369 Submitted by: Daniel Morante <daniel@morante.net>
Diffstat (limited to 'net-p2p/zetacoin')
-rw-r--r--net-p2p/zetacoin/Makefile111
-rw-r--r--net-p2p/zetacoin/distinfo2
-rw-r--r--net-p2p/zetacoin/files/patch-src-makefile_unix30
-rw-r--r--net-p2p/zetacoin/files/patch-src__leveldb__build_detect_platform20
-rw-r--r--net-p2p/zetacoin/files/patch-src__rpcdump.cpp11
-rw-r--r--net-p2p/zetacoin/files/patch-src__serialize.h22
-rw-r--r--net-p2p/zetacoin/files/patch-zetacoin-qt_pro11
-rw-r--r--net-p2p/zetacoin/files/pkg-message.in12
-rw-r--r--net-p2p/zetacoin/files/zetacoin.conf.sample15
-rw-r--r--net-p2p/zetacoin/files/zetacoin.in71
-rw-r--r--net-p2p/zetacoin/pkg-descr7
-rw-r--r--net-p2p/zetacoin/pkg-plist6
12 files changed, 318 insertions, 0 deletions
diff --git a/net-p2p/zetacoin/Makefile b/net-p2p/zetacoin/Makefile
new file mode 100644
index 000000000000..1d385cbda1f6
--- /dev/null
+++ b/net-p2p/zetacoin/Makefile
@@ -0,0 +1,111 @@
+# Created by: Daniel Morante <daniel@morante.net>
+# $FreeBSD$
+
+PORTNAME= zetacoin
+PORTVERSION= 0.8.99.6
+CATEGORIES= net-p2p finance
+MASTER_SITES= GH
+
+MAINTAINER= daniel@morante.net
+COMMENT= Peer-to-Peer crypto currency with quick transactions
+
+LICENSE= MIT
+
+LIB_DEPENDS= libboost_date_time.so:${PORTSDIR}/devel/boost-libs
+
+OPTIONS_DEFINE= X11 UPNP QRCODES
+OPTIONS_DEFAULT= X11 QRCODES
+UPNP_DESC= Build with UPNP support
+QRCODES_DESC= Build with QR code display
+
+USE_GITHUB= yes
+GH_ACCOUNT= ${PORTNAME}
+GH_PROJECT= ${PORTNAME}
+GH_COMMIT= e804194
+GH_TAGNAME= e804194
+
+USES= gmake
+USE_OPENSSL= yes
+USE_BDB= yes
+WANT_BDB_VER= 48
+
+CXXFLAGS+= -I${LOCALBASE}/include -I${BDB_INCLUDE_DIR}
+CXXFLAGS+= -L${LOCALBASE}/lib -L${BDB_LIB_DIR}
+CXXFLAGS+= -Wno-invalid-offsetof
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MX11}
+PLIST_SUB+= X11=""
+.else
+USE_RC_SUBR= ${PORTNAME}
+SUB_FILES= pkg-message
+PLIST_SUB+= X11="@comment "
+.endif
+
+.if ${PORT_OPTIONS:MX11}
+USE_QT4= corelib gui qmake_build linguist uic moc rcc
+BINARY= ${PORTNAME}-qt
+PLIST_SUB+= HEADLESS="@comment "
+.else
+BINARY= ${PORTNAME}d
+MAKE_ARGS+= -C ${WRKSRC}/src
+PLIST_SUB+= HEADLESS=""
+.endif
+
+.if ${PORT_OPTIONS:MQRCODES}
+LIB_DEPENDS+= libqrencode.so:${PORTSDIR}/graphics/libqrencode
+QMAKE_USE_QRCODE=1
+.else
+QMAKE_USE_QRCODE=0
+.endif
+
+PLIST_SUB+= EXECUTABLE="bin/${BINARY}"
+
+.if ${PORT_OPTIONS:MUPNP}
+LIB_DEPENDS+= libminiupnpc.so:${PORTSDIR}/net/miniupnpc
+QMAKE_USE_UPNP= 1
+.else
+QMAKE_USE_UPNP= -
+.endif
+
+.include <bsd.port.pre.mk>
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' ${WRKSRC}/src/makefile.unix
+.if !${PORT_OPTIONS:MX11}
+ @cd ${WRKSRC}/src && ${CP} -p makefile.unix Makefile
+ @${REINPLACE_CMD} \
+ -e 's|^USE_UPNP.*$$|USE_UPNP=${QMAKE_USE_UPNP}|' \
+ -e 's|-l pthread|${PTHREAD_LIBS}|g' \
+ -e 's:-l dl::' \
+ ${WRKSRC}/src/Makefile
+.endif
+
+do-configure:
+.if ${PORT_OPTIONS:MX11}
+ cd ${WRKSRC} && ${SETENV} ${QMAKE_ENV} \
+ ${QMAKE} ${QMAKE_ARGS} USE_UPNP=${QMAKE_USE_UPNP} USE_QRCODE=${QMAKE_USE_QRCODE} \
+ QMAKE_LRELEASE=lrelease-qt4 PREFIX=${PREFIX} INCLUDEPATH=${BDB_INCLUDE_DIR} \
+ QMAKE_LIBDIR+=${BDB_LIB_DIR} ${PORTNAME}-qt.pro
+.endif
+
+do-install:
+.if ${PORT_OPTIONS:MX11}
+ ${INSTALL_PROGRAM} -s ${WRKSRC}/${BINARY} ${STAGEDIR}${PREFIX}/bin/${BINARY}
+ ${REINPLACE_CMD} -e 's,=/usr,=${PREFIX},' \
+ -e 's,bitcoin,zetacoin,g' \
+ -e 's,Bitcoin,Zetacoin,g' \
+ -e 's,128,,g' ${WRKSRC}/contrib/debian/bitcoin-qt.desktop
+ ${INSTALL} ${WRKSRC}/contrib/debian/bitcoin-qt.desktop ${STAGEDIR}${PREFIX}/share/applications/zetacoin-qt.desktop
+ ${INSTALL} ${WRKSRC}/src/qt/res/icons/bitcoin.png ${STAGEDIR}${PREFIX}/share/pixmaps/zetacoin.png
+
+.else
+ ${INSTALL_PROGRAM} -s ${WRKSRC}/src/${BINARY} ${STAGEDIR}${PREFIX}/bin/${BINARY}
+ ${INSTALL} ${FILESDIR}/${PORTNAME}.conf.sample ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
+ @if [ ! -f ${PREFIX}/etc/${PORTNAME}.conf ]; then \
+ ${CP} -p ${FILESDIR}/${PORTNAME}.conf.sample ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf; \
+ fi
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/net-p2p/zetacoin/distinfo b/net-p2p/zetacoin/distinfo
new file mode 100644
index 000000000000..4e5b34ff85de
--- /dev/null
+++ b/net-p2p/zetacoin/distinfo
@@ -0,0 +1,2 @@
+SHA256 (zetacoin-0.8.99.6.tar.gz) = c1c105330e997b2604cc8ecdef50897b79c4395915d67fdbb773c2d3b63be585
+SIZE (zetacoin-0.8.99.6.tar.gz) = 2184876
diff --git a/net-p2p/zetacoin/files/patch-src-makefile_unix b/net-p2p/zetacoin/files/patch-src-makefile_unix
new file mode 100644
index 000000000000..6b65524b691a
--- /dev/null
+++ b/net-p2p/zetacoin/files/patch-src-makefile_unix
@@ -0,0 +1,30 @@
+--- src/makefile.unix.orig 2013-10-13 06:05:19.000000000 -0400
++++ src/makefile.unix 2013-12-27 05:11:28.000000000 -0500
+@@ -15,6 +15,11 @@
+
+ DEFS=-DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64
+
++BOOST_INCLUDE_PATH=%%PREFIX%%/include
++BDB_INCLUDE_PATH=%%PREFIX%%/include/db48
++BOOST_LIB_PATH=%%PREFIX%%/lib
++BDB_LIB_PATH=%%PREFIX%%/lib/db48
++
+ DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
+ LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
+
+@@ -38,6 +43,7 @@
+ -l boost_filesystem$(BOOST_LIB_SUFFIX) \
+ -l boost_program_options$(BOOST_LIB_SUFFIX) \
+ -l boost_thread$(BOOST_LIB_SUFFIX) \
++ -l boost_chrono$(BOOST_LIB_SUFFIX) \
+ -l db_cxx$(BDB_LIB_SUFFIX) \
+ -l ssl \
+ -l crypto
+@@ -61,7 +67,6 @@
+ LIBS+= \
+ -Wl,-B$(LMODE2) \
+ -l z \
+- -l dl \
+ -l pthread
+
+
diff --git a/net-p2p/zetacoin/files/patch-src__leveldb__build_detect_platform b/net-p2p/zetacoin/files/patch-src__leveldb__build_detect_platform
new file mode 100644
index 000000000000..4dcb75feba47
--- /dev/null
+++ b/net-p2p/zetacoin/files/patch-src__leveldb__build_detect_platform
@@ -0,0 +1,20 @@
+--- src/leveldb/build_detect_platform.orig 2014-01-17 19:31:04.000000000 +0000
++++ src/leveldb/build_detect_platform 2014-01-17 19:33:47.000000000 +0000
+@@ -170,7 +170,7 @@
+ true
+ else
+ # If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h.
+- $CXX $CXXFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null <<EOF
++ $CXX $CXXFLAGS -std=c++0x -x c++ - -o - > /dev/null 2>/dev/null <<EOF
+ #include <cstdatomic>
+ int main() {}
+ EOF
+@@ -182,7 +182,7 @@
+ fi
+
+ # Test whether tcmalloc is available
+- $CXX $CXXFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
++ $CXX $CXXFLAGS -x c++ -ltcmalloc - -o - > /dev/null 2>/dev/null <<EOF
+ int main() {}
+ EOF
+ if [ "$?" = 0 ]; then
diff --git a/net-p2p/zetacoin/files/patch-src__rpcdump.cpp b/net-p2p/zetacoin/files/patch-src__rpcdump.cpp
new file mode 100644
index 000000000000..2fe96672be95
--- /dev/null
+++ b/net-p2p/zetacoin/files/patch-src__rpcdump.cpp
@@ -0,0 +1,11 @@
+--- src/rpcdump.cpp.orig 2014-01-16 19:35:10.000000000 +0000
++++ src/rpcdump.cpp 2014-01-16 19:35:24.000000000 +0000
+@@ -27,7 +27,7 @@
+ }
+
+ int64 static DecodeDumpTime(const std::string &str) {
+- static const boost::posix_time::time_input_facet facet("%Y-%m-%dT%H:%M:%SZ");
++ static boost::posix_time::time_input_facet facet("%Y-%m-%dT%H:%M:%SZ");
+ static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);
+ const std::locale loc(std::locale::classic(), &facet);
+ std::istringstream iss(str);
diff --git a/net-p2p/zetacoin/files/patch-src__serialize.h b/net-p2p/zetacoin/files/patch-src__serialize.h
new file mode 100644
index 000000000000..e13520bf9f7d
--- /dev/null
+++ b/net-p2p/zetacoin/files/patch-src__serialize.h
@@ -0,0 +1,22 @@
+--- ./src/serialize.h.orig 2013-09-24 01:50:35.661706153 +0000
++++ ./src/serialize.h 2013-09-24 01:50:52.913703572 +0000
+@@ -895,19 +895,6 @@
+ iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
+ void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
+
+- void insert(iterator it, const_iterator first, const_iterator last)
+- {
+- assert(last - first >= 0);
+- if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
+- {
+- // special case for inserting at the front when there's room
+- nReadPos -= (last - first);
+- memcpy(&vch[nReadPos], &first[0], last - first);
+- }
+- else
+- vch.insert(it, first, last);
+- }
+-
+ void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
+ {
+ assert(last - first >= 0);
diff --git a/net-p2p/zetacoin/files/patch-zetacoin-qt_pro b/net-p2p/zetacoin/files/patch-zetacoin-qt_pro
new file mode 100644
index 000000000000..6d56986d0747
--- /dev/null
+++ b/net-p2p/zetacoin/files/patch-zetacoin-qt_pro
@@ -0,0 +1,11 @@
+--- zetacoin-qt.pro.orig 2013-10-13 06:05:19.000000000 -0400
++++ zetacoin-qt.pro 2013-10-18 18:49:57.000000000 -0400
+@@ -418,7 +418,7 @@
+ LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
+ # -lgdi32 has to happen after -lcrypto (see #681)
+ win32:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
+-LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX
++LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_program_options$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lboost_chrono$$BOOST_LIB_SUFFIX
+ win32:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
+ macx:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
+
diff --git a/net-p2p/zetacoin/files/pkg-message.in b/net-p2p/zetacoin/files/pkg-message.in
new file mode 100644
index 000000000000..e529a6950db7
--- /dev/null
+++ b/net-p2p/zetacoin/files/pkg-message.in
@@ -0,0 +1,12 @@
+*******************************************************************
+To configure the Zetacoin server please edit:
+%%PREFIX%%/etc/zetacoin.conf
+
+You must at least set a "rpcpassword" in the configuration file above.
+
+To run the zetacoind server at startup, add the following
+settings to your /etc/rc.conf
+
+zetacoin_enable="YES"
+
+*******************************************************************
diff --git a/net-p2p/zetacoin/files/zetacoin.conf.sample b/net-p2p/zetacoin/files/zetacoin.conf.sample
new file mode 100644
index 000000000000..09316b91e043
--- /dev/null
+++ b/net-p2p/zetacoin/files/zetacoin.conf.sample
@@ -0,0 +1,15 @@
+rpcuser=myname
+#rpcpassword=YOU MUST SET A PASSWORD
+maxconnection=80
+rpcallowip=127.0.0.1
+rpcport=17335
+port=17333
+server=1
+daemon=1
+listen=1
+logtimestamps=1
+addnode=63.247.147.163
+addnode=105.236.111.72
+addnode=188.252.16.110
+addnode=54.212.51.236
+addnode=75.162.220.45
diff --git a/net-p2p/zetacoin/files/zetacoin.in b/net-p2p/zetacoin/files/zetacoin.in
new file mode 100644
index 000000000000..c59cd402f4ed
--- /dev/null
+++ b/net-p2p/zetacoin/files/zetacoin.in
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# PROVIDE: zetacoin
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# zetacoin_enable (bool): Set to NO by default.
+# Set it to YES to enable zetacoin.
+# zetacoin_config (path): Set to %%PREFIX%%/etc/zetacoin.conf
+# by default.
+# zetacoin_datadir (str): Default to "/var/db/zetacoin"
+# Base data directory.
+
+. /etc/rc.subr
+
+name=zetacoin
+rcvar=zetacoin_enable
+
+: ${zetacoin_enable:=NO}
+: ${zetacoin_config=%%PREFIX%%/etc/zetacoin.conf}
+: ${zetacoin_datadir=/var/db/zetacoin}
+
+required_files=${zetacoin_config}
+command=%%PREFIX%%/bin/zetacoind
+zetacoin_chdir=${zetacoin_datadir}
+pidfile="${zetacoin_datadir}/zetacoind.pid"
+stop_cmd=zetacoin_stop
+command_args="-conf=${zetacoin_config} -datadir=${zetacoin_datadir} -noupnp -daemon -pid=${pidfile}"
+start_precmd="${name}_prestart"
+
+zetacoin_create_datadir()
+{
+ echo "Creating data directory"
+ eval mkdir -p ${zetacoin_datadir}
+}
+
+zetacoin_prestart()
+{
+ if [ ! -d "${zetacoin_datadir}/." ]; then
+ zetacoin_create_datadir || return 1
+ fi
+}
+
+zetacoin_requirepidfile()
+{
+ if [ ! "0`check_pidfile ${pidfile} ${command}`" -gt 1 ]; then
+ echo "${name} not running? (check $pidfile)."
+ exit 1
+ fi
+}
+
+zetacoin_stop()
+{
+ zetacoin_requirepidfile
+
+ if checkyesno ${rcvar}; then
+ echo "Stopping ${name}."
+ eval ${command} -conf=${zetacoin_config} -datadir=${zetacoin_datadir} stop
+ wait_for_pids ${pidfile}
+ fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/net-p2p/zetacoin/pkg-descr b/net-p2p/zetacoin/pkg-descr
new file mode 100644
index 000000000000..b63d9cf2e72b
--- /dev/null
+++ b/net-p2p/zetacoin/pkg-descr
@@ -0,0 +1,7 @@
+Zetacoin is a free open source peer-to-peer electronic cash system that
+is completely decentralized, without the need for a central server or
+trusted parties. Users hold the crypto keys to their own money and
+transact directly with each other, with the help of a P2P network to
+check for double-spending.
+
+WWW: https://github.com/zetacoin/zetacoin
diff --git a/net-p2p/zetacoin/pkg-plist b/net-p2p/zetacoin/pkg-plist
new file mode 100644
index 000000000000..cd22c67d3eda
--- /dev/null
+++ b/net-p2p/zetacoin/pkg-plist
@@ -0,0 +1,6 @@
+%%EXECUTABLE%%
+%%X11%%share/applications/zetacoin-qt.desktop
+%%X11%%share/pixmaps/zetacoin.png
+%%HEADLESS%%@unexec if cmp -s %D/etc/zetacoin.conf.sample %D/etc/zetacoin.conf; then rm -f %D/etc/zetacoin.conf; fi
+%%HEADLESS%%etc/zetacoin.conf.sample
+%%HEADLESS%%@exec if [ ! -f %D/etc/zetacoin.conf ] ; then cp -p %D/%F %B/zetacoin.conf; fi