From 2f7b023e1239a8055eb1c260cef824fcac8fe8f0 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Sat, 15 Feb 2014 08:55:29 -0800 Subject: [PATCH] net-p2p/dogecoind-1.5.1-r1 --- net-p2p/dogecoind/ChangeLog | 2 + net-p2p/dogecoind/Manifest | 11 + net-p2p/dogecoind/dogecoind-1.5.1-r1.ebuild | 128 ++++++++++++ net-p2p/dogecoind/dogecoind-1.5.1.ebuild | 124 +++++++++++ .../files/dogecoin-sys_leveldb.patch | 193 ++++++++++++++++++ net-p2p/dogecoind/files/dogecoin.conf | 8 + net-p2p/dogecoind/files/dogecoin.confd | 10 + net-p2p/dogecoind/files/dogecoin.initd | 104 ++++++++++ net-p2p/dogecoind/files/dogecoin.service | 30 +++ net-p2p/dogecoind/files/dogecoind.logrotate | 7 + net-p2p/dogecoind/metadata.xml | 11 + 11 files changed, 628 insertions(+) create mode 100644 net-p2p/dogecoind/ChangeLog create mode 100644 net-p2p/dogecoind/Manifest create mode 100644 net-p2p/dogecoind/dogecoind-1.5.1-r1.ebuild create mode 100644 net-p2p/dogecoind/dogecoind-1.5.1.ebuild create mode 100644 net-p2p/dogecoind/files/dogecoin-sys_leveldb.patch create mode 100644 net-p2p/dogecoind/files/dogecoin.conf create mode 100644 net-p2p/dogecoind/files/dogecoin.confd create mode 100644 net-p2p/dogecoind/files/dogecoin.initd create mode 100644 net-p2p/dogecoind/files/dogecoin.service create mode 100644 net-p2p/dogecoind/files/dogecoind.logrotate create mode 100644 net-p2p/dogecoind/metadata.xml diff --git a/net-p2p/dogecoind/ChangeLog b/net-p2p/dogecoind/ChangeLog new file mode 100644 index 0000000..d45f3d6 --- /dev/null +++ b/net-p2p/dogecoind/ChangeLog @@ -0,0 +1,2 @@ +# ChangeLog for net-p2p/dogecoind + diff --git a/net-p2p/dogecoind/Manifest b/net-p2p/dogecoind/Manifest new file mode 100644 index 0000000..e61f22b --- /dev/null +++ b/net-p2p/dogecoind/Manifest @@ -0,0 +1,11 @@ +AUX dogecoin-sys_leveldb.patch 7264 SHA256 9fbfabdba7c92f82b74e2bca0fefdeeacec281375bf602d86f2797dcf41a777b SHA512 81040d6d6254721716c88cdae8818b2c3d610589b8a2929cda62b73df12d274192eaab066019c2a706fc6d66012d81602de6cdc6f000a2b3d6c39a3d3d5402be WHIRLPOOL e1ae908c4e6a57e2402e4c0280f5516c366783ee688059bffade89928a176b6cbb37ff75dc89f72ebc5152430eb165ecb79964c9e0428f793e2e51376a37a2b1 +AUX dogecoin.conf 80 SHA256 541ae10cc2246b620de3e7efa97eee59efacf83d28ea5f1297a121d0708226d2 SHA512 43bef890505a1fac88887bb39e9fdd4ec673ae8838a40279b33711e970551f5a75ac25171c41f8c83de2c953b157f7a3f57171e868fd9f626007d9909331a19f WHIRLPOOL 728e38b62da2c7c3a1149ac511b92d156f7b3c51dacfadd7ce74d9e6f915a6547c4cc8d34159243f50eee333c63b35949b311ea5a7f48a6c3bf17a5d4d47c123 +AUX dogecoin.confd 245 SHA256 334ae7ecfc7a9528bf589834108875f24f5aaba2cc0229968f30e90d6e0ebae3 SHA512 33b23c57ab7dce048b4fa0aad7755227f0a8fe12e46bfe8dbf876b9f251fe6d158db7ac75c558c6ff3aa9b80be07f58c43289cd32ae999616af65e6c96253995 WHIRLPOOL 7010cd72dcbf96a10b9834d7e30401da64a35d4da2190bd2dc9cf54ad2597aecd54a776c1112738cdc9e807b3a5580f40a9be21978df456bc37b9684f4a04eb1 +AUX dogecoin.initd 2511 SHA256 fbaa1a2c534e5b0e1137a32d1f1b10d42951f6f36868bf8ed1e20e3d4b2a49c3 SHA512 656791c9d5812a5ea941a731aa1db10b22df6cfbf014737b9a2e2873ad6ccb642ac1ffacdd942e742ba373d0a5557315ba27a01af738197cf8fcb4240426daaa WHIRLPOOL d9f468153b5ac52df47d697de62b6afbb5b43612a1fb658053f3393a6c1553dfa731bdcb04088a9cd0325eb3f5254be9e3d163560bd5e7a5115950f89161a06f +AUX dogecoin.service 879 SHA256 6c121a84cf9057133f1932622a47e58fbed7b4bb5248b73a356a309b7c728a41 SHA512 6aa48c98cf3d64ee7520dbd8d91fa3a514c7677aacc309db010b2e3184a0ccfcf867c5105d94c7c43e668ab84842790f04a75a0daa0e7db589745e1e5600715c WHIRLPOOL 96361a915fb40668ecb05b068c8acb324a72a037aabf67e39776adc8919c86286feb6c2d2664f4dc2fe59088cc80db114d337312fee0a9b6fae6d2ac7b770cd4 +AUX dogecoind.logrotate 113 SHA256 33d642ea78faca1788f25dc725aaa2249d0a60791d56e6d31febd207432ab68e SHA512 d041af278b6138f8f13b3a51928f0e509ef7a5ef767e2f29ce27a6766709b583f6452dd2813cbbe9691765b042ad6b5e50f457dba3022b9b5f1ca419168845d9 WHIRLPOOL c5554efed5fe6979340686ec7e4b8bf51aac7d5c9770ec318f67a9041b4bfa616e7216793e8458b21228bc937e512960bad4588d3449be46d2b1d5f053aeae74 +DIST dogecoin-1.5.1.tar.gz 3434804 SHA256 2a18483c21ffdb9450b42a841a32c9f58bb5e5b86a8504f2e1a6686a87b5908b SHA512 5ca623376b514bf9ddae695040a02273ae558a671798cb595f814d42fe53e1c29188d2ed06fd1c5a59be76fb6efa52dc5c18c921ad092c1e86ea4cadfe3c6b86 WHIRLPOOL 9fc6d46444ee61cf308c5ed0fd254947386ecd9ec4fe661f87358388f4762d7095a767ad1e77cf1fd0fec79588da94e0172dede6d253fda1985bd067efcb8b1c +EBUILD dogecoind-1.5.1-r1.ebuild 3138 SHA256 26b47d8c15d2cbd6e63e626d06e635109a38f9f4dcef31cd0bbaa75c2b0183ef SHA512 c4742727683cf90d03d406cbb1c3d851fb89de3fd0f6cad8afc64b2da752926bd8142ba244d83ff300e957a4b8e1533bf098159bcbd881d171c53cb8fd162e2b WHIRLPOOL c2af18ace5e9cc81c1ee01cda8ccecfaa4feef83dbedf5d8e0788a69b1a929e4c7be90c73e4252a844c015264fb01c6effa647103c3cc603b4c9faf915c11f7d +EBUILD dogecoind-1.5.1.ebuild 3040 SHA256 cd43392e9c4791296dfc60e950522db8a5ed232234172fe1f401373631ce3cfd SHA512 62920b49bec11b8dc22d50bf76cf0bb32375e860ef576c778abe5f36ac2cfd78a6c680e6f0880519250ce725272924cbb475259d46e87c7a93a98eb8979c4651 WHIRLPOOL 1bd9e020a4b755c13bc7a99a14c5a2a2b1e163a4b61018c412fba259bc3075f4f4e73804ff7255a8031811ff9ea040cc994b896d883a6d6ea89b234ace587426 +MISC ChangeLog 35 SHA256 249b088967e439f9ede35725074ad34e74eb2aebf5afdf87f77f4d9f69a105c1 SHA512 6849adb7ba7996356171b259f1e7d428a27e5168c035787a86a2dc8e37c595bcd4a9887f5cadebeee4aefdce61e1dd6ffc8f924ff1fdda7729b75dcd2a404f43 WHIRLPOOL b8da20935cce8d197d9b83593f52c52f10ba33a9a0ce2c6fb76edc5800eb7275352f602d7b4304690459c7bcdba01df06af92d2e71b58e7822bc16b92c7ab1d1 +MISC metadata.xml 325 SHA256 37aef5bcb42f89e449ea4f0ec19174be6c9ba1bafcd49df1d3f60969a2eeb0e9 SHA512 de0df1316737a65c1e0996dbae24e653eac94d439cf2c291126ba0917195345a31518f7b3f9b2d548b2330d615c01797b2a808b341491980d1ffdd23f43bc145 WHIRLPOOL 31a18cf426f2479402744bb74e6987c9cd87899558fe7c9c4e5bd3a4d171d2f0ab21c40898d5c96f7c67ce7a74327f859df1ac51eb2e94a6abc1ce64045de2af diff --git a/net-p2p/dogecoind/dogecoind-1.5.1-r1.ebuild b/net-p2p/dogecoind/dogecoind-1.5.1-r1.ebuild new file mode 100644 index 0000000..7cc9c99 --- /dev/null +++ b/net-p2p/dogecoind/dogecoind-1.5.1-r1.ebuild @@ -0,0 +1,128 @@ +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DB_VER="5.1" + +inherit bash-completion-r1 db-use eutils systemd user + +MyPV="${PV/_/-}" +MyPN="dogecoin" +MyP="${MyPN}-${MyPV}" + +DESCRIPTION="P2P Internet currency based on Bitcoin but wow such doge" +HOMEPAGE="https://dogecoin.com/" +SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz" +SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz" + +LICENSE="MIT ISC GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="bash-completion examples ipv6 logrotate upnp" + +RDEPEND=" + dev-libs/boost[threads(+)] + dev-libs/openssl:0[-bindist] + logrotate? ( + app-admin/logrotate + ) + upnp? ( + net-libs/miniupnpc + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] + dev-libs/leveldb[-snappy] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 + sys-apps/sed +" + +S="${WORKDIR}/${MyP}" + +pkg_setup() { + local UG='dogecoin' + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}" +} + +src_prepare() { +# epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch +# rm -r src/leveldb + + if has_version '>=dev-libs/boost-1.52'; then + sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix + fi +} + +src_configure() { + OPTS=() + + OPTS+=("DEBUGFLAGS=") + OPTS+=("CXXFLAGS=${CXXFLAGS}") + OPTS+=("LDFLAGS=${LDFLAGS}") + + if use upnp; then + OPTS+=("USE_UPNP=1") + else + OPTS+=("USE_UPNP=-") + fi + + use ipv6 || OPTS+=("USE_IPV6=-") + + OPTS+=("USE_SYSTEM_LEVELDB=1") + OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")") + OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}") + +# if has_version '>=dev-libs/boost-1.52'; then +# OPTS+=("LIBS+=-lboost_chrono\$\$BOOST_LIB_SUFFIX") +# fi + + cd src || die + emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN} +} + +#Tests are broken with and without our dogecoin-sys_leveldb.patch. +#When tests work, make sure to inherit toolchain-funcs +#src_test() { +# cd src || die +# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin +# ./test_dogecoin || die 'Tests failed' +#} + +src_install() { + dobin src/${PN} + + insinto /etc/dogecoin + doins "${FILESDIR}/dogecoin.conf" + fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf + fperms 600 /etc/dogecoin/dogecoin.conf + + newconfd "${FILESDIR}/dogecoin.confd" ${PN} + newinitd "${FILESDIR}/dogecoin.initd" ${PN} + systemd_dounit "${FILESDIR}/dogecoin.service" + + keepdir /var/lib/dogecoin/.dogecoin + fperms 700 /var/lib/dogecoin + fowners dogecoin:dogecoin /var/lib/dogecoin/ + fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin + dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf + +# dodoc doc/README.md doc/release-notes.md +# newman contrib/debian/manpages/bitcoind.1 dogecoind.1 +# newman contrib/debian/manpages/bitcoin.conf.5 dogecoin.conf.5 + + if use bash-completion; then + :; +# newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion + fi + + if use examples; then + docinto examples +# dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools} + fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/dogecoind.logrotate" dogecoind + fi +} diff --git a/net-p2p/dogecoind/dogecoind-1.5.1.ebuild b/net-p2p/dogecoind/dogecoind-1.5.1.ebuild new file mode 100644 index 0000000..8faa855 --- /dev/null +++ b/net-p2p/dogecoind/dogecoind-1.5.1.ebuild @@ -0,0 +1,124 @@ +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +DB_VER="5.1" + +inherit bash-completion-r1 db-use eutils systemd user + +MyPV="${PV/_/-}" +MyPN="dogecoin" +MyP="${MyPN}-${MyPV}" + +DESCRIPTION="P2P Internet currency based on Bitcoin but wow such doge" +HOMEPAGE="https://dogecoin.com/" +SRC_URI="https://github.com/${MyPN}-project/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz" +SRC_URI="https://github.com/${MyPN}/${MyPN}/archive/${MyPV}.tar.gz -> ${MyP}.tar.gz" + +LICENSE="MIT ISC GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="bash-completion examples ipv6 logrotate upnp" + +RDEPEND=" + dev-libs/boost[threads(+)] + dev-libs/openssl:0[-bindist] + logrotate? ( + app-admin/logrotate + ) + upnp? ( + net-libs/miniupnpc + ) + sys-libs/db:$(db_ver_to_slot "${DB_VER}")[cxx] + <=dev-libs/leveldb-1.12.0[-snappy] +" +DEPEND="${RDEPEND} + >=app-shells/bash-4.1 + sys-apps/sed +" + +S="${WORKDIR}/${MyP}" + +pkg_setup() { + local UG='dogecoin' + enewgroup "${UG}" + enewuser "${UG}" -1 -1 /var/lib/dogecoin "${UG}" +} + +src_prepare() { +# epatch "${FILESDIR}"/${MyPN}-sys_leveldb.patch +# rm -r src/leveldb + + if has_version '>=dev-libs/boost-1.52'; then + sed -i 's/\(-l db_cxx\)/-l boost_chrono$(BOOST_LIB_SUFFIX) \1/' src/makefile.unix + fi +} + +src_configure() { + OPTS=() + + OPTS+=("DEBUGFLAGS=") + OPTS+=("CXXFLAGS=${CXXFLAGS}") + OPTS+=("LDFLAGS=${LDFLAGS}") + + if use upnp; then + OPTS+=("USE_UPNP=1") + else + OPTS+=("USE_UPNP=-") + fi + + use ipv6 || OPTS+=("USE_IPV6=-") + + OPTS+=("USE_SYSTEM_LEVELDB=1") + OPTS+=("BDB_INCLUDE_PATH=$(db_includedir "${DB_VER}")") + OPTS+=("BDB_LIB_SUFFIX=-${DB_VER}") + + cd src || die + emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" ${PN} +} + +#Tests are broken with and without our dogecoin-sys_leveldb.patch. +#When tests work, make sure to inherit toolchain-funcs +#src_test() { +# cd src || die +# emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" -f makefile.unix "${OPTS[@]}" test_dogecoin +# ./test_dogecoin || die 'Tests failed' +#} + +src_install() { + dobin src/${PN} + + insinto /etc/dogecoin + doins "${FILESDIR}/dogecoin.conf" + fowners dogecoin:dogecoin /etc/dogecoin/dogecoin.conf + fperms 600 /etc/dogecoin/dogecoin.conf + + newconfd "${FILESDIR}/dogecoin.confd" ${PN} + newinitd "${FILESDIR}/dogecoin.initd" ${PN} + systemd_dounit "${FILESDIR}/dogecoin.service" + + keepdir /var/lib/dogecoin/.dogecoin + fperms 700 /var/lib/dogecoin + fowners dogecoin:dogecoin /var/lib/dogecoin/ + fowners dogecoin:dogecoin /var/lib/dogecoin/.dogecoin + dosym /etc/dogecoin/dogecoin.conf /var/lib/dogecoin/.dogecoin/dogecoin.conf + +# dodoc doc/README.md doc/release-notes.md +# newman contrib/debian/manpages/bitcoind.1 dogecoind.1 +# newman contrib/debian/manpages/bitcoin.conf.5 dogecoin.conf.5 + + if use bash-completion; then + :; +# newbashcomp contrib/bitcoind.bash-completion ${PN}.bash-completion + fi + + if use examples; then + docinto examples +# dodoc -r contrib/{bitrpc,pyminer,spendfrom,tidy_datadir.sh,wallettools} + fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/dogecoind.logrotate" dogecoind + fi +} diff --git a/net-p2p/dogecoind/files/dogecoin-sys_leveldb.patch b/net-p2p/dogecoind/files/dogecoin-sys_leveldb.patch new file mode 100644 index 0000000..b64fc78 --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoin-sys_leveldb.patch @@ -0,0 +1,193 @@ +diff -Naur dogecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro dogecoin-0.8.5.3-rc3/bitcoin-qt.pro +--- dogecoin-0.8.5.3-rc3.orig/bitcoin-qt.pro 2013-11-28 21:17:05.000000000 -0500 ++++ dogecoin-0.8.5.3-rc3/bitcoin-qt.pro 2013-11-29 14:53:00.960537685 -0500 +@@ -5,7 +5,7 @@ + INCLUDEPATH += src src/json src/qt + QT += core gui network + greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +-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 + +@@ -101,25 +101,30 @@ + 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 -Naur dogecoin-0.8.5.3-rc3.orig/src/leveldb.cpp dogecoin-0.8.5.3-rc3/src/leveldb.cpp +--- dogecoin-0.8.5.3-rc3.orig/src/leveldb.cpp 2013-11-28 21:17:05.000000000 -0500 ++++ dogecoin-0.8.5.3-rc3/src/leveldb.cpp 2013-11-29 14:55:33.760543008 -0500 +@@ -8,7 +8,9 @@ + #include + #include + #include +-#include ++#ifndef LEVELDB_WITHOUT_MEMENV ++#include ++#endif + + #include + +@@ -43,8 +45,12 @@ + 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 -Naur dogecoin-0.8.5.3-rc3.orig/src/makefile.unix dogecoin-0.8.5.3-rc3/src/makefile.unix +--- dogecoin-0.8.5.3-rc3.orig/src/makefile.unix 2013-11-28 21:17:05.000000000 -0500 ++++ dogecoin-0.8.5.3-rc3/src/makefile.unix 2013-11-29 15:08:58.337571033 -0500 +@@ -110,8 +110,7 @@ + # 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 \ +@@ -120,7 +119,6 @@ + obj/crypter.o \ + obj/key.o \ + obj/db.o \ +- obj/init.o \ + obj/keystore.o \ + obj/main.o \ + obj/net.o \ +@@ -141,9 +139,17 @@ + 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) + + ifdef USE_SSE2 + DEFS += -DUSE_SSE2 +@@ -156,15 +162,25 @@ + test check: test_dogecoin FORCE + ./test_dogecoin + ++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) + 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 +@@ -175,33 +191,34 @@ + version.cpp: obj/build.h + DEFS += -DHAVE_BUILD_INFO + +-obj/%-sse2.o: %-sse2.cpp +- $(CXX) -c $(xCXXFLAGS) -msse2 -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) + ++obj/%-sse2.o: %-sse2.cpp ++ $(CXX) -c $(xCXXFLAGS) -msse2 -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) ++ + obj/%.o: %.cpp +- $(CXX) -c $(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) ++ $(CXX) -c $(xCXXFLAGS) -DLEVELDB_WITHOUT_MEMENV -MMD -MF $(@:%.o=%.d) -o $@ $< ++ $(P_TO_D) + +-dogecoind: $(OBJS:obj/%=obj/%) ++dogecoind: $(OBJS) + $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) + +-TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) +- + 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) ++ ++TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) + +-test_dogecoin: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) ++test_dogecoin: $(TESTOBJS) + $(LINK) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ $(TESTLIBS) $(xLDFLAGS) $(LIBS) + + clean: diff --git a/net-p2p/dogecoind/files/dogecoin.conf b/net-p2p/dogecoind/files/dogecoin.conf new file mode 100644 index 0000000..c6a55f3 --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoin.conf @@ -0,0 +1,8 @@ +# http://www.bitcoin.org/smf/index.php?topic=644.0 +#rpcuser= +#rpcpassword= + + + + + diff --git a/net-p2p/dogecoind/files/dogecoin.confd b/net-p2p/dogecoind/files/dogecoin.confd new file mode 100644 index 0000000..7751418 --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoin.confd @@ -0,0 +1,10 @@ +# Config file for /etc/init.d/dogecoind + +# owner of dogecoind process (don't change, must be existing) +DOGECOIN_USER="dogecoin" + +# See http://www.bitcoin.org/smf/index.php?topic=1063 +DOGECOIN_OPTS="${DOGECOIN_OPTS}" + +# nice level +NICELEVEL="19" diff --git a/net-p2p/dogecoind/files/dogecoin.initd b/net-p2p/dogecoind/files/dogecoin.initd new file mode 100644 index 0000000..c315843 --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoin.initd @@ -0,0 +1,104 @@ +#!/sbin/runscript +# Distributed under the terms of the GNU General Public License, v2 or later + +VARDIR="/var/lib/dogecoin" +CONFFILE="${VARDIR}/.dogecoin/dogecoin.conf" + +depend() { + need net +} + +checkconfig() { + if [[ "${DOGECOIN_USER}" == "" ]] ; then + eerror "Please edit /etc/conf.d/dogecoind" + eerror "A user must be specified to run dogecoind 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 "${DOGECOIN_USER}" | cut -d ':' -f 1 ) -sq` ; then + eerror "Please edit /etc/conf.d/dogecoind" + eerror "Specified user must exist!" + return 1 + fi + if `echo "${DOGECOIN_USER}" | grep ':' -sq` ; then + if ! `cut -d ':' -f 1 /etc/group | grep $( echo "${DOGECOIN_USER}" | cut -d ':' -f 2 ) -sq` ; then + eerror "Please edit /etc/conf.d/dogecoind" + 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 Dogecoind daemon" + + pkg-config openrc + if [ $? = 0 ]; then + start_openrc + else + start_baselayout + fi +} + +stop() { + ebegin "Stopping Dogecoin daemon" + + pkg-config openrc + if [ $? = 0 ]; then + stop_openrc + else + stop_baselayout + fi +} + +start_openrc() { + start-stop-daemon \ + --start --user "${DOGECOIN_USER}" --name dogecoind \ + --pidfile /var/run/dogecoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/dogecoind \ + --nicelevel "${NICELEVEL}" \ + --background \ + --wait 2000 \ + -- ${DOGECOIN_OPTS} + eend $? +} + +stop_openrc() { + start-stop-daemon --stop --user "${DOGECOIN_USER}" \ + --name dogecoind --pidfile /var/run/dogecoind.pid \ + --wait 30000 \ + --progress + eend $? +} + +start_baselayout() { + start-stop-daemon \ + --start --user "${DOGECOIN_USER}" --name dogecoind \ + --pidfile /var/run/dogecoind.pid --make-pidfile \ + --env HOME="${VARDIR}" --exec /usr/bin/dogecoind \ + --chuid "${DOGECOIN_USER}" \ + --nicelevel "${NICELEVEL}" \ + --background \ + -- ${DOGECOIN_OPTS} + eend $? +} + +stop_baselayout() { + start-stop-daemon \ + --stop \ + --user "${DOGECOIN_USER}" \ + --name dogecoind \ + --pidfile /var/run/dogecoind.pid + eend $? +} diff --git a/net-p2p/dogecoind/files/dogecoin.service b/net-p2p/dogecoind/files/dogecoin.service new file mode 100644 index 0000000..474268d --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoin.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/dogecoind.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/dogecoind.service.d/myopts.conf" +# containing: +# [Service] +# Environment="DOGECOIN_OPTS=-debug -logtimestamps" +# Nice=10 +# This will override the setting appearing below. + +# Note that almost all daemon options could be specified in +# /etc/dogecoin/dogecoin.conf + +[Unit] +Description=Dogecoin Daemon +After=network.target + +[Service] +User=dogecoin +Environment=DOGECOIN_OPTS= +ExecStart=/usr/bin/dogecoind -daemon=0 $DOGECOIN_OPTS +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/net-p2p/dogecoind/files/dogecoind.logrotate b/net-p2p/dogecoind/files/dogecoind.logrotate new file mode 100644 index 0000000..5e58453 --- /dev/null +++ b/net-p2p/dogecoind/files/dogecoind.logrotate @@ -0,0 +1,7 @@ +/var/lib/dogecoin/.dogecoin/debug.log { + weekly + sharedscripts + postrotate + killall -HUP dogecoind + endscript +} diff --git a/net-p2p/dogecoind/metadata.xml b/net-p2p/dogecoind/metadata.xml new file mode 100644 index 0000000..6628167 --- /dev/null +++ b/net-p2p/dogecoind/metadata.xml @@ -0,0 +1,11 @@ + + + + + jwind-gentoo@squeep.com + Justin Wind + + + Use app-admin/logrotate for rotating logs + + -- 2.45.2