diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-04-27 09:21:32 +0000 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-04-27 09:21:32 +0000 |
commit | aae76d46d808fae60db72b8500976efaebdab0fd (patch) | |
tree | 1f7d0e9b24b30163a93df35ad0ef88d988ac6686 /net-p2p | |
parent | Initial import, ebuild written by me (diff) | |
download | gentoo-2-aae76d46d808fae60db72b8500976efaebdab0fd.tar.gz gentoo-2-aae76d46d808fae60db72b8500976efaebdab0fd.tar.bz2 gentoo-2-aae76d46d808fae60db72b8500976efaebdab0fd.zip |
Version bump rc3's and add log rotation
(Portage version: 2.1.10.49/cvs/Linux x86_64)
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/bitcoind/ChangeLog | 18 | ||||
-rw-r--r-- | net-p2p/bitcoind/bitcoind-0.4.5.ebuild (renamed from net-p2p/bitcoind/bitcoind-0.4.5_rc3.ebuild) | 13 | ||||
-rw-r--r-- | net-p2p/bitcoind/bitcoind-0.5.0.6.ebuild (renamed from net-p2p/bitcoind/bitcoind-0.5.0.6_rc3.ebuild) | 2 | ||||
-rw-r--r-- | net-p2p/bitcoind/bitcoind-0.5.4.ebuild (renamed from net-p2p/bitcoind/bitcoind-0.5.4_rc3.ebuild) | 13 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/0.4.5-reopen_log_file.patch | 119 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/0.6.0-reopen_log_file.patch | 119 | ||||
-rw-r--r-- | net-p2p/bitcoind/files/bitcoind.logrotate | 7 | ||||
-rw-r--r-- | net-p2p/bitcoind/metadata.xml | 1 |
8 files changed, 282 insertions, 10 deletions
diff --git a/net-p2p/bitcoind/ChangeLog b/net-p2p/bitcoind/ChangeLog index c4bd3a241282..081d60b7d7da 100644 --- a/net-p2p/bitcoind/ChangeLog +++ b/net-p2p/bitcoind/ChangeLog @@ -1,10 +1,18 @@ # ChangeLog for net-p2p/bitcoind # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/ChangeLog,v 1.24 2012/04/07 01:03:09 blueness Exp $ - -*bitcoind-0.5.4_rc3 (07 Apr 2012) -*bitcoind-0.5.0.6_rc3 (07 Apr 2012) -*bitcoind-0.4.5_rc3 (07 Apr 2012) +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/ChangeLog,v 1.25 2012/04/27 09:21:32 blueness Exp $ + + 27 Apr 2012; Anthony G. Basile <blueness@gentoo.org> + +files/0.4.5-reopen_log_file.patch, -bitcoind-0.4.5_rc3.ebuild, + +bitcoind-0.4.5.ebuild, -bitcoind-0.5.0.6_rc3.ebuild, + +bitcoind-0.5.0.6.ebuild, -bitcoind-0.5.4_rc3.ebuild, + +files/0.6.0-reopen_log_file.patch, +bitcoind-0.5.4.ebuild, + +files/bitcoind.logrotate, metadata.xml: + Version bump rc3's and add log rotation + +*bitcoind-0.5.4 (27 Apr 2012) +*bitcoind-0.5.0.6 (27 Apr 2012) +*bitcoind-0.4.5 (27 Apr 2012) 07 Apr 2012; Anthony G. Basile <blueness@gentoo.org> -bitcoind-0.4.5_rc2.ebuild, +bitcoind-0.4.5_rc3.ebuild, diff --git a/net-p2p/bitcoind/bitcoind-0.4.5_rc3.ebuild b/net-p2p/bitcoind/bitcoind-0.4.5.ebuild index 3dbe83df854c..7002a0f61142 100644 --- a/net-p2p/bitcoind/bitcoind-0.4.5_rc3.ebuild +++ b/net-p2p/bitcoind/bitcoind-0.4.5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.4.5_rc3.ebuild,v 1.1 2012/04/07 01:03:09 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.4.5.ebuild,v 1.1 2012/04/27 09:21:32 blueness Exp $ EAPI="4" @@ -20,12 +20,15 @@ SRC_URI="http://gitorious.org/bitcoin/${PN}-stable/archive-tarball/v${PV/_/} -> LICENSE="MIT ISC" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="+bip16 +eligius ssl upnp" +IUSE="+bip16 +eligius logrotate ssl upnp" RDEPEND=" >=dev-libs/boost-1.41.0 dev-libs/crypto++ dev-libs/openssl[-bindist] + logrotate? ( + app-admin/logrotate + ) upnp? ( net-libs/miniupnpc ) @@ -52,6 +55,7 @@ src_prepare() { else use eligius && epatch "${WORKDIR}/0.4.5rc1-eligius_sendfee.patch" fi + use logrotate && epatch "${FILESDIR}/${PV}-reopen_log_file.patch" } src_compile() { @@ -96,4 +100,9 @@ src_install() { dosym /etc/bitcoin/bitcoin.conf /var/lib/bitcoin/.bitcoin/bitcoin.conf dodoc doc/README + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/bitcoind.logrotate" bitcoind + fi } diff --git a/net-p2p/bitcoind/bitcoind-0.5.0.6_rc3.ebuild b/net-p2p/bitcoind/bitcoind-0.5.0.6.ebuild index e968ead82582..9f3479b6a460 100644 --- a/net-p2p/bitcoind/bitcoind-0.5.0.6_rc3.ebuild +++ b/net-p2p/bitcoind/bitcoind-0.5.0.6.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.0.6_rc3.ebuild,v 1.1 2012/04/07 01:03:09 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.0.6.ebuild,v 1.1 2012/04/27 09:21:32 blueness Exp $ EAPI="4" diff --git a/net-p2p/bitcoind/bitcoind-0.5.4_rc3.ebuild b/net-p2p/bitcoind/bitcoind-0.5.4.ebuild index 5e5d84d050ab..cff90053ba70 100644 --- a/net-p2p/bitcoind/bitcoind-0.5.4_rc3.ebuild +++ b/net-p2p/bitcoind/bitcoind-0.5.4.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.4_rc3.ebuild,v 1.1 2012/04/07 01:03:09 blueness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-p2p/bitcoind/bitcoind-0.5.4.ebuild,v 1.1 2012/04/27 09:21:32 blueness Exp $ EAPI="4" @@ -20,11 +20,14 @@ SRC_URI="http://gitorious.org/bitcoin/bitcoind-stable/archive-tarball/v${PV/_/} LICENSE="MIT ISC" SLOT="0" KEYWORDS="~amd64 ~arm ~x86" -IUSE="+bip16 +eligius examples ssl upnp" +IUSE="+bip16 +eligius examples logrotate ssl upnp" RDEPEND=" >=dev-libs/boost-1.41.0 dev-libs/openssl[-bindist] + logrotate? ( + app-admin/logrotate + ) upnp? ( net-libs/miniupnpc ) @@ -50,6 +53,7 @@ src_prepare() { else use eligius && epatch "${WORKDIR}/0.5.0.6rc1-eligius_sendfee.patch" fi + use logrotate && epatch "${FILESDIR}/0.4.5-reopen_log_file.patch" } src_compile() { @@ -110,4 +114,9 @@ src_install() { docinto examples dodoc -r contrib/{bitrpc,pyminer,wallettools} fi + + if use logrotate; then + insinto /etc/logrotate.d + newins "${FILESDIR}/bitcoind.logrotate" bitcoind + fi } diff --git a/net-p2p/bitcoind/files/0.4.5-reopen_log_file.patch b/net-p2p/bitcoind/files/0.4.5-reopen_log_file.patch new file mode 100644 index 000000000000..1d0ee2ae3275 --- /dev/null +++ b/net-p2p/bitcoind/files/0.4.5-reopen_log_file.patch @@ -0,0 +1,119 @@ +diff --git a/src/init.cpp b/src/init.cpp +index 2dccc81..630fc29 100644 +--- a/src/init.cpp ++++ b/src/init.cpp +@@ -8,6 +8,7 @@ + #include "net.h" + #include "init.h" + #include "strlcpy.h" ++#include "util.h" + #include <boost/filesystem.hpp> + #include <boost/filesystem/fstream.hpp> + #include <boost/interprocess/sync/file_lock.hpp> +@@ -71,6 +72,10 @@ void HandleSIGTERM(int) + fRequestShutdown = true; + } + ++void HandleSIGHUP(int) ++{ ++ fReopenDebugLog = true; ++} + + + +@@ -132,7 +137,13 @@ bool AppInit2(int argc, char* argv[]) + sa.sa_flags = 0; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); +- sigaction(SIGHUP, &sa, NULL); ++ ++ // Reopen debug.log on SIGHUP ++ struct sigaction sa_hup; ++ sa_hup.sa_handler = HandleSIGHUP; ++ sigemptyset(&sa_hup.sa_mask); ++ sa_hup.sa_flags = 0; ++ sigaction(SIGHUP, &sa_hup, NULL); + #endif + + // +diff --git a/src/util.cpp b/src/util.cpp +index 0f496bc..736fac6 100644 +--- a/src/util.cpp ++++ b/src/util.cpp +@@ -30,6 +30,8 @@ string strMiscWarning; + bool fTestNet = false; + bool fNoListen = false; + bool fLogTimestamps = false; ++FILE* fileout = NULL; ++bool fReopenDebugLog = false; + + + +@@ -154,6 +156,13 @@ int GetRandInt(int nMax) + + + ++string GetDebugLogName() ++{ ++ char pszFile[MAX_PATH+100]; ++ GetDataDir(pszFile); ++ strlcat(pszFile, "/debug.log", sizeof(pszFile)); ++ return pszFile; ++} + + inline int OutputDebugStringF(const char* pszFormat, ...) + { +@@ -169,19 +178,27 @@ inline int OutputDebugStringF(const char* pszFormat, ...) + else + { + // print to debug.log +- static FILE* fileout = NULL; + + if (!fileout) + { +- char pszFile[MAX_PATH+100]; +- GetDataDir(pszFile); +- strlcat(pszFile, "/debug.log", sizeof(pszFile)); ++ const char* pszFile = GetDebugLogName().c_str(); + fileout = fopen(pszFile, "a"); + if (fileout) setbuf(fileout, NULL); // unbuffered + } + if (fileout) + { + static bool fStartedNewLine = true; ++#ifndef WIN32 ++ flockfile(fileout); ++ ++ // reopen the log file, if requested ++ if (fReopenDebugLog) { ++ fReopenDebugLog = false; ++ const char* pszFile = GetDebugLogName().c_str(); ++ if (freopen(pszFile,"a",fileout) != NULL) ++ setbuf(fileout, NULL); // unbuffered ++ } ++#endif + + // Debug print useful for profiling + if (fLogTimestamps && fStartedNewLine) +@@ -195,6 +212,9 @@ inline int OutputDebugStringF(const char* pszFormat, ...) + va_start(arg_ptr, pszFormat); + ret = vfprintf(fileout, pszFormat, arg_ptr); + va_end(arg_ptr); ++#ifndef WIN32 ++ funlockfile(fileout); ++#endif + } + } + +diff --git a/src/util.h b/src/util.h +index 4e4cbb9..d2c19c9 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -166,6 +166,7 @@ extern std::string strMiscWarning; + extern bool fTestNet; + extern bool fNoListen; + extern bool fLogTimestamps; ++extern bool fReopenDebugLog; + + void RandAddSeed(); + void RandAddSeedPerfmon(); diff --git a/net-p2p/bitcoind/files/0.6.0-reopen_log_file.patch b/net-p2p/bitcoind/files/0.6.0-reopen_log_file.patch new file mode 100644 index 000000000000..baf14ef275f6 --- /dev/null +++ b/net-p2p/bitcoind/files/0.6.0-reopen_log_file.patch @@ -0,0 +1,119 @@ +diff --git a/src/init.cpp b/src/init.cpp +index 4078b7e..87a619f 100644 +--- a/src/init.cpp ++++ b/src/init.cpp +@@ -8,6 +8,7 @@ + #include "net.h" + #include "init.h" + #include "strlcpy.h" ++#include "util.h" + #include <boost/filesystem.hpp> + #include <boost/filesystem/fstream.hpp> + #include <boost/filesystem/convenience.hpp> +@@ -83,6 +84,10 @@ void HandleSIGTERM(int) + fRequestShutdown = true; + } + ++void HandleSIGHUP(int) ++{ ++ fReopenDebugLog = true; ++} + + + +@@ -144,7 +149,13 @@ bool AppInit2(int argc, char* argv[]) + sa.sa_flags = 0; + sigaction(SIGTERM, &sa, NULL); + sigaction(SIGINT, &sa, NULL); +- sigaction(SIGHUP, &sa, NULL); ++ ++ // Reopen debug.log on SIGHUP ++ struct sigaction sa_hup; ++ sa_hup.sa_handler = HandleSIGHUP; ++ sigemptyset(&sa_hup.sa_mask); ++ sa_hup.sa_flags = 0; ++ sigaction(SIGHUP, &sa_hup, NULL); + #endif + + // +diff --git a/src/util.cpp b/src/util.cpp +index 08752e6..ca4e53b 100644 +--- a/src/util.cpp ++++ b/src/util.cpp +@@ -32,6 +32,8 @@ bool fTestNet = false; + bool fNoListen = false; + bool fLogTimestamps = false; + CMedianFilter<int64> vTimeOffsets(200,0); ++FILE* fileout = NULL; ++bool fReopenDebugLog = false; + + + +@@ -155,6 +157,13 @@ int GetRandInt(int nMax) + + + ++string GetDebugLogName() ++{ ++ char pszFile[MAX_PATH+100]; ++ GetDataDir(pszFile); ++ strlcat(pszFile, "/debug.log", sizeof(pszFile)); ++ return pszFile; ++} + + inline int OutputDebugStringF(const char* pszFormat, ...) + { +@@ -170,19 +179,27 @@ inline int OutputDebugStringF(const char* pszFormat, ...) + else + { + // print to debug.log +- static FILE* fileout = NULL; + + if (!fileout) + { +- char pszFile[MAX_PATH+100]; +- GetDataDir(pszFile); +- strlcat(pszFile, "/debug.log", sizeof(pszFile)); ++ const char* pszFile = GetDebugLogName().c_str(); + fileout = fopen(pszFile, "a"); + if (fileout) setbuf(fileout, NULL); // unbuffered + } + if (fileout) + { + static bool fStartedNewLine = true; ++#ifndef WIN32 ++ flockfile(fileout); ++ ++ // reopen the log file, if requested ++ if (fReopenDebugLog) { ++ fReopenDebugLog = false; ++ const char* pszFile = GetDebugLogName().c_str(); ++ if (freopen(pszFile,"a",fileout) != NULL) ++ setbuf(fileout, NULL); // unbuffered ++ } ++#endif + + // Debug print useful for profiling + if (fLogTimestamps && fStartedNewLine) +@@ -196,6 +213,9 @@ inline int OutputDebugStringF(const char* pszFormat, ...) + va_start(arg_ptr, pszFormat); + ret = vfprintf(fileout, pszFormat, arg_ptr); + va_end(arg_ptr); ++#ifndef WIN32 ++ funlockfile(fileout); ++#endif + } + } + +diff --git a/src/util.h b/src/util.h +index 4fa5a08..5981ab6 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -123,6 +123,7 @@ extern std::string strMiscWarning; + extern bool fTestNet; + extern bool fNoListen; + extern bool fLogTimestamps; ++extern bool fReopenDebugLog; + + void RandAddSeed(); + void RandAddSeedPerfmon(); diff --git a/net-p2p/bitcoind/files/bitcoind.logrotate b/net-p2p/bitcoind/files/bitcoind.logrotate new file mode 100644 index 000000000000..36d8dc2b1344 --- /dev/null +++ b/net-p2p/bitcoind/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/bitcoind/metadata.xml b/net-p2p/bitcoind/metadata.xml index b6b0f9d93d40..848f2d64c429 100644 --- a/net-p2p/bitcoind/metadata.xml +++ b/net-p2p/bitcoind/metadata.xml @@ -12,6 +12,7 @@ <use> <flag name='bip16'>Enable backported support for relaying and mining new BIP16 pay-to-script-hash transactions</flag> <flag name='eligius'>Enable using lower fees accepted by Eligius</flag> + <flag name='logrotate'>Use app-admin/logrotate for rotating logs</flag> <flag name='upnp'>Enable Universal Plug and Play</flag> </use> </pkgmetadata> |