1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

Namecoin is an open source decentralized key/value registration and transfer

system based on Bitcoin technology (a decentralized cryptocurrency).

It allows you to:

    * Securely register and transfer arbitrary names (keys), no possible
      censorship!
    * Attach values (data) to the names (currently up to 520 bytes, will be
      extended)
    * Trade and transact namecoins, the digital currency NMC

To register a name, you must own some namecoins (NMC, the internal
cryptocurrency used by the software).

WWW: http://namecoin.info/

PR:		ports/185459
Submitted by:	Chad J. Milios <milios@ccsys.com>
This commit is contained in:
Steve Wills 2014-02-12 18:44:49 +00:00
parent 0022fc1a19
commit eb2820b2fd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=343950
10 changed files with 272 additions and 0 deletions

View File

@ -64,6 +64,7 @@
SUBDIR += mldonkey-perlreactor
SUBDIR += mldonkey-urlslave
SUBDIR += museekplus
SUBDIR += namecoin
SUBDIR += napshare
SUBDIR += ncdc
SUBDIR += opendchub

98
net-p2p/namecoin/Makefile Normal file
View File

@ -0,0 +1,98 @@
# Created by: Chad J. Milios <milios@ccsys.com>
# $FreeBSD$
PORTNAME= namecoin
PORTVERSION= Q.3.72
CATEGORIES= net-p2p dns
MASTER_SITES= GH
MAINTAINER= milios@ccsys.com
COMMENT= Decentralized, open DNS system and general purpose key/value store
LIB_DEPENDS= libboost_date_time.so:${PORTSDIR}/devel/boost-libs
OPTIONS_DEFINE= X11 UPNP QRCODES DBUS
OPTIONS_DEFAULT= X11 QRCODES
UPNP_DESC= Build with UPNP support
QRCODES_DESC= Build with QR code display
USE_GITHUB= yes
GH_ACCOUNT= namecoinq
GH_PROJECT= namecoinq
GH_COMMIT= cdf052b
GH_TAGNAME= v${PORTVERSION}
USES= gmake compiler:c++11-lib
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+= -DCRYPTOPP_DISABLE_ASM
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MX11}
USE_QT4= corelib network gui qmake_build linguist_build uic_build moc_build rcc_build
BINARY= namecoin-qt
LIB_DEPENDS+= libprotobuf.so:${PORTSDIR}/devel/protobuf
.else
BINARY= namecoind
MAKE_ARGS+= -C ${WRKSRC}/src
USE_GNOME= glib20
.endif
.if ${PORT_OPTIONS:MQRCODES}
LIB_DEPENDS+= libqrencode.so:${PORTSDIR}/graphics/libqrencode
QMAKE_USE_QRCODE=1
.else
QMAKE_USE_QRCODE=0
.endif
.if ${PORT_OPTIONS:MDBUS}
USE_QT4+= dbus
QMAKE_USE_DBUS= 1
.else
QMAKE_USE_DBUS= 0
.endif
PLIST_FILES+= 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:
.if !${PORT_OPTIONS:MX11}
@cd ${WRKSRC}/src && ${CP} ${FILESDIR}/makefile.unix Makefile
@${REINPLACE_CMD} \
-e 's|^USE_UPNP.*$$|USE_UPNP=${QMAKE_USE_UPNP}|' \
-e 's|-l pthread|${PTHREAD_LIBS}|g' \
${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} INCLUDEPATH+=${BDB_INCLUDE_DIR} \
QMAKE_LIBDIR+=${BDB_LIB_DIR} ${BINARY}.pro
.endif
do-install:
@${MKDIR} ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MX11}
${INSTALL_PROGRAM} ${WRKSRC}/${BINARY} ${STAGEDIR}${PREFIX}/bin/
.else
${INSTALL_PROGRAM} ${WRKSRC}/src/${BINARY} ${STAGEDIR}${PREFIX}/bin/
.endif
.include <bsd.port.post.mk>

View File

@ -0,0 +1,2 @@
SHA256 (namecoin-Q.3.72.tar.gz) = 426b6c10b999ed11f436b2d8a56715a4355d30af41e13a1fd6e6ee5dd8348775
SIZE (namecoin-Q.3.72.tar.gz) = 1453900

View File

@ -0,0 +1,76 @@
CXX?=g++
DEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
LIBS= \
-Wl,-Bstatic \
-l boost_system \
-l boost_filesystem \
-l boost_program_options \
-l boost_thread \
-l boost_chrono \
-l db_cxx \
-l ssl \
-l crypto
USE_UPNP:=0
ifneq (${USE_UPNP}, -)
LIBS += -l miniupnpc
DEFS += -DUSE_UPNP=$(USE_UPNP)
endif
LIBS+= \
-Wl,-Bdynamic \
-l gthread-2.0 \
-l z \
-l pthread
CXXFLAGS+=-O2 -Wno-invalid-offsetof -Wformat $(DEFS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h allocators.h db.h walletdb.h crypter.h net.h irc.h keystore.h main.h \
wallet.h bitcoinrpc.h uibase.h ui.h noui.h init.h auxpow.h
BASE_OBJS= \
obj/auxpow.o \
obj/util.o \
obj/key.o \
obj/script.o \
obj/db.o \
obj/walletdb.o \
obj/crypter.o \
obj/net.o \
obj/irc.o \
obj/keystore.o \
obj/main.o \
obj/wallet.o \
obj/bitcoinrpc.o \
obj/init.o \
cryptopp/obj/sha.o \
cryptopp/obj/cpu.o
OBJS = \
$(BASE_OBJS) \
obj/hook.o
all: namecoind
cryptopp/obj/%.o: cryptopp/%.cpp
$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
obj/nogui/%.o: %.cpp $(HEADERS)
$(CXX) -c $(CXXFLAGS) -o $@ $<
obj/test/%.o: test/%.cpp $(HEADERS)
$(CXX) -c $(CFLAGS) -o $@ $<
obj/nogui/namecoin.o: namecoin.h
namecoind: $(BASE_OBJS:obj/%=obj/nogui/%) obj/nogui/namecoin.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
clean:
-rm -f namecoin namecoind
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f obj/test/*.o
-rm -f cryptopp/obj/*.o
-rm -f headers.h.gch

View File

@ -0,0 +1,10 @@
--- ./src/main.h.orig 2013-10-29 13:38:10.000000000 +0000
+++ ./src/main.h 2014-01-18 23:12:20.871138275 +0000
@@ -16,7 +16,6 @@
#ifdef __WXMSW__
#include <io.h> /* for _commit */
#elif !defined(MAC_OSX)
-#include <sys/prctl.h>
#endif
class CBlock;

View File

@ -0,0 +1,25 @@
--- ./src/net.cpp.orig 2013-10-29 13:38:10.000000000 +0000
+++ ./src/net.cpp 2014-01-18 23:12:20.911138205 +0000
@@ -51,7 +51,7 @@
CAddress addrLocalHost("0.0.0.0", 0, false, nLocalServices);
CNode* pnodeLocalHost = NULL;
uint64 nLocalHostNonce = 0;
-array<int, 10> vnThreadsRunning;
+boost::array<int, 10> vnThreadsRunning;
SOCKET hListenSocket = INVALID_SOCKET;
vector<CNode*> vNodes;
@@ -1094,13 +1094,8 @@
char intClient[16];
char intPort[6];
-#if !defined(__WXMSW__) && !defined(MAC_OSX)
- r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
- port, port, lanaddr, 0, "TCP", 0);
-#else
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, 0, "TCP", 0, "0");
-#endif
if(r!=UPNPCOMMAND_SUCCESS)
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
port, port, lanaddr, r, strupnperror(r));

View File

@ -0,0 +1,12 @@
--- ./src/qt/configurenamedialog.h.orig 2013-10-29 13:38:10.000000000 +0000
+++ ./src/qt/configurenamedialog.h 2014-01-18 23:12:20.925138619 +0000
@@ -1,6 +1,9 @@
#ifndef CONFIGURENAMEDIALOG_H
#define CONFIGURENAMEDIALOG_H
+#include <sys/socket.h>
+#include <netinet/in.h>
+
#include <QDialog>
namespace Ui {

View File

@ -0,0 +1,12 @@
--- ./src/qt/managenamespage.h.orig 2013-10-29 13:38:10.000000000 +0000
+++ ./src/qt/managenamespage.h 2014-01-18 23:12:20.965138391 +0000
@@ -1,6 +1,9 @@
#ifndef MANAGENAMESPAGE_H
#define MANAGENAMESPAGE_H
+#include <sys/socket.h>
+#include <netinet/in.h>
+
#include <QDialog>
#include <QSortFilterProxyModel>

View File

@ -0,0 +1,21 @@
--- src/serialize.h.orig 2014-01-19 03:49:23.000000000 +0000
+++ src/serialize.h 2014-01-19 03:52:10.000000000 +0000
@@ -858,18 +858,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)
- {
- if (it == vch.begin() + nReadPos && 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)
{
if (it == vch.begin() + nReadPos && last - first <= nReadPos)

View File

@ -0,0 +1,15 @@
Namecoin is an open source decentralized key/value registration and transfer
system based on Bitcoin technology (a decentralized cryptocurrency).
It allows you to:
* Securely register and transfer arbitrary names (keys), no possible
censorship!
* Attach values (data) to the names (currently up to 520 bytes, will be
extended)
* Trade and transact namecoins, the digital currency NMC
To register a name, you must own some namecoins (NMC, the internal
cryptocurrency used by the software).
WWW: http://namecoin.info/