diff options
Diffstat (limited to 'net-p2p/bitcoin-qt/files')
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.10.0-openrc-compat.patch | 24 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch | 31 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch | 185 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch | 31 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch | 34 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.9.5-sys_leveldb.patch | 63 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch | 12 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/9999-syslibs.patch | 243 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoin.conf | 8 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoin.confd | 10 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoin.initd-r1 | 104 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoind.logrotate | 7 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoind.logrotate-r1 | 8 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/bitcoind.service | 30 | ||||
-rw-r--r-- | net-p2p/bitcoin-qt/files/miniupnpc-14.patch | 28 |
15 files changed, 818 insertions, 0 deletions
diff --git a/net-p2p/bitcoin-qt/files/0.10.0-openrc-compat.patch b/net-p2p/bitcoin-qt/files/0.10.0-openrc-compat.patch new file mode 100644 index 0000000..a7c31d6 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.10.0-openrc-compat.patch @@ -0,0 +1,24 @@ +--- contrib/init/bitcoind.openrc 2015-03-03 09:37:59.919728713 +0000 ++++ contrib/init/bitcoind.openrc 2015-03-03 09:38:08.109757531 +0000 +@@ -12,9 +12,11 @@ + BITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind} + BITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid} + BITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}} +-BITCOIND_USER=${BITCOIND_USER:-bitcoin} ++BITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-bitcoin}} + BITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin} + BITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind} ++BITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}} ++BITCOIND_OPTS="${BITCOIND_OPTS:-${BITCOIN_OPTS}}" + + name="Bitcoin Core Daemon" + description="Bitcoin crypto-currency p2p network daemon" +@@ -28,7 +30,7 @@ + + required_files="${BITCOIND_CONFIGFILE}" + start_stop_daemon_args="-u ${BITCOIND_USER} \ +- -N ${BITCOIND_NICE:-0} -w 2000" ++ -N ${BITCOIND_NICE} -w 2000" + pidfile="${BITCOIND_PIDFILE}" + retry=60 + diff --git a/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch b/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch new file mode 100644 index 0000000..5eaaba9 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.8-openssl-101k.patch @@ -0,0 +1,31 @@ +diff --git a/src/key.cpp b/src/key.cpp +index 75114c6..7fcb17d 100644 +--- a/src/key.cpp ++++ b/src/key.cpp +@@ -376,11 +376,23 @@ bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v + + bool CKey::Verify(uint256 hash, const std::vector<unsigned char>& vchSig) + { +- // -1 = error, 0 = bad sig, 1 = good +- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1) ++ if (vchSig.empty()) + return false; + +- return true; ++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first. ++ unsigned char *norm_der = NULL; ++ ECDSA_SIG *norm_sig = ECDSA_SIG_new(); ++ const unsigned char* sigptr = &vchSig[0]; ++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size()); ++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der); ++ ECDSA_SIG_free(norm_sig); ++ if (derlen <= 0) ++ return false; ++ ++ // -1 = error, 0 = bad sig, 1 = good ++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1; ++ OPENSSL_free(norm_der); ++ return ret; + } + + bool CKey::VerifyCompact(uint256 hash, const std::vector<unsigned char>& vchSig) diff --git a/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch b/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch new file mode 100644 index 0000000..2b9ab1a --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.8.2-sys_leveldb.patch @@ -0,0 +1,185 @@ +diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro +index cf80986..520b5df 100644 +--- a/bitcoin-qt.pro ++++ b/bitcoin-qt.pro +@@ -4,7 +4,7 @@ macx:TARGET = "Bitcoin-Qt" + VERSION = 0.8.0 + INCLUDEPATH += src src/json src/qt + QT += network +-DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE ++DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE LEVELDB_WITHOUT_MEMENV + CONFIG += no_include_pwd + CONFIG += thread + +@@ -98,25 +98,29 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { + QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets + } + ++contains(USE_SYSTEM_LEVELDB, 1) { ++ LIBS += -lleveldb ++} else { + INCLUDEPATH += src/leveldb/include src/leveldb/helpers +-LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a ++LIBS += $$PWD/src/leveldb/libleveldb.a + !win32 { + # we use QMAKE_CXXFLAGS_RELEASE even without RELEASE=1 because we use RELEASE to indicate linking preferences not -O preferences +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a + } else { + # make an educated guess about what the ranlib command is called + isEmpty(QMAKE_RANLIB) { + QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib) + } + LIBS += -lshlwapi +- genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a ++ genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a + } + genleveldb.target = $$PWD/src/leveldb/libleveldb.a + genleveldb.depends = FORCE + PRE_TARGETDEPS += $$PWD/src/leveldb/libleveldb.a + QMAKE_EXTRA_TARGETS += genleveldb ++} + # Gross ugly hack that depends on qmake internals, unfortunately there is no other way to do it. +-QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb ; $(MAKE) clean ++QMAKE_CLEAN += $$PWD/src/leveldb/libleveldb.a; cd $$PWD/src/leveldb && $(MAKE) clean || true + + # regenerate src/build.h + !win32|contains(USE_BUILD_INFO, 1) { +diff --git a/src/leveldb.cpp b/src/leveldb.cpp +index b41764f..30c524d 100644 +--- a/src/leveldb.cpp ++++ b/src/leveldb.cpp +@@ -8,7 +8,9 @@ + #include <leveldb/env.h> + #include <leveldb/cache.h> + #include <leveldb/filter_policy.h> +-#include <memenv/memenv.h> ++#ifndef LEVELDB_WITHOUT_MEMENV ++#include <memenv.h> ++#endif + + #include <boost/filesystem.hpp> + +@@ -42,8 +44,12 @@ CLevelDB::CLevelDB(const boost::filesystem::path &path, size_t nCacheSize, bool + options = GetOptions(nCacheSize); + options.create_if_missing = true; + if (fMemory) { ++#ifndef LEVELDB_WITHOUT_MEMENV + penv = leveldb::NewMemEnv(leveldb::Env::Default()); + options.env = penv; ++#else ++ throw std::runtime_error("CLevelDB(): compiled without memenv support"); ++#endif + } else { + if (fWipe) { + printf("Wiping LevelDB in %s\n", path.string().c_str()); +diff --git a/src/makefile.unix b/src/makefile.unix +index 081edaf..27f2199 100644 +--- a/src/makefile.unix ++++ b/src/makefile.unix +@@ -104,8 +104,7 @@ xCXXFLAGS=-O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-para + # adds some defaults in front. Unfortunately, LDFLAGS=... $(LDFLAGS) does not work. + xLDFLAGS=$(LDHARDENING) $(LDFLAGS) + +-OBJS= \ +- leveldb/libleveldb.a \ ++BASEOBJS := \ + obj/alert.o \ + obj/version.o \ + obj/checkpoints.o \ +@@ -114,7 +113,6 @@ OBJS= \ + obj/crypter.o \ + obj/key.o \ + obj/db.o \ +- obj/init.o \ + obj/keystore.o \ + obj/main.o \ + obj/net.o \ +@@ -134,24 +132,43 @@ OBJS= \ + obj/hash.o \ + obj/bloom.o \ + obj/noui.o \ +- obj/leveldb.o \ + obj/txdb.o + ++OBJS := \ ++ obj/leveldb.o \ ++ obj/init.o \ ++ $(BASEOBJS) ++ ++TESTOBJS := \ ++ obj-test/leveldb.o \ ++ $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) \ ++ $(BASEOBJS) ++ + + all: bitcoind + + test check: test_bitcoin FORCE + ./test_bitcoin + ++ifdef USE_SYSTEM_LEVELDB ++ LIBS += -lleveldb ++ TESTLIBS += -lmemenv ++else + # + # LevelDB support + # + MAKEOVERRIDES = +-LIBS += $(CURDIR)/leveldb/libleveldb.a $(CURDIR)/leveldb/libmemenv.a ++LIBS += $(CURDIR)/leveldb/libleveldb.a ++TESTLIBS += $(CURDIR)/leveldb/libmemenv.a + DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) +-DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers) ++DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers/memenv) + leveldb/libleveldb.a: +- @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a libmemenv.a && cd .. ++ @echo "Building LevelDB ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libleveldb.a && cd .. ++leveldb/libmemenv.a: ++ @echo "Building LevelDB memenv ..." && cd leveldb && $(MAKE) CC=$(CC) CXX=$(CXX) OPT="$(xCXXFLAGS)" libmemenv.a && cd .. ++OBJS += leveldb/libleveldb.a ++TESTOBJS += leveldb/libmemenv.a ++endif + + # auto-generated dependencies: + -include obj/*.P +@@ -162,26 +179,28 @@ obj/build.h: FORCE + version.cpp: obj/build.h + DEFS += -DHAVE_BUILD_INFO + +-obj/%.o: %.cpp +- $(CXX) -c $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< ++P_TO_D = \ + @cp $(@:%.o=%.d) $(@:%.o=%.P); \ +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ ++ sed -e 's/\#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ + -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ + rm -f $(@:%.o=%.d) + +-bitcoind: $(OBJS:obj/%=obj/%) +- $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) ++obj/%.o: %.cpp ++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) + +-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) ++bitcoind: $(OBJS) ++ $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) + + obj-test/%.o: test/%.cpp + $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< +- @cp $(@:%.o=%.d) $(@:%.o=%.P); \ +- sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ +- -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ +- rm -f $(@:%.o=%.d) ++ $(P_TO_D) ++ ++obj-test/leveldb.o: leveldb.cpp ++ $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) + +-test_bitcoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) ++test_bitcoin: $(TESTOBJS) + $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS) + + clean: diff --git a/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch b/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch new file mode 100644 index 0000000..80f6488 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.9-openssl-101k.patch @@ -0,0 +1,31 @@ +diff --git a/src/key.cpp b/src/key.cpp +index 5b261bb..a845ba1 100644 +--- a/src/key.cpp ++++ b/src/key.cpp +@@ -227,10 +227,23 @@ public: + } + + bool Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) { +- // -1 = error, 0 = bad sig, 1 = good +- if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1) ++ if (vchSig.empty()) + return false; +- return true; ++ ++ // New versions of OpenSSL will reject non-canonical DER signatures. de/re-serialize first. ++ unsigned char *norm_der = NULL; ++ ECDSA_SIG *norm_sig = ECDSA_SIG_new(); ++ const unsigned char* sigptr = &vchSig[0]; ++ d2i_ECDSA_SIG(&norm_sig, &sigptr, vchSig.size()); ++ int derlen = i2d_ECDSA_SIG(norm_sig, &norm_der); ++ ECDSA_SIG_free(norm_sig); ++ if (derlen <= 0) ++ return false; ++ ++ // -1 = error, 0 = bad sig, 1 = good ++ bool ret = ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), norm_der, derlen, pkey) == 1; ++ OPENSSL_free(norm_der); ++ return ret; + } + + bool SignCompact(const uint256 &hash, unsigned char *p64, int &rec) { diff --git a/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch b/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch new file mode 100644 index 0000000..60e9f2b --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.9.0-sys_leveldb.patch @@ -0,0 +1,34 @@ +commit c38e0af3e021eb0b2aba846c77b06ca71de06b11 (personal-github/sys_leveldb, sys_leveldb) +Author: Luke Dashjr <luke-jr+git@utopios.org> +Date: Mon Sep 9 03:06:17 2013 +0000 + + configure: Add unsupported --with-system-leveldb configure flag + +diff --git a/configure.ac b/configure.ac +index 3ed4549..5a5852d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -332,10 +332,22 @@ AC_TRY_COMPILE([#include <sys/socket.h>], + [ AC_MSG_RESULT(no)] + ) + ++dnl Check for leveldb, only if explicitly requested + LEVELDB_CPPFLAGS= + LIBLEVELDB= + LIBMEMENV= +-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) ++AC_ARG_WITH([system-leveldb], ++ [AS_HELP_STRING([--with-system-leveldb], ++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])], ++ [system_leveldb=$withval], ++ [system_leveldb=no] ++) ++if test x$system_leveldb != xno; then ++ LEVELDB_CPPFLAGS= ++ LIBLEVELDB=-lleveldb ++ LIBMEMENV=-lmemenv ++fi ++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno]) + AC_SUBST(LEVELDB_CPPFLAGS) + AC_SUBST(LIBLEVELDB) + AC_SUBST(LIBMEMENV) diff --git a/net-p2p/bitcoin-qt/files/0.9.5-sys_leveldb.patch b/net-p2p/bitcoin-qt/files/0.9.5-sys_leveldb.patch new file mode 100644 index 0000000..0987adb --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.9.5-sys_leveldb.patch @@ -0,0 +1,63 @@ +diff --git a/configure.ac b/configure.ac +index 7924105..a899b3c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -394,10 +394,44 @@ AC_TRY_COMPILE([#include <sys/socket.h>], + [ AC_MSG_RESULT(no)] + ) + ++dnl Check for leveldb, only if explicitly requested + LEVELDB_CPPFLAGS= + LIBLEVELDB= + LIBMEMENV= +-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) ++AC_ARG_WITH([system-leveldb], ++ [AS_HELP_STRING([--with-system-leveldb], ++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])], ++ [system_leveldb=$withval], ++ [system_leveldb=no] ++) ++if test x$system_leveldb != xno; then ++ LEVELDB_CPPFLAGS= ++ AC_CHECK_LIB([leveldb],[main],[ ++ LIBLEVELDB=-lleveldb ++ ],[ ++ AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ TEMP_LIBS="$LIBS" ++ LIBS="$LIBS $LIBLEVELDB" ++ AC_CHECK_LIB([memenv],[main],[ ++ LIBMEMENV=-lmemenv ++ ],[ ++ AC_MSG_ERROR([LevelDB's memenv library not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ LIBS="$TEMP_LIBS" ++ AC_CHECK_HEADER([leveldb/filter_policy.h],[],[ ++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ AC_CHECK_HEADER([leveldb/helpers/memenv.h],[ ++ AC_MSG_CHECKING([for memenv.h path]) ++ BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv]) ++ ],[ ++ AC_CHECK_HEADER([memenv.h],[],[ ++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ ]) ++fi ++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno]) + AC_SUBST(LEVELDB_CPPFLAGS) + AC_SUBST(LIBLEVELDB) + AC_SUBST(LIBMEMENV) +diff --git a/src/m4/bitcoin_subdir_to_include.m4 b/src/m4/bitcoin_subdir_to_include.m4 +index 66f106c..5f0a3b1 100644 +--- a/src/m4/bitcoin_subdir_to_include.m4 ++++ b/src/m4/bitcoin_subdir_to_include.m4 +@@ -5,7 +5,7 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ + AC_MSG_RESULT([default]) + else + echo "#include <$2$3.h>" >conftest.cpp +- newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] ++ newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d]) + AC_MSG_RESULT([${newinclpath}]) + if test "x${newinclpath}" != "x"; then + eval "$1=\"\$$1\"' -I${newinclpath}'" diff --git a/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch b/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch new file mode 100644 index 0000000..3519466 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/0.9.x-ljr_noblacklist.patch @@ -0,0 +1,12 @@ +diff --git a/src/script.cpp b/src/script.cpp +index 24bbbad..a60d8b6 100644 +--- a/src/script.cpp ++++ b/src/script.cpp +@@ -1870,6 +1870,7 @@ bool fIsBareMultisigStd = false; + + const char *CScript::IsBlacklisted() const + { ++ return false; + if (this->size() >= 7 && this->at(0) == OP_DUP) + { + // pay-to-pubkeyhash diff --git a/net-p2p/bitcoin-qt/files/9999-syslibs.patch b/net-p2p/bitcoin-qt/files/9999-syslibs.patch new file mode 100644 index 0000000..2cdf2ab --- /dev/null +++ b/net-p2p/bitcoin-qt/files/9999-syslibs.patch @@ -0,0 +1,243 @@ +diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 +index 66f106c..5f0a3b1 100644 +--- a/build-aux/m4/bitcoin_subdir_to_include.m4 ++++ b/build-aux/m4/bitcoin_subdir_to_include.m4 +@@ -5,7 +5,7 @@ AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ + AC_MSG_RESULT([default]) + else + echo "#include <$2$3.h>" >conftest.cpp +- newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] ++ newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d]) + AC_MSG_RESULT([${newinclpath}]) + if test "x${newinclpath}" != "x"; then + eval "$1=\"\$$1\"' -I${newinclpath}'" +diff --git a/configure.ac b/configure.ac +index 37fe47e..14e5c34 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -170,6 +170,18 @@ AC_ARG_WITH([utils], + [build_bitcoin_utils=$withval], + [build_bitcoin_utils=yes]) + ++AC_ARG_ENABLE([util-cli], ++ [AS_HELP_STRING([--enable-util-cli], ++ [build bitcoin-cli])], ++ [build_bitcoin_cli=$enableval], ++ [build_bitcoin_cli=$build_bitcoin_utils]) ++ ++AC_ARG_ENABLE([util-tx], ++ [AS_HELP_STRING([--enable-util-tx], ++ [build bitcoin-tx])], ++ [build_bitcoin_tx=$enableval], ++ [build_bitcoin_tx=$build_bitcoin_utils]) ++ + AC_ARG_WITH([libs], + [AS_HELP_STRING([--with-libs], + [build libraries (default=yes)])], +@@ -488,14 +500,65 @@ if test x$use_reduce_exports = xyes; then + [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])]) + fi + ++dnl Check for leveldb, only if explicitly requested + LEVELDB_CPPFLAGS= + LIBLEVELDB= + LIBMEMENV= +-AM_CONDITIONAL([EMBEDDED_LEVELDB],[true]) ++AC_ARG_WITH([system-leveldb], ++ [AS_HELP_STRING([--with-system-leveldb], ++ [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])], ++ [system_leveldb=$withval], ++ [system_leveldb=no] ++) ++if test x$system_leveldb != xno; then ++ LEVELDB_CPPFLAGS= ++ AC_CHECK_LIB([leveldb],[main],[ ++ LIBLEVELDB=-lleveldb ++ ],[ ++ AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ TEMP_LIBS="$LIBS" ++ LIBS="$LIBS $LIBLEVELDB" ++ AC_CHECK_LIB([memenv],[main],[ ++ LIBMEMENV=-lmemenv ++ ],[ ++ AC_MSG_ERROR([LevelDB's memenv library not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ LIBS="$TEMP_LIBS" ++ AC_CHECK_HEADER([leveldb/filter_policy.h],[],[ ++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ AC_CHECK_HEADER([leveldb/helpers/memenv.h],[ ++ AC_MSG_CHECKING([for memenv.h path]) ++ BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv]) ++ ],[ ++ AC_CHECK_HEADER([memenv.h],[],[ ++ AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway]) ++ ]) ++ ]) ++fi ++AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno]) + AC_SUBST(LEVELDB_CPPFLAGS) + AC_SUBST(LIBLEVELDB) + AC_SUBST(LIBMEMENV) + ++dnl Check for libsecp256k1, only if explicitly requested ++AC_ARG_WITH([system-libsecp256k1], ++ [AS_HELP_STRING([--with-system-libsecp256k1], ++ [Build with system libsecp256k1 (default is no; DANGEROUS; NOT SUPPORTED)])], ++ [system_libsecp256k1=$withval], ++ [system_libsecp256k1=no] ++) ++if test x$system_libsecp256k1 != xno; then ++ PKG_CHECK_MODULES([libsecp256k1],[libsecp256k1],,[true]) ++else ++ libsecp256k1_CFLAGS='-I$(srcdir)/secp256k1/include' ++ libsecp256k1_LIBS='secp256k1/libsecp256k1.la' ++fi ++AM_CONDITIONAL([EMBEDDED_LIBSECP256K1],[test x$system_libsecp256k1 = xno]) ++AC_SUBST(libsecp256k1_CFLAGS) ++AC_SUBST(libsecp256k1_LIBS) ++ + if test x$enable_wallet != xno; then + dnl Check for libdb_cxx only if wallet enabled + BITCOIN_FIND_BDB48 +@@ -515,7 +578,7 @@ BITCOIN_QT_INIT + dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus + BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4]) + +-if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then ++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then + use_boost=no + else + use_boost=yes +@@ -701,9 +764,13 @@ AC_MSG_CHECKING([whether to build bitcoind]) + AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) + AC_MSG_RESULT($build_bitcoind) + +-AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)]) +-AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes]) +-AC_MSG_RESULT($build_bitcoin_utils) ++AC_MSG_CHECKING([whether to build bitcoin-cli]) ++AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes]) ++AC_MSG_RESULT($build_bitcoin_cli) ++ ++AC_MSG_CHECKING([whether to build bitcoin-tx]) ++AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes]) ++AC_MSG_RESULT($build_bitcoin_tx) + + AC_MSG_CHECKING([whether to build libraries]) + AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes]) +@@ -826,7 +893,7 @@ else + AC_MSG_RESULT([no]) + fi + +-if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then ++if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononononono; then + AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests]) + fi + +@@ -895,8 +962,10 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR" + unset PKG_CONFIG_LIBDIR + PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP" + ++if test x$system_libsecp256k1 = xno; then + ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no" + AC_CONFIG_SUBDIRS([src/secp256k1]) ++fi + + AC_OUTPUT + +diff --git a/qa/pull-tester/rpc-tests.sh b/qa/pull-tester/rpc-tests.sh +index 9b31865..5bb187c 100755 +--- a/qa/pull-tester/rpc-tests.sh ++++ b/qa/pull-tester/rpc-tests.sh +@@ -57,7 +57,7 @@ testScriptsExt=( + extArg="-extended" + passOn=${@#$extArg} + +-if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then ++if [ "x${ENABLE_BITCOIND}${ENABLE_CLI}${ENABLE_WALLET}" = "x111" ]; then + for (( i = 0; i < ${#testScripts[@]}; i++ )) + do + if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ] +diff --git a/qa/pull-tester/tests-config.sh.in b/qa/pull-tester/tests-config.sh.in +index 10f4d33..e0e407d 100755 +--- a/qa/pull-tester/tests-config.sh.in ++++ b/qa/pull-tester/tests-config.sh.in +@@ -8,7 +8,7 @@ EXEEXT="@EXEEXT@" + + # These will turn into comments if they were disabled when configuring. + @ENABLE_WALLET_TRUE@ENABLE_WALLET=1 +-@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1 ++@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=1 + @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1 + + REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}" +diff --git a/src/Makefile.am b/src/Makefile.am +index 1c2f770..4d60ddf 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1,4 +1,6 @@ ++if EMBEDDED_LIBSECP256K1 + DIST_SUBDIRS = secp256k1 ++endif + AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) + + +@@ -20,7 +22,7 @@ endif + BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config + BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) + +-BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include ++BITCOIN_INCLUDES += $(libsecp256k1_CFLAGS) + + LIBBITCOIN_SERVER=libbitcoin_server.a + LIBBITCOIN_WALLET=libbitcoin_wallet.a +@@ -30,10 +32,16 @@ LIBBITCOIN_UTIL=libbitcoin_util.a + LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a + LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a + LIBBITCOINQT=qt/libbitcoinqt.a ++if EMBEDDED_LIBSECP256K1 + LIBSECP256K1=secp256k1/libsecp256k1.la ++else ++LIBSECP256K1=$(libsecp256k1_LIBS) ++endif + ++if EMBEDDED_LIBSECP256K1 + $(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*) + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) ++endif + + # Make is not made aware of per-object dependencies to avoid limiting building parallelization + # But to build the less dependent modules first, we manually select their order here: +@@ -63,8 +71,11 @@ if BUILD_BITCOIND + bin_PROGRAMS += bitcoind + endif + +-if BUILD_BITCOIN_UTILS +- bin_PROGRAMS += bitcoin-cli bitcoin-tx ++if BUILD_BITCOIN_CLI ++ bin_PROGRAMS += bitcoin-cli ++endif ++if BUILD_BITCOIN_TX ++ bin_PROGRAMS += bitcoin-tx + endif + + .PHONY: FORCE +diff --git a/src/Makefile.test.include b/src/Makefile.test.include +index 0997148..14b4deb 100644 +--- a/src/Makefile.test.include ++++ b/src/Makefile.test.include +@@ -111,10 +111,12 @@ bitcoin_test_check: $(TEST_BINARY) FORCE + bitcoin_test_clean : FORCE + rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) + ++if EMBEDDED_LIBSECP256K1 + check-local: + @echo "Running test/bitcoin-util-test.py..." + $(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check ++endif + + %.json.h: %.json + @$(MKDIR_P) $(@D) diff --git a/net-p2p/bitcoin-qt/files/bitcoin.conf b/net-p2p/bitcoin-qt/files/bitcoin.conf new file mode 100644 index 0000000..c6a55f3 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoin.conf @@ -0,0 +1,8 @@ +# http://www.bitcoin.org/smf/index.php?topic=644.0 +#rpcuser= +#rpcpassword= + + + + + diff --git a/net-p2p/bitcoin-qt/files/bitcoin.confd b/net-p2p/bitcoin-qt/files/bitcoin.confd new file mode 100644 index 0000000..7c0868c --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoin.confd @@ -0,0 +1,10 @@ +# Config file for /etc/init.d/bitcoin + +# owner of bitcoind process (don't change, must be existing) +BITCOIN_USER="bitcoin" + +# See http://www.bitcoin.org/smf/index.php?topic=1063 +BITCOIN_OPTS="${BITCOIN_OPTS}" + +# nice level +NICELEVEL="19" diff --git a/net-p2p/bitcoin-qt/files/bitcoin.initd-r1 b/net-p2p/bitcoin-qt/files/bitcoin.initd-r1 new file mode 100644 index 0000000..02a159c --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoin.initd-r1 @@ -0,0 +1,104 @@ +#!/sbin/runscript +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/bitcoin" +CONFFILE="${VARDIR}/.bitcoin/bitcoin.conf" + +depend() { + need net +} + +checkconfig() { + if [ "${BITCOIN_USER}" = "" ] ; then + eerror "Please edit /etc/conf.d/bitcoind" + eerror "A user must be specified to run bitcoind as that user." + eerror "Modify USER to your needs (you may also add a group after a colon)" + return 1 + fi + if ! `getent passwd | cut -d ':' -f 1 | grep $( echo "${BITCOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then + eerror "Please edit /etc/conf.d/bitcoind" + eerror "Specified user must exist!" + return 1 + fi + if `echo "${BITCOIN_USER}" | grep ':' -sq` ; then + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${BITCOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then + eerror "Please edit /etc/conf.d/bitcoind" + eerror "Specified group must exist!" + return 1 + fi + fi + if ! grep -q '^rpcpassword=' "${CONFFILE}"; then + eerror "Please edit `readlink -f ${CONFFILE}`" + eerror "There must be at least a line assigning rpcpassword=something-secure" + return 1 + fi + if ! stat -Lc '%a' "${CONFFILE}" | grep -q '^[4567]00$'; then + eerror "`readlink -f ${CONFFILE}` should not be readable by other users" + return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + ebegin "Starting Bitcoind daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping Bitcoin daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${BITCOIN_USER}" --name bitcoind \ + --pidfile /var/run/bitcoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${BITCOIN_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${BITCOIN_USER}" \ + --name bitcoind --pidfile /var/run/bitcoind.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${BITCOIN_USER}" --name bitcoind \ + --pidfile /var/run/bitcoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/bitcoind \ + --chuid "${BITCOIN_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${BITCOIN_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${BITCOIN_USER}" \ + --name bitcoind \ + --pidfile /var/run/bitcoind.pid + eend $? +} diff --git a/net-p2p/bitcoin-qt/files/bitcoind.logrotate b/net-p2p/bitcoin-qt/files/bitcoind.logrotate new file mode 100644 index 0000000..36d8dc2 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoind.logrotate @@ -0,0 +1,7 @@ +/var/lib/bitcoin/.bitcoin/debug.log { + weekly + sharedscripts + postrotate + killall -HUP bitcoind + endscript +} diff --git a/net-p2p/bitcoin-qt/files/bitcoind.logrotate-r1 b/net-p2p/bitcoin-qt/files/bitcoind.logrotate-r1 new file mode 100644 index 0000000..f9a4702 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoind.logrotate-r1 @@ -0,0 +1,8 @@ +/var/lib/bitcoin/.bitcoin/debug.log { + missingok + weekly + sharedscripts + postrotate + killall -HUP bitcoind + endscript +} diff --git a/net-p2p/bitcoin-qt/files/bitcoind.service b/net-p2p/bitcoin-qt/files/bitcoind.service new file mode 100644 index 0000000..9774700 --- /dev/null +++ b/net-p2p/bitcoin-qt/files/bitcoind.service @@ -0,0 +1,30 @@ +# It's not recommended to modify this file in-place, because it will be +# overwritten during package upgrades. If you want to customize, the +# best way is to create file +# "/etc/systemd/system/bitcoind.service.d/*.conf" +# containing your changes + +# For example, if you want to change some daemon and/or unit options, +# create a file named +# "/etc/systemd/system/bitcoind.service.d/myopts.conf" +# containing: +# [Service] +# Environment="BITCOIN_OPTS=-debug -logtimestamps" +# Nice=10 +# This will override the setting appearing below. + +# Note that almost all daemon options could be specified in +# /etc/bitcoin/bitcoin.conf + +[Unit] +Description=Bitcoin Daemon +After=network.target + +[Service] +User=bitcoin +Environment=BITCOIN_OPTS= +ExecStart=/usr/bin/bitcoind -daemon=0 $BITCOIN_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/bitcoin-qt/files/miniupnpc-14.patch b/net-p2p/bitcoin-qt/files/miniupnpc-14.patch new file mode 100644 index 0000000..aa8e32f --- /dev/null +++ b/net-p2p/bitcoin-qt/files/miniupnpc-14.patch @@ -0,0 +1,28 @@ +commit 9f3e48e5219a09b5ddfd6883d1f0498910eff4b6 (origin-pull/6583/head) +Author: Pavel Vasin <pavel@vasin.nl> +Date: Sun Aug 23 23:53:49 2015 +0300 + + add support for miniupnpc api version 14 + + The value of new arg ttl is set to 2 as it's recommended default. + +diff --git a/src/net.cpp b/src/net.cpp +index fb5726a..4c6331f 100644 +--- a/src/net.cpp ++++ b/src/net.cpp +@@ -1120,10 +1120,14 @@ void ThreadMapPort() + #ifndef UPNPDISCOVER_SUCCESS + /* miniupnpc 1.5 */ + devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0); +-#else ++#elif MINIUPNPC_API_VERSION < 14 + /* miniupnpc 1.6 */ + int error = 0; + devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error); ++#else ++ /* miniupnpc 1.9.20150730 */ ++ int error = 0; ++ devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error); + #endif + + struct UPNPUrls urls; |