Builds on uclibc & musl 32 bit with miniupnpc 1.8 / 1.9 & 1.9.20140401
libraries.
---
testing/namecoin/10-use-latest-UPnP-lib.patch | 11 +++
.../20-boost-thread_build-dynamically.patch | 19 +++++
testing/namecoin/APKBUILD | 83 ++++++++++++++++++++++
testing/namecoin/namecoin.conf | 10 +++
testing/namecoin/namecoin.confd | 13 ++++
testing/namecoin/namecoin.initd | 38 ++++++++++
testing/namecoin/namecoin.post-deinstall | 22 ++++++
testing/namecoin/namecoin.post-install | 54 ++++++++++++++
8 files changed, 250 insertions(+)
create mode 100644 testing/namecoin/10-use-latest-UPnP-lib.patch
create mode 100644 testing/namecoin/20-boost-thread_build-dynamically.patch
create mode 100644 testing/namecoin/APKBUILD
create mode 100644 testing/namecoin/namecoin.conf
create mode 100644 testing/namecoin/namecoin.confd
create mode 100644 testing/namecoin/namecoin.initd
create mode 100644 testing/namecoin/namecoin.post-deinstall
create mode 100644 testing/namecoin/namecoin.post-install
diff --git a/testing/namecoin/10-use-latest-UPnP-lib.patch b/testing/namecoin/10-use-latest-UPnP-lib.patch
new file mode 100644
index 0000000..89d9a45
--- /dev/null
+++ b/testing/namecoin/10-use-latest-UPnP-lib.patch
@@ -0,0 +1,11 @@
+--- src/net.cpp
++++ src/net.cpp.new
+@@ -1087,7 +1087,7 @@
+
+ #ifndef __WXMSW__
+ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
+- port, port, lanaddr, 0, "TCP", 0);
++ port, port, lanaddr, 0, "TCP", 0, "0");
+ #else
+ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
+ port, port, lanaddr, 0, "TCP", 0, "0");
diff --git a/testing/namecoin/20-boost-thread_build-dynamically.patch b/testing/namecoin/20-boost-thread_build-dynamically.patch
new file mode 100644
index 0000000..4bd7992
--- /dev/null
+++ b/testing/namecoin/20-boost-thread_build-dynamically.patch
@@ -0,0 +1,19 @@
+--- src/Makefile
++++ src/Makefile.new
+@@ -21,13 +21,13 @@
+ 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_thread-mt$(LIBBOOST_SUFFIX) \
+ -l boost_chrono$(LIBBOOST_SUFFIX) \
+- -l db_cxx \
++ -l db_cxx$(BDB_LIB_SUFFIX) \
+ -l ssl \
+ -l crypto
+
diff --git a/testing/namecoin/APKBUILD b/testing/namecoin/APKBUILD
new file mode 100644
index 0000000..8a8f4c2
--- /dev/null
+++ b/testing/namecoin/APKBUILD
@@ -0,0 +1,83 @@
+# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+pkgname=namecoin
+pkgver=3.72
+pkgrel=0
+pkgdesc="Namecoin is a peer to peer DNS based on bitcoin"
+url="https://github.com/namecoin/namecoin"
+arch="all"
+license="GPL"
+depends=""
+depends_dev="openssl-dev db-dev boost-dev miniupnpc-dev glib-dev qt-dev"
+makedepends="$depends_dev"
+install="$pkgname.post-install $pkgname.post-deinstall"
+subpackages="$pkgname-qt"
+source="https://github.com/namecoin/namecoin/archive/vQ.$pkgver.tar.gz
+ 10-use-latest-UPnP-lib.patch
+ 20-boost-thread_build-dynamically.patch
+ $pkgname.initd
+ $pkgname.confd
+ $pkgname.conf
+ "
+
+_builddir="$srcdir"/namecoin-vQ.$pkgver/src
+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"
+ # build namecoind
+ make USE_UPNP=1 USE_SSL=1 || return 1
+ cd ..
+ # build namecoin-qt
+ qmake
+ # Fix boost_thread linking
+ sed -i 's/-lboost_thread/-lboost_thread-mt/g' ./Makefile
+ make || return 1
+}
+
+qt() {
+ pkgdesc="Qt frontend for Namecoin"
+ depends="namecoin=$pkgver-r$pkgrel"
+ cd "$srcdir"/namecoin-vQ.$pkgver
+ install -Dm755 namecoin-qt "$pkgdir"/usr/bin/namecoinqt || return 1
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/namecoinqt \
+ "$subpkgdir"/usr/bin/
+}
+
+package() {
+ cd "$_builddir"
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
+ # daemon config
+ install -m600 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
+ # app config
+ install -m600 -D "$srcdir"/$pkgname.conf "$pkgdir"/etc/$pkgname.conf
+ install -Dm755 namecoind "$pkgdir"/usr/bin/namecoind || return 1
+}
+
+md5sums="dc1cc80bcf0833f0bf7239e7ae6c1399 vQ.3.72.tar.gz
+4806af721972347f7bc9f00cc8209368 10-use-latest-UPnP-lib.patch
+9bf15d9314cacd8b9d89f25029745045 20-boost-thread_build-dynamically.patch
+bca7c0a28a42b88023210cedb566ee6a namecoin.initd
+a09e207f13abdf2aa098348f362b2ebc namecoin.confd
+7c27809a00b5c43577d5ebc93e287ff4 namecoin.conf"
+sha256sums="8c30214186bf0baf4f779235e82715a99686c8c358524ffa352b88e2a3d98725 vQ.3.72.tar.gz
+781f9e85d02edbd6bd635302a4b9563ee0a00762949343cb192df8d675ffc06f 10-use-latest-UPnP-lib.patch
+8ef976aa4f24413ca4bda9c004b095e053224fb679a30cb9903bf23307b73414 20-boost-thread_build-dynamically.patch
+26ea79512075e854dc86a87618008fbf8a0d6a660263f217cc240c4add08f55b namecoin.initd
+ce62ed34f03544de3afa6beca86c6ac62a5860da808f8412e6b5dd87ea3086fa namecoin.confd
+d12169f4ba7606220c9d1f84a9997fc497fbc7b5e88c2b651849df011ac0a7f4 namecoin.conf"
+sha512sums="fac3b0cb3d02ccb438869752581ab57df6dd8e47201e613e73c64459009d9d20358f6595400938e61bf795f679466a098bbc77f1b2940591ec93d04cc387ea32 vQ.3.72.tar.gz
+c69826ac80ea1c1f447d6000a43b7be93f79e3667e0b7dd19cc86a9cb2d579d715549c32bf5b75b601208c404a7c0e574627c566c0cca513258ad73a28a831b5 10-use-latest-UPnP-lib.patch
+b0e148e8cc736b0ef6e2b47c3f2379795ecc519d9b95358c159633f31999d9811484ae9ae522d42015bf25dd6c22035ebd9b2089084559ed12ce24cf04a2d95d 20-boost-thread_build-dynamically.patch
+b6336d6f1fa854b505ed445f054bc8027a5e3a033563487fa43f430533e8ea4d335311ff726143517880d5b516783270f6d22a6ae5b4499814adc54dd0e947d1 namecoin.initd
+e86d673c90aaac797c4c2a9ad4471e32774ac1fa81b0ce57ee4413d452ddd0d2ac1b7f825e62a713d1075d099385cb2687b8bdf534b200b0d7b20946786be119 namecoin.confd
+811c8f8dd2786876e699fe98c94dda363bac5b0e2f1c0f359a067a5858dd65312d3ab5cbdb7f79da6a6717f97e47691ed598e0a4b49084dcec8c0cb298e596f1 namecoin.conf"
diff --git a/testing/namecoin/namecoin.conf b/testing/namecoin/namecoin.conf
new file mode 100644
index 0000000..7697273
--- /dev/null
+++ b/testing/namecoin/namecoin.conf
@@ -0,0 +1,10 @@
+# Namecoin configuration file for Alpine Linux
+#
+#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/testing/namecoin/namecoin.confd b/testing/namecoin/namecoin.confd
new file mode 100644
index 0000000..a2b4542
--- /dev/null
+++ b/testing/namecoin/namecoin.confd
@@ -0,0 +1,13 @@
+# Namecoin daemon conf.d file for Alpine Linux
+#
+##################################################
+## If run as a NON root user / group change ##
+## 'pidfile' below to a user writable location ##
+##################################################
+name=namecoind
+daemon=/usr/bin/$name
+config=/etc/namecoin.conf
+user=root
+group=root
+pidfile=/var/run/$name.pid
+
diff --git a/testing/namecoin/namecoin.initd b/testing/namecoin/namecoin.initd
new file mode 100644
index 0000000..d9e89a2
--- /dev/null
+++ b/testing/namecoin/namecoin.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+
+# Namecoin init.d file for Alpine Linux.
+##################################################
+## If run as a NON root user / group change ##
+## 'pidfile' below to a user writable location ##
+##################################################
+
+name=namecoind
+daemon=/usr/bin/$name
+config=/etc/conf.d/namecoin
+user=root
+group=root
+pidfile=/var/run/${name}.pid
+
+depend() {
+ need net
+ after firewall
+}
+
+start() {
+ ebegin "Starting ${name}"
+ start-stop-daemon --start --quiet \
+ --pidfile /var/run/${name}.pid \
+ --user ${user}:${group} \
+ --exec ${daemon} -- -conf=${config} -pid=${pidfile}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile ${pidfile} \
+ --exec ${daemon}
+ eend $?
+}
+
+
diff --git a/testing/namecoin/namecoin.post-deinstall b/testing/namecoin/namecoin.post-deinstall
new file mode 100644
index 0000000..e642f8e
--- /dev/null
+++ b/testing/namecoin/namecoin.post-deinstall
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+RED="\033[1;31m"
+
+print_red() {
+ local prompt="${STRONG}$1${RED}$2${NORMAL}"
+ printf "${prompt}%s"
+}
+
+if grep -F "## LC_ALL setting required for namecoind ##" /etc/profile 1>/dev/null; then
+ sed -i '/## LC_ALL setting required for namecoind ##/d' /etc/profile
+ sed -i '/export LC_ALL=C/d' /etc/profile
+ print_red "\nRemoving locale setting fix for:" " Namecoind\n\n"
+ print_red "Deleted:" "\texport LC_ALL=C"
+ print_red "\nFrom:" "\t\t/etc/profile\n\n"
+fi
+
+exit 0
+
+
diff --git a/testing/namecoin/namecoin.post-install b/testing/namecoin/namecoin.post-install
new file mode 100644
index 0000000..444eb37
--- /dev/null
+++ b/testing/namecoin/namecoin.post-install
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+NORMAL="\033[1;0m"
+STRONG="\033[1;1m"
+GREEN="\033[1;32m"
+
+config=/etc/namecoin.conf
+
+randgen() {
+ output=$(< /dev/urandom tr -dc '0-9a-zA-Z!@#$%^&*_+-' | head -c${1:-$1}) 2>/dev/null
+ echo $output
+}
+
+# Generate random port
+randport() {
+ n=$RANDOM
+ while [ $n -gt 65536 ] && [ $n -lt 1024 ]; do
+ n=$RANDOM
+ done
+ echo $n
+}
+
+# Find unused TCP port
+findRandomTcpPort(){
+ port=$(randport)
+ while :
+ do
+ (echo >/dev/tcp/localhost/$port) &>/dev/null && port=$(randport) || break
+ done
+ echo $port
+}
+
+print_green() {
+ local prompt="${STRONG}$1${GREEN}$2${NORMAL}"
+ printf "${prompt}%s"
+}
+
+# Fix locale for namecoind
+if ! grep -F "export LC_ALL=C" /etc/profile 1>/dev/null; then
+ sed -i '1i export LC_ALL=C' /etc/profile
+ sed -i '1i ## LC_ALL setting required for namecoind ##' /etc/profile
+ print_green "\nSetting correct locale for:" " Namecoind\n\n"
+ print_green "Added:" "\texport LC_ALL=C"
+ print_green "\nTo:" "\t/etc/profile"
+ print_green "\n\nLog off & on before running" " /etc/init.d/namecoin start\n"
+fi
+
+# Set random RPC user / passwd / port
+if grep -F "changeme" $config 1>/dev/null; then
+ sed -i "s/rpcuser=changeme/rpcuser=USER-"$(randgen 32)"/" $config
+ sed -i "s/rpcpassword=changeme/rpcpassword=PW-"$(randgen 64)"/" $config
+ sed -i "s/rpcport=changeme/rpcport="$(findRandomTcpPort)"/" $config
+ print_green "Generated random user / password / port in:" " $config\n\n"
+fi
--
1.9.1
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---