summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2013-08-28 13:35:59 +0000
committerPeter Volkov <pva@gentoo.org>2013-08-28 13:35:59 +0000
commit37c82b7eaf92ba2d9fee5b646acec741d495c434 (patch)
tree91e0c14736b099071aaa503c9c2aff77148335e4 /dev-vcs
parentStable for HPPA (bug #482308). (diff)
downloadhistorical-37c82b7eaf92ba2d9fee5b646acec741d495c434.tar.gz
historical-37c82b7eaf92ba2d9fee5b646acec741d495c434.tar.bz2
historical-37c82b7eaf92ba2d9fee5b646acec741d495c434.zip
Fixed test failure with botan-1.10, thank Martin von Gagern for patch in bug #380257. Fixed another failure with pcre3 (patch from debian).
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64 Manifest-Sign-Key: 0xF1989B07
Diffstat (limited to 'dev-vcs')
-rw-r--r--dev-vcs/monotone/ChangeLog10
-rw-r--r--dev-vcs/monotone/Manifest17
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch644
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-pcre3.patch26
-rw-r--r--dev-vcs/monotone/metadata.xml4
-rw-r--r--dev-vcs/monotone/monotone-1.0-r4.ebuild115
6 files changed, 813 insertions, 3 deletions
diff --git a/dev-vcs/monotone/ChangeLog b/dev-vcs/monotone/ChangeLog
index b7745cbdbed0..0d584260ad48 100644
--- a/dev-vcs/monotone/ChangeLog
+++ b/dev-vcs/monotone/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for dev-vcs/monotone
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-vcs/monotone/ChangeLog,v 1.26 2013/06/30 00:18:23 chithanh Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/monotone/ChangeLog,v 1.27 2013/08/28 13:35:54 pva Exp $
+
+*monotone-1.0-r4 (28 Aug 2013)
+
+ 28 Aug 2013; Peter Volkov <pva@gentoo.org> +monotone-1.0-r4.ebuild,
+ +files/monotone-1.0-botan-1.10-v2.patch, +files/monotone-1.0-pcre3.patch,
+ metadata.xml:
+ Fixed test failure with botan-1.10, thank Martin von Gagern for patch in bug
+ #380257. Fixed another failure with pcre3 (patch from debian).
30 Jun 2013; Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
+files/monotone-1.0-boost-1.53.patch, monotone-1.0-r3.ebuild:
diff --git a/dev-vcs/monotone/Manifest b/dev-vcs/monotone/Manifest
index 06bb65d6476c..62696b9ea1bf 100644
--- a/dev-vcs/monotone/Manifest
+++ b/dev-vcs/monotone/Manifest
@@ -1,10 +1,15 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
AUX 50monotone-gentoo.el 1217 SHA256 bfd32a5f57abd47bd6bc35ce27c2a31dfd1c1f7517d869fc0bca6b715d8ea259 SHA512 c76f92fcf0f99dc9a419db1e8679a5854d015aa93046ad86aba10828a4b4651a3494f16d594faef74ce4cbf93f1e45cd99883ff777cf4d730a7f9e4a63f6b0e9 WHIRLPOOL 6be072c8f54418773776a1572324a66271866f474d25a72fab2e79894314e1624229a2479e960140c36ac188bd07d3e84e57829a2544bc3fbc317db56c7c2702
AUX hooks.lua 154 SHA256 55e17360a14ccf70d2da5b3e3ad038b1021c30f4be5c69029f50bd1ec8cbf326 SHA512 1244786898087edfe5c11493081c38d498c5ed275449b040caf4b9fbd1b3c15d238246c3d9c62cbfb5d0dd5f9a9ebac12a50ce6471fc245ede5c5e944bdb88e2 WHIRLPOOL 8d539f2aa64a85353da5653ec6987a7915a4eed0bea1f44a4b7bfac7c62e702f04ac94010309c8a5a8cc9040c733f9d42aab0c95edc3bd56549a91e2609f218c
AUX monotone-0.36.initd 2464 SHA256 c561618b38e7efce2a175bc166f1b4dfb9fcbb87ccb61e3df02f8dc9b7e615f2 SHA512 62d239a1d00d959c9834c601ecbc798796d6148a49992f98b795983eb687909eb497d2b6160d4aee74a74eee53452fe3cddeeb3093972a2590379b02ff5bf390 WHIRLPOOL 7e21a82b2438276f420fe998d5529f17e9921114ea9b3f7178c0ab53d54b5a091270b9b0dac0bc30b0b82349cb8c856204492e68a7509b470acf88bc317174b1
AUX monotone-1.0-bash-completion-tests.patch 760 SHA256 bd5f78ccc627ab7f58d4b628c8bfbbaffe07e7ba8f5434d3ec823e8922aba401 SHA512 0c0ed67e668c28a8bd25624f420be72049f223e67f2686528a2899b47499661b972398ec3da891e1a55fbe69a2a0928812334c5741cb1391e3df04a9a49aaf7d WHIRLPOOL 85e0f269bf4ce310f31f74e25f1a5fb9c5eb24077a1dec3865e64a0a8f87633e60e464bbdb3b0c39219e201b3b718a1ca7221f4df2f9bfc68d54d5682350b9cd
AUX monotone-1.0-boost-1.53.patch 3768 SHA256 4a7e8135552cdb362416193a1e9f4fa5ef73a14c9974514c204d97b8c55740a2 SHA512 0ba422905701ddbab1c0d21d515079f686949d00d6579dd0578b45c1a05449b12a415209c327823739ed72a2f52f5d33735d293ef7c95d4a7f3afb22b80de33f WHIRLPOOL fa46fe37f993c1d133dc513d7a0f1b752797cc0fd56cae4969a7ab76ce3276d07f39cbbbbe9fb0e72d284fd3636a3b19534253bb4e2949a3802bf575ff936f69
+AUX monotone-1.0-botan-1.10-v2.patch 26290 SHA256 7455fdbc238d7ac461801e962bf6bcd6e147b050358ac24aa2280f0cb387ccc8 SHA512 f41f5c363cc6fd5a30582a1551a283ef7ad7c2c2450ff9c557fe3551dbe5184ba93ec88d9d9f7f3d4a7c678cf04043f23fa32d8c6bd837c05d5f11fdc9d661fd WHIRLPOOL b9261552fcf133f259db074d0dd973bbc6e7cc434733da4322746b5a461512481050c590a263bef5f0a185bd5656cb73d1d616b2d1a1808b06844cb7269ff34b
AUX monotone-1.0-botan-1.10.patch 16771 SHA256 79ae0d0925138d0f84fa0af4b4f8d3464f5791a4cba97f7c21ea435301d336e9 SHA512 928631ed957b7bd2ba38d0644eba110fcaa9f90729ce221829ea963e1dba4ac4da3cbd5b19732b5285901948f6d5dd6000c183e904e912ef1e4e52b9ed3b4a4f WHIRLPOOL 006d6a89c551f7440b209f4e431e633d02ac587118be528b52a343ccb581eae8081e5be7c8f989616259587b49def8c15dcb0252ebdff6ea1bf91d2d916c240e
AUX monotone-1.0-glibc-2.14-file-handle.patch 4132 SHA256 38ca0788f7e69e58e539e4b1acf95b95c4fa0dd1b5f0fcad3e4154774fc1c869 SHA512 b7855748d97855f8796cb663b97efaa23bc8c6032b1cfb61ef31acb9b7c97a1b8f66fef4a6aae226a740fd4352f322eb542dc2da4c6471233d48f29d18aa5d40 WHIRLPOOL 9d02ed8a13a4ef572f932b3cc4c366b5673bc2d5dbf2e826aeec03c65d438825d4841fb8e19b969cabc9c7f996405311509ea741191f0d87805a93da239b2bc4
+AUX monotone-1.0-pcre3.patch 1205 SHA256 2adf14d0b574abecfc84939abfd4285de62a323ba0e61d16c122e43e3295a824 SHA512 3b3d81bdeb1a253a25b29b6ee9a4c006d3d6a2d8c82c28ad51d4aebfc80ba5369b604259a0478bda0e11042769c809da65b3afda1ba25eefcf56af643ae6b932 WHIRLPOOL 681f2d73c40eb145c7797cd283007c731913f05d1aadcc37a7c8d65444f1520e0722dcd01d8b76b79a25f4a0056252095a8f43314b800b6e087fff9da09e46fd
AUX monotone.confd 803 SHA256 4e266a08108441438fb4b3ac40216e731378d378593807b0826f58446c346e5b SHA512 356c2bee23546083044d336ba8c929e22e78083cd834f15d5fd7dbeee50e0a895cc314b24fe3099e7ec748c6936333bcbf5c10a429557d2df3e05739d08627a5 WHIRLPOOL 47005eec989eb0fad91162a172570e7e4dcca704d821289c0d33d66a08c6c2cbe7377b7b3ffcffda4278a0834b23a53d39d80eb80c22704b8f0a9155817a36e4
AUX read-permissions 192 SHA256 4f93a644b2f16d6ea5c4d28e3039dfddd7f8e38ca1b8d54389094be751fbfa7c SHA512 a86c6d7963e41f471de5c3c8538e0464364dffdaf8aee9890b833042c20b0a3a692e2262106f63fc7a669e2a9003d2a01aecb1d9a7632b432fdb828d1a42cdbd WHIRLPOOL 8bb1ec95c884000727a7f47dc3b558606c463eb0b1752838a1ca93d97a77c3cb44ebeb24d4af19cf0d67fa347ba13346c8c71f089785388a65721740a9baa0c8
AUX write-permissions 32 SHA256 ddd40fac5d6fe98d9f58c4731a500eb1350a42ae7ca0ddaa40eaa3bbeb99026c SHA512 7348c621149d2911db11eb078ad39eb02ed3b51f4e1dd7ebc58dc863cfc0839e115c26d707c496138767f64e3987a4cc7dffb5eb711872a5d40fd8d084b9c08e WHIRLPOOL 3e04781c7637ecd08dea6e79d1f8e60eeb3d2617b6ec4c5e006ef873c480b63e4f27a1f753e1ba0805fb65ce52651fe8be48c4b5648e2aac4a8b724fe20082ca
@@ -12,5 +17,13 @@ DIST monotone-0.99.1.tar.gz 4940291 SHA256 204ebb12f36599ac4c105ae5bf45edd7da13a
DIST monotone-1.0.tar.bz2 3588074 SHA256 5c530bc4652b2c08b5291659f0c130618a14780f075f981e947952dcaefc31dc SHA512 85f5a015ee3f7a924e16b7f20974cadd18bd6aaf2815eca0da42689373fc654c661051ce6981ec473f9eac7f9796cfed3431f0cfe16d1cbe0b0b625302ef3e77 WHIRLPOOL c0379f4e37fc6dc8f47caf4b548f7ef124cdf3f7a87fccb3a4cc6d160bcff4092a4d9636d71558120c9e28ef072bcf5dd23d6e116ad49abb6c99a9886d1747df
EBUILD monotone-0.99.1-r1.ebuild 3364 SHA256 7342df34e01a5314ae19d31c93025f34ca676577873565e0e39a41323b453abd SHA512 ed691786cb52985dd57cd23f6ad64837431902adf8a3dc5a8bee7513d17e9dd1eb6485f14085cc1305b3a3ccf5068d4215710619a941be5943bf1c8a0547eef9 WHIRLPOOL 031c6a73b7bf3c2fb2ead46d93dd173dfe979b0f0527211d441becd441f68d93c2814af841a9d109c9ecfa4b1f3f85901fb2d247decd7a8bffb3571df3e29738
EBUILD monotone-1.0-r3.ebuild 3414 SHA256 3aa8f2c01d210791bc069961ef3052ccb8fc98b8a2efa9e3cf2459d77abf2b29 SHA512 f2b641165d3a7cce6715a70894908f2fc03db28a64a5d51d9aa2a5b7814f51c12b430d1c849173ad904e89017c5bda15acefa222b25460d2e7f815845441ab35 WHIRLPOOL aa071e64ae5d43633d5c7e2a81d64179a53a101945ec322d4c0e648cb8e7bb28edf1919d6777a83de30e4987fe8f62a983165e4298999ee393c505561c6ed649
-MISC ChangeLog 15723 SHA256 00252e115cf473ba99e669efb3bdb560bfa5f5c245932fa1c1c1f2f8e2cbe292 SHA512 e9f27b28cb348b7138e6ae5dda1967f82ba0263fa18c16d7cae6f86ca2ed8543757291d5b92e534529ca26ed791785729c4da4878e41ffb5e5966d21524702be WHIRLPOOL 6b7d3b83703309e62483fa0a347e60f53328b78728468b09faa688314423bec11c77a626b1515a2209671eed3a8c6ad3262a3073225827d946d189aac8a132a9
-MISC metadata.xml 931 SHA256 ccdef0fbdd5b80153d94cf72c025ae221a51bd14a4dc3b38a40468c28d0b72dc SHA512 260bcea0df75eade475421241de560d22ead3775f45e6d9e96ed56afb21e7faf05614a060ea6c3c6028e66f5e7a0ce059ec8ff0f334a0476c28701c3f2b91fea WHIRLPOOL ef9356aed0b0e4941d4c3d16919d3a056305e2b6ff85c68204774e0560d3c81e0301de7c5be7d47728392fc60cd246d5a04bdf6f230ecb365ec09b42df94cf7e
+EBUILD monotone-1.0-r4.ebuild 3459 SHA256 61114b3743fa049f2e90b4263adb4f26e61a602667ac3bd96be21aa209936aa4 SHA512 9b1e0ae958ca5e71989f6558e7b529938def1225eaa793db5fbac11e25433db69dcc9f9e34b50c6258715ed63b59b21e0b3d660ef952a5b3a26fcc68d6716fb3 WHIRLPOOL dabd74e05575f5cd63e409063061b48b47e230b60251ff092ae67b8bf3dedc73a3ae02552a684f2eed0a8d810708008d845cbc41348d4dadc7a903abe74858e5
+MISC ChangeLog 16057 SHA256 a6b410645ca96e60b7f1a81c4a31a7f834672354d57fb94c407ffe0f3a531c05 SHA512 623082c97ac945df09d70a4ac6a66e30f9f9932d12ee99d045f94579328fd459fbe561fb04b187ce2c74599cdcab69ee42a3f6422166fffb50ba976a6d7955b4 WHIRLPOOL 788bfb71b87ebf1c9b2ee479047688bbaa04ee857377c62e6b607f7d89d4683a38644f79e891288f98cb128da820cfeafd6dc231be89d56e17698270a00372da
+MISC metadata.xml 1022 SHA256 49612eb1b8b9b74a9d0d4cf6a1da8137a549f92da58570a0cd99655187dba298 SHA512 8c22f244eb8bc6e1338d2773418fadaccf9f238cb22f417129877c134792e351d459631f6952692905f91b533098a2d2a9a8f4cb09e2d32cfcb895891f4b8e96 WHIRLPOOL 333a0b3d5e49b5bd927f5846951d9844794868d50788b8434f9c7bdb2bc573a8f6db534aa9b59c7501509cf9c91e770203beb367a9342e91cc3c807ef7c94224
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.20 (GNU/Linux)
+
+iF4EAREIAAYFAlId/MsACgkQGrk+8vGYmwdUdgEApQAYKVyrtVbSFnUpa50gnNdM
+WE9KFvZZOtIvBxPGJEQBAOv+O3KgMEX+6+Mrxn2e+dq7X4sfzf2KIPAM0BqTxQAM
+=AWB3
+-----END PGP SIGNATURE-----
diff --git a/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch b/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch
new file mode 100644
index 000000000000..a86bac555b18
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch
@@ -0,0 +1,644 @@
+Make monotone work with botan 1.10.
+
+Patch generated using the following command:
+mtn diff -r 972ee5c3eab3fb5ba0b80684193293d18438a9d0 \
+ -r f4feb3fdc68e4f955909450b2dcb3ff9312dbc9e
+
+Authors: Martin von Gagern, Markus Wanner
+
+References:
+https://bugs.gentoo.org/380257
+https://code.monotone.ca/p/monotone/issues/182/
+https://code.monotone.ca/p/monotone/source/commit/f4feb3fd
+
+============================================================
+--- src/database.cc 4c259f963c440fc95564dfec99b2f832f0bad643
++++ src/database.cc 87efeeff2d3263ba98af684a4022f1897434ed2d
+@@ -3425,9 +3425,8 @@ database::encrypt_rsa(key_id const & pub
+ rsa_pub_key pub;
+ get_key(pub_id, pub);
+
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+ shared_ptr<RSA_PublicKey> pub_key
+@@ -3471,14 +3470,13 @@ database::check_signature(key_id const &
+ else
+ {
+ rsa_pub_key pub;
+- SecureVector<Botan::byte> pub_block;
+
+ if (!public_key_exists(id))
+ return cert_unknown;
+
+ get_key(id, pub);
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ L(FL("building verifier for %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+============================================================
+--- src/gzip.cc e7c19bee910e3d421fd073933810ec52092b1d9b
++++ src/gzip.cc 9da41f6820cdf39707b22c716e3682e0fa0fd745
+@@ -110,7 +110,7 @@ Gzip_Compression::Gzip_Compression(u32bi
+ if(deflateInit2(&(zlib->stream), level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK)
+ {
+ delete zlib; zlib = 0;
+- throw Exception("Gzip_Compression: Memory allocation error");
++ throw Memory_Exhaustion();
+ }
+ }
+
+@@ -137,7 +137,7 @@ void Gzip_Compression::start_msg()
+ /*************************************************
+ * Compress Input with Gzip *
+ *************************************************/
+-void Gzip_Compression::write(const byte input[], u32bit length)
++void Gzip_Compression::write(const byte input[], filter_length_t length)
+ {
+
+ count += length;
+@@ -152,7 +152,7 @@ void Gzip_Compression::write(const byte
+ zlib->stream.avail_out = buffer.size();
+ int rc = deflate(&(zlib->stream), Z_NO_FLUSH);
+ if (rc != Z_OK && rc != Z_STREAM_END)
+- throw Exception("Internal error in Gzip_Compression deflate.");
++ throw Invalid_State("Internal error in Gzip_Compression deflate.");
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ }
+ }
+@@ -172,7 +172,7 @@ void Gzip_Compression::end_msg()
+ zlib->stream.avail_out = buffer.size();
+ rc = deflate(&(zlib->stream), Z_FINISH);
+ if (rc != Z_OK && rc != Z_STREAM_END)
+- throw Exception("Internal error in Gzip_Compression finishing deflate.");
++ throw Invalid_State("Internal error in Gzip_Compression finishing deflate.");
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ }
+
+@@ -228,7 +228,7 @@ Gzip_Decompression::Gzip_Decompression()
+ no_writes(true), pipe(new Hash_Filter("CRC32")), footer(0)
+ {
+ if (DEFAULT_BUFFERSIZE < sizeof(GZIP::GZIP_HEADER))
+- throw Exception("DEFAULT_BUFFERSIZE is too small");
++ throw Decoding_Error("DEFAULT_BUFFERSIZE is too small");
+
+ zlib = new Zlib_Stream;
+
+@@ -237,7 +237,7 @@ Gzip_Decompression::Gzip_Decompression()
+ if(inflateInit2(&(zlib->stream), -15) != Z_OK)
+ {
+ delete zlib; zlib = 0;
+- throw Exception("Gzip_Decompression: Memory allocation error");
++ throw Memory_Exhaustion();
+ }
+ }
+
+@@ -256,7 +256,7 @@ void Gzip_Decompression::start_msg()
+ void Gzip_Decompression::start_msg()
+ {
+ if (!no_writes)
+- throw Exception("Gzip_Decompression: start_msg after already writing");
++ throw Decoding_Error("Gzip_Decompression: start_msg after already writing");
+
+ pipe.start_msg();
+ datacount = 0;
+@@ -267,7 +267,7 @@ void Gzip_Decompression::start_msg()
+ /*************************************************
+ * Decompress Input with Gzip *
+ *************************************************/
+-void Gzip_Decompression::write(const byte input[], u32bit length)
++void Gzip_Decompression::write(const byte input[], filter_length_t length)
+ {
+ if(length) no_writes = false;
+
+@@ -277,15 +277,16 @@ void Gzip_Decompression::write(const byt
+ u32bit eat_len = eat_footer(input, length);
+ input += eat_len;
+ length -= eat_len;
+- if (length == 0)
+- return;
+ }
+
++ if (length == 0)
++ return;
++
+ // Check the gzip header
+ if (pos < sizeof(GZIP::GZIP_HEADER))
+ {
+- u32bit len = std::min((u32bit)sizeof(GZIP::GZIP_HEADER)-pos, length);
+- u32bit cmplen = len;
++ filter_length_t len = std::min((filter_length_t)sizeof(GZIP::GZIP_HEADER)-pos, length);
++ filter_length_t cmplen = len;
+ // The last byte is the OS flag - we don't care about that
+ if (pos + len - 1 >= GZIP::HEADER_POS_OS)
+ cmplen--;
+@@ -317,8 +318,8 @@ void Gzip_Decompression::write(const byt
+ if(rc == Z_NEED_DICT)
+ throw Decoding_Error("Gzip_Decompression: Need preset dictionary");
+ if(rc == Z_MEM_ERROR)
+- throw Exception("Gzip_Decompression: Memory allocation error");
+- throw Exception("Gzip_Decompression: Unknown decompress error");
++ throw Memory_Exhaustion();
++ throw Decoding_Error("Gzip_Decompression: Unknown decompress error");
+ }
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ pipe.write(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+@@ -346,8 +347,14 @@ u32bit Gzip_Decompression::eat_footer(co
+ if (footer.size() >= GZIP::FOOTER_LENGTH)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error in footer");
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ size_t eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(),
++ static_cast<size_t>(length));
++ footer += std::make_pair(input, eat_len);
++#else
+ u32bit eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(), length);
+ footer.append(input, eat_len);
++#endif
+
+ if (footer.size() == GZIP::FOOTER_LENGTH)
+ {
+@@ -364,7 +371,7 @@ void Gzip_Decompression::check_footer()
+ void Gzip_Decompression::check_footer()
+ {
+ if (footer.size() != GZIP::FOOTER_LENGTH)
+- throw Exception("Gzip_Decompression: Error finalizing decompression");
++ throw Decoding_Error("Gzip_Decompression: Error finalizing decompression");
+
+ pipe.end_msg();
+
+@@ -377,7 +384,12 @@ void Gzip_Decompression::check_footer()
+ for (int i = 0; i < 4; i++)
+ buf[3-i] = tmpbuf[i];
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ tmpbuf.resize(4);
++ tmpbuf.copy(footer.begin(), 4);
++#else
+ tmpbuf.set(footer.begin(), 4);
++#endif
+ if (buf != tmpbuf)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error - CRC32 error");
+
+@@ -400,7 +412,7 @@ void Gzip_Decompression::end_msg()
+ // read, clear() will reset no_writes
+ if(no_writes) return;
+
+- throw Exception("Gzip_Decompression: didn't find footer");
++ throw Decoding_Error("Gzip_Decompression: didn't find footer");
+
+ }
+
+@@ -412,7 +424,11 @@ void Gzip_Decompression::clear()
+ no_writes = true;
+ inflateReset(&(zlib->stream));
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ footer.clear();
++#else
+ footer.destroy();
++#endif
+ pos = 0;
+ datacount = 0;
+ }
+============================================================
+--- src/gzip.hh 649dfc0b250954f39c0f73870f8bec3f32f7fa43
++++ src/gzip.hh aff9da63bb22366bccf69c2d75ee7790406d2455
+@@ -7,11 +7,18 @@
+ #ifndef BOTAN_EXT_GZIP_H__
+ #define BOTAN_EXT_GZIP_H__
+
++#include <botan/version.h>
+ #include <botan/filter.h>
+ #include <botan/pipe.h>
+
+ namespace Botan {
+
++#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,4)
++// Only 1.9.4 and newer export the Memory_Exception. Give this gzip
++// implementation something compatible to work with.
++typedef std::bad_alloc Memory_Exhaustion;
++#endif
++
+ namespace GZIP {
+
+ /* A basic header - we only need to set the IDs and compression method */
+@@ -30,13 +37,19 @@ namespace GZIP {
+
+ }
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++typedef size_t filter_length_t;
++#else
++typedef u32bit filter_length_t;
++#endif
++
+ /*************************************************
+ * Gzip Compression Filter *
+ *************************************************/
+ class Gzip_Compression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Compression"; }
+@@ -60,7 +73,7 @@ class Gzip_Decompression : public Filter
+ class Gzip_Decompression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Decompression"; }
+============================================================
+--- src/key_packet.cc d1306df89dd684badac02c03744cd446381c07d3
++++ src/key_packet.cc c97262d161b23c9640972188979669b3e95afe7b
+@@ -106,8 +106,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+============================================================
+--- src/key_store.cc 64c4c4bed1fadc26b51207b9f61343f9dd7d3c6e
++++ src/key_store.cc b7859345f7c665914d16357409bdff24a48b7996
+@@ -572,13 +572,21 @@ key_store_state::decrypt_private_key(key
+ try // with empty passphrase
+ {
+ Botan::DataSource_Memory ds(kp.priv());
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI()));
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), ""));
+ #else
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, ""));
+ #endif
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required & e)
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument & e)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ L(FL("failed to load key with no passphrase: %s") % e.what());
+
+@@ -605,13 +613,18 @@ key_store_state::decrypt_private_key(key
+ {
+ Botan::DataSource_Memory ds(kp.priv());
+ #if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+- pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), phrase()));
++ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(),
++ phrase()));
+ #else
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, phrase()));
+ #endif
+ break;
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ cycles++;
+ L(FL("decrypt_private_key: failure %d to load encrypted key: %s")
+@@ -822,10 +835,14 @@ key_store::decrypt_rsa(key_id const & id
+ plaintext = string(reinterpret_cast<char const*>(plain.begin()),
+ plain.size());
+ }
+- catch (Botan::Exception & ex)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (std::exception & e)
++#else
++ catch (Botan::Exception & e)
++#endif
+ {
+ E(false, ciphertext.made_from,
+- F("Botan error decrypting data: '%s'") % ex.what());
++ F("Botan error decrypting data: '%s'") % e.what());
+ }
+ }
+
+@@ -856,9 +873,9 @@ key_store::make_signature(database & db,
+ {
+ if (agent.connected()) {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(key.pub().data()),
+- key.pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(key.pub().data()),
++ key.pub().size());
+ L(FL("make_signature: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+@@ -1031,8 +1048,14 @@ key_store_state::migrate_old_key_pair
+ for (;;)
+ try
+ {
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ arc4_key.resize(phrase().size());
++ arc4_key.copy(reinterpret_cast<Botan::byte const *>(phrase().data()),
++ phrase().size());
++#else
+ arc4_key.set(reinterpret_cast<Botan::byte const *>(phrase().data()),
+ phrase().size());
++#endif
+
+ Pipe arc4_decryptor(get_cipher("ARC4", arc4_key, Botan::DECRYPTION));
+
+@@ -1051,7 +1074,11 @@ key_store_state::migrate_old_key_pair
+ #endif
+ break;
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument & e)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ L(FL("migrate_old_key_pair: failure %d to load old private key: %s")
+ % cycles % e.what());
+============================================================
+--- src/monotone.cc a25ecdd170a601db798b63a60add7681609a34c4
++++ src/monotone.cc 764bc9ca406b41d21efd552a0d810bc2849e0588
+@@ -156,27 +156,53 @@ cpp_main(int argc, char ** argv)
+ E(linked_botan_version != BOTAN_VERSION_CODE_FOR(1,7,14), origin::system,
+ F("monotone does not support Botan 1.7.14"));
+
+-#if BOTAN_VERSION_CODE <= BOTAN_VERSION_CODE_FOR(1,7,6)
++ // In Botan 1.9.9, the DataSink_Stream cannot be instantiated per
++ // se. As 1.10.1 is already out, let's simply disable support for
++ // that specific (testing) version of botan.
++ E(linked_botan_version != BOTAN_VERSION_CODE_FOR(1,9,9), origin::system,
++ F("monotone does not support Botan 1.9.9"));
++
++#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,7,7)
++ // motonote binary compiled against botan younger than 1.7.7
+ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,6,3), origin::system,
+ F("this monotone binary requires Botan 1.6.3 or newer"));
+- E(linked_botan_version <= BOTAN_VERSION_CODE_FOR(1,7,6), origin::system,
+- F("this monotone binary does not work with Botan newer than 1.7.6"));
+-#elif BOTAN_VERSION_CODE <= BOTAN_VERSION_CODE_FOR(1,7,22)
+- E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,7,6), origin::system,
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,7,7), origin::system,
++ F("this monotone binary does not work with Botan 1.7.7 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,7,22)
++ // motonote binary compiled against botan 1.7.7 - 1.7.21
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,7,7), origin::system,
+ F("this monotone binary requires Botan 1.7.7 or newer"));
+- // While compiling against 1.7.22 or newer is recommended, because
+- // it enables new features of Botan, the monotone binary compiled
+- // against Botan 1.7.21 and before should still work with newer Botan
+- // versions, including all of the stable branch 1.8.x.
+- E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+- F("this monotone binary does not work with Botan 1.9.x"));
+-#else
+- E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,7,22), origin::system,
++ // While compiling against 1.7.22 or newer is recommended, because it
++ // enables new features of Botan, the monotone binary compiled against
++ // Botan 1.7.21 and before should still work with newer Botan version,
++ // including all of the stable branch 1.8.x, up to and including
++ // 1.9.3.
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary does not work with Botan 1.9.4 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,4)
++ // motonote binary compiled against botan 1.7.22 - 1.9.3
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,7,22), origin::system,
+ F("this monotone binary requires Botan 1.7.22 or newer"));
+- E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+- F("this monotone binary does not work with Botan 1.9.x"));
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary does not work with Botan 1.9.4 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
++ // motonote binary compiled against botan 1.9.4 - 1.9.10
++#pragma message ( "The resulting monotone binary won't be able to run with any stable release of botan." )
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary requires Botan 1.9.4 or newer"));
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,11), origin::system,
++ F("this monotone binary does not work with Botan 1.9.11 or newer"));
++
++#else
++ // motonote binary compiled against botan 1.9.11 and newer
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,9,11), origin::system,
++ F("this monotone binary requires Botan 1.9.11 or newer"));
+ #endif
+
++
+ app_state app;
+ try
+ {
+============================================================
+--- src/packet.cc f61360ed2524fdf53411bd24d022a2a3c9e6e9c7
++++ src/packet.cc 571ff6eae1d269a146da74f2730b70376957d3bb
+@@ -156,8 +156,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+@@ -175,7 +175,9 @@ namespace
+ Botan::DataSource_Memory ds(decoded);
+ try
+ {
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI());
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ Botan::PKCS8::load_key(ds, lazy_rng::get(), string());
+ #else
+ Botan::PKCS8::load_key(ds, string());
+@@ -189,7 +191,11 @@ namespace
+ }
+ // since we do not want to prompt for a password to decode it finally,
+ // we ignore all other exceptions
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required) {}
++#else
+ catch (Botan::Invalid_Argument) {}
++#endif
+ }
+ void validate_certname(string const & cn) const
+ {
+@@ -460,8 +466,16 @@ read_packets(istream & in, packet_consum
+ return count;
+ }
+
++// Dummy User_Interface implementation for Botan
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++std::string
++Dummy_UI::get_passphrase(const std::string &, const std::string &,
++ Botan::User_Interface::UI_Result&) const
++{
++ throw Passphrase_Required("Passphrase required");
++}
++#endif
+
+-
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/packet.hh 0a224e6e92f244e2c3e9a5cdb935eb8613d7e85b
++++ src/packet.hh 9c43d30145f0292d6ceda5e717e366fdead5a4d6
+@@ -10,6 +10,10 @@
+ #ifndef __PACKET_HH__
+ #define __PACKET_HH__
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++#include <botan/ui.h>
++#endif
++
+ #include "vocab.hh"
+
+ struct cert;
+@@ -84,8 +88,23 @@ size_t read_packets(std::istream & in, p
+
+ size_t read_packets(std::istream & in, packet_consumer & cons);
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++// A helper class implementing Botan::User_Interface - which doesn't really
++// interface with the user, but provides the necessary plumbing for Botan.
++//
++// See Botan commit 2d09d7d0cd4bd0e7155d001dd65a4f29103b158c
++typedef std::runtime_error Passphrase_Required;
++
++class Dummy_UI : public Botan::User_Interface
++{
++public:
++ virtual std::string get_passphrase(const std::string &, const std::string &,
++ Botan::User_Interface::UI_Result &) const;
++};
+ #endif
+
++#endif
++
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/sha1.cc 5e1aa972d7c7d66e06320b039989652b830dcd75
++++ src/sha1.cc 42e48b22fd88b25e0d38d4f91e1f13f8a83c7120
+@@ -50,9 +50,12 @@ CMD_HIDDEN(benchmark_sha1, "benchmark_sh
+ Botan::Default_Benchmark_Timer timer;
+ std::map<std::string, double> results =
+ Botan::algorithm_benchmark("SHA-1", milliseconds, timer, rng, af);
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
++ std::map<std::string, double> results =
++ Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
+ #else
+ std::map<std::string, double> results =
+- Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
++ Botan::algorithm_benchmark("SHA-1", af, rng, milliseconds, 16);
+ #endif
+
+ for(std::map<std::string, double>::const_iterator i = results.begin();
+============================================================
+--- src/ssh_agent.cc 6d188e7012a0b82f782563b09bbd7adf3f70cf75
++++ src/ssh_agent.cc 4a0dcab873559e934e41c5f220b5434d35600d9b
+@@ -385,9 +385,9 @@ ssh_agent::has_key(const keypair & key)
+ ssh_agent::has_key(const keypair & key)
+ {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>((key.pub)().data()),
+- (key.pub)().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>((key.pub)().data()),
++ (key.pub)().size());
+ L(FL("has_key: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+============================================================
+--- src/transforms.cc cdfb6854ef4992faba21074145f3c8269b845b11
++++ src/transforms.cc b99278ffe95c0081bf4986bc74d3699c37a52948
+@@ -53,15 +53,16 @@ using Botan::Hash_Filter;
+ // paradigm "must" be used. this program is intended for source code
+ // control and I make no bones about it.
+
+-NORETURN(static inline void error_in_transform(Botan::Exception & e));
++NORETURN(static inline void error_in_transform(std::exception & e));
+
+ static inline void
+-error_in_transform(Botan::Exception & e, origin::type caused_by)
++error_in_transform(std::exception & e, origin::type caused_by)
+ {
+ // these classes can all indicate data corruption
+ if (typeid(e) == typeid(Botan::Encoding_Error)
+ || typeid(e) == typeid(Botan::Decoding_Error)
+ || typeid(e) == typeid(Botan::Stream_IO_Error)
++ || typeid(e) == typeid(Botan::Invalid_Argument)
+ || typeid(e) == typeid(Botan::Integrity_Failure))
+ {
+ // clean up the what() string a little: throw away the
+@@ -107,7 +108,7 @@ error_in_transform(Botan::Exception & e,
+ pipe->process_msg(in); \
+ out = pipe->read_all_as_string(Pipe::LAST_MESSAGE); \
+ } \
+- catch (Botan::Exception & e) \
++ catch (std::exception & e) \
+ { \
+ pipe.reset(new Pipe(new T(carg))); \
+ error_in_transform(e, made_from); \
+@@ -173,7 +174,7 @@ template<> string xform<Botan::Hex_Decod
+ {
+ throw Botan::Decoding_Error(string("invalid hex character '") + (char)c + "'");
+ }
+- catch(Botan::Exception & e)
++ catch(std::exception & e)
+ {
+ error_in_transform(e, made_from);
+ }
+@@ -219,7 +220,7 @@ void pack(T const & in, base64< gzip<T>
+ tmp = pipe->read_all_as_string(Pipe::LAST_MESSAGE);
+ out = base64< gzip<T> >(tmp, in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Gzip_Compression,
+ new Base64_Encoder));
+@@ -237,7 +238,7 @@ void unpack(base64< gzip<T> > const & in
+ pipe->process_msg(in());
+ out = T(pipe->read_all_as_string(Pipe::LAST_MESSAGE), in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Base64_Decoder,
+ new Gzip_Decompression));
+@@ -264,7 +265,7 @@ calculate_ident(data const & dat,
+ p->process_msg(dat());
+ ident = id(p->read_all_as_string(Pipe::LAST_MESSAGE), dat.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ p.reset(new Pipe(new Hash_Filter("SHA-160")));
+ error_in_transform(e, dat.made_from);
diff --git a/dev-vcs/monotone/files/monotone-1.0-pcre3.patch b/dev-vcs/monotone/files/monotone-1.0-pcre3.patch
new file mode 100644
index 000000000000..932538e38a4b
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-pcre3.patch
@@ -0,0 +1,26 @@
+Author: Francis Russell
+Bug-Debian: http://bugs.debian.org/665448
+Description: The test 'syntax_errors_in_.mtn-ignore' from the monotone
+ test suite contains a .mtn-ignore file which contains a number of
+ regular expressions. Some of these are intended to match and fail to
+ match the names of files created by the test harness. The rest have
+ invalid syntax and should be ignored.
+ .
+ One regex, '(?<=\C)' is presumably intended to be invalid, but with
+ the most recent version of pcre3 matches most files and therefore
+ causes the test to fail. In fact, it appears to be a valid regex that
+ performs a positive look behind to match a single data unit (usually a
+ byte, even in UTF mode). This patch removes the problematic regex until
+ the issue can be addressed upstream.
+Index: monotone-1.0/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore
+===================================================================
+--- monotone-1.0.orig/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore 2011-03-26 06:41:05.000000000 +0000
++++ monotone-1.0/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore 2012-03-25 20:02:37.695875219 +0100
+@@ -21,7 +21,6 @@
+ [[:fnord:]]
+ \\x{123456}
+ (?(0))
+-(?<=\C)
+ \l
+ (?C256)
+ (?C1
diff --git a/dev-vcs/monotone/metadata.xml b/dev-vcs/monotone/metadata.xml
index ffe46506ae02..968c07b67dee 100644
--- a/dev-vcs/monotone/metadata.xml
+++ b/dev-vcs/monotone/metadata.xml
@@ -7,6 +7,10 @@
<name>Jonny</name>
<description>Future Maintainer</description>
</maintainer>
+ <maintainer>
+ <email>pva@gentoo.org</email>
+ <name>Peter Volkov</name>
+ </maintainer>
<longdescription>
A free distributed version control system. It provides a simple,
single-file transactional version store, with fully disconnected
diff --git a/dev-vcs/monotone/monotone-1.0-r4.ebuild b/dev-vcs/monotone/monotone-1.0-r4.ebuild
new file mode 100644
index 000000000000..56ec219f24ae
--- /dev/null
+++ b/dev-vcs/monotone/monotone-1.0-r4.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-vcs/monotone/monotone-1.0-r4.ebuild,v 1.1 2013/08/28 13:35:54 pva Exp $
+
+# QA failiures reported in https://code.monotone.ca/p/monotone/issues/181/
+EAPI="4"
+inherit bash-completion-r1 elisp-common eutils toolchain-funcs user
+
+DESCRIPTION="Monotone Distributed Version Control System"
+HOMEPAGE="http://monotone.ca"
+SRC_URI="http://monotone.ca/downloads/${PV}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="1"
+KEYWORDS="~amd64 ~ia64 ~x86"
+IUSE="doc ipv6 nls test"
+
+RDEPEND="sys-libs/zlib
+ >=dev-libs/libpcre-7.6
+ >=dev-libs/botan-1.8.0
+ >=dev-db/sqlite-3.3.8
+ >=dev-lang/lua-5.1
+ net-dns/libidn"
+DEPEND="${RDEPEND}
+ >=dev-libs/boost-1.33.1
+ nls? ( >=sys-devel/gettext-0.11.5 )
+ doc? ( sys-apps/texinfo )
+ test? ( dev-tcltk/expect
+ app-shells/bash-completion )"
+
+pkg_setup() {
+ enewgroup monotone
+ enewuser monotone -1 -1 /var/lib/monotone monotone
+}
+
+src_prepare() {
+ if [[ $(gcc-major-version) -lt "3" ||
+ ( $(gcc-major-version) -eq "3" && $(gcc-minor-version) -le 3 ) ]]; then
+ die 'requires >=gcc-3.4'
+ fi
+ epatch "${FILESDIR}/monotone-1.0-bash-completion-tests.patch"
+ epatch "${FILESDIR}/monotone-1.0-botan-1.10-v2.patch"
+ epatch "${FILESDIR}/monotone-1.0-glibc-2.14-file-handle.patch"
+ epatch "${FILESDIR}/monotone-1.0-boost-1.53.patch"
+ epatch "${FILESDIR}/monotone-1.0-pcre3.patch"
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable ipv6)
+}
+
+src_compile() {
+ emake
+ use doc && emake html
+}
+
+src_test() {
+ # Disables netsync_bind_opt test
+ # https://code.monotone.ca/p/monotone/issues/179/
+ export DISABLE_NETWORK_TESTS=true
+ if [[ ${UID} != 0 ]]; then
+ emake check
+ else
+ ewarn "Tests will fail if ran as root, skipping."
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ mv "${ED}"/usr/share/doc/${PN} "${ED}"/usr/share/doc/${PF} || die
+
+ rm "${ED}"/etc/bash_completion.d/monotone.bash_completion || die
+ newbashcomp extra/shell/monotone.bash_completion ${PN}
+
+ if use doc; then
+ dohtml -r doc/html/*
+ dohtml -r doc/figures
+ fi
+
+ dodoc AUTHORS NEWS README* UPGRADE
+ docinto contrib
+ docompress -x /usr/share/doc/${PF}/contrib
+ dodoc -r contrib
+ newconfd "${FILESDIR}"/monotone.confd monotone
+ newinitd "${FILESDIR}"/${PN}-0.36.initd monotone
+
+ insinto /etc/monotone
+ newins "${FILESDIR}"/hooks.lua hooks.lua
+ newins "${FILESDIR}"/read-permissions read-permissions
+ newins "${FILESDIR}"/write-permissions write-permissions
+
+ keepdir /var/lib/monotone/keys/ /var/{log,run}/monotone
+ fowners monotone:monotone /var/lib/monotone{,/keys} /var/{log,run}/monotone
+}
+
+pkg_postinst() {
+ elog
+ elog "For details and instructions to upgrade from previous versions,"
+ elog "please read /usr/share/doc/${PF}/UPGRADE.bz2"
+ elog
+ elog " 1. edit /etc/conf.d/monotone"
+ elog " 2. import the first keys to enable access with"
+ elog " env HOME=\${homedir} mtn pubkey me@example.net | /etc/init.d/monotone import"
+ elog " Thereafter, those with write permission can add other keys via"
+ elog " netsync with 'monotone push --key-to-push=IDENT' and then IDENT"
+ elog " can be used in the read-permission and write-permission files."
+ elog " 3. adjust permisions in /etc/monotone/read-permissions"
+ elog " and /etc/monotone/write-permissions"
+ elog " 4. start the daemon: /etc/init.d/monotone start"
+ elog " 5. make persistent: rc-update add monotone default"
+ elog
+}