Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jan 2014 07:01:55 GMT
From:      "Chad J. Milios" <milios@ccsys.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/185459: New port: net-p2p/namecoin (ver Q.3.72)
Message-ID:  <201401040701.s0471tmp005793@oldred.freebsd.org>
Resent-Message-ID: <201401040710.s047A0Zi069237@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         185459
>Category:       ports
>Synopsis:       New port: net-p2p/namecoin (ver Q.3.72)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 04 07:10:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Chad J. Milios
>Release:        9.2-RELEASE-p2/amd64
>Organization:
Crop Circle Systems, Inc.
>Environment:
FreeBSD kakashi.ccsys.com 9.2-RELEASE-p2 FreeBSD 9.2-RELEASE-p2 #0 r259093: Thu Dec 12 23:34:17 UTC 2013     root@shikamaru.ccsys.com:/usr/obj/usr/src/sys/NUOS  amd64
>Description:
This is a port of namecoin stable release Q.3.72 and a slave port namecoin-daemon. QT4 user interface is supported including the new integrated name registration. The daemon can be installed by opting out of the GUI option OR by using the included slave port so as to allow namecoin-qt and namecoind to easily coexist as packaged a system.

If you use this I'd appreciate your feedback. This is my first released port so go easy on me when you tell me how foolish I did it. :) I'd like some testing and community input, etc before this gets committed. This works great for my uses and limited testing and I don't think it should eat any of your coins but I wouldn't transfer hundreds of NMC into it just yet. :)

This is just the standard Namecoin software and does not have any OPTIONS to automatically integrate with DNS resolution yet. Once I get this port to a satisfactory place I'll be adding integration with resolver(s). I have much more experience with the DNS system than I do with QT and Qmake. This port was my little holiday learning project so maybe I did everything wrong. I'm open to any input about which of the many ways there are to do it that people would prefer to have made simple via the port or the ways people are doing resolution of the .bit TLD already using FreeBSD.
>How-To-Repeat:
In particular, I'm out of my depth when it comes to getting a gcc from ports to properly play nice with qmake, and I resorted to a libconf.d config in this port that I'm hoping someone will teach my how to avoid. Maybe it's not terrible but my gut tells me I'm doing it wrong. The compilation output that starts:

g++47 -Wl,-rpath=/usr/lib:/usr/local/lib -Wl,-rpath=/usr/local/lib/gcc47 -L/usr/local/lib/gcc47 -fstack-protector-all -Wl,-O1 -pthread -Wl,-rpath,/usr/local/lib/qt4 -o namecoin-qt

seems to have too many -Wl,-rpath='s in it for my taste and without the included libmap.d hack results in a namecoin-qt that simply gasps as it dies:

/usr/lib/libstdc++.so.6: version GLIBCXX_3.4.11 required by /usr/local/bin/namecoin-qt not found

If anyone knows how to eliminate the need for the libconf.d/namecoin-qt.conf I included in this port, or how to eliminate the USE_GCC=yes altogether, your help would be much appreciated. I may be totally off base but hopefully this will start us off toward having a usable and stable namecoin client and rpc server on FreeBSD!
>Fix:


Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	namecoin
#	namecoin/pkg-descr
#	namecoin/files
#	namecoin/files/patch-src_qt_configurenamedialog.h
#	namecoin/files/patch-src_net.cpp
#	namecoin/files/patch-src_main.h
#	namecoin/files/patch-src_qt_managenamespage.h
#	namecoin/files/libmap.conf
#	namecoin/files/makefile.unix
#	namecoin/distinfo
#	namecoin/Makefile
#	namecoin-daemon
#	namecoin-daemon/Makefile
#
echo c - namecoin
mkdir -p namecoin > /dev/null 2>&1
echo x - namecoin/pkg-descr
sed 's/^X//' >namecoin/pkg-descr << '117f67382f1626fb9fd126b6e66ee216'
XNamecoin is an open source decentralized key/value registration and transfer system based on Bitcoin technology (a decentralized cryptocurrency).
X
XIt allows you to:
X
X    Securely register and transfer arbitrary names (keys), no possible censorship!
X    Attach values (data) to the names (currently up to 520 bytes, will be extended)
X    Trade and transact namecoins, the digital currency NMC
X
XThere are plenty of possible use cases. Some examples:
X
X    DNS: domain_name => domain_zone_configuration (also for i2p, Tor)
X    TLS: https like encryption and secure identification by Namecoin domain/ID/name
X    Alias/Identity: user_name => user_public_identity (email, name, gpg key, BTC-adress, etc)
X    Timestamping: document_hash => document_infos (name, hash, owner, etc)
X    Broadcasting / Messaging
X    Web of trust
X    Bonds, shares
X    Voting
X    Torrent tracker
X
XTo register a name, you must own some namecoins (NMC, the internal cryptocurrency used by the software).
X
XWWW: http://namecoin.info/
117f67382f1626fb9fd126b6e66ee216
echo c - namecoin/files
mkdir -p namecoin/files > /dev/null 2>&1
echo x - namecoin/files/patch-src_qt_configurenamedialog.h
sed 's/^X//' >namecoin/files/patch-src_qt_configurenamedialog.h << 'fd458b3f77de7a4d2e771dad5f7c5475'
X--- src/qt/configurenamedialog.h.orig	2014-01-03 19:35:57.779743611 +0000
X+++ src/qt/configurenamedialog.h	2014-01-03 19:36:36.515288567 +0000
X@@ -1,6 +1,9 @@
X #ifndef CONFIGURENAMEDIALOG_H
X #define CONFIGURENAMEDIALOG_H
X 
X+#include <sys/socket.h>
X+#include <netinet/in.h>
X+
X #include <QDialog>
X 
X namespace Ui {
fd458b3f77de7a4d2e771dad5f7c5475
echo x - namecoin/files/patch-src_net.cpp
sed 's/^X//' >namecoin/files/patch-src_net.cpp << '586303403abf3298ba56c9d325e47c3b'
X--- src/net.cpp.orig	2014-01-03 18:15:08.517743991 +0000
X+++ src/net.cpp	2014-01-03 18:16:00.387744056 +0000
X@@ -1094,13 +1094,8 @@
X         char intClient[16];
X         char intPort[6];
X 
X-#if !defined(__WXMSW__) && !defined(MAC_OSX)
X-        r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
X-	                        port, port, lanaddr, 0, "TCP", 0);
X-#else
X         r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
X 	                        port, port, lanaddr, 0, "TCP", 0, "0");
X-#endif
X         if(r!=UPNPCOMMAND_SUCCESS)
X             printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
X                 port, port, lanaddr, r, strupnperror(r));
586303403abf3298ba56c9d325e47c3b
echo x - namecoin/files/patch-src_main.h
sed 's/^X//' >namecoin/files/patch-src_main.h << 'bf1841f707c8c379965f83bbf4af097c'
X--- src/main.h.orig	2014-01-03 14:53:49.331743939 +0000
X+++ src/main.h	2014-01-03 14:54:29.778743504 +0000
X@@ -16,7 +16,6 @@
X #ifdef __WXMSW__
X #include <io.h> /* for _commit */
X #elif !defined(MAC_OSX)
X-#include <sys/prctl.h>
X #endif
X 
X class CBlock;
bf1841f707c8c379965f83bbf4af097c
echo x - namecoin/files/patch-src_qt_managenamespage.h
sed 's/^X//' >namecoin/files/patch-src_qt_managenamespage.h << '8df20cff343bcdb5a186bae5abcfa0c9'
X--- src/qt/managenamespage.h.orig	2014-01-03 19:31:40.464744466 +0000
X+++ src/qt/managenamespage.h	2014-01-03 19:31:48.654744497 +0000
X@@ -1,6 +1,9 @@
X #ifndef MANAGENAMESPAGE_H
X #define MANAGENAMESPAGE_H
X 
X+#include <sys/socket.h>
X+#include <netinet/in.h>
X+
X #include <QDialog>
X #include <QSortFilterProxyModel>
X 
8df20cff343bcdb5a186bae5abcfa0c9
echo x - namecoin/files/libmap.conf
sed 's/^X//' >namecoin/files/libmap.conf << 'b73e42350c757e7857779ba55f47a901'
X[%%BINARY%%]
Xlibstdc++.so.6	%%CC%%/libstdc++.so.6
b73e42350c757e7857779ba55f47a901
echo x - namecoin/files/makefile.unix
sed 's/^X//' >namecoin/files/makefile.unix << '2869bc8ad2dd8f7c83a6384e6e3ce423'
XCXX?=g++
XDEFS=-DNOPCH -DFOURWAYSSE2 -DUSE_SSL
X
XLIBS= \
X -Wl,-Bstatic \
X   -l boost_system \
X   -l boost_filesystem \
X   -l boost_program_options \
X   -l boost_thread \
X   -l boost_chrono \
X   -l db_cxx \
X   -l ssl \
X   -l crypto
X
XUSE_UPNP:=0
Xifneq (${USE_UPNP}, -)
X	LIBS += -l miniupnpc
X	DEFS += -DUSE_UPNP=$(USE_UPNP)
Xendif
X
XLIBS+= \
X -Wl,-Bdynamic \
X   -l gthread-2.0 \
X   -l z \
X   -l pthread
X
XCXXFLAGS+=-O2 -Wno-invalid-offsetof -Wformat $(DEFS)
XHEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
X    script.h allocators.h db.h walletdb.h crypter.h net.h irc.h keystore.h main.h \
X    wallet.h bitcoinrpc.h uibase.h ui.h noui.h init.h auxpow.h
X
XBASE_OBJS= \
X    obj/auxpow.o \
X    obj/util.o \
X    obj/key.o \
X    obj/script.o \
X    obj/db.o \
X    obj/walletdb.o \
X    obj/crypter.o \
X    obj/net.o \
X    obj/irc.o \
X    obj/keystore.o \
X    obj/main.o \
X    obj/wallet.o \
X    obj/bitcoinrpc.o \
X    obj/init.o \
X    cryptopp/obj/sha.o \
X    cryptopp/obj/cpu.o
X
XOBJS = \
X    $(BASE_OBJS) \
X    obj/hook.o
X
Xall: namecoind
X
Xcryptopp/obj/%.o: cryptopp/%.cpp
X	$(CXX) -c $(CXXFLAGS) -O3 -o $@ $<
X
Xobj/nogui/%.o: %.cpp $(HEADERS)
X	$(CXX) -c $(CXXFLAGS) -o $@ $<
X
Xobj/test/%.o: test/%.cpp $(HEADERS)
X	$(CXX) -c $(CFLAGS) -o $@ $<
X
Xobj/nogui/namecoin.o: namecoin.h
X
Xnamecoind: $(BASE_OBJS:obj/%=obj/nogui/%) obj/nogui/namecoin.o
X	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS)
X
Xclean:
X	-rm -f namecoin namecoind
X	-rm -f obj/*.o
X	-rm -f obj/nogui/*.o
X	-rm -f obj/test/*.o
X	-rm -f cryptopp/obj/*.o
X	-rm -f headers.h.gch
2869bc8ad2dd8f7c83a6384e6e3ce423
echo x - namecoin/distinfo
sed 's/^X//' >namecoin/distinfo << 'af7280dcc6b0f3404156a1150a56ce37'
XSHA256 (namecoin-Q.3.72.tar.gz) = 426b6c10b999ed11f436b2d8a56715a4355d30af41e13a1fd6e6ee5dd8348775
XSIZE (namecoin-Q.3.72.tar.gz) = 1453900
af7280dcc6b0f3404156a1150a56ce37
echo x - namecoin/Makefile
sed 's/^X//' >namecoin/Makefile << 'e2404596dd40f9872699085b1b2157fb'
X# Created by: Chad J. Milios <milios@ccsys.com>
X# $FreeBSD$
X
XPORTNAME=	namecoin
XPORTVERSION=	Q.3.72
XCATEGORIES=	net-p2p dns
XMASTER_SITES=	GH
X
XMAINTAINER=	milios@ccsys.com
XCOMMENT=	A decentralized, open DNS system and general purpose key/value store.
X
XLIB_DEPENDS=	libboost_date_time.so:${PORTSDIR}/devel/boost-libs
X
XUSE_GCC=	yes
X
XOPTIONS_DEFINE=	GUI UPNP QRCODES
XOPTIONS_DEFAULT=	GUI QRCODES
X
XGUI_DESC=	Build as a QT4 GUI
XUPNP_DESC=	Build with UPNP support
XQRCODES_DESC=	Build with QR code display
X
XUSE_GITHUB=	yes
XGH_ACCOUNT=	namecoinq
XGH_PROJECT=	namecoinq
XGH_COMMIT=	cdf052b
XGH_TAGNAME=	v${PORTVERSION}
X
XUSE_GMAKE=	yes
XUSE_OPENSSL=	yes
XUSE_BDB=	yes
XWANT_BDB_VER=	48
X
XCXXFLAGS+=	-I${LOCALBASE}/include -I${BDB_INCLUDE_DIR}
XCXXFLAGS+=	-L${LOCALBASE}/lib -L${BDB_LIB_DIR}
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
XUSE_QT4=	corelib gui qmake_build linguist uic moc rcc
XBINARY=		namecoin-qt
XPLIST_FILES+=	etc/libmap.d/${BINARY}.conf
XLIB_DEPENDS+=	libprotobuf.so:${PORTSDIR}/devel/protobuf
X.else
XBINARY=		namecoind
XMAKE_ARGS+=	-C ${WRKSRC}/src
X.endif
X
X.if ${PORT_OPTIONS:MQRCODES}
XLIB_DEPENDS+=	libqrencode.so:${PORTSDIR}/graphics/libqrencode
XQMAKE_USE_QRCODE=1
X.else
XQMAKE_USE_QRCODE=0
X.endif
X
X.if ${PORT_OPTIONS:MDBUS}
XUSE_QT4+=       dbus
XQMAKE_USE_DBUS= 1
X.else
XQMAKE_USE_DBUS= 0
X.endif
X
XPLIST_FILES+=	bin/${BINARY}
X
X.if ${PORT_OPTIONS:MUPNP}
XLIB_DEPENDS+=	libminiupnpc.so:${PORTSDIR}/net/miniupnpc
XQMAKE_USE_UPNP=	1
X.else
XQMAKE_USE_UPNP=	-
X.endif
X
X.include <bsd.port.pre.mk>
X
Xpost-patch:
X.if !${PORT_OPTIONS:MGUI} || defined(WITHOUT_X11)
X	@cd ${WRKSRC}/src && ${CP} ${FILESDIR}/makefile.unix Makefile
X	@${REINPLACE_CMD} \
X		-e 's|^USE_UPNP.*$$|USE_UPNP=${QMAKE_USE_UPNP}|' \
X		-e 's|-l pthread|${PTHREAD_LIBS}|g' \
X		${WRKSRC}/src/Makefile
X.else
X	@${CP} ${FILESDIR}/libmap.conf ${WRKSRC}/libmap.conf
X	@${REINPLACE_CMD} \
X	-e 's|%%BINARY%%|${BINARY}|' \
X		-e 's|%%CC%%|${CC}|' \
X		${WRKSRC}/libmap.conf
X.endif
X
Xdo-configure:
X.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
X	cd ${WRKSRC} && ${SETENV} ${QMAKE_ENV} \
X		${QMAKE} ${QMAKE_ARGS} USE_UPNP=${QMAKE_USE_UPNP} USE_QRCODE=${QMAKE_USE_QRCODE} \
X		QMAKE_LRELEASE=${LRELEASE} INCLUDEPATH+=${BDB_INCLUDE_DIR} \
X		QMAKE_LIBDIR+=${BDB_LIB_DIR} ${BINARY}.pro
X.endif
X
Xdo-install:
X	@${MKDIR} ${STAGEDIR}${PREFIX}/bin
X.if ${PORT_OPTIONS:MGUI} && !defined(WITHOUT_X11)
X	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/libmap.d
X	${CP} ${WRKSRC}/libmap.conf ${STAGEDIR}${PREFIX}/etc/libmap.d/${BINARY}.conf
X	${INSTALL_PROGRAM} ${WRKSRC}/${BINARY} ${STAGEDIR}${PREFIX}/bin/
X.else
X	${INSTALL_PROGRAM} ${WRKSRC}/src/${BINARY} ${STAGEDIR}${PREFIX}/bin/
X.endif
X
X.include <bsd.port.post.mk>
e2404596dd40f9872699085b1b2157fb
echo c - namecoin-daemon
mkdir -p namecoin-daemon > /dev/null 2>&1
echo x - namecoin-daemon/Makefile
sed 's/^X//' >namecoin-daemon/Makefile << '133b970f294840a0aacb3b455ea21902'
X# $FreeBSD$
X
XPKGNAMESUFFIX=	-daemon
XCOMMENT=	A decentralized, open DNS system and general purpose key/value store.
XMASTERDIR=	${.CURDIR}/../namecoin
XDESCR=		${MASTERDIR}/pkg-descr
XSLAVE_PORT=	yes
XOPTIONS_EXCLUDE=	GUI QRCODES
X.include "${MASTERDIR}/Makefile"
133b970f294840a0aacb3b455ea21902
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401040701.s0471tmp005793>