aboutsummaryrefslogtreecommitdiffstats
path: root/community/namecoin
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2016-08-18 20:46:53 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2016-08-21 22:24:04 +0200
commit5c9f3ca3e307be53b45beeed2ce1626f38008625 (patch)
tree919836fe454e953f46685adf8228b0401280d4b6 /community/namecoin
parent6a00a953ba02bab6440a2c784e7db37c6eaeace1 (diff)
testing/[various]: move to community
albatross-themes apk-post-messages autossh bitcoin btrbk entr ffmpegthumbnailer firejail firetools fwsnort gnome-colors imapsync inetutils-syslogd inotify-tools-inc isync junit ktsuss letsencrypt-nosudo libmbim libndp libqmi libteam mini-sendmail modemmanager namecoin networkmanager nginx-naxsi numix-themes nxapi opencl-headers opencl-icd-loader opus-tools perl-authen-ntlm perl-bit-vector perl-data-uniqid perl-file-copy-recursive perl-getopt-argvfile perl-io-tee perl-iptables-chainmgr perl-iptables-parse perl-module-scandeps perl-par-dist perl-par-packer perl-par perl-uri-escape psad py-crcmod py-graphviz py-lz4 py-opencl py-opengl-accelerate runit secpwgen secure-delete socklog spacefm tinyssh udevil virt-viewer virtualbricks whois wrk xpra zram-init
Diffstat (limited to 'community/namecoin')
-rw-r--r--community/namecoin/12-fix-miniupnpc.patch17
-rw-r--r--community/namecoin/20-boost-multithread-dynamic.patch33
-rw-r--r--community/namecoin/31-set-default-env-function.patch61
-rw-r--r--community/namecoin/APKBUILD75
-rw-r--r--community/namecoin/namecoin.conf13
-rw-r--r--community/namecoin/namecoin.initd38
-rw-r--r--community/namecoin/namecoin.post-install35
-rw-r--r--community/namecoin/namecoin.pre-install6
-rw-r--r--community/namecoin/system-strlcpy.patch60
9 files changed, 338 insertions, 0 deletions
diff --git a/community/namecoin/12-fix-miniupnpc.patch b/community/namecoin/12-fix-miniupnpc.patch
new file mode 100644
index 00000000000..bf226df8a42
--- /dev/null
+++ b/community/namecoin/12-fix-miniupnpc.patch
@@ -0,0 +1,17 @@
+--- namecoin-nc*/src/net.cpp
++++ namecoin-nc*/src/net.cpp
+@@ -19,10 +19,10 @@
+ #endif
+
+ #ifdef USE_UPNP
+-#include <miniwget.h>
+-#include <miniupnpc.h>
+-#include <upnpcommands.h>
+-#include <upnperrors.h>
++#include <miniupnpc/miniwget.h>
++#include <miniupnpc/miniupnpc.h>
++#include <miniupnpc/upnpcommands.h>
++#include <miniupnpc/upnperrors.h>
+ #endif
+
+ using namespace std;
diff --git a/community/namecoin/20-boost-multithread-dynamic.patch b/community/namecoin/20-boost-multithread-dynamic.patch
new file mode 100644
index 00000000000..4adf46f3495
--- /dev/null
+++ b/community/namecoin/20-boost-multithread-dynamic.patch
@@ -0,0 +1,33 @@
+--- namecoin-nc*/src/Makefile
++++ namecoin-nc*/src/Makefile
+@@ -9,24 +9,20 @@
+ DEFS += -DBOOST_THREAD_USE_LIB
+
+ INCLUDEPATHS= \
+- -I../libs/openssl-1.0.1i/include \
+- -I../libs/db-4.7.25.NC/build_unix \
+- -I../libs/boost_1_50_0
++ -I/usr/include
+
+ LIBPATHS= \
+- -L../libs/openssl-1.0.1i \
+- -L../libs/db-4.7.25.NC/build_unix \
+- -L../libs/boost_1_50_0/stage/lib
++ -L/usr/lib
+
+ LIBBOOST_SUFFIX=
+
+ LIBS= \
+- -Wl,-Bstatic \
++ -Wl,-Bdynamic \
+ -l boost_system$(LIBBOOST_SUFFIX) \
+ -l boost_filesystem$(LIBBOOST_SUFFIX) \
+- -l boost_program_options$(LIBBOOST_SUFFIX) \
+- -l boost_thread$(LIBBOOST_SUFFIX) \
+- -l boost_chrono$(LIBBOOST_SUFFIX) \
++ -l boost_program_options-mt$(LIBBOOST_SUFFIX) \
++ -l boost_thread-mt$(LIBBOOST_SUFFIX) \
++ -l boost_chrono-mt$(LIBBOOST_SUFFIX) \
+ -l db_cxx \
+ -l ssl \
+ -l crypto
diff --git a/community/namecoin/31-set-default-env-function.patch b/community/namecoin/31-set-default-env-function.patch
new file mode 100644
index 00000000000..9af0446cfd2
--- /dev/null
+++ b/community/namecoin/31-set-default-env-function.patch
@@ -0,0 +1,61 @@
+--- namecoin-nc*/src/init.cpp
++++ namecoin-nc*/src/init.cpp
+@@ -99,6 +99,10 @@
+ #ifndef GUI
+ int main(int argc, char* argv[])
+ {
++ #ifndef WIN32
++ SetupEnvironment();
++ #endif
++
+ bool fRet = false;
+ fRet = AppInit(argc, argv);
+
+--- namecoin-nc*/src/qt/bitcoin.cpp
++++ namecoin-nc*/src/qt/bitcoin.cpp
+@@ -124,6 +124,10 @@
+ #ifndef BITCOIN_QT_TEST
+ int main(int argc, char *argv[])
+ {
++ #ifndef WIN32
++ SetupEnvironment();
++ #endif
++
+ // Command-line options take precedence:
+ ParseParameters(argc, argv);
+
+--- namecoin-nc*/src/util.cpp
++++ namecoin-nc*/src/util.cpp
+@@ -1114,3 +1114,20 @@
+ }
+ return true;
+ }
++
++#ifndef WIN32
++void SetupEnvironment()
++{
++ try
++ {
++ #if BOOST_FILESYSTEM_VERSION == 3
++ boost::filesystem::path::codecvt(); // Raises runtime error if current locale is invalid
++ #else // boost filesystem v2
++ std::locale(); // Raises runtime error if current locale is invalid
++ #endif
++ } catch(std::runtime_error &e)
++ {
++ setenv("LC_ALL", "C", 1); // Force C locale
++ }
++}
++#endif
+
+--- namecoin-nc0.3.76/src/util.h
++++ namecoin-nc0.3.76/src.new/util.h
+@@ -211,6 +211,7 @@
+
+ void RandAddSeed();
+ void RandAddSeedPerfmon();
++void SetupEnvironment();
+ int OutputDebugStringF(const char* pszFormat, ...);
+ int my_snprintf(char* buffer, size_t limit, const char* format, ...);
+
+
diff --git a/community/namecoin/APKBUILD b/community/namecoin/APKBUILD
new file mode 100644
index 00000000000..a2d5eff3432
--- /dev/null
+++ b/community/namecoin/APKBUILD
@@ -0,0 +1,75 @@
+# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname=namecoin
+pkgver=0.3.80
+pkgrel=1
+pkgdesc="Namecoin is a peer to peer DNS based on bitcoin"
+url="https://github.com/namecoin/namecoin"
+arch=""
+license="GPL"
+depends=""
+depends_dev="openssl-dev db-dev boost-dev miniupnpc-dev glib-dev qt5-qtbase-dev qt5-qttools-dev"
+makedepends="$depends_dev bsd-compat-headers"
+install="$pkgname.post-install $pkgname.pre-install"
+subpackages="$pkgname-qt"
+source="$pkgname-$pkgver.tar.gz::https://github.com/namecoin/namecoin/archive/nc$pkgver.tar.gz
+ 20-boost-multithread-dynamic.patch
+ system-strlcpy.patch
+ $pkgname.initd
+ $pkgname.conf
+ "
+
+_builddir="$srcdir"/namecoin-nc$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"/src
+ # build namecoind
+ make USE_UPNP=1 USE_SSL=1 || return 1
+ cd ..
+ # build namecoin-qt
+ qmake
+ # Fix boost_multi thread linking in the GUI too
+ sed -i 's/-lboost_thread/-lboost_thread-mt/g' ./Makefile
+ sed -i 's/-lboost_program_options/-lboost_program_options-mt/g' ./Makefile
+ sed -i 's/-lboost_chrono/-lboost_chrono-mt/g' ./Makefile
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"/src
+ install -Dm755 namecoind "$pkgdir"/usr/bin/namecoind || return 1
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname || return 1
+ install -m600 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf || return 1
+}
+
+qt() {
+ pkgdesc="Namecoin with a Qt frontend"
+ cd "$_builddir"
+ mkdir -p "$subpkgdir"/usr/bin
+ install -Dm755 namecoin-qt "$subpkgdir"/usr/bin/namecoin-qt || return 1
+}
+
+md5sums="7302f83d8390184139277255a6c1d484 namecoin-0.3.80.tar.gz
+e4e43d7420191a94500189fe58a34a9c 20-boost-multithread-dynamic.patch
+3350b82aec4eb1edb2555c0b0e8b0451 system-strlcpy.patch
+9ecdbd9e17240075d064498a80fd50bd namecoin.initd
+59b2e0e765738ba48f632051fb6917ae namecoin.conf"
+sha256sums="3f5e5af95cea46111d3cf1663f0e84d5fda653917745e0607a3ca4773baea59c namecoin-0.3.80.tar.gz
+1b0e2c1c3ca849df816405c9f8dd86e056daed213c3e4c4e72161cabd64e67e8 20-boost-multithread-dynamic.patch
+44ff4beb1a10bd1e6a0f984a37d69e025b2c2b5de58af300ec5c23fd3e83f67e system-strlcpy.patch
+04ae66115343aa8ed7343139a2370b1e570c8ab4397d09457f5f157dd906a204 namecoin.initd
+4b413833527929ea863351469a5a4fc1e0ac365fe9df5e8a8304d8667acf8cea namecoin.conf"
+sha512sums="6ff3fddd72cf8ed4224b42deb6a7ca50906262cb50c3ca5ccb419791daa474d52b9584cbc47240fa7546c3f23fe23b72af475f16d1dd110ab13098e3e60a5de6 namecoin-0.3.80.tar.gz
+fc13574fef73cca20178e5895e2327567f40c91d25105d72b301a155f9025bfb494ce337096424fd71da8034fb0544562b8459c1d8ae2598ee503efd5995c6bf 20-boost-multithread-dynamic.patch
+8701c8faf786420a7085a8e5d85080fe18f26e53ae346c1c897315fd7f8f00e1f1e326ed5917b0eefa8f74bc7470e8979c1b10515017584baa2e9feb3c39b205 system-strlcpy.patch
+3048248b3da7300b0b3cb5667283badc17b41e6c90573604fd9ea9eb9933e93f9b1d6288846793b4e7a001a4cae5e52d2ce42e4bdc83e48f72aca6ee0e8ddd43 namecoin.initd
+3f92cb9a5f66d0e9e3792691b2e62b929c092030273bb87ebd9564e0c02196a5a9f69c458162f1b35099ac28e9b79b1c4035144b9d2dae4ad3e87d05a40d7ed4 namecoin.conf"
diff --git a/community/namecoin/namecoin.conf b/community/namecoin/namecoin.conf
new file mode 100644
index 00000000000..dd483322591
--- /dev/null
+++ b/community/namecoin/namecoin.conf
@@ -0,0 +1,13 @@
+### Namecoin configuration for Alpine Linux ###
+# #
+##### data directory is /var/lib/namecoin #####
+##### & set in /etc/init.d/namecoin not here ##
+#
+#proxy=127.0.0.1:9050 #use TOR Socks Proxy
+rpcallowip=127.0.0.1
+rpcuser=changeme
+rpcpassword=changeme
+rpcport=changeme
+daemon=1
+#gen=1 #generate namecoins
+
diff --git a/community/namecoin/namecoin.initd b/community/namecoin/namecoin.initd
new file mode 100644
index 00000000000..9bdeea08932
--- /dev/null
+++ b/community/namecoin/namecoin.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+
+# Namecoin init.d file for Alpine Linux.
+
+name=namecoind
+daemon=/usr/bin/$name
+config=/etc/namecoin.conf
+user=namecoin
+group=namecoin
+## supercedes datadir set in $config ##
+datadir=/var/lib/namecoin
+pidfile=/var/run/namecoin/$name.pid
+
+depend() {
+ need net
+ after logger firewall
+}
+
+start() {
+ ebegin "Starting ${name}"
+ # enforce permissions
+ checkpath -q -d ${pidfile%/*} -o ${user}:${group}
+ checkpath -q -d ${datadir} -m 0700 -o ${user}:${group}
+ checkpath -q -f ${config} -m 0600 -o ${user}:${group}
+ start-stop-daemon --start --quiet \
+ --pidfile ${pidfile} \
+ --user ${user}:${group} \
+ --exec ${daemon} -- -conf=${config} -datadir=${datadir} -pid=${pidfile}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile ${pidfile} \
+ --exec ${daemon}
+ eend $?
+}
diff --git a/community/namecoin/namecoin.post-install b/community/namecoin/namecoin.post-install
new file mode 100644
index 00000000000..ee8b756b407
--- /dev/null
+++ b/community/namecoin/namecoin.post-install
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+GREEN="\033[1;32m"
+
+config=$(grep -F 'config=' /etc/init.d/namecoin |sed 's/config=//')
+
+randgen() {
+ output=$(cat /dev/urandom | tr -dc '0-9a-zA-Z!@#$%^&*_+-' | head -c${1:-$1}) 2>/dev/null
+ echo $output
+}
+
+findRandomTcpPort(){
+ port=$(( 1024 + $(( $RANDOM % $(( 65534 - 1024 )) )) ))
+ while netstat -atn | grep -q :$port; do port=$(expr $port + 1); done; echo $port
+}
+
+GenPasswd(){
+ sed -i "/rpcuser=/ c \rpcuser=USER-"$(randgen 32)"" $config
+ sed -i "/rpcpassword=/ c \rpcpassword=PW-"$(randgen 64)"" $config
+ sed -i "/rpcport=/ c \rpcport="$(findRandomTcpPort)"" $config
+ print_green "Generated random user / password / port in:" " $config\n"
+}
+
+print_green() {
+ local prompt="${STRONG}$1${GREEN}$2${NORMAL}"
+ printf "${prompt}%s"
+}
+
+if grep -F "changeme" $config 1>/dev/null; then
+ GenPasswd
+fi
+
+exit 0
diff --git a/community/namecoin/namecoin.pre-install b/community/namecoin/namecoin.pre-install
new file mode 100644
index 00000000000..f41286d1bda
--- /dev/null
+++ b/community/namecoin/namecoin.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S namecoin 2>/dev/null
+adduser -S -D -h /var/lib/namecoin -s /sbin/nologin -G namecoin -g namecoin namecoin 2>/dev/null
+
+exit 0
diff --git a/community/namecoin/system-strlcpy.patch b/community/namecoin/system-strlcpy.patch
new file mode 100644
index 00000000000..f7bb2717df8
--- /dev/null
+++ b/community/namecoin/system-strlcpy.patch
@@ -0,0 +1,60 @@
+diff --git a/src/init.cpp b/src/init.cpp
+index bc7e714..295e20f 100644
+--- a/src/init.cpp
++++ b/src/init.cpp
+@@ -6,7 +6,6 @@
+ #include "bitcoinrpc.h"
+ #include "net.h"
+ #include "init.h"
+-#include "strlcpy.h"
+ #include <boost/filesystem.hpp>
+ #include <boost/filesystem/fstream.hpp>
+ #include <boost/interprocess/sync/file_lock.hpp>
+diff --git a/src/irc.cpp b/src/irc.cpp
+index fea0aa2..fd5d8c4 100644
+--- a/src/irc.cpp
++++ b/src/irc.cpp
+@@ -5,7 +5,6 @@
+ #include "headers.h"
+ #include "irc.h"
+ #include "net.h"
+-#include "strlcpy.h"
+
+ using namespace std;
+ using namespace boost;
+diff --git a/src/net.cpp b/src/net.cpp
+index 4d2f651..7df2b77 100644
+--- a/src/net.cpp
++++ b/src/net.cpp
+@@ -7,7 +7,6 @@
+ #include "db.h"
+ #include "net.h"
+ #include "init.h"
+-#include "strlcpy.h"
+
+ #ifdef __WXMSW__
+ #include <string.h>
+diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
+index 30dcca6..21a11af 100644
+--- a/src/qt/bitcoin.cpp
++++ b/src/qt/bitcoin.cpp
+@@ -15,7 +15,6 @@
+ #include "ui_interface.h"
+ #include "paymentserver.h"
+ #include "../allocators.h"
+-#include "../strlcpy.h"
+
+ #include <boost/filesystem.hpp>
+
+diff --git a/src/util.cpp b/src/util.cpp
+index fc51717..50ce19f 100644
+--- a/src/util.cpp
++++ b/src/util.cpp
+@@ -2,7 +2,6 @@
+ // Distributed under the MIT/X11 software license, see the accompanying
+ // file license.txt or http://www.opensource.org/licenses/mit-license.php.
+ #include "headers.h"
+-#include "strlcpy.h"
+ #include <boost/program_options/detail/config_file.hpp>
+ #include <boost/program_options/parsers.hpp>
+ #include <boost/filesystem.hpp>