summaryrefslogtreecommitdiffstats
path: root/app-arch
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /app-arch
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'app-arch')
-rw-r--r--app-arch/p7zip/Manifest40
-rw-r--r--app-arch/p7zip/files/4.65-hardlink.patch13
-rw-r--r--app-arch/p7zip/files/4.65-makefile.patch20
-rw-r--r--app-arch/p7zip/files/7z5
-rw-r--r--app-arch/p7zip/files/7za5
-rw-r--r--app-arch/p7zip/files/9.04-kde4.patch87
-rw-r--r--app-arch/p7zip/files/9.04-makefile.patch19
-rw-r--r--app-arch/p7zip/files/p7zip73
-rw-r--r--app-arch/p7zip/files/p7zip-4.16_x86_static.patch10
-rw-r--r--app-arch/p7zip/files/p7zip-9.13-QA.patch17
-rw-r--r--app-arch/p7zip/files/p7zip-9.20.1-QA.patch17
-rw-r--r--app-arch/p7zip/files/p7zip-9.20.1-execstack.patch24
-rw-r--r--app-arch/p7zip/files/p7zip-ds-442.patch11
-rw-r--r--app-arch/p7zip/files/p7zip-ds-rcc.patch314
-rw-r--r--app-arch/p7zip/files/p7zip_4.27-libun7zip.patch597
-rw-r--r--app-arch/p7zip/files/p7zip_4.44-libun7zip.patch599
-rw-r--r--app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch336
-rw-r--r--app-arch/p7zip/files/p7zip_4.57-libun7zip.patch684
-rw-r--r--app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch305
-rw-r--r--app-arch/p7zip/files/p7zip_4.65-libun7zip.patch550
-rw-r--r--app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch294
-rw-r--r--app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch12
-rw-r--r--app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch307
-rw-r--r--app-arch/p7zip/p7zip-4.27-r1.ebuild66
-rw-r--r--app-arch/p7zip/p7zip-4.30-r1.ebuild65
-rw-r--r--app-arch/p7zip/p7zip-4.42-r1.ebuild81
-rw-r--r--app-arch/p7zip/p7zip-4.44-r1.ebuild86
-rw-r--r--app-arch/p7zip/p7zip-4.44-r2.ebuild87
-rw-r--r--app-arch/p7zip/p7zip-4.57-r1.ebuild101
-rw-r--r--app-arch/p7zip/p7zip-4.65-r2.ebuild150
-rw-r--r--app-arch/p7zip/p7zip-9.13-r2.ebuild151
-rw-r--r--app-arch/p7zip/p7zip-9.13-r3.ebuild152
-rw-r--r--app-arch/p7zip/p7zip-9.20.1-r5.ebuild172
-rw-r--r--app-arch/ruszip/Manifest6
-rw-r--r--app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch12
-rw-r--r--app-arch/ruszip/files/zip-2.31-exec-stack.patch20
-rw-r--r--app-arch/ruszip/files/zip-2.32-build.patch89
-rw-r--r--app-arch/ruszip/files/zip232-ds-recoderus.patch165
-rw-r--r--app-arch/ruszip/ruszip-2.32-r1.ebuild46
-rw-r--r--app-arch/unrar/Manifest11
-rw-r--r--app-arch/unrar/files/ftello_unrar_fix.patch16
-rw-r--r--app-arch/unrar/files/unrar-3.4.3_fix.patch71
-rw-r--r--app-arch/unrar/files/unrar-3.5.3_fix.patch60
-rw-r--r--app-arch/unrar/unrar-3.4.3-r1.ebuild51
-rw-r--r--app-arch/unrar/unrar-3.5.4-r2.ebuild39
-rw-r--r--app-arch/unrar/unrar-3.6.5-r1.ebuild48
-rw-r--r--app-arch/unrar/unrar-3.7.3-r1.ebuild47
-rw-r--r--app-arch/unzip/Manifest18
-rw-r--r--app-arch/unzip/files/librcc-0.2.7.h1544
-rw-r--r--app-arch/unzip/files/unzip-5.50-dotdot.patch84
-rw-r--r--app-arch/unzip/files/unzip-5.52-CVE-2008-0888.patch35
-rw-r--r--app-arch/unzip/files/unzip-5.52-ds-rusxmms.patch150
-rw-r--r--app-arch/unzip/files/unzip-5.52-ds-rusxmms2.patch149
-rw-r--r--app-arch/unzip/files/unzip-5.52-no-exec-stack.patch13
-rw-r--r--app-arch/unzip/files/unzip-6.0-no-exec-stack.patch13
-rw-r--r--app-arch/unzip/files/unzip-ds-lazyrcc.patch146
-rw-r--r--app-arch/unzip/files/unzip-ds-rcc.patch105
-rw-r--r--app-arch/unzip/files/unzip-ds-unixenc.patch9
-rw-r--r--app-arch/unzip/files/unzip60-ds-isprint.patch12
-rw-r--r--app-arch/unzip/unzip-5.52-r3.ebuild51
-rw-r--r--app-arch/unzip/unzip-5.52-r4.ebuild67
-rw-r--r--app-arch/unzip/unzip-5.52-r5.ebuild74
-rw-r--r--app-arch/unzip/unzip-5.52-r6.ebuild74
-rw-r--r--app-arch/unzip/unzip-6.0-r3.ebuild94
64 files changed, 8769 insertions, 0 deletions
diff --git a/app-arch/p7zip/Manifest b/app-arch/p7zip/Manifest
new file mode 100644
index 0000000..7acfea2
--- /dev/null
+++ b/app-arch/p7zip/Manifest
@@ -0,0 +1,40 @@
+AUX 4.65-hardlink.patch 413 SHA256 187fc9f9ec0160c7b5f6a1bf7394e7d92db1fbebf219a1ea55725d40255256c8 SHA512 4474aa46f46d5c42924c31925b52296a20879c4bd5bf8918b6531a20d5d31939ef0956161fcb9d8af2dcc97650bdb348ab920e346b41601be64e93163fe4b7fd WHIRLPOOL 91822c3bb0113613a3246f3aed52464c2dcafe0d9a5e98747e524d4cdfb590036ed9606cfc10590e6e85d6682c3738f5267bcab29f59228c4d7fa8e25b16ce24
+AUX 4.65-makefile.patch 450 SHA256 d36e71be74fdcc3c2afaf2217cb4712f00e3e75f3d23efd6c288f058092c4120 SHA512 dd21f0a4850a6d5643f950c34cac3b34aa4453f47bf3c9f5de9725f5fba2588f5c38d69a980e434b0bb8372ade7c9c0917a6a9f748776838ba6f51823b76de5b WHIRLPOOL 30717ab379a48ae124c20b99d041e71f150d6e46ca9a54cf06bc1e413e94770fafb417047758fe8b24ce4f09b9f0c5ba4edbc895fc3a67ab922842b31d151807
+AUX 7z 142 SHA256 4b5a22ff23f0dc7e3b5dc0c44733fe73b2d3cd1683092a3d691179687cf95e1d SHA512 720d979865f1e66b4102f5cebd3f081162c226f4ba5b40fe66f2b2147d86c90e60786b761b2f9c3de66ba53683c9daa8cd0b544c107208a2698919b5df0c35bc WHIRLPOOL cab2bd7fd00b2fc2bc48c8cc0706bdf1390b25947a002fc395533049fec032cf811798a277341d692b5c48e410adf50b98da93a29dc5b8ab13fb720a4711551e
+AUX 7za 144 SHA256 15a7f37e025d1188ee52a262027a268cdfcbd1347171da9aa560a3a1a824366b SHA512 4378841ae3e34b70a2ddc9e426d3f2bc0c41cc3c4a4afd9ad498d6cb8e1733532c6a3ba19b473624a23b0064fc7f3c5b31d4bd46d2c89b5e862da1b59c56b949 WHIRLPOOL b1d97a21cf6483efe1b2c03636336e646d696a894c893fa0f61e2683e03f7a86315f119ecf2b838f682196e1d0691e8732fde5e7da16b9bed3ef3324d2d15399
+AUX 9.04-kde4.patch 5185 SHA256 facc613f8c684ca2c0baff4c89e99f0abe29b12b96ef2281e17a0041e07631c3 SHA512 040a40f634888f89424efac075cf8f5651c91d055de4a2d6dd1f7fbbf8e6e1befcf4f4ffeddd11a641c73cfc2bcfcfb7a8ca3076b222d16aeb306114da4ab6c7 WHIRLPOOL 5b25f5474a5571e2b2ca731d98bd7a14c5e98c417bf2a6359801a387ea7de130aac0da12502a070d7914964b9501131d72d9ed261e765f3952db83b363972737
+AUX 9.04-makefile.patch 470 SHA256 c8ef2898ed994929600c04ed0ecfd2dc2b94982d274ee217cbc05234c37750f6 SHA512 2c131e0b42ae6c8cd236125be313ea032b47edf858d1248a8648fd0e794ca4094016a3bb06e15fe65582626dd9d611a08a87ad5789695fff0a2244bb7f3cec3d WHIRLPOOL b2a66b46651a8036808985524b2c6311fa0d7dbceba453f1ac4bb1cc0fef9fbe060b1d4c04e20353c4232915f340cf3bd65d0f7e0ccc3eac8651d3ac15d389db
+AUX p7zip 1210 SHA256 28d181cd1c43628da0adb485e20f270461b6cf8d743d2187a3380f7799fbc2d5 SHA512 e3f1497cc00669430de336aac1d45a0313831b7f5dc88b9b2ca49e743d8e9e7c73b403d94b4fd9de6cd59875fef47756f9dab9ddf12442ee3fff71e413715553 WHIRLPOOL e14aef0141b8260a5206bd94d22560c927a3ce0e643433ee68d8ade0601655b8a6b7c8ad78f81a0fb97323c7c37eb3fc5483d9e49c2ac259d146b60e678cc973
+AUX p7zip-4.16_x86_static.patch 276 SHA256 09fa439da270e1f96d580425a4addaeb4684b3f727d01d08e9b293124646797d SHA512 acbd79ce2b698445384aeca88956605f44944fa91e0677f03403013b45e956537edcbb28ee84d5adc786ae43ce70291ea436e0bf620a0895e985675b879a803f WHIRLPOOL ce883d92a40b0595691913bd0490fa5602caef8ba0d20c5cc724fef28eb75d5163a3c3e77dfe79c98292002045fc8ec6beebe610a6bffc74eeb4f1b18cda30bc
+AUX p7zip-9.13-QA.patch 650 SHA256 d44e500a5d15b8c25826fd8a60c61e9c524724c40f22683967212f9843d6db17 SHA512 c8b260d30a39ce66990aaa429d60c3b4a472f03f03c407badbe235106245f4ab0f9422ec1ddd98e5fbe97e9296d69908687625f141e3aa91ff5f32588b332543 WHIRLPOOL 6d01c5f28efe6e528a1a5f7e0fdef7701b4ba92e9a21646832094dbbc3ae7e0e3671ee925c2f8009afca85cb9bdca83fce225063a3c47af7d05625019c47fada
+AUX p7zip-9.20.1-QA.patch 650 SHA256 695b6836b13699e3db3e019dbd54275e48a01b59210fd353a2d9e46224c60785 SHA512 b07f8608b973be7c547b226bc23dd064d6cc18f6b1ea70ce72aff72fa098852914eb8d331fe7230b7fdfbb1f0fce59eb3404fd3a5b44d151ea847e87fd2d8f39 WHIRLPOOL 077a4bdf44dcbd66a525e795e082aef41321dc7770415a1cd78716d78aa5b5b2e780afcb4194ea7c2ae2947a596292be18ab8dd3f9bce302e47f8d9cdcc6a046
+AUX p7zip-9.20.1-execstack.patch 785 SHA256 0725ca42b5ac8d4024a18e2759a12c3ba04b8ea504376c14d8890f7bebba3fb1 SHA512 2b3404554295596dd1113700f72f7149baded7b381e70edea78a2cf66ad69ac6fb03653c490843ecab13e348638a0efaaeb3f5e71a0670255d09a91c70c7977f WHIRLPOOL 4aa1a9632d706c4f9f8b906a9a84929605a56e92c4289a296b767d107e11f85848d40bd58ad4df21c2d87f385318b8e740b71bc7c0467ea3af2bd6c58502d25a
+AUX p7zip-ds-442.patch 446 SHA256 f7379a06363e34af0307cc5365958f8e56f7788bd90743d85cfa10706996d590 SHA512 241088daf142b301b5fd1e98bfdba9e93a2ad79b945904973c6842adbcd52b4e054fb4d041b4a0ea7663474d221fc95e8198d518affdd620f66056067050c0c7 WHIRLPOOL 816baddd4234df4d5d2212746f5272d64b04eea7411d3593d34aa6a625360e621055bcd687d783decdf00d26041c387af58bb8f115b8fa2c2f3e76664cd52ab8
+AUX p7zip-ds-rcc.patch 9611 SHA256 385719352baebc32c41348b3bb10ea5d27e645d142203db74d286146112c2364 SHA512 acc047844e3dc26cdeca953043d63c8cbc5e215950247862463f0e4001b61cedcc827923e1d3ba0970edae1770ba22918d471caec2bd71bc563442cace6a9e02 WHIRLPOOL 6185cd76efc1eb2cbbf3dbaff0e9c521ed821b83d83ba34d0a46efc5a5534071b397834501b6370ba467f0666ef1fafb1f5e4f1a2382e4208782d45ad079dd77
+AUX p7zip_4.27-libun7zip.patch 19287 SHA256 e37f1846b5cf81212917b3d453c520b7ec5878a9aff385a7d4099fc4491bbd7a SHA512 ae62666143861d703d158f853da179e4a95a1008316f449d11c111d8670b3f9505e760f0c1ffc2bb7286ae5e3f114f708092409706a595ee63f87189a3337996 WHIRLPOOL 82dba6cbd28a346600b18c8601874abe58b8a988a84fcf644765202fbbdb0578ee7c52f0b17d6497445e1e8b2825c3276c4157a4e63b11278d8aa2d022ee85d9
+AUX p7zip_4.44-libun7zip.patch 19480 SHA256 d990724e3a570191ba32cccaf736a40d6c9d13219ffdb18bb738241036423ccd SHA512 b9cbab7b6584584ffa6aa30228460d0c7e8b127159d00939b6da2f139f8122a4923e67e6ee0f71c66f87cfca90d41964202a0e73877ad86948960e2ae72d45c6 WHIRLPOOL 88222cf99f33e4d1286609fa7921b11eaacc66d919255bf460574e30178d3039c37ed97d52ff99a9badbd908c9e2bf22eecfafbcdff73a506d628814b5ce821d
+AUX p7zip_4.57-ds-rusxmms.patch 10537 SHA256 543cc5c8e6b92f2c702d082b68877442eb90e5a17e840722a4c072a60ea9385e SHA512 3e6900712dc2b8cf79a541dad5560950230c2b6aaf32609579939c0afd6d06007427d967e2beade42a7f5c3d15323428b4f19056a23d4c4ea171c73a611f7de3 WHIRLPOOL 23ec6a8b10efeb3e307972e779705fe45fe9725ca70f262675de123ef1a2f14db13749f4f4bf76eee70c97fd8730f61a43ed5eb259f9951e99083873b3759152
+AUX p7zip_4.57-libun7zip.patch 23438 SHA256 fafaefbc227adb074fc8e77f78a7d7b52689d5a1b8478a935677321183e464a1 SHA512 f15fcf68b7a0f1628e0d73823764aad4f528446dfc301ce22f009eb3f5070445a5b7dd8ab06effd85c065cb4b79abfe6bc15d122180413489f84046ad1c344e4 WHIRLPOOL 05ccbbfccf8a66021d91c8c9f0c501d50c257461a2314688097b2a4f65c85edb3b833c1d27cb7167f502ec9f3392736b21e3be61aa7b00f5778f8d9f1d168f5e
+AUX p7zip_4.65-ds-rusxmms.patch 9323 SHA256 4494a08118650102179de1f280850c83582bd483522c37dffe8699e47cba480a SHA512 540807e009f2574bec30ba440233be62ef7d3eda87b12c498a11ac3a59d25f12abec0ae79b059cd9f5cffd910bdd792710f783deb0053c8f6fe8710a7b49f317 WHIRLPOOL 84e03d9f77b76ea3638006c8c31f0260bd5da3d98151e85c8e3420f862ec2985aed8b7bc502811c9c313124ce7738a1ff401f2bef63773e93ee5086fbcdf2b82
+AUX p7zip_4.65-libun7zip.patch 14251 SHA256 f53a5c849f65f9326b71ad7f44e031fbc5a618697cae8167a53dc0673be13188 SHA512 ad98ed3df11d8b7acceffbb7d2893d466375f71b87cd5148147b915dfc2cdca7a74d1086cf91033a9b30affa8540e5a4f235aa479d5e55a9ffd28bb9649f2c1c WHIRLPOOL 433a646b311a0cfadb415f8a40b5106b495bffdc5b1e3bd6a522fe01301b0a5190bda6f03faf6c5cd113cb7e6a09e6d059842ac4f04a4379c7414bbfc9887920
+AUX p7zip_9.04-ds-rusxmms.patch 9466 SHA256 61d4c284dd25d5f6b13d2393fe667703e221c362a18b021f493d8467b100ad16 SHA512 0bb202b578f96831f4e986794c98858cbba54d681bbd250d5926fadcbc31724634b702efeae037b73b6a955e6b6a71de6c1bdb2baff7b9345a062b3d8c1a6cae WHIRLPOOL 7c0b75999b972769bfbbc18f8598d25df7fa8e638135a14d20c5957df90bac10a6ffbaa696f0e76f4c9a4766d4067ba337c168d41190632f7b4fb7a6b6cfe326
+AUX p7zip_9.13-ds-dynbuf.patch 473 SHA256 e1ddb4a89e7d2376b11177064d554011c6c348080e47c6cd573e994dbba45d94 SHA512 9a7d4cc6141bd4f6f40515605df9072be562237304075e6d2b8e4527152156126d9837191f2a839a7e05ec00a1f86b30d26a6df038a067528e0a3b108264561f WHIRLPOOL 1e24600f25b45a1fb56505284a95ac136cd4dad29c4cb982fb4f1b67c14883201cbb6eaa0b62994dcd318e91953313ca8bc11ee6007218af3133066453ba7fab
+AUX p7zip_9.13-ds-rusxmms.patch 10443 SHA256 5c3840ec53e6390e2fc007e9ce8a8186c646b382253044013d307e1df38ab2c5 SHA512 9c7e316afed084ce6fb12bef91fbafc49372a3c4b13b33f5980ffa4800b848079cc0add6899d484a5ae69ef35d9b331aa748727cd9c36185213fb36979fa2985 WHIRLPOOL b80261d887fb017c0407ea77a64f545c5d33f7220abe1d57dd1734a0a29e206da92f1d7da5afd4233e5417c75ebf825f0d70643c2364a0cca8fbac2ddaec2659
+DIST p7zip_4.27_src.tar.bz2 416045 SHA256 1064abbf2e2a9bab515978b554324fe83b9e00eee5dd7d1f031a0b2af9dfae24 SHA512 9bd73f9ae96e98777c980e1bb5056299abeebc6d87d530e03a3f891269b128aee578888ee5a8a912c7e96f10a228847be4a29e8db257227a68bcbe5fea20c156 WHIRLPOOL a082a00bd177fea6149317e2b319fb5e029f17987c0208ea507da2b84465d4b8938e436bbe1c399e996e3a4c6714c61c6aa07bcdc6b900f421e66d72889c1d2f
+DIST p7zip_4.30_src_all.tar.bz2 427869 SHA256 2d5ba5c96b82cbcc9987ef81a843f77b886ee5c5d2ff9149f4d11f4f380fc8a9 SHA512 61a6adeca3a4002a2c634dc7df0264641d7074674cf423cfb464e40835958eb8dad21af593d955fca95e68631095fc37b99cdb25770a6e9002d8b4a64a4ec823 WHIRLPOOL 8124ea55c8ef3b120d9f3dca6c06cf0b62c8c7f297d1f9ad53bba00c711ad7d60b669066fa78242592b43c8c5b0f76016ce293f4cde0180193c7b65981eb10c1
+DIST p7zip_4.42_src_all.tar.bz2 1461812 SHA256 029ab89f0a553987abdbe0c14605efdf9c11f0f4074b854a6fc4181345d6ac44 SHA512 ff015f8c9e1a2e28777a253bb3a88aa45ad54bfafbd019ec62d81340b2a4eea4c9ed4532abe80ae722e1a1a03d72f4a5b6f4cb9e8ff8b2243e3eafd0176eb97b WHIRLPOOL e315a080ee30cb325ec3534a282d996bb2d5ce0d75e4b592328ccc2595b08345aacc20b7006af0c4b2fa28d046e9708339cbb4a43e1da85addd3518343aa5bf8
+DIST p7zip_4.44_src_all.tar.bz2 1518820 SHA256 cb87304f682e7176ab95ce73d3ce2b7b65384e051272fc34ef934e2427bbd3af SHA512 d470236ba325c72d3cb4c5866afa052d3f9816b5042115b7ac5a217d20d4aec05bff1f4f278d2283acb41515e14cb0cae5c268ce9145b5bc74118eac812eec6c WHIRLPOOL e0b7f171e7f0416d99b9838326c7bf16a76f1a09e0ed3e385dd55d1a38fc698598459b7fa27ab9b8431543a88fdaf058a29ca8c181edf0ae6ba8ad7880eac3c8
+DIST p7zip_4.57_src_all.tar.bz2 1473608 SHA256 00e923386dd53d532a86331d1694eaeee626783afa503f91edf7370357e05b53 SHA512 436279e64dc37b3db80bf4acede765d461f13853dde71df4d93d13fbacb1ad25ea67605f379cbf1be23d204002ff2ffa4734d36904e32dc0b3f7329037da1ded WHIRLPOOL cdd48f611dd9bd7ddc367593a64144a6c4054f050aff7bd55e72146b21286419898e99e9af71dda22cbc259d52d4275625ceb1a6a50cf2dacda0d08c6886fd49
+DIST p7zip_4.65_src_all.tar.bz2 2501418 SHA256 691cc9419a73a9348319f5b2c3ba2655471bee052c6c7fa57a226800c89ab07f SHA512 ae4a48a959b03b519ff00df510194d4d5780c198c8f4fb907fd2e209728fb77db7baa85d3a5438ca5d94af37a8e736f7486f8cac1ba606cd56b917aed11dac85 WHIRLPOOL 8dc6d6c4e840374ef8f85e7cd03a2dd71a5a18425cd92a1c5a3988240b4d2ee9175717fda312d005a97771ea126e16f13e5805f7eacc3aea4f357aa146b45ea6
+DIST p7zip_9.13_src_all.tar.bz2 3753579 SHA256 fc9c0fa2eabd367d6adbc3ea07bb305dbdc1f68717eea362c8c074b91c03d923 SHA512 84b6687fc33af55c7f282fc6c988789cbdd0b3d2df0adb1c14b6ad12ebc2ed4600ddf6b043d2d8f2baa717ee8afc3601f7e9e37c5d44d6357727bf3a36686e11 WHIRLPOOL 886ba23a09e8aab3b92cd870dda5aa876638c3b7149155b3c8eb1031b94e262f2254ebd575ca42c42e57789ccfff6ab4289937c952373947bd61ec8f92e7370a
+DIST p7zip_9.20.1_src_all.tar.bz2 3835235 SHA256 49557e7ffca08100f9fc687f4dfc5aea703ca207640c76d9dee7b66f03cb4782 SHA512 7bb8a276aaefc4a83364e45633c48527de44c6b1205344f3356db570582f30f81d82a94938c99a7ad193587b584cc1c03219c28249de40018bdaee6c3b2a022a WHIRLPOOL cb20f37d3f796931a9b330728aa7148afe98bbf8a49bb91bfd80e4667c16416206b23bf34298e9ec37825e8b43f92a5710f0cea1f974296d5c17aa2c7b0931f3
+EBUILD p7zip-4.27-r1.ebuild 1722 SHA256 a8b59dc0c2f095be3cd53f6a716cbc97cf6ac2c1e74f448fbf9ec9745070a58f SHA512 49408abe34f28590b7b1d0cc5980823e042387452035ab95f633aa1f4c1a872b4a30499bc9d05e0eb334036f6fbd66f5fde25f26acd4ff4a36946d0737b916f3 WHIRLPOOL b97f19c8724ac2588c6f0ee465cdc60d3a5849621c002bea45d63bd01a4f8fbf135c8502eed0440eaaae7f714d417ad8f3b4ca51f7bc2fbf3c1615535845367c
+EBUILD p7zip-4.30-r1.ebuild 1728 SHA256 3f65b1eaa89e08496c918ca459505b2a129705dbd7fb90f8bf9cc38caee3924f SHA512 12284d1a8d6099d0c05f88e2cc8046f479d27db6f42b6cdbc473a83324d49c69c91ec68aa66d8ed264979ac4d7bd752b4287da80ee320a996d99edd59381d7d1 WHIRLPOOL 8b39a69b44a0bb574b953a128f11f4bde70e0e5998398fbc0a6f4e425c494eaccf1cce70a1a15d4dd3d0d5b55cf791debd8960cbd77cbe605dfe4b3c779cca5c
+EBUILD p7zip-4.42-r1.ebuild 2386 SHA256 872dd581447ab8a523856e2d7118ac95946dd34301cb040fb5afcba49ce1ba9a SHA512 6b51790b5465c2fabdadbb89ea0b1039fbcd92c3e334beb45a9ecdcc59d32376b6d5ee079a14404ed46f09a19bf24bf8e005edc59be21f456e7e02feb934cc8c WHIRLPOOL e2e76f6af32a63261a5670041053697bc78ebfa71a78cba673b088c98e4d575d13b21424435fbcb4f34b421507d06cf82754ae1f6a3c15e846b830244b6f3e1b
+EBUILD p7zip-4.44-r1.ebuild 2652 SHA256 96a7b905816eeefb7b76be5004e2eb6f02bdccaab7dc005071c249bac620e1b4 SHA512 30f5dd83b8365386963a42fb714e0882d950ae53a89a508003cfa68a5c5c4206bd25844423eb8cdc545e3b186b9860787edb5aa8d44c2167df1a56b82a65a93e WHIRLPOOL 775b5616390ea5bf159af8c1a548b7d338b6b73661c7ecdc483baac175be546ea12f2047664e06570d4247c40fdf1f9cc62a21c86066ce7ea75efc34175a5e71
+EBUILD p7zip-4.44-r2.ebuild 2698 SHA256 655f1fcc045272bd08c665b659d42ffb694b59a227305ae0815ae1a791621e4f SHA512 176ca2940532316adc156949b5363ea843bd9254922fb7701f3b94363d91a6b609f5b8a2161d2c37626be45eee99da7b200a7bc2f831d01fd6615cb9a3c06d46 WHIRLPOOL f10c1077dd28dc587937ba221031f5ac7ea402995abc033d0683e7c9fbb38451c5c5a8db9290d9b9dce6318309d5526ab93a7aa723e4aaa1e915ad4765139ac5
+EBUILD p7zip-4.57-r1.ebuild 3210 SHA256 b006929fa5e3cb21c8ed80e3637a49795edafa6aea5805d7903fd51fd50bf87c SHA512 89f6148e5b586057b553bb5c1b3d6501a16d0b110f93aca992f952cf2d5c08879677386896b8bc8b4e8193e19e84ed234a173d717e1a1187fed16bf247a04bbf WHIRLPOOL 22a624274706ca06d6b966c37fb208c5caaf212e26fea856d7d3759e03cad30a8881d6d5465f3884339cf4f2090bc88d6bf77e0e9691d2d1427f72b00a063e7c
+EBUILD p7zip-4.65-r2.ebuild 4084 SHA256 10e5517f3497b88d5dc1a807c68548fe8d81ffe446680276028cc8b0a994e061 SHA512 f2f525f781a281f4d08cd4be330ae80d08015cb69ef4a3bb63efa841af6ccca8650157f3f048d9a9ee123ecfffe6bf17525a9d1388d096dc917b0c9d6a5f36ac WHIRLPOOL d49d26ed0c635a070668ebf6eb5a986bd9245775bc6051a1757ae69d0091d19e72ab4dd1663517789dec8f0e052b23d9159b0ed2d9e881c706b957488daa68e5
+EBUILD p7zip-9.13-r2.ebuild 4193 SHA256 1a2a9ff0afbcd664c0703037847cee6324b4ce44f578f2ff96742349b95075cb SHA512 0c543f43b34b36382d3d0b3a3a2730a6b41e510daab7087a239cfa8e5feea5a28f02999ecfdd921363aa7549f5b032aa521a031d9204f246beb2e0e41e891e79 WHIRLPOOL dc01393a3fab82504b567531d63a6ea2dc6435937cea6482ba571f0c5ba54d8e7db46b4140194a945a0c5f45d75465f1fe95a481030a2fc4183e1dfa5bfa3e31
+EBUILD p7zip-9.13-r3.ebuild 4258 SHA256 e000860cb1a69bd08e25d23363ed99dc7f364d8a0f8e86fdc021d144c8e2ecdb SHA512 1bef2e300671ab342c70d2e7a03e09feaa110e739e4f1810a5baa518b3f3ca7797a4491d3cd0dd2bfdce9263408cbf6ca88952cef3ba157e662ce26df4ecd872 WHIRLPOOL 2216af7584949411f0d4f98a519f77b958e7488568c525b78a05b2db7d782bbbd49302ecaee4116d0819334afae81cf370270b3924d659b3180b22de07f72300
+EBUILD p7zip-9.20.1-r5.ebuild 4710 SHA256 b3ceb233d5b33c62b36fa635a4dc4c196c4bfef98a6cf58c0c050d6e05affbcd SHA512 e24f04d51ed1e540772cf51b91302bb2ad07bf587549b3c196b0036420dac844e4b63be223a39b03b87de3b525afaec62a598940cd3b5034ee8a2308c23ea506 WHIRLPOOL b3e53395b87b7110bd5698916df7e5004081887df03bad7af8b09f35b6979bb29b88ccf28db95564d7c4e2b9ecc4a93bcfa7de5b07dfc2d86d7fe73184398a2e
diff --git a/app-arch/p7zip/files/4.65-hardlink.patch b/app-arch/p7zip/files/4.65-hardlink.patch
new file mode 100644
index 0000000..05d9e71
--- /dev/null
+++ b/app-arch/p7zip/files/4.65-hardlink.patch
@@ -0,0 +1,13 @@
+--- makefile 2009-02-25 16:03:33.000000000 +0100
++++ makefile.new 2009-02-25 16:03:17.000000000 +0100
+@@ -55,8 +55,8 @@
+ $(MAKE) -C CPP/7zip/UI/Console all
+
+ 7zG: common7z
+- cd bin ; rm -f Lang ; ln ../GUI/Lang .
+- cd bin ; rm -f help ; ln ../GUI/help .
++ cd bin ; rm -f Lang ; ln -sf ../GUI/Lang .
++ cd bin ; rm -f help ; ln -sf ../GUI/help .
+ $(MAKE) -C CPP/7zip/UI/GUI all
+
+ clean:
diff --git a/app-arch/p7zip/files/4.65-makefile.patch b/app-arch/p7zip/files/4.65-makefile.patch
new file mode 100644
index 0000000..b0297f8
--- /dev/null
+++ b/app-arch/p7zip/files/4.65-makefile.patch
@@ -0,0 +1,20 @@
+--- CPP/7zip/Bundles/Format7zFree/makefile 2009-02-09 21:47:24.000000000 +0100
++++ CPP/7zip/Bundles/Format7zFree/makefile.new 2009-02-25 14:18:31.000000000 +0100
+@@ -271,8 +271,6 @@
+ MyAes.o \
+ Pbkdf2HmacSha1.o \
+ RandGen.o \
+- Rar20Crypto.o \
+- RarAes.o \
+ Sha1.o \
+ WzAes.o \
+ ZipCrypto.o \
+@@ -313,7 +313,6 @@
+ $(LZH_OBJS) \
+ $(LZM_OBJS) \
+ $(NSIS_OBJS) \
+- $(RAR_OBJS) \
+ $(SPLIT_OBJS) \
+ $(TAR_OBJS) \
+ $(UDF_OBJS) \
+
diff --git a/app-arch/p7zip/files/7z b/app-arch/p7zip/files/7z
new file mode 100644
index 0000000..05c7086
--- /dev/null
+++ b/app-arch/p7zip/files/7z
@@ -0,0 +1,5 @@
+#!/bin/sh
+# 7z wrapper, p7zip, should be called with full path
+# so symlink and copy should not be used instead.
+
+exec /usr/lib/p7zip/7z "$@"
diff --git a/app-arch/p7zip/files/7za b/app-arch/p7zip/files/7za
new file mode 100644
index 0000000..f718bb4
--- /dev/null
+++ b/app-arch/p7zip/files/7za
@@ -0,0 +1,5 @@
+#!/bin/sh
+# 7za wrapper, p7zip, should be called with full path
+# so symlink and copy should not be used instead.
+
+exec /usr/lib/p7zip/7za "$@"
diff --git a/app-arch/p7zip/files/9.04-kde4.patch b/app-arch/p7zip/files/9.04-kde4.patch
new file mode 100644
index 0000000..c309d70
--- /dev/null
+++ b/app-arch/p7zip/files/9.04-kde4.patch
@@ -0,0 +1,87 @@
+diff --git a/GUI/kde/p7zip_compress.desktop b/GUI/kde/p7zip_compress.desktop
+index 9010fbd..b965fa6 100644
+--- a/GUI/kde/p7zip_compress.desktop
++++ b/GUI/kde/p7zip_compress.desktop
+@@ -1,6 +1,8 @@
+ [Desktop Entry]
+-ServiceTypes=inode/directory
+-Actions=CompressDialog;Compress7z;CompressZip;extractHere;ExtractSubdir;ExtractTo;test;Benchmark
++Type=Service
++ServiceTypes=KonqPopupMenu/Plugin
++MimeType=all/all;
++Actions=CompressDialog;Compress7z;CompressZip;Benchmark
+ X-KDE-Priority=TopLevel
+ X-KDE-Submenu=7-Zip
+ X-KDE-Icon=p7zip
+diff --git a/GUI/kde/p7zip_extract.desktop b/GUI/kde/p7zip_extract.desktop
+index 9038c76..a7dca4d 100644
+--- a/GUI/kde/p7zip_extract.desktop
++++ b/GUI/kde/p7zip_extract.desktop
+@@ -1,10 +1,30 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+-ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+-Actions=extractHere
++Type=Service
++ServiceTypes=KonqPopupMenu/Plugin
++MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-compressed-tar;application/x-bzip-compressed-tar;application/zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-java-archive;application/x-deb;application/x-ace;application/x-7z-compressed;application/x-arc;application/x-arj;application/x-compress;application/x-zip-compressed;application/x-cpio;application/x-pak;
++#MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-rar-compressed;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak;
++Actions=extractHere;ExtractSubdir;ExtractTo;test;
++X-KDE-Priority=TopLevel
++X-KDE-Submenu=7-Zip
++X-KDE-Icon=p7zip
+
+ [Desktop Action extractHere]
+-Name=Extract Here with 7-zip
++Name=Extract Here
+ Exec=p7zipForFilemanager x %U
+ Icon=p7zip
++
++[Desktop Action ExtractSubdir]
++Name=Extract to subdirectory
++Icon=p7zip
++Exec=p7zipForFilemanager xs %U
++
++[Desktop Action ExtractTo]
++Name=Extract to ...
++Icon=p7zip
++Exec=p7zipForFilemanager xd %U
++
++[Desktop Action test]
++Name=Test Archive
++Exec=p7zipForFilemanager t %U
++Icon=p7zip
+diff --git a/GUI/kde/p7zip_extract_subdir.desktop b/GUI/kde/p7zip_extract_subdir.desktop
+index 1800fa0..a711f3c 100644
+--- a/GUI/kde/p7zip_extract_subdir.desktop
++++ b/GUI/kde/p7zip_extract_subdir.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=ExtractSubdir
+
+diff --git a/GUI/kde/p7zip_extract_to.desktop b/GUI/kde/p7zip_extract_to.desktop
+index bf13ec0..18d2b74 100644
+--- a/GUI/kde/p7zip_extract_to.desktop
++++ b/GUI/kde/p7zip_extract_to.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=ExtractTo
+
+diff --git a/GUI/kde/p7zip_test.desktop b/GUI/kde/p7zip_test.desktop
+index 2c17acb..5212bb2 100644
+--- a/GUI/kde/p7zip_test.desktop
++++ b/GUI/kde/p7zip_test.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=test
+
diff --git a/app-arch/p7zip/files/9.04-makefile.patch b/app-arch/p7zip/files/9.04-makefile.patch
new file mode 100644
index 0000000..93a99cc
--- /dev/null
+++ b/app-arch/p7zip/files/9.04-makefile.patch
@@ -0,0 +1,19 @@
+--- p7zip_9.04/CPP/7zip/Bundles/Format7zFree/makefile.orig 2010-01-04 13:58:54.527887746 +0100
++++ p7zip_9.04/CPP/7zip/Bundles/Format7zFree/makefile 2010-01-04 13:59:10.290868343 +0100
+@@ -247,8 +247,6 @@
+ MyAes.o \
+ Pbkdf2HmacSha1.o \
+ RandGen.o \
+- Rar20Crypto.o \
+- RarAes.o \
+ Sha1.o \
+ WzAes.o \
+ ZipCrypto.o \
+@@ -298,7 +296,6 @@
+ $(HFS_OBJS) \
+ $(ISO_OBJS) \
+ $(NSIS_OBJS) \
+- $(RAR_OBJS) \
+ $(TAR_OBJS) \
+ $(UDF_OBJS) \
+ $(WIM_OBJS) \
diff --git a/app-arch/p7zip/files/p7zip b/app-arch/p7zip/files/p7zip
new file mode 100644
index 0000000..9aaf078
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip
@@ -0,0 +1,73 @@
+#!/bin/bash
+# gzip-like CLI wrapper for p7zip
+set -e
+
+compress=true
+file=
+
+usage ()
+ {
+ echo "Usage: $0 [-d] [-h|--help] [file]"
+ exit 1
+ }
+
+while [ "$#" != "0" ] ; do
+ case "$1" in
+ -d) compress=false ;;
+ -c) echo "$0: ignoring $1 option (not yet implemented)" ;;
+ -h|--help) usage ;;
+ *)
+ if [ "${file}" = "" ] ; then
+ file="$1"
+ else
+ usage
+ fi
+ ;;
+ esac
+ shift
+done
+
+# make sure they're present, before we screw up
+for i in mktemp 7z rm cat tty ; do
+ if ! which $i > /dev/null ; then
+ echo "$0: $i: command not found"
+ exit 1
+ fi
+done
+
+if [ "${file}" != "" ] ; then
+ if ${compress} ; then
+ 7z a ${file}.7z ${file}
+ rm ${file}
+ else
+ case ${file} in
+ *.7z)
+ 7z x ${file}
+ rm ${file}
+ ;;
+ *)
+ echo "$0: ${file}: unknown suffix -- ignored"
+ ;;
+ esac
+ fi
+ exit 0
+fi
+
+tmp=`mktemp`
+trap "rm -f ${tmp}" 0
+
+if ${compress} ; then
+ if tty > /dev/null ; then
+ echo "$0: compressed data not written to a terminal."
+ echo "For help, type: $0 -h"
+ exit 1
+ fi
+ rm -f ${tmp}
+ 7z a ${tmp} -si >/dev/null
+ cat ${tmp}
+else
+ cat > ${tmp}
+ 7z x ${tmp} -so 2>/dev/null | cat
+fi
+
+rm -f ${tmp}
diff --git a/app-arch/p7zip/files/p7zip-4.16_x86_static.patch b/app-arch/p7zip/files/p7zip-4.16_x86_static.patch
new file mode 100644
index 0000000..c52ef86
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-4.16_x86_static.patch
@@ -0,0 +1,10 @@
+--- makefile.machine.orig 2005-04-15 18:31:10.000000000 +0200
++++ makefile.machine 2005-04-15 18:12:26.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -static
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
diff --git a/app-arch/p7zip/files/p7zip-9.13-QA.patch b/app-arch/p7zip/files/p7zip-9.13-QA.patch
new file mode 100644
index 0000000..4a2b92e
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.13-QA.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Jun 7 14:29:51 UTC 2012
+Subject: fix QA warnings
+
+https://sourceforge.net/tracker/?func=detail&atid=660493&aid=3532590&group_id=111810
+
+--- CPP/7zip/Archive/NtfsHandler.cpp
++++ CPP/7zip/Archive/NtfsHandler.cpp
+@@ -1250,7 +1250,7 @@
+ if (recSizeLog < Header.SectorSizeLog)
+ return false;
+ numSectorsInRec = 1 << (recSizeLog - Header.SectorSizeLog);
+- if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, NULL, 0))
++ if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, 0, NULL))
+ return S_FALSE;
+ if (!mftRec.IsFILE())
+ return S_FALSE;
diff --git a/app-arch/p7zip/files/p7zip-9.20.1-QA.patch b/app-arch/p7zip/files/p7zip-9.20.1-QA.patch
new file mode 100644
index 0000000..8845aca
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.20.1-QA.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Jun 7 14:31:12 UTC 2012
+Subject: fix QA warnings
+
+https://sourceforge.net/tracker/?func=detail&atid=660493&aid=3532590&group_id=111810
+
+--- CPP/7zip/Archive/NtfsHandler.cpp
++++ CPP/7zip/Archive/NtfsHandler.cpp
+@@ -1280,7 +1280,7 @@
+ if (recSizeLog < Header.SectorSizeLog)
+ return false;
+ numSectorsInRec = 1 << (recSizeLog - Header.SectorSizeLog);
+- if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, NULL, 0))
++ if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, 0, NULL))
+ return S_FALSE;
+ if (!mftRec.IsFILE())
+ return S_FALSE;
diff --git a/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch b/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch
new file mode 100644
index 0000000..1fdff48
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch
@@ -0,0 +1,24 @@
+diff -Naupr p7zip_9.20.1.orig/Asm/x64/7zCrcT8U.asm p7zip_9.20.1/Asm/x64/7zCrcT8U.asm
+--- p7zip_9.20.1.orig/Asm/x64/7zCrcT8U.asm 2008-08-14 11:18:07.000000000 +0200
++++ p7zip_9.20.1/Asm/x64/7zCrcT8U.asm 2011-07-26 17:43:57.727910278 +0200
+@@ -101,3 +101,8 @@ _CrcUpdateT8:
+ ret
+
+ end
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++
+diff -Naupr p7zip_9.20.1.orig/Asm/x86/7zCrcT8U.asm p7zip_9.20.1/Asm/x86/7zCrcT8U.asm
+--- p7zip_9.20.1.orig/Asm/x86/7zCrcT8U.asm 2009-07-14 12:44:15.000000000 +0200
++++ p7zip_9.20.1/Asm/x86/7zCrcT8U.asm 2011-07-26 17:44:23.938864508 +0200
+@@ -99,3 +99,8 @@ _CrcUpdateT8:
+
+
+ ; end
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++
diff --git a/app-arch/p7zip/files/p7zip-ds-442.patch b/app-arch/p7zip/files/p7zip-ds-442.patch
new file mode 100644
index 0000000..ba9b3d2
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-ds-442.patch
@@ -0,0 +1,11 @@
+diff -dPNur p7zip_4.42/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.42-new/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.42/7zip/Bundles/Un7Zip/Un7Zip.cpp 2006-06-28 04:12:35.000000000 +0500
++++ p7zip_4.42-new/7zip/Bundles/Un7Zip/Un7Zip.cpp 2006-06-28 04:25:56.000000000 +0500
+@@ -117,6 +117,7 @@
+ v1, v2,
+ wildcardCensorHead,
+ true,
++ false,
+ passwordEnabled,
+ password);
+ if (result != S_OK)
diff --git a/app-arch/p7zip/files/p7zip-ds-rcc.patch b/app-arch/p7zip/files/p7zip-ds-rcc.patch
new file mode 100644
index 0000000..98e7855
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-ds-rcc.patch
@@ -0,0 +1,314 @@
+diff -dPNur p7zip_4.44-old/C/rccrecode.c p7zip_4.44/C/rccrecode.c
+--- p7zip_4.44-old/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44/C/rccrecode.c 2007-04-14 19:47:03.000000000 +0200
+@@ -0,0 +1,69 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.44-old/C/rccrecode.h p7zip_4.44/C/rccrecode.h
+--- p7zip_4.44-old/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44/C/rccrecode.h 2007-04-14 19:34:20.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/makefile p7zip_4.44/CPP/7zip/Archive/Zip/makefile
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/makefile 2007-01-23 21:29:41.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/makefile 2007-04-14 18:36:44.000000000 +0200
+@@ -13,6 +13,7 @@
+ LIBS=$(LOCAL_LIBS_DLL)
+
+ OBJS = \
++../../../../C/rccrecode.o \
+ ../../../Common/MyWindows.o \
+ ../../../Common/Vector.o\
+ ../../../Common/Alloc.o\
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-01-20 18:06:58.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-04-14 19:34:59.000000000 +0200
+@@ -9,11 +9,22 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
++
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+
+ // static const char kEndOfString = '\0';
+-
++
+ bool CInArchive::Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit)
+ {
+ m_Stream = inStream;
+@@ -179,10 +190,18 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
+ if (nameSize == 0)
+ return AString();
+ SafeReadBytes(m_NameBuffer.GetBuffer(nameSize), nameSize);
+ m_NameBuffer.ReleaseBuffer(nameSize);
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.h 2007-01-20 18:06:28.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.h 2007-04-14 19:05:31.000000000 +0200
+@@ -104,6 +104,10 @@
+ bool SeekInArchive(UInt64 position);
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
++
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
+ };
+
+ }}
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-01-20 18:06:57.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-04-14 19:44:44.000000000 +0200
+@@ -8,9 +8,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ m_Stream = outStream;
+@@ -104,6 +114,8 @@
+
+ HRESULT COutArchive::WriteLocalHeader(const CLocalItem &item)
+ {
++ char *rccrec;
++
+ m_Stream->Seek(m_BasePosition, STREAM_SEEK_SET, NULL);
+
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+@@ -124,6 +136,12 @@
+ return E_FAIL;
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -147,6 +165,8 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
++
+ m_Stream->Seek(m_BasePosition, STREAM_SEEK_SET, NULL);
+
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+@@ -175,6 +195,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.h 2007-01-20 18:06:29.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.h 2007-04-14 19:10:12.000000000 +0200
+@@ -44,6 +44,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.44-old/CPP/7zip/Bundles/Alone/makefile p7zip_4.44/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.44-old/CPP/7zip/Bundles/Alone/makefile 2007-01-23 21:29:43.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Bundles/Alone/makefile 2007-04-14 18:52:31.000000000 +0200
+@@ -41,6 +41,7 @@
+ $(MY_HOME)/mySplitCommandLine.o
+
+ OBJS=\
++../../../../C/rccrecode.o \
+ ../../../Common/MyWindows.o \
+ 7zAES.o \
+ 7zCompressionMode.o \
+diff -dPNur p7zip_4.44-old/makefile.linux_amd64 p7zip_4.44/makefile.linux_amd64
+--- p7zip_4.44-old/makefile.linux_amd64 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_amd64 2007-04-14 18:50:13.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_gcc_2.95_no_need_for_libstdc p7zip_4.44/makefile.linux_gcc_2.95_no_need_for_libstdc
+--- p7zip_4.44-old/makefile.linux_gcc_2.95_no_need_for_libstdc 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_gcc_2.95_no_need_for_libstdc 2007-04-14 18:51:02.000000000 +0200
+@@ -10,6 +10,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_x86_ppc_alpha p7zip_4.44/makefile.linux_x86_ppc_alpha
+--- p7zip_4.44-old/makefile.linux_x86_ppc_alpha 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_x86_ppc_alpha 2007-04-14 18:51:15.000000000 +0200
+@@ -14,6 +14,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_x86_ppc_alpha__gcc_4.X p7zip_4.44/makefile.linux_x86_ppc_alpha__gcc_4.X
+--- p7zip_4.44-old/makefile.linux_x86_ppc_alpha__gcc_4.X 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_x86_ppc_alpha__gcc_4.X 2007-04-14 18:51:19.000000000 +0200
+@@ -14,6 +14,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.machine p7zip_4.44/makefile.machine
+--- p7zip_4.44-old/makefile.machine 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.machine 2007-04-14 18:49:24.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
diff --git a/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch
new file mode 100644
index 0000000..0020729
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch
@@ -0,0 +1,597 @@
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile p7zip_4.27/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,85 @@
++PROG=libun7zip.so
++
++LOCAL_FLAGS= -I../../../Common/ -I../../../myWindows/ -I../../../ -I../../../include_windows/ \
++-DCOMPRESS_BCJ2 -DEXTRACT_ONLY -DEXCLUDE_COM -DNO_REGISTRY -DFORMAT_7Z \
++-DCOMPRESS_LZMA -DCOMPRESS_BCJ_X86 -DCOMPRESS_COPY -DCOMPRESS_PPMD -D_SFX $(RPM_OPT_FLAGS)
++
++include ../../../makefile.machine
++
++LOCAL_SHARED=$(LINK_SHARED)
++LIBS=$(LOCAL_LIBS_DLL)
++
++MY_WINDOWS= \
++ $(MY_HOME)/myGetTickCount.o \
++ $(MY_HOME)/wine_date_and_time.o \
++ $(MY_HOME)/myModuleFileName.o \
++
++OBJS=\
++CoderMixer2.o\
++CoderMixer2MT.o\
++CoderMixer2ST.o\
++CrossThreadProgress.o\
++FilterCoder.o\
++ItemNameUtils.o\
++OutStreamWithCRC.o\
++ConsoleClose.o\
++ExtractCallbackConsole.o\
++ExtractCallbackNULL.o\
++List.o\
++OpenCallbackConsole.o\
++UserInputUtils.o\
++7zDecode.o\
++7zExtract.o\
++7zFolderOutStream.o\
++7zHandler.o\
++7zHeader.o\
++7zIn.o\
++7zMethodID.o\
++LZMADecoder.o\
++BranchCoder.o\
++x86.o\
++x86_2.o\
++PPMDDecoder.o\
++LZOutWindow.o\
++CopyCoder.o\
++Error.o\
++FileDir.o\
++FileFind.o\
++FileIO.o\
++FileName.o\
++PropVariant.o\
++PropVariantConversions.o\
++Synchronization.o\
++../../../Common/MyWindows.o\
++../../../Common/Alloc.o\
++../../../Common/StdInStream.o\
++../../../Common/StdOutStream.o\
++../../../Common/StringConvert.o\
++../../../Common/String.o\
++../../../Common/CRC.o\
++../../../Common/Vector.o\
++../../../Common/Wildcard.o\
++../../../Common/IntToString.o\
++FilePathAutoRename.o\
++FileStreams.o\
++InBuffer.o\
++LimitedStreams.o\
++LockedStream.o\
++OffsetStream.o\
++OutBuffer.o\
++ProgressUtils.o\
++StreamBinder.o\
++StreamObjects.o\
++StreamUtils.o\
++ArchiveExtractCallback.o\
++ArchiveOpenCallback.o\
++ArchiverInfo.o\
++DefaultName.o\
++Extract.o\
++ExtractingFilePath.o\
++OpenArchive.o\
++PropIDUtils.o\
++Un7Zip.o
++
++include ../../../makefile.glb
++
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.27/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile.depend 2005-09-23 09:48:46.000000000 +0400
+@@ -0,0 +1 @@
++
+\ ÷ ËÏÎÃÅ ÆÁÊÌÁ ÎÅÔ ÎÏ×ÏÊ ÓÔÒÏËÉ
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.list p7zip_4.27/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile.list 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,128 @@
++CoderMixer2.o : ../../Archive/Common/CoderMixer2.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2.cpp
++CoderMixer2MT.o : ../../Archive/Common/CoderMixer2MT.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2MT.cpp
++CoderMixer2ST.o : ../../Archive/Common/CoderMixer2ST.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2ST.cpp
++CrossThreadProgress.o : ../../Archive/Common/CrossThreadProgress.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CrossThreadProgress.cpp
++FilterCoder.o : ../../Archive/Common/FilterCoder.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/FilterCoder.cpp
++ItemNameUtils.o : ../../Archive/Common/ItemNameUtils.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/ItemNameUtils.cpp
++OutStreamWithCRC.o : ../../Archive/Common/OutStreamWithCRC.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/OutStreamWithCRC.cpp
++ConsoleClose.o : ../../UI/Console/ConsoleClose.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ConsoleClose.cpp
++ExtractCallbackConsole.o : ../../UI/Console/ExtractCallbackConsole.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackConsole.cpp
++ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackNULL.cpp
++List.o : ../../UI/Console/List.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/List.cpp
++OpenCallbackConsole.o : ../../UI/Console/OpenCallbackConsole.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/OpenCallbackConsole.cpp
++UserInputUtils.o : ../../UI/Console/UserInputUtils.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/UserInputUtils.cpp
++7zDecode.o : ../../Archive/7z/7zDecode.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zDecode.cpp
++7zExtract.o : ../../Archive/7z/7zExtract.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zExtract.cpp
++7zFolderOutStream.o : ../../Archive/7z/7zFolderOutStream.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zFolderOutStream.cpp
++7zHandler.o : ../../Archive/7z/7zHandler.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zHandler.cpp
++7zHeader.o : ../../Archive/7z/7zHeader.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zHeader.cpp
++7zIn.o : ../../Archive/7z/7zIn.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zIn.cpp
++7zMethodID.o : ../../Archive/7z/7zMethodID.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zMethodID.cpp
++LZMADecoder.o : ../../Compress/LZMA/LZMADecoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/LZMA/LZMADecoder.cpp
++BranchCoder.o : ../../Compress/Branch/BranchCoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/BranchCoder.cpp
++x86.o : ../../Compress/Branch/x86.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/x86.cpp
++x86_2.o : ../../Compress/Branch/x86_2.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/x86_2.cpp
++PPMDDecoder.o : ../../Compress/PPMD/PPMDDecoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/PPMD/PPMDDecoder.cpp
++LZOutWindow.o : ../../Compress/LZ/LZOutWindow.cpp
++ $(CXX) $(CFLAGS) ../../Compress/LZ/LZOutWindow.cpp
++CopyCoder.o : ../../Compress/Copy/CopyCoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Copy/CopyCoder.cpp
++Error.o : ../../../Windows/Error.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/Error.cpp
++FileDir.o : ../../../Windows/FileDir.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileDir.cpp
++FileFind.o : ../../../Windows/FileFind.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileFind.cpp
++FileIO.o : ../../../Windows/FileIO.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileIO.cpp
++FileName.o : ../../../Windows/FileName.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileName.cpp
++PropVariant.o : ../../../Windows/PropVariant.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/PropVariant.cpp
++PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/PropVariantConversions.cpp
++Synchronization.o : ../../../Windows/Synchronization.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/Synchronization.cpp
++Alloc.o : ../../../Common/Alloc.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
++CRC.o : ../../../Common/CRC.cpp
++ $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
++IntToString.o : ../../../Common/IntToString.cpp
++ $(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
++StdInStream.o : ../../../Common/StdInStream.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StdInStream.cpp
++StdOutStream.o : ../../../Common/StdOutStream.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StdOutStream.cpp
++String.o : ../../../Common/String.cpp
++ $(CXX) $(CFLAGS) ../../../Common/String.cpp
++StringConvert.o : ../../../Common/StringConvert.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
++Vector.o : ../../../Common/Vector.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Vector.cpp
++Wildcard.o : ../../../Common/Wildcard.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Wildcard.cpp
++FilePathAutoRename.o : ../../Common/FilePathAutoRename.cpp
++ $(CXX) $(CFLAGS) ../../Common/FilePathAutoRename.cpp
++FileStreams.o : ../../Common/FileStreams.cpp
++ $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
++InBuffer.o : ../../Common/InBuffer.cpp
++ $(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
++LimitedStreams.o : ../../Common/LimitedStreams.cpp
++ $(CXX) $(CFLAGS) ../../Common/LimitedStreams.cpp
++LockedStream.o : ../../Common/LockedStream.cpp
++ $(CXX) $(CFLAGS) ../../Common/LockedStream.cpp
++OffsetStream.o : ../../Common/OffsetStream.cpp
++ $(CXX) $(CFLAGS) ../../Common/OffsetStream.cpp
++OutBuffer.o : ../../Common/OutBuffer.cpp
++ $(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
++ProgressUtils.o : ../../Common/ProgressUtils.cpp
++ $(CXX) $(CFLAGS) ../../Common/ProgressUtils.cpp
++StreamUtils.o : ../../Common/StreamUtils.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
++StreamBinder.o : ../../Common/StreamBinder.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamBinder.cpp
++StreamObjects.o : ../../Common/StreamObjects.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamObjects.cpp
++ArchiveExtractCallback.o : ../../UI/Common/ArchiveExtractCallback.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiveExtractCallback.cpp
++ArchiveOpenCallback.o : ../../UI/Common/ArchiveOpenCallback.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiveOpenCallback.cpp
++ArchiverInfo.o : ../../UI/Common/ArchiverInfo.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiverInfo.cpp
++DefaultName.o : ../../UI/Common/DefaultName.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/DefaultName.cpp
++Extract.o : ../../UI/Common/Extract.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/Extract.cpp
++ExtractingFilePath.o : ../../UI/Common/ExtractingFilePath.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ExtractingFilePath.cpp
++OpenArchive.o : ../../UI/Common/OpenArchive.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/OpenArchive.cpp
++PropIDUtils.o : ../../UI/Common/PropIDUtils.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/PropIDUtils.cpp
++Un7Zip.o : ./Un7Zip.cpp
++ $(CXX) $(CFLAGS) ./Un7Zip.cpp
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/testlib.c p7zip_4.27/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/testlib.c 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,7 @@
++
++#include "u7zip.h"
++
++int main(int argc, char *argv[])
++{
++ return un7zip(argv[1], "/tmp", 0);
++}
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.27/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/u7zip.h 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,19 @@
++#ifndef __UN7ZIP_H
++#define __UN7ZIP_H
++
++#define LIST_7Z 0
++#define TEST_7Z 1
++#define EXTRACT_7Z 2
++
++#define S_OK 0x00000000L
++#define S_FALSE 0x00000001L
++#define E_NOTIMPL 0x80004001L
++#define E_NOINTERFACE 0x80004002L
++#define E_ABORT 0x80004004L
++#define E_FAIL 0x80004005L
++#define E_OUTOFMEMORY 0x8007000EL
++#define E_INVALIDARG 0x80070057L
++
++int un7zip(char *name, char *dir, int command);
++
++#endif
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.27/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/Un7Zip.cpp 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,127 @@
++// Un7Zip.cpp
++
++#include "StdAfx.h"
++
++#include "Common/MyInitGuid.h"
++
++#include "Common/StdOutStream.h"
++#include "Common/Wildcard.h"
++#include "Common/StringConvert.h"
++#include "Common/MyCom.h"
++#include "Common/Exception.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileName.h"
++#include "Windows/Defs.h"
++
++#include "../../IPassword.h"
++#include "../../ICoder.h"
++
++#include "../../UI/Common/OpenArchive.h"
++#include "../../UI/Common/DefaultName.h"
++#include "../../UI/Common/ExitCode.h"
++#include "../../UI/Common/Extract.h"
++
++#include "../../UI/Console/List.h"
++#include "../../UI/Console/OpenCallbackConsole.h"
++#include "../../UI/Console/ExtractCallbackNULL.h"
++
++
++static int Un7Zip(char *name, char *dir, int command);
++
++extern "C" {
++
++int un7zip(char *name, char *dir, int command)
++{
++ return Un7Zip(name, dir, command);
++}
++
++}
++
++using namespace NWindows;
++using namespace NFile;
++
++static const wchar_t *kUniversalWildcard = L"*";
++static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor)
++{
++ wildcardCensor.AddItem(true, kUniversalWildcard, false);
++ return true;
++}
++
++static int Un7Zip(char *name, char *dir, int commands)
++{
++
++ CStdOutStream *g_StdStream = &g_StdOut;
++
++ NWildcard::CCensor wildcardCensor;
++ AddNameToCensor(wildcardCensor);
++ bool passwordEnabled = 1;
++ UString password = L"null";
++
++ UString outputDir= MultiByteToUnicodeString(dir);
++ UString archiveName = MultiByteToUnicodeString(name);
++
++ NFind::CFileInfoW archiveFileInfo;
++
++ if (!NFind::FindFile(archiveName, archiveFileInfo))
++ return S_FALSE;
++ if (archiveFileInfo.IsDirectory())
++ return S_FALSE;
++
++ {
++
++ UStringVector v1, v2;
++ v1.Add(archiveName);
++ v2.Add(archiveName);
++
++ const NWildcard::CCensorNode &wildcardCensorHead =
++ wildcardCensor.Pairs.Front().Head;
++
++ if(commands > 0)
++ {
++ CExtractCallbackNULL *ecs = new CExtractCallbackNULL;
++ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
++ ecs->OutStream = g_StdStream;
++ ecs->PasswordIsDefined = passwordEnabled;
++ ecs->Password = password;
++ ecs->Init();
++
++ COpenCallbackConsole openCallback;
++ openCallback.OutStream = g_StdStream;
++ openCallback.PasswordIsDefined = passwordEnabled;
++ openCallback.Password = password;
++
++ CExtractOptions eo;
++ eo.StdOutMode = false;
++ eo.PathMode = NExtract::NPathMode::kFullPathnames;
++ if(commands == 1)
++ eo.TestMode = 1;
++ else
++ eo.TestMode = 0;
++ eo.OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
++ eo.OutputDir = outputDir;
++ eo.YesToAll = 1;
++
++ HRESULT result = DecompressArchives(
++ v1, v2,
++ wildcardCensorHead,
++ eo, &openCallback, ecs);
++ if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
++ return S_FALSE;
++ if (result != S_OK)
++ return S_FALSE;
++ }
++ else
++ {
++ HRESULT result = ListArchives(
++ v1, v2,
++ wildcardCensorHead,
++ true,
++ passwordEnabled,
++ password);
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -ruN p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.cpp 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,132 @@
++// ExtractCallbackNULL.cpp
++
++#include "StdAfx.h"
++
++#include "ExtractCallbackNULL.h"
++#include "UserInputUtils.h"
++#include "ConsoleClose.h"
++
++#include "Common/Wildcard.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileFind.h"
++#include "Windows/Time.h"
++#include "Windows/Defs.h"
++#include "Windows/PropVariant.h"
++#include "Windows/Error.h"
++#include "Windows/PropVariantConversions.h"
++
++#include "../../Common/FilePathAutoRename.h"
++
++#include "../Common/ExtractingFilePath.h"
++
++using namespace NWindows;
++using namespace NFile;
++using namespace NDirectory;
++
++STDMETHODIMP CExtractCallbackNULL::SetTotal(UInt64 size)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetCompleted(const UInt64 *completeValue)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::AskOverwrite(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer)
++{
++
++ NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(OutStream);
++
++ switch(overwriteAnswer)
++ {
++ case NUserAnswerMode::kQuit:
++ return E_ABORT;
++ case NUserAnswerMode::kNo:
++ *answer = NOverwriteAnswer::kNo;
++ break;
++ case NUserAnswerMode::kNoAll:
++ *answer = NOverwriteAnswer::kNoToAll;
++ break;
++ case NUserAnswerMode::kYesAll:
++ *answer = NOverwriteAnswer::kYesToAll;
++ break;
++ case NUserAnswerMode::kYes:
++ *answer = NOverwriteAnswer::kYes;
++ break;
++ case NUserAnswerMode::kAutoRename:
++ *answer = NOverwriteAnswer::kAutoRename;
++ break;
++ default:
++ return E_FAIL;
++ }
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::PrepareOperation(const wchar_t *name, Int32 askExtractMode, const UInt64 *position)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::MessageError(const wchar_t *message)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetOperationResult(Int32 operationResult)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::CryptoGetTextPassword(BSTR *password)
++{
++ if (!PasswordIsDefined)
++ {
++ Password = GetPassword(OutStream);
++ PasswordIsDefined = true;
++ }
++ CMyComBSTR tempName(Password);
++ *password = tempName.Detach();
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::BeforeOpen(const wchar_t *name)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::OpenResult(const wchar_t *name, HRESULT result)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ThereAreNoFiles()
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ExtractResult(HRESULT result)
++{
++ if (result == S_OK)
++ return result;
++ if (result == E_ABORT)
++ return result;
++ if (result == E_OUTOFMEMORY)
++ return result;
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::SetPassword(const UString &password)
++{
++ PasswordIsDefined = true;
++ Password = password;
++ return S_OK;
++}
+diff -ruN p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.h 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,65 @@
++// ExtractCallbackNULL.h
++
++#ifndef __EXTRACTCALLBACKCONSOLE_H
++#define __EXTRACTCALLBACKCONSOLE_H
++
++#include "Common/String.h"
++#include "Common/StdOutStream.h"
++#include "../../Common/FileStreams.h"
++#include "../../IPassword.h"
++#include "../../Archive/IArchive.h"
++#include "../Common/ArchiveExtractCallback.h"
++
++class CExtractCallbackNULL:
++ public IExtractCallbackUI,
++ public ICryptoGetTextPassword,
++ public CMyUnknownImp
++{
++public:
++ MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
++
++ STDMETHOD(SetTotal)(UInt64 total);
++ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
++
++ // IFolderArchiveExtractCallback
++ STDMETHOD(AskOverwrite)(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer);
++ STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position);
++
++ STDMETHOD(MessageError)(const wchar_t *message);
++ STDMETHOD(SetOperationResult)(Int32 operationResult);
++
++ // ICryptoGetTextPassword
++ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
++
++ HRESULT BeforeOpen(const wchar_t *name);
++ HRESULT OpenResult(const wchar_t *name, HRESULT result);
++ HRESULT ThereAreNoFiles();
++ HRESULT ExtractResult(HRESULT result);
++
++ HRESULT SetPassword(const UString &password);
++
++public:
++ bool PasswordIsDefined;
++ UString Password;
++
++ UInt64 NumArchives;
++ UInt64 NumArchiveErrors;
++ UInt64 NumFileErrors;
++ UInt64 NumFileErrorsInCurrentArchive;
++
++ CStdOutStream *OutStream;
++
++ void CExtractCallbackNULL::Init()
++ {
++ NumArchives = 0;
++ NumArchiveErrors = 0;
++ NumFileErrors = 0;
++ NumFileErrorsInCurrentArchive = 0;
++ }
++
++};
++
++#endif
diff --git a/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch
new file mode 100644
index 0000000..e3216c4
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch
@@ -0,0 +1,599 @@
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile 2007-03-29 13:01:21.000000000 +0200
+@@ -0,0 +1,84 @@
++PROG=libun7zip.so
++
++LOCAL_FLAGS= -I../../../Common/ -I../../../myWindows/ -I../../../ -I../../../include_windows/ \
++-DCOMPRESS_BCJ2 -DEXTRACT_ONLY -DEXCLUDE_COM -DNO_REGISTRY -DFORMAT_7Z \
++-DCOMPRESS_LZMA -DCOMPRESS_BCJ_X86 -DCOMPRESS_COPY -DCOMPRESS_PPMD -D_SFX $(RPM_OPT_FLAGS)
++
++include ../../../../makefile.machine
++
++LOCAL_SHARED=$(LINK_SHARED)
++LIBS=$(LOCAL_LIBS_DLL)
++
++MY_WINDOWS= \
++ $(MY_HOME)/myGetTickCount.o \
++ $(MY_HOME)/wine_date_and_time.o \
++
++OBJS=\
++CoderMixer2.o\
++CoderMixer2MT.o\
++CoderMixer2ST.o\
++CrossThreadProgress.o\
++FilterCoder.o\
++ItemNameUtils.o\
++OutStreamWithCRC.o\
++ConsoleClose.o\
++ExtractCallbackConsole.o\
++ExtractCallbackNULL.o\
++List.o\
++OpenCallbackConsole.o\
++UserInputUtils.o\
++7zDecode.o\
++7zExtract.o\
++7zFolderOutStream.o\
++7zHandler.o\
++7zHeader.o\
++7zIn.o\
++7zMethodID.o\
++LZMADecoder.o\
++BranchCoder.o\
++x86.o\
++x86_2.o\
++PPMDDecoder.o\
++LZOutWindow.o\
++CopyCoder.o\
++Error.o\
++FileDir.o\
++FileFind.o\
++FileIO.o\
++FileName.o\
++PropVariant.o\
++PropVariantConversions.o\
++Synchronization.o\
++../../../Common/MyWindows.o\
++../../../Common/Alloc.o\
++../../../Common/StdInStream.o\
++../../../Common/StdOutStream.o\
++../../../Common/StringConvert.o\
++../../../Common/String.o\
++../../../Common/CRC.o\
++../../../Common/Vector.o\
++../../../Common/Wildcard.o\
++../../../Common/IntToString.o\
++FilePathAutoRename.o\
++FileStreams.o\
++InBuffer.o\
++LimitedStreams.o\
++LockedStream.o\
++OffsetStream.o\
++OutBuffer.o\
++ProgressUtils.o\
++StreamBinder.o\
++StreamObjects.o\
++StreamUtils.o\
++ArchiveExtractCallback.o\
++ArchiveOpenCallback.o\
++ArchiverInfo.o\
++DefaultName.o\
++Extract.o\
++ExtractingFilePath.o\
++OpenArchive.o\
++PropIDUtils.o\
++Un7Zip.o
++
++include ../../../../makefile.glb
++
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.depend 2007-03-29 13:01:21.000000000 +0200
+@@ -0,0 +1 @@
++
+\ No newline at end of file
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.list 2007-03-29 13:01:21.000000000 +0200
+@@ -0,0 +1,128 @@
++CoderMixer2.o : ../../Archive/Common/CoderMixer2.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2.cpp
++CoderMixer2MT.o : ../../Archive/Common/CoderMixer2MT.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2MT.cpp
++CoderMixer2ST.o : ../../Archive/Common/CoderMixer2ST.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2ST.cpp
++CrossThreadProgress.o : ../../Archive/Common/CrossThreadProgress.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/CrossThreadProgress.cpp
++FilterCoder.o : ../../Archive/Common/FilterCoder.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/FilterCoder.cpp
++ItemNameUtils.o : ../../Archive/Common/ItemNameUtils.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/ItemNameUtils.cpp
++OutStreamWithCRC.o : ../../Archive/Common/OutStreamWithCRC.cpp
++ $(CXX) $(CFLAGS) ../../Archive/Common/OutStreamWithCRC.cpp
++ConsoleClose.o : ../../UI/Console/ConsoleClose.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ConsoleClose.cpp
++ExtractCallbackConsole.o : ../../UI/Console/ExtractCallbackConsole.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackConsole.cpp
++ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackNULL.cpp
++List.o : ../../UI/Console/List.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/List.cpp
++OpenCallbackConsole.o : ../../UI/Console/OpenCallbackConsole.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/OpenCallbackConsole.cpp
++UserInputUtils.o : ../../UI/Console/UserInputUtils.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/UserInputUtils.cpp
++7zDecode.o : ../../Archive/7z/7zDecode.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zDecode.cpp
++7zExtract.o : ../../Archive/7z/7zExtract.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zExtract.cpp
++7zFolderOutStream.o : ../../Archive/7z/7zFolderOutStream.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zFolderOutStream.cpp
++7zHandler.o : ../../Archive/7z/7zHandler.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zHandler.cpp
++7zHeader.o : ../../Archive/7z/7zHeader.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zHeader.cpp
++7zIn.o : ../../Archive/7z/7zIn.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zIn.cpp
++7zMethodID.o : ../../Archive/7z/7zMethodID.cpp
++ $(CXX) $(CFLAGS) ../../Archive/7z/7zMethodID.cpp
++LZMADecoder.o : ../../Compress/LZMA/LZMADecoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/LZMA/LZMADecoder.cpp
++BranchCoder.o : ../../Compress/Branch/BranchCoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/BranchCoder.cpp
++x86.o : ../../Compress/Branch/x86.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/x86.cpp
++x86_2.o : ../../Compress/Branch/x86_2.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Branch/x86_2.cpp
++PPMDDecoder.o : ../../Compress/PPMD/PPMDDecoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/PPMD/PPMDDecoder.cpp
++LZOutWindow.o : ../../Compress/LZ/LZOutWindow.cpp
++ $(CXX) $(CFLAGS) ../../Compress/LZ/LZOutWindow.cpp
++CopyCoder.o : ../../Compress/Copy/CopyCoder.cpp
++ $(CXX) $(CFLAGS) ../../Compress/Copy/CopyCoder.cpp
++Error.o : ../../../Windows/Error.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/Error.cpp
++FileDir.o : ../../../Windows/FileDir.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileDir.cpp
++FileFind.o : ../../../Windows/FileFind.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileFind.cpp
++FileIO.o : ../../../Windows/FileIO.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileIO.cpp
++FileName.o : ../../../Windows/FileName.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/FileName.cpp
++PropVariant.o : ../../../Windows/PropVariant.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/PropVariant.cpp
++PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/PropVariantConversions.cpp
++Synchronization.o : ../../../Windows/Synchronization.cpp
++ $(CXX) $(CFLAGS) ../../../Windows/Synchronization.cpp
++Alloc.o : ../../../Common/Alloc.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
++CRC.o : ../../../Common/CRC.cpp
++ $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
++IntToString.o : ../../../Common/IntToString.cpp
++ $(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
++StdInStream.o : ../../../Common/StdInStream.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StdInStream.cpp
++StdOutStream.o : ../../../Common/StdOutStream.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StdOutStream.cpp
++String.o : ../../../Common/String.cpp
++ $(CXX) $(CFLAGS) ../../../Common/String.cpp
++StringConvert.o : ../../../Common/StringConvert.cpp
++ $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
++Vector.o : ../../../Common/Vector.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Vector.cpp
++Wildcard.o : ../../../Common/Wildcard.cpp
++ $(CXX) $(CFLAGS) ../../../Common/Wildcard.cpp
++FilePathAutoRename.o : ../../Common/FilePathAutoRename.cpp
++ $(CXX) $(CFLAGS) ../../Common/FilePathAutoRename.cpp
++FileStreams.o : ../../Common/FileStreams.cpp
++ $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
++InBuffer.o : ../../Common/InBuffer.cpp
++ $(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
++LimitedStreams.o : ../../Common/LimitedStreams.cpp
++ $(CXX) $(CFLAGS) ../../Common/LimitedStreams.cpp
++LockedStream.o : ../../Common/LockedStream.cpp
++ $(CXX) $(CFLAGS) ../../Common/LockedStream.cpp
++OffsetStream.o : ../../Common/OffsetStream.cpp
++ $(CXX) $(CFLAGS) ../../Common/OffsetStream.cpp
++OutBuffer.o : ../../Common/OutBuffer.cpp
++ $(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
++ProgressUtils.o : ../../Common/ProgressUtils.cpp
++ $(CXX) $(CFLAGS) ../../Common/ProgressUtils.cpp
++StreamUtils.o : ../../Common/StreamUtils.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
++StreamBinder.o : ../../Common/StreamBinder.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamBinder.cpp
++StreamObjects.o : ../../Common/StreamObjects.cpp
++ $(CXX) $(CFLAGS) ../../Common/StreamObjects.cpp
++ArchiveExtractCallback.o : ../../UI/Common/ArchiveExtractCallback.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiveExtractCallback.cpp
++ArchiveOpenCallback.o : ../../UI/Common/ArchiveOpenCallback.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiveOpenCallback.cpp
++ArchiverInfo.o : ../../UI/Common/ArchiverInfo.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ArchiverInfo.cpp
++DefaultName.o : ../../UI/Common/DefaultName.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/DefaultName.cpp
++Extract.o : ../../UI/Common/Extract.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/Extract.cpp
++ExtractingFilePath.o : ../../UI/Common/ExtractingFilePath.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/ExtractingFilePath.cpp
++OpenArchive.o : ../../UI/Common/OpenArchive.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/OpenArchive.cpp
++PropIDUtils.o : ../../UI/Common/PropIDUtils.cpp
++ $(CXX) $(CFLAGS) ../../UI/Common/PropIDUtils.cpp
++Un7Zip.o : ./Un7Zip.cpp
++ $(CXX) $(CFLAGS) ./Un7Zip.cpp
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/testlib.c 2007-03-29 13:01:21.000000000 +0200
+@@ -0,0 +1,7 @@
++
++#include "u7zip.h"
++
++int main(int argc, char *argv[])
++{
++ return un7zip(argv[1], "/tmp", 0);
++}
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/u7zip.h 2007-03-29 13:01:21.000000000 +0200
+@@ -0,0 +1,19 @@
++#ifndef __UN7ZIP_H
++#define __UN7ZIP_H
++
++#define LIST_7Z 0
++#define TEST_7Z 1
++#define EXTRACT_7Z 2
++
++#define S_OK 0x00000000L
++#define S_FALSE 0x00000001L
++#define E_NOTIMPL 0x80004001L
++#define E_NOINTERFACE 0x80004002L
++#define E_ABORT 0x80004004L
++#define E_FAIL 0x80004005L
++#define E_OUTOFMEMORY 0x8007000EL
++#define E_INVALIDARG 0x80070057L
++
++int un7zip(char *name, char *dir, int command);
++
++#endif
+diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 2007-03-29 12:50:00.000000000 +0200
+@@ -0,0 +1,130 @@
++// Un7Zip.cpp
++
++#include "StdAfx.h"
++
++#include "Common/MyInitGuid.h"
++
++#include "Common/StdOutStream.h"
++#include "Common/Wildcard.h"
++#include "Common/StringConvert.h"
++#include "Common/MyCom.h"
++#include "Common/Exception.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileName.h"
++#include "Windows/Defs.h"
++
++#include "../../IPassword.h"
++#include "../../ICoder.h"
++
++#include "../../UI/Common/OpenArchive.h"
++#include "../../UI/Common/DefaultName.h"
++#include "../../UI/Common/ExitCode.h"
++#include "../../UI/Common/Extract.h"
++
++#include "../../UI/Console/List.h"
++#include "../../UI/Console/OpenCallbackConsole.h"
++#include "../../UI/Console/ExtractCallbackNULL.h"
++
++
++static int Un7Zip(char *name, char *dir, int command);
++
++extern "C" {
++
++int un7zip(char *name, char *dir, int command)
++{
++ return Un7Zip(name, dir, command);
++}
++
++}
++
++using namespace NWindows;
++using namespace NFile;
++
++static const wchar_t *kUniversalWildcard = L"*";
++static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor)
++{
++ wildcardCensor.AddItem(true, kUniversalWildcard, false);
++ return true;
++}
++
++static int Un7Zip(char *name, char *dir, int commands)
++{
++
++ CStdOutStream *g_StdStream = &g_StdOut;
++
++ NWildcard::CCensor wildcardCensor;
++ AddNameToCensor(wildcardCensor);
++ bool passwordEnabled = 1;
++ UString password = L"null";
++
++ UString outputDir= MultiByteToUnicodeString(dir);
++ UString archiveName = MultiByteToUnicodeString(name);
++
++ NFind::CFileInfoW archiveFileInfo;
++
++ if (!NFind::FindFile(archiveName, archiveFileInfo))
++ return S_FALSE;
++ if (archiveFileInfo.IsDirectory())
++ return S_FALSE;
++
++ {
++
++ UStringVector v1, v2;
++ v1.Add(archiveName);
++ v2.Add(archiveName);
++
++ const NWildcard::CCensorNode &wildcardCensorHead =
++ wildcardCensor.Pairs.Front().Head;
++
++ if(commands > 0)
++ {
++ CExtractCallbackNULL *ecs = new CExtractCallbackNULL;
++ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
++ ecs->OutStream = g_StdStream;
++ ecs->PasswordIsDefined = passwordEnabled;
++ ecs->Password = password;
++ ecs->Init();
++
++ COpenCallbackConsole openCallback;
++ openCallback.OutStream = g_StdStream;
++ openCallback.PasswordIsDefined = passwordEnabled;
++ openCallback.Password = password;
++
++ CExtractOptions eo;
++ eo.StdOutMode = false;
++ eo.PathMode = NExtract::NPathMode::kFullPathnames;
++ if(commands == 1)
++ eo.TestMode = 1;
++ else
++ eo.TestMode = 0;
++ eo.OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
++ eo.OutputDir = outputDir;
++ eo.YesToAll = 1;
++
++ UString errorMessage;
++ HRESULT result = DecompressArchives(
++ v1, v2,
++ wildcardCensorHead,
++ eo, &openCallback, ecs, errorMessage);
++
++ if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
++ return S_FALSE;
++ if (result != S_OK)
++ return S_FALSE;
++ }
++ else
++ {
++ HRESULT result = ListArchives(
++ v1, v2,
++ wildcardCensorHead,
++ true,
++ false,
++ passwordEnabled,
++ password);
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -dPNur p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 2007-03-29 12:55:02.000000000 +0200
+@@ -0,0 +1,132 @@
++// ExtractCallbackNULL.cpp
++
++#include "StdAfx.h"
++
++#include "ExtractCallbackNULL.h"
++#include "UserInputUtils.h"
++#include "ConsoleClose.h"
++
++#include "Common/Wildcard.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileFind.h"
++#include "Windows/Time.h"
++#include "Windows/Defs.h"
++#include "Windows/PropVariant.h"
++#include "Windows/Error.h"
++#include "Windows/PropVariantConversions.h"
++
++#include "../../Common/FilePathAutoRename.h"
++
++#include "../Common/ExtractingFilePath.h"
++
++using namespace NWindows;
++using namespace NFile;
++using namespace NDirectory;
++
++STDMETHODIMP CExtractCallbackNULL::SetTotal(UInt64 size)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetCompleted(const UInt64 *completeValue)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::AskOverwrite(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer)
++{
++
++ NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(OutStream);
++
++ switch(overwriteAnswer)
++ {
++ case NUserAnswerMode::kQuit:
++ return E_ABORT;
++ case NUserAnswerMode::kNo:
++ *answer = NOverwriteAnswer::kNo;
++ break;
++ case NUserAnswerMode::kNoAll:
++ *answer = NOverwriteAnswer::kNoToAll;
++ break;
++ case NUserAnswerMode::kYesAll:
++ *answer = NOverwriteAnswer::kYesToAll;
++ break;
++ case NUserAnswerMode::kYes:
++ *answer = NOverwriteAnswer::kYes;
++ break;
++ case NUserAnswerMode::kAutoRename:
++ *answer = NOverwriteAnswer::kAutoRename;
++ break;
++ default:
++ return E_FAIL;
++ }
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::PrepareOperation(const wchar_t *name, Int32 askExtractMode, const UInt64 *position)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::MessageError(const wchar_t *message)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetOperationResult(Int32 operationResult, bool encrypted)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::CryptoGetTextPassword(BSTR *password)
++{
++ if (!PasswordIsDefined)
++ {
++ Password = GetPassword(OutStream);
++ PasswordIsDefined = true;
++ }
++ CMyComBSTR tempName(Password);
++ *password = tempName.Detach();
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::BeforeOpen(const wchar_t *name)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::OpenResult(const wchar_t *name, HRESULT result, bool encrypted)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ThereAreNoFiles()
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ExtractResult(HRESULT result)
++{
++ if (result == S_OK)
++ return result;
++ if (result == E_ABORT)
++ return result;
++ if (result == E_OUTOFMEMORY)
++ return result;
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::SetPassword(const UString &password)
++{
++ PasswordIsDefined = true;
++ Password = password;
++ return S_OK;
++}
+diff -dPNur p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h 2007-03-29 12:55:12.000000000 +0200
+@@ -0,0 +1,65 @@
++// ExtractCallbackNULL.h
++
++#ifndef __EXTRACTCALLBACKCONSOLE_H
++#define __EXTRACTCALLBACKCONSOLE_H
++
++#include "Common/String.h"
++#include "Common/StdOutStream.h"
++#include "../../Common/FileStreams.h"
++#include "../../IPassword.h"
++#include "../../Archive/IArchive.h"
++#include "../Common/ArchiveExtractCallback.h"
++
++class CExtractCallbackNULL:
++ public IExtractCallbackUI,
++ public ICryptoGetTextPassword,
++ public CMyUnknownImp
++{
++public:
++ MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
++
++ STDMETHOD(SetTotal)(UInt64 total);
++ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
++
++ // IFolderArchiveExtractCallback
++ STDMETHOD(AskOverwrite)(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer);
++ STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position);
++
++ STDMETHOD(MessageError)(const wchar_t *message);
++ STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
++
++ // ICryptoGetTextPassword
++ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
++
++ HRESULT BeforeOpen(const wchar_t *name);
++ HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
++ HRESULT ThereAreNoFiles();
++ HRESULT ExtractResult(HRESULT result);
++
++ HRESULT SetPassword(const UString &password);
++
++public:
++ bool PasswordIsDefined;
++ UString Password;
++
++ UInt64 NumArchives;
++ UInt64 NumArchiveErrors;
++ UInt64 NumFileErrors;
++ UInt64 NumFileErrorsInCurrentArchive;
++
++ CStdOutStream *OutStream;
++
++ void Init()
++ {
++ NumArchives = 0;
++ NumArchiveErrors = 0;
++ NumFileErrors = 0;
++ NumFileErrorsInCurrentArchive = 0;
++ }
++
++};
++
++#endif
diff --git a/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch
new file mode 100644
index 0000000..0913c13
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch
@@ -0,0 +1,336 @@
+diff -dPNur p7zip_4.57/C/rccrecode.c p7zip_4.57-new/C/rccrecode.c
+--- p7zip_4.57/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/C/rccrecode.c 2008-04-11 20:23:42.000000000 +0200
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.57/C/rccrecode.h p7zip_4.57-new/C/rccrecode.h
+--- p7zip_4.57/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/C/rccrecode.h 2008-04-11 20:23:42.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-12-08 11:19:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.cpp 2008-04-11 20:23:42.000000000 +0200
+@@ -9,11 +9,22 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
++
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+
+ // static const char kEndOfString = '\0';
+-
++
+ bool CInArchive::Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit)
+ {
+ m_Stream = inStream;
+@@ -196,10 +207,18 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
+ if (nameSize == 0)
+ return AString();
+ SafeReadBytes(m_NameBuffer.GetBuffer(nameSize), nameSize);
+ m_NameBuffer.ReleaseBuffer(nameSize);
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.h 2007-12-08 11:19:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.h 2008-04-11 20:23:42.000000000 +0200
+@@ -106,6 +106,10 @@
+ bool SeekInArchive(UInt64 position);
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
++
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
+ };
+
+ }}
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-06-26 20:06:23.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.cpp 2008-04-11 20:23:42.000000000 +0200
+@@ -7,9 +7,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+@@ -112,6 +122,7 @@
+ {
+ SeekTo(m_BasePosition);
+
++ char *rccrec;
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+
+ WriteUInt32(NSignature::kLocalFileHeader);
+@@ -130,6 +141,12 @@
+ throw CSystemException(E_FAIL);
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -154,6 +171,7 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+ bool isPack64 = item.PackSize >= 0xFFFFFFFF;
+ bool isPosition64 = item.LocalHeaderPosition >= 0xFFFFFFFF;
+@@ -180,6 +198,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.h 2007-06-26 20:06:22.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.h 2008-04-11 20:23:42.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Alone/makefile p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.57/CPP/7zip/Bundles/Alone/makefile 2007-07-24 20:55:33.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile 2008-04-11 20:23:42.000000000 +0200
+@@ -15,6 +15,7 @@
+ LIBS=$(LOCAL_LIBS)
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Alone/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_4.57/CPP/7zip/Bundles/Alone/makefile.list 2007-07-24 20:56:10.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile.list 2008-04-11 20:23:42.000000000 +0200
+@@ -196,6 +196,7 @@
+ ../../../../C/Compress/Branch/BranchPPC.c \
+ ../../../../C/Compress/Branch/BranchSPARC.c \
+ ../../../../C/Compress/Branch/BranchX86.c \
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zCrc.c \
+ ../../../../C/Sort.c \
+ ../../../../C/Threads.c \
+@@ -237,6 +238,8 @@
+ $(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
+ ListFileUtils.o : ../../../Common/ListFileUtils.cpp
+ $(CXX) $(CFLAGS) ../../../Common/ListFileUtils.cpp
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+ MyWindows.o : ../../../Common/MyWindows.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
+ Random.o : ../../../Common/Random.cpp
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile 2007-08-03 20:16:04.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile 2008-04-11 20:30:53.000000000 +0200
+@@ -14,6 +14,7 @@
+ LIBS=$(LOCAL_LIBS_DLL)
+
+ OBJS = \
++rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ CRC.o \
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile.list 2007-08-03 20:17:57.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile.list 2008-04-11 20:32:11.000000000 +0200
+@@ -218,6 +218,7 @@
+ ../../../../C/Compress/Branch/BranchPPC.c \
+ ../../../../C/Compress/Branch/BranchSPARC.c \
+ ../../../../C/Compress/Branch/BranchX86.c \
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zCrc.c \
+ ../../../../C/Sort.c \
+ ../../../../C/Threads.c \
+@@ -237,6 +238,8 @@
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/ListFileUtils.cpp
+ MyWindows.o : ../../../Common/MyWindows.cpp
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/MyWindows.cpp
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CC_SHARED) $(CFLAGS) ../../../../C/rccrecode.c
+ Random.o : ../../../Common/Random.cpp
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/Random.cpp
+ StdInStream.o : ../../../Common/StdInStream.cpp
+diff -dPNur p7zip_4.57/makefile.machine p7zip_4.57-new/makefile.machine
+--- p7zip_4.57/makefile.machine 2007-12-15 18:19:48.000000000 +0100
++++ p7zip_4.57-new/makefile.machine 2008-04-11 20:23:42.000000000 +0200
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_4.57/makefile.machine.orig p7zip_4.57-new/makefile.machine.orig
+--- p7zip_4.57/makefile.machine.orig 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/makefile.machine.orig 2007-12-15 18:19:48.000000000 +0100
+@@ -0,0 +1,21 @@
++#
++# makefile for Linux (x86, PPC, alpha ...)
++#
++
++OPTFLAGS=-O
++
++ALLFLAGS=${OPTFLAGS} -s \
++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
++ -DNDEBUG -D_REENTRANT -DENV_UNIX \
++ $(LOCAL_FLAGS)
++
++CXX=g++ $(ALLFLAGS)
++CC=gcc $(ALLFLAGS)
++CC_SHARED=-fPIC
++LINK_SHARED=-fPIC -shared
++
++LOCAL_LIBS=-lpthread
++LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
++
++OBJ_CRC32=$(OBJ_CRC32_C)
++
diff --git a/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch
new file mode 100644
index 0000000..07a3188
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch
@@ -0,0 +1,684 @@
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile 2008-04-11 19:39:40.000000000 +0200
+@@ -0,0 +1,99 @@
++PROG=libun7zip.so
++
++LOCAL_FLAGS= \
++ -DEXTRACT_ONLY \
++ -DNO_READ_FROM_CODER \
++ -D_SFX
++
++include ../../../../makefile.crc32
++include ../../../../makefile.machine
++
++LOCAL_SHARED=$(LINK_SHARED)
++LIBS=$(LOCAL_LIBS_DLL)
++
++OBJS=\
++myGetTickCount.o\
++wine_date_and_time.o\
++mySplitCommandLine.o\
++CommandLineParser.o\
++CRC.o\
++IntToString.o\
++StdInStream.o\
++StdOutStream.o\
++MyString.o\
++MyWindows.o\
++StringConvert.o\
++MyVector.o\
++Wildcard.o\
++CoderMixer2.o\
++CoderMixer2MT.o\
++CrossThreadProgress.o\
++FilterCoder.o\
++ItemNameUtils.o\
++OutStreamWithCRC.o\
++ConsoleClose.o\
++ExtractCallbackConsole.o\
++ExtractCallbackNULL.o\
++List.o\
++OpenCallbackConsole.o\
++UserInputUtils.o\
++7zDecode.o\
++7zExtract.o\
++7zFolderOutStream.o\
++7zHandler.o\
++7zHeader.o\
++7zIn.o\
++7zRegister.o\
++LZMADecoder.o\
++LZMARegister.o\
++BranchCoder.o\
++x86.o\
++x86_2.o\
++PPMDDecoder.o\
++PPMDRegister.o\
++LZOutWindow.o\
++CopyCoder.o\
++CopyRegister.o\
++7zAES.o\
++7zAESRegister.o\
++MyAES.o\
++Error.o\
++FileDir.o\
++FileFind.o\
++FileIO.o\
++FileName.o\
++PropVariant.o\
++PropVariantConversions.o\
++Synchronization.o\
++System.o\
++FilePathAutoRename.o\
++FileStreams.o\
++InBuffer.o\
++LimitedStreams.o\
++LockedStream.o\
++StreamUtils.o\
++OutBuffer.o\
++ProgressUtils.o\
++StreamBinder.o\
++StreamObjects.o\
++VirtThread.o \
++ArchiveExtractCallback.o\
++ArchiveOpenCallback.o\
++DefaultName.o\
++LoadCodecs.o\
++Extract.o\
++ExtractingFilePath.o\
++OpenArchive.o\
++PropIDUtils.o\
++CreateCoder.o\
++Sha256.o \
++BranchX86.o \
++BCJ2Register.o\
++BCJRegister.o\
++Threads.o\
++$(OBJ_CRC32) \
++Aes.o \
++Un7Zip.o
++
++include ../../../../makefile.glb
++
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.depend 2008-04-11 18:37:10.000000000 +0200
+@@ -0,0 +1 @@
++
+\ No newline at end of file
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.list 2008-04-11 19:19:43.000000000 +0200
+@@ -0,0 +1,180 @@
++wine_date_and_time.o : ../../../myWindows/wine_date_and_time.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/wine_date_and_time.cpp
++myGetTickCount.o : ../../../myWindows/myGetTickCount.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/myGetTickCount.cpp
++mySplitCommandLine.o : ../../../myWindows/mySplitCommandLine.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/mySplitCommandLine.cpp
++CommandLineParser.o : ../../../Common/CommandLineParser.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/CommandLineParser.cpp
++CRC.o : ../../../Common/CRC.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/CRC.cpp
++IntToString.o : ../../../Common/IntToString.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/IntToString.cpp
++ListFileUtils.o : ../../../Common/ListFileUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/ListFileUtils.cpp
++MyWindows.o : ../../../Common/MyWindows.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyWindows.cpp
++Random.o : ../../../Common/Random.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/Random.cpp
++StdInStream.o : ../../../Common/StdInStream.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StdInStream.cpp
++StdOutStream.o : ../../../Common/StdOutStream.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StdOutStream.cpp
++MyString.o : ../../../Common/MyString.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyString.cpp
++StringConvert.o : ../../../Common/StringConvert.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StringConvert.cpp
++StringToInt.o : ../../../Common/StringToInt.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StringToInt.cpp
++UTFConvert.o : ../../../Common/UTFConvert.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/UTFConvert.cpp
++MyVector.o : ../../../Common/MyVector.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyVector.cpp
++Wildcard.o : ../../../Common/Wildcard.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/Wildcard.cpp
++CoderMixer2.o : ../../Archive/Common/CoderMixer2.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CoderMixer2.cpp
++CoderMixer2MT.o : ../../Archive/Common/CoderMixer2MT.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CoderMixer2MT.cpp
++CrossThreadProgress.o : ../../Archive/Common/CrossThreadProgress.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CrossThreadProgress.cpp
++ItemNameUtils.o : ../../Archive/Common/ItemNameUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/ItemNameUtils.cpp
++OutStreamWithCRC.o : ../../Archive/Common/OutStreamWithCRC.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/OutStreamWithCRC.cpp
++ConsoleClose.o : ../../UI/Console/ConsoleClose.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ConsoleClose.cpp
++ExtractCallbackConsole.o : ../../UI/Console/ExtractCallbackConsole.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ExtractCallbackConsole.cpp
++List.o : ../../UI/Console/List.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/List.cpp
++MainAr.o : ../../UI/Console/MainAr.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/MainAr.cpp
++OpenCallbackConsole.o : ../../UI/Console/OpenCallbackConsole.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/OpenCallbackConsole.cpp
++UserInputUtils.o : ../../UI/Console/UserInputUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/UserInputUtils.cpp
++7zDecode.o : ../../Archive/7z/7zDecode.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zDecode.cpp
++7zExtract.o : ../../Archive/7z/7zExtract.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zExtract.cpp
++7zFolderOutStream.o : ../../Archive/7z/7zFolderOutStream.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zFolderOutStream.cpp
++7zHandler.o : ../../Archive/7z/7zHandler.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zHandler.cpp
++7zHeader.o : ../../Archive/7z/7zHeader.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zHeader.cpp
++7zIn.o : ../../Archive/7z/7zIn.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zIn.cpp
++LZMADecoder.o : ../../Compress/LZMA/LZMADecoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZMA/LZMADecoder.cpp
++BranchCoder.o : ../../Compress/Branch/BranchCoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BranchCoder.cpp
++x86.o : ../../Compress/Branch/x86.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/x86.cpp
++x86_2.o : ../../Compress/Branch/x86_2.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/x86_2.cpp
++PPMDDecoder.o : ../../Compress/PPMD/PPMDDecoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/PPMD/PPMDDecoder.cpp
++LZOutWindow.o : ../../Compress/LZ/LZOutWindow.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZ/LZOutWindow.cpp
++CopyCoder.o : ../../Compress/Copy/CopyCoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Copy/CopyCoder.cpp
++7zAES.o : ../../Crypto/7zAES/7zAES.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/7zAES/7zAES.cpp
++MyAES.o : ../../Crypto/AES/MyAES.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/AES/MyAES.cpp
++Sha256.o : ../../Crypto/Hash/Sha256.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/Hash/Sha256.cpp
++Error.o : ../../../Windows/Error.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/Error.cpp
++FileDir.o : ../../../Windows/FileDir.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileDir.cpp
++FileFind.o : ../../../Windows/FileFind.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileFind.cpp
++FileIO.o : ../../../Windows/FileIO.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileIO.cpp
++FileName.o : ../../../Windows/FileName.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileName.cpp
++PropVariant.o : ../../../Windows/PropVariant.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/PropVariant.cpp
++PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/PropVariantConversions.cpp
++Synchronization.o : ../../../Windows/Synchronization.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/Synchronization.cpp
++System.o : ../../../Windows/System.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/System.cpp
++CreateCoder.o : ../../Common/CreateCoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/CreateCoder.cpp
++FilePathAutoRename.o : ../../Common/FilePathAutoRename.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FilePathAutoRename.cpp
++FileStreams.o : ../../Common/FileStreams.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FileStreams.cpp
++FilterCoder.o : ../../Common/FilterCoder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FilterCoder.cpp
++InBuffer.o : ../../Common/InBuffer.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/InBuffer.cpp
++LimitedStreams.o : ../../Common/LimitedStreams.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/LimitedStreams.cpp
++LockedStream.o : ../../Common/LockedStream.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/LockedStream.cpp
++StreamUtils.o : ../../Common/StreamUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamUtils.cpp
++OutBuffer.o : ../../Common/OutBuffer.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/OutBuffer.cpp
++ProgressUtils.o : ../../Common/ProgressUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/ProgressUtils.cpp
++StreamBinder.o : ../../Common/StreamBinder.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamBinder.cpp
++StreamObjects.o : ../../Common/StreamObjects.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamObjects.cpp
++VirtThread.o : ../../Common/VirtThread.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/VirtThread.cpp
++ArchiveExtractCallback.o : ../../UI/Common/ArchiveExtractCallback.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ArchiveExtractCallback.cpp
++ArchiveOpenCallback.o : ../../UI/Common/ArchiveOpenCallback.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ArchiveOpenCallback.cpp
++LoadCodecs.o : ../../UI/Common/LoadCodecs.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/LoadCodecs.cpp
++DefaultName.o : ../../UI/Common/DefaultName.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/DefaultName.cpp
++Extract.o : ../../UI/Common/Extract.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/Extract.cpp
++ExtractingFilePath.o : ../../UI/Common/ExtractingFilePath.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ExtractingFilePath.cpp
++OpenArchive.o : ../../UI/Common/OpenArchive.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/OpenArchive.cpp
++PropIDUtils.o : ../../UI/Common/PropIDUtils.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/PropIDUtils.cpp
++Main.o : ./Main.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ./Main.cpp
++BranchX86.o : ../../../../C/Compress/Branch/BranchX86.c
++ $(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Compress/Branch/BranchX86.c
++7zRegister.o : ../../Archive/7z/7zRegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zRegister.cpp
++LZMARegister.o : ../../Compress/LZMA/LZMARegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZMA/LZMARegister.cpp
++BCJ2Register.o : ../../Compress/Branch/BCJ2Register.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BCJ2Register.cpp
++BCJRegister.o : ../../Compress/Branch/BCJRegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BCJRegister.cpp
++PPMDRegister.o : ../../Compress/PPMD/PPMDRegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/PPMD/PPMDRegister.cpp
++CopyRegister.o : ../../Compress/Copy/CopyRegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Copy/CopyRegister.cpp
++7zAESRegister.o : ../../Crypto/7zAES/7zAESRegister.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/7zAES/7zAESRegister.cpp
++Threads.o : ../../../../C/Threads.c
++ $(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Threads.c
++Aes.o : ../../../../C/Crypto/Aes.c
++ $(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Crypto/Aes.c
++# CRC32, C version
++7zCrc.o : ../../../../C/7zCrc.c
++ $(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/7zCrc.c
++# CRC32, ASM version
++7zCrcT8.o : ../../../../C/7zCrcT8.c
++ $(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/7zCrcT8.c
++ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ExtractCallbackNULL.cpp
++Un7Zip.o : ./Un7Zip.cpp
++ $(CXX) $(CFLAGS) $(CC_SHARED) ./Un7Zip.cpp
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/testlib.c 2008-04-11 18:37:10.000000000 +0200
+@@ -0,0 +1,7 @@
++
++#include "u7zip.h"
++
++int main(int argc, char *argv[])
++{
++ return un7zip(argv[1], "/tmp", 0);
++}
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/u7zip.h 2008-04-11 18:37:10.000000000 +0200
+@@ -0,0 +1,19 @@
++#ifndef __UN7ZIP_H
++#define __UN7ZIP_H
++
++#define LIST_7Z 0
++#define TEST_7Z 1
++#define EXTRACT_7Z 2
++
++#define S_OK 0x00000000L
++#define S_FALSE 0x00000001L
++#define E_NOTIMPL 0x80004001L
++#define E_NOINTERFACE 0x80004002L
++#define E_ABORT 0x80004004L
++#define E_FAIL 0x80004005L
++#define E_OUTOFMEMORY 0x8007000EL
++#define E_INVALIDARG 0x80070057L
++
++int un7zip(char *name, char *dir, int command);
++
++#endif
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 2008-04-11 19:33:45.000000000 +0200
+@@ -0,0 +1,148 @@
++// Un7Zip.cpp
++
++#include "StdAfx.h"
++
++#include "Common/MyInitGuid.h"
++
++#include "Common/StdOutStream.h"
++#include "Common/Wildcard.h"
++#include "Common/StringConvert.h"
++#include "Common/MyCom.h"
++#include "Common/MyException.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileName.h"
++#include "Windows/Defs.h"
++
++#include "../../IPassword.h"
++#include "../../ICoder.h"
++
++#include "../../UI/Common/OpenArchive.h"
++#include "../../UI/Common/DefaultName.h"
++#include "../../UI/Common/ExitCode.h"
++#include "../../UI/Common/Extract.h"
++
++#include "../../UI/Console/List.h"
++#include "../../UI/Console/OpenCallbackConsole.h"
++#include "../../UI/Console/ExtractCallbackNULL.h"
++
++
++static int Un7Zip(char *name, char *dir, int command);
++
++extern "C" {
++
++int un7zip(char *name, char *dir, int command)
++{
++ return Un7Zip(name, dir, command);
++}
++
++}
++
++using namespace NWindows;
++using namespace NFile;
++
++static const wchar_t *kUniversalWildcard = L"*";
++static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor)
++{
++ wildcardCensor.AddItem(true, kUniversalWildcard, false);
++ return true;
++}
++
++static int Un7Zip(char *name, char *dir, int commands)
++{
++
++ CStdOutStream *g_StdStream = &g_StdOut;
++
++ NWildcard::CCensor wildcardCensor;
++ AddNameToCensor(wildcardCensor);
++ bool passwordEnabled = 1;
++ UString password = L"null";
++
++ UString outputDir= MultiByteToUnicodeString(dir);
++ UString archiveName = MultiByteToUnicodeString(name);
++
++ NFind::CFileInfoW archiveFileInfo;
++
++ if (!NFind::FindFile(archiveName, archiveFileInfo))
++ return S_FALSE;
++ if (archiveFileInfo.IsDirectory())
++ return S_FALSE;
++
++ {
++
++ UStringVector v1, v2;
++ v1.Add(archiveName);
++ v2.Add(archiveName);
++
++
++ CCodecs *codecs = new CCodecs;
++ CMyComPtr<
++ #ifdef EXTERNAL_CODECS
++ ICompressCodecsInfo
++ #else
++ IUnknown
++ #endif
++ > compressCodecsInfo = codecs;
++ HRESULT result = codecs->Load();
++ if (result != S_OK)
++ throw CSystemException(result);
++
++ const NWildcard::CCensorNode &wildcardCensorHead =
++ wildcardCensor.Pairs.Front().Head;
++
++ if(commands > 0)
++ {
++ CExtractCallbackNULL *ecs = new CExtractCallbackNULL;
++ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
++ ecs->OutStream = g_StdStream;
++ ecs->PasswordIsDefined = passwordEnabled;
++ ecs->Password = password;
++ ecs->Init();
++
++ COpenCallbackConsole openCallback;
++ openCallback.OutStream = g_StdStream;
++ openCallback.PasswordIsDefined = passwordEnabled;
++ openCallback.Password = password;
++
++ CExtractOptions eo;
++ eo.StdOutMode = false;
++ eo.PathMode = NExtract::NPathMode::kFullPathnames;
++ if(commands == 1)
++ eo.TestMode = 1;
++ else
++ eo.TestMode = 0;
++ eo.OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
++ eo.OutputDir = outputDir;
++ eo.YesToAll = 1;
++
++ UString errorMessage;
++ CDecompressStat stat;
++
++ HRESULT result = DecompressArchives(
++ codecs,
++ v1, v2,
++ wildcardCensorHead,
++ eo, &openCallback, ecs, errorMessage, stat);
++
++ if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
++ return S_FALSE;
++ if (result != S_OK)
++ return S_FALSE;
++ }
++ else
++ {
++ UInt64 numErrors = 0;
++ HRESULT result = ListArchives(
++ codecs,
++ v1, v2,
++ wildcardCensorHead,
++ true, false,
++ passwordEnabled,
++ password, numErrors);
++
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -dPNur p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 2008-04-11 19:28:29.000000000 +0200
+@@ -0,0 +1,132 @@
++// ExtractCallbackNULL.cpp
++
++#include "StdAfx.h"
++
++#include "ExtractCallbackNULL.h"
++#include "UserInputUtils.h"
++#include "ConsoleClose.h"
++
++#include "Common/Wildcard.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileFind.h"
++#include "Windows/Time.h"
++#include "Windows/Defs.h"
++#include "Windows/PropVariant.h"
++#include "Windows/Error.h"
++#include "Windows/PropVariantConversions.h"
++
++#include "../../Common/FilePathAutoRename.h"
++
++#include "../Common/ExtractingFilePath.h"
++
++using namespace NWindows;
++using namespace NFile;
++using namespace NDirectory;
++
++STDMETHODIMP CExtractCallbackNULL::SetTotal(UInt64 size)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetCompleted(const UInt64 *completeValue)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::AskOverwrite(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer)
++{
++
++ NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(OutStream);
++
++ switch(overwriteAnswer)
++ {
++ case NUserAnswerMode::kQuit:
++ return E_ABORT;
++ case NUserAnswerMode::kNo:
++ *answer = NOverwriteAnswer::kNo;
++ break;
++ case NUserAnswerMode::kNoAll:
++ *answer = NOverwriteAnswer::kNoToAll;
++ break;
++ case NUserAnswerMode::kYesAll:
++ *answer = NOverwriteAnswer::kYesToAll;
++ break;
++ case NUserAnswerMode::kYes:
++ *answer = NOverwriteAnswer::kYes;
++ break;
++ case NUserAnswerMode::kAutoRename:
++ *answer = NOverwriteAnswer::kAutoRename;
++ break;
++ default:
++ return E_FAIL;
++ }
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::PrepareOperation(const wchar_t *name, bool /* isFolder */, Int32 askExtractMode, const UInt64 *position)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::MessageError(const wchar_t *message)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetOperationResult(Int32 operationResult, bool encrypted)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::CryptoGetTextPassword(BSTR *password)
++{
++ if (!PasswordIsDefined)
++ {
++ Password = GetPassword(OutStream);
++ PasswordIsDefined = true;
++ }
++ CMyComBSTR tempName(Password);
++ *password = tempName.Detach();
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::BeforeOpen(const wchar_t *name)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::OpenResult(const wchar_t *name, HRESULT result, bool encrypted)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ThereAreNoFiles()
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ExtractResult(HRESULT result)
++{
++ if (result == S_OK)
++ return result;
++ if (result == E_ABORT)
++ return result;
++ if (result == E_OUTOFMEMORY)
++ return result;
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::SetPassword(const UString &password)
++{
++ PasswordIsDefined = true;
++ Password = password;
++ return S_OK;
++}
+diff -dPNur p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h 2008-04-11 19:28:46.000000000 +0200
+@@ -0,0 +1,65 @@
++// ExtractCallbackNULL.h
++
++#ifndef __EXTRACTCALLBACKCONSOLE_H
++#define __EXTRACTCALLBACKCONSOLE_H
++
++#include "Common/MyString.h"
++#include "Common/StdOutStream.h"
++#include "../../Common/FileStreams.h"
++#include "../../IPassword.h"
++#include "../../Archive/IArchive.h"
++#include "../Common/ArchiveExtractCallback.h"
++
++class CExtractCallbackNULL:
++ public IExtractCallbackUI,
++ public ICryptoGetTextPassword,
++ public CMyUnknownImp
++{
++public:
++ MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
++
++ STDMETHOD(SetTotal)(UInt64 total);
++ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
++
++ // IFolderArchiveExtractCallback
++ STDMETHOD(AskOverwrite)(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer);
++ STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
++
++ STDMETHOD(MessageError)(const wchar_t *message);
++ STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
++
++ // ICryptoGetTextPassword
++ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
++
++ HRESULT BeforeOpen(const wchar_t *name);
++ HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
++ HRESULT ThereAreNoFiles();
++ HRESULT ExtractResult(HRESULT result);
++
++ HRESULT SetPassword(const UString &password);
++
++public:
++ bool PasswordIsDefined;
++ UString Password;
++
++ UInt64 NumArchives;
++ UInt64 NumArchiveErrors;
++ UInt64 NumFileErrors;
++ UInt64 NumFileErrorsInCurrentArchive;
++
++ CStdOutStream *OutStream;
++
++ void Init()
++ {
++ NumArchives = 0;
++ NumArchiveErrors = 0;
++ NumFileErrors = 0;
++ NumFileErrorsInCurrentArchive = 0;
++ }
++
++};
++
++#endif
diff --git a/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch
new file mode 100644
index 0000000..7072522
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch
@@ -0,0 +1,305 @@
+diff -dPNur p7zip_4.65/C/rccrecode.c p7zip_4.65-new/C/rccrecode.c
+--- p7zip_4.65/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/C/rccrecode.c 2009-06-14 02:44:19.000000000 +0200
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.65/C/rccrecode.h p7zip_4.65-new/C/rccrecode.h
+--- p7zip_4.65/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/C/rccrecode.h 2009-06-14 02:44:19.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.cpp 2008-11-28 23:03:44.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-06-14 02:47:28.000000000 +0200
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ extern "C"
+ {
+ #include "../../../../C/CpuArch.h"
+@@ -23,6 +25,14 @@
+
+ // static const char kEndOfString = '\0';
+
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ Close();
+@@ -198,12 +208,21 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ return AString();
+ char *p = m_NameBuffer.GetBuffer(nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ m_NameBuffer.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.h 2008-08-14 11:11:13.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.h 2009-06-14 02:48:32.000000000 +0200
+@@ -108,6 +108,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.cpp 2008-08-14 11:11:26.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-06-14 02:44:19.000000000 +0200
+@@ -7,9 +7,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+@@ -112,6 +122,7 @@
+ {
+ SeekTo(m_BasePosition);
+
++ char *rccrec;
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+
+ WriteUInt32(NSignature::kLocalFileHeader);
+@@ -130,6 +141,12 @@
+ throw CSystemException(E_FAIL);
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -154,6 +171,7 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+ bool isPack64 = item.PackSize >= 0xFFFFFFFF;
+ bool isPosition64 = item.LocalHeaderPosition >= 0xFFFFFFFF;
+@@ -181,6 +199,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.h 2008-08-14 11:11:13.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.h 2009-06-14 02:44:19.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Alone/makefile p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Alone/makefile 2009-02-07 19:39:04.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile 2009-06-14 02:44:19.000000000 +0200
+@@ -250,6 +250,7 @@
+ Sha256.o
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Alone/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Alone/makefile.list 2009-02-09 21:04:57.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile.list 2009-06-14 02:51:45.000000000 +0200
+@@ -204,6 +204,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Bra.c \
+ ../../../../C/Bra86.c \
+ ../../../../C/BraIA64.c \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile 2009-02-09 21:47:24.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile 2009-06-14 03:00:06.000000000 +0200
+@@ -296,6 +296,7 @@
+ Sha256.o \
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-02-09 21:04:32.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-06-14 03:00:39.000000000 +0200
+@@ -235,6 +235,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Bra.c \
+ ../../../../C/Bra86.c \
+ ../../../../C/BraIA64.c \
+diff -dPNur p7zip_4.65/makefile.machine p7zip_4.65-new/makefile.machine
+--- p7zip_4.65/makefile.machine 2009-02-14 18:19:09.000000000 +0100
++++ p7zip_4.65-new/makefile.machine 2009-06-14 02:44:19.000000000 +0200
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_4.65/makefile.rules p7zip_4.65-new/makefile.rules
+--- p7zip_4.65/makefile.rules 2009-02-09 21:03:16.000000000 +0100
++++ p7zip_4.65-new/makefile.rules 2009-06-14 02:52:48.000000000 +0200
+@@ -558,3 +558,5 @@
+ 7zCrcT8.o : ../../../../C/7zCrcT8.c
+ $(CC) $(CFLAGS) ../../../../C/7zCrcT8.c
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
diff --git a/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch
new file mode 100644
index 0000000..7646c3f
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch
@@ -0,0 +1,550 @@
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,137 @@
++PROG=libun7zip.so
++
++LOCAL_FLAGS= \
++ -DEXTRACT_ONLY \
++ -DNO_READ_FROM_CODER \
++ -D_SFX
++
++include ../../../../makefile.crc32
++include ../../../../makefile.machine
++
++LOCAL_SHARED=$(LINK_SHARED)
++LIBS=$(LOCAL_LIBS_DLL)
++
++SFX_CONSOLE_OBJS = \
++ Un7Zip.o
++
++CONSOLE_OBJS = \
++ ConsoleClose.o \
++ ExtractCallbackConsole.o \
++ ExtractCallbackNULL.o \
++ List.o \
++ OpenCallbackConsole.o \
++ UserInputUtils.o \
++
++# NewHandler.o
++COMMON_OBJS = \
++ CommandLineParser.o \
++ CRC.o \
++ IntToString.o \
++ StdInStream.o \
++ StdOutStream.o \
++ MyString.o \
++ MyWindows.o\
++ StringConvert.o \
++ MyVector.o \
++ Wildcard.o \
++
++# DLL.o
++WIN_OBJS = \
++ Error.o \
++ FileDir.o \
++ FileFind.o \
++ FileIO.o \
++ FileName.o \
++ PropVariant.o \
++ PropVariantConversions.o \
++ Synchronization.o \
++ System.o
++
++7ZIP_COMMON_OBJS = \
++ CreateCoder.o \
++ FilePathAutoRename.o \
++ FileStreams.o \
++ InBuffer.o \
++ FilterCoder.o \
++ LimitedStreams.o \
++ LockedStream.o \
++ OutBuffer.o \
++ ProgressUtils.o \
++ StreamBinder.o \
++ StreamObjects.o \
++ StreamUtils.o \
++ VirtThread.o \
++
++UI_COMMON_OBJS = \
++ ArchiveExtractCallback.o \
++ ArchiveOpenCallback.o \
++ DefaultName.o \
++ LoadCodecs.o \
++ Extract.o \
++ ExtractingFilePath.o \
++ OpenArchive.o \
++ PropIDUtils.o \
++
++AR_COMMON_OBJS = \
++ CoderMixer2.o \
++ CoderMixer2MT.o \
++ CrossThreadProgress.o \
++ ItemNameUtils.o \
++ OutStreamWithCRC.o \
++
++
++7Z_OBJS = \
++ 7zDecode.o \
++ 7zExtract.o \
++ 7zFolderOutStream.o \
++ 7zHandler.o \
++ 7zHeader.o \
++ 7zIn.o \
++ 7zRegister.o \
++
++COMPRESS_OBJS = \
++ BranchCoder.o \
++ Bcj2Coder.o \
++ Bcj2Register.o \
++ BcjCoder.o \
++ BcjRegister.o \
++ CopyCoder.o \
++ CopyRegister.o \
++ LzmaDecoder.o \
++ LzmaRegister.o \
++ PpmdDecoder.o \
++ PpmdRegister.o \
++
++CRYPTO_OBJS = \
++ 7zAes.o \
++ 7zAesRegister.o \
++ MyAes.o \
++
++# Alloc.o
++C_OBJS = \
++ Bra86.o \
++ LzmaDec.o \
++ Threads.o \
++ Aes.o \
++ Sha256.o \
++
++OBJS = \
++ myGetTickCount.o\
++ wine_date_and_time.o\
++ mySplitCommandLine.o\
++ $(SFX_CONSOLE_OBJS) \
++ $(CONSOLE_OBJS) \
++ $(COMMON_OBJS) \
++ $(WIN_OBJS) \
++ $(7ZIP_COMMON_OBJS) \
++ $(UI_COMMON_OBJS) \
++ $(AR_COMMON_OBJS) \
++ $(7Z_OBJS) \
++ $(COMPRESS_OBJS) \
++ $(CRYPTO_OBJS) \
++ $(C_OBJS) \
++ $(OBJ_CRC32)
++
++
++include ../../../../makefile.glb
++
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.depend 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1 @@
++
+\ No newline at end of file
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.list 2009-06-14 23:16:37.000000000 +0200
+@@ -0,0 +1,10 @@
++CXXFLAGS += $(CC_SHARED)
++CFLAGS += $(CC_SHARED)
++
++include ../../../../makefile.rules
++
++ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackNULL.cpp
++
++Un7Zip.o : ./Un7Zip.cpp
++ $(CXX) $(CFLAGS) ./Un7Zip.cpp
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/testlib.c 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,7 @@
++
++#include "u7zip.h"
++
++int main(int argc, char *argv[])
++{
++ return un7zip(argv[1], "/tmp", 0);
++}
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/u7zip.h 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,19 @@
++#ifndef __UN7ZIP_H
++#define __UN7ZIP_H
++
++#define LIST_7Z 0
++#define TEST_7Z 1
++#define EXTRACT_7Z 2
++
++#define S_OK 0x00000000L
++#define S_FALSE 0x00000001L
++#define E_NOTIMPL 0x80004001L
++#define E_NOINTERFACE 0x80004002L
++#define E_ABORT 0x80004004L
++#define E_FAIL 0x80004005L
++#define E_OUTOFMEMORY 0x8007000EL
++#define E_INVALIDARG 0x80070057L
++
++int un7zip(char *name, char *dir, int command);
++
++#endif
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,148 @@
++// Un7Zip.cpp
++
++#include "StdAfx.h"
++
++#include "Common/MyInitGuid.h"
++
++#include "Common/StdOutStream.h"
++#include "Common/Wildcard.h"
++#include "Common/StringConvert.h"
++#include "Common/MyCom.h"
++#include "Common/MyException.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileName.h"
++#include "Windows/Defs.h"
++
++#include "../../IPassword.h"
++#include "../../ICoder.h"
++
++#include "../../UI/Common/OpenArchive.h"
++#include "../../UI/Common/DefaultName.h"
++#include "../../UI/Common/ExitCode.h"
++#include "../../UI/Common/Extract.h"
++
++#include "../../UI/Console/List.h"
++#include "../../UI/Console/OpenCallbackConsole.h"
++#include "../../UI/Console/ExtractCallbackNULL.h"
++
++
++static int Un7Zip(char *name, char *dir, int command);
++
++extern "C" {
++
++int un7zip(char *name, char *dir, int command)
++{
++ return Un7Zip(name, dir, command);
++}
++
++}
++
++using namespace NWindows;
++using namespace NFile;
++
++static const wchar_t *kUniversalWildcard = L"*";
++static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor)
++{
++ wildcardCensor.AddItem(true, kUniversalWildcard, false);
++ return true;
++}
++
++static int Un7Zip(char *name, char *dir, int commands)
++{
++
++ CStdOutStream *g_StdStream = &g_StdOut;
++
++ NWildcard::CCensor wildcardCensor;
++ AddNameToCensor(wildcardCensor);
++ bool passwordEnabled = 1;
++ UString password = L"null";
++
++ UString outputDir= MultiByteToUnicodeString(dir);
++ UString archiveName = MultiByteToUnicodeString(name);
++
++ NFind::CFileInfoW archiveFileInfo;
++
++ if (!NFind::FindFile(archiveName, archiveFileInfo))
++ return S_FALSE;
++ if (archiveFileInfo.IsDir())
++ return S_FALSE;
++
++ {
++
++ UStringVector v1, v2;
++ v1.Add(archiveName);
++ v2.Add(archiveName);
++
++
++ CCodecs *codecs = new CCodecs;
++ CMyComPtr<
++ #ifdef EXTERNAL_CODECS
++ ICompressCodecsInfo
++ #else
++ IUnknown
++ #endif
++ > compressCodecsInfo = codecs;
++ HRESULT result = codecs->Load();
++ if (result != S_OK)
++ throw CSystemException(result);
++
++ const NWildcard::CCensorNode &wildcardCensorHead =
++ wildcardCensor.Pairs.Front().Head;
++
++ if(commands > 0)
++ {
++ CExtractCallbackNULL *ecs = new CExtractCallbackNULL;
++ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
++ ecs->OutStream = g_StdStream;
++ ecs->PasswordIsDefined = passwordEnabled;
++ ecs->Password = password;
++ ecs->Init();
++
++ COpenCallbackConsole openCallback;
++ openCallback.OutStream = g_StdStream;
++ openCallback.PasswordIsDefined = passwordEnabled;
++ openCallback.Password = password;
++
++ CExtractOptions eo;
++ eo.StdOutMode = false;
++ eo.PathMode = NExtract::NPathMode::kFullPathnames;
++ if(commands == 1)
++ eo.TestMode = 1;
++ else
++ eo.TestMode = 0;
++ eo.OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
++ eo.OutputDir = outputDir;
++ eo.YesToAll = 1;
++
++ UString errorMessage;
++ CDecompressStat stat;
++
++ HRESULT result = DecompressArchives(
++ codecs, CIntVector(),
++ v1, v2,
++ wildcardCensorHead,
++ eo, &openCallback, ecs, errorMessage, stat);
++
++ if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
++ return S_FALSE;
++ if (result != S_OK)
++ return S_FALSE;
++ }
++ else
++ {
++ UInt64 numErrors = 0;
++ HRESULT result = ListArchives(
++ codecs, CIntVector(),
++ v1, v2,
++ wildcardCensorHead,
++ true, false,
++ passwordEnabled,
++ password, numErrors);
++
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -dPNur p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,130 @@
++// ExtractCallbackNULL.cpp
++
++#include "StdAfx.h"
++
++#include "ExtractCallbackNULL.h"
++#include "UserInputUtils.h"
++#include "ConsoleClose.h"
++
++#include "Common/Wildcard.h"
++
++#include "Windows/FileDir.h"
++#include "Windows/FileFind.h"
++#include "Windows/Time.h"
++#include "Windows/Defs.h"
++#include "Windows/PropVariant.h"
++#include "Windows/Error.h"
++#include "Windows/PropVariantConversions.h"
++
++#include "../../Common/FilePathAutoRename.h"
++
++#include "../Common/ExtractingFilePath.h"
++
++using namespace NWindows;
++using namespace NFile;
++using namespace NDirectory;
++
++STDMETHODIMP CExtractCallbackNULL::SetTotal(UInt64 size)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetCompleted(const UInt64 *completeValue)
++{
++ if (NConsoleClose::TestBreakSignal())
++ return E_ABORT;
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::AskOverwrite(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer)
++{
++
++ NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(OutStream);
++
++ switch(overwriteAnswer)
++ {
++ case NUserAnswerMode::kQuit:
++ return E_ABORT;
++ case NUserAnswerMode::kNo:
++ *answer = NOverwriteAnswer::kNo;
++ break;
++ case NUserAnswerMode::kNoAll:
++ *answer = NOverwriteAnswer::kNoToAll;
++ break;
++ case NUserAnswerMode::kYesAll:
++ *answer = NOverwriteAnswer::kYesToAll;
++ break;
++ case NUserAnswerMode::kYes:
++ *answer = NOverwriteAnswer::kYes;
++ break;
++ case NUserAnswerMode::kAutoRenameAll:
++ *answer = NOverwriteAnswer::kAutoRename;
++ break;
++ default:
++ return E_FAIL;
++ }
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::PrepareOperation(const wchar_t *name, bool /* isFolder */, Int32 askExtractMode, const UInt64 *position)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::MessageError(const wchar_t *message)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::SetOperationResult(Int32 operationResult, bool encrypted)
++{
++ return S_OK;
++}
++
++STDMETHODIMP CExtractCallbackNULL::CryptoGetTextPassword(BSTR *password)
++{
++ if (!PasswordIsDefined)
++ {
++ Password = GetPassword(OutStream);
++ PasswordIsDefined = true;
++ }
++ return StringToBstr(Password, password);
++}
++
++HRESULT CExtractCallbackNULL::BeforeOpen(const wchar_t *name)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::OpenResult(const wchar_t *name, HRESULT result, bool encrypted)
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ThereAreNoFiles()
++{
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::ExtractResult(HRESULT result)
++{
++ if (result == S_OK)
++ return result;
++ if (result == E_ABORT)
++ return result;
++ if (result == E_OUTOFMEMORY)
++ return result;
++ return S_OK;
++}
++
++HRESULT CExtractCallbackNULL::SetPassword(const UString &password)
++{
++ PasswordIsDefined = true;
++ Password = password;
++ return S_OK;
++}
+diff -dPNur p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,65 @@
++// ExtractCallbackNULL.h
++
++#ifndef __EXTRACTCALLBACKCONSOLE_H
++#define __EXTRACTCALLBACKCONSOLE_H
++
++#include "Common/MyString.h"
++#include "Common/StdOutStream.h"
++#include "../../Common/FileStreams.h"
++#include "../../IPassword.h"
++#include "../../Archive/IArchive.h"
++#include "../Common/ArchiveExtractCallback.h"
++
++class CExtractCallbackNULL:
++ public IExtractCallbackUI,
++ public ICryptoGetTextPassword,
++ public CMyUnknownImp
++{
++public:
++ MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
++
++ STDMETHOD(SetTotal)(UInt64 total);
++ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
++
++ // IFolderArchiveExtractCallback
++ STDMETHOD(AskOverwrite)(
++ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
++ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
++ Int32 *answer);
++ STDMETHOD (PrepareOperation)(const wchar_t *name, bool isFolder, Int32 askExtractMode, const UInt64 *position);
++
++ STDMETHOD(MessageError)(const wchar_t *message);
++ STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
++
++ // ICryptoGetTextPassword
++ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
++
++ HRESULT BeforeOpen(const wchar_t *name);
++ HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
++ HRESULT ThereAreNoFiles();
++ HRESULT ExtractResult(HRESULT result);
++
++ HRESULT SetPassword(const UString &password);
++
++public:
++ bool PasswordIsDefined;
++ UString Password;
++
++ UInt64 NumArchives;
++ UInt64 NumArchiveErrors;
++ UInt64 NumFileErrors;
++ UInt64 NumFileErrorsInCurrentArchive;
++
++ CStdOutStream *OutStream;
++
++ void Init()
++ {
++ NumArchives = 0;
++ NumArchiveErrors = 0;
++ NumFileErrors = 0;
++ NumFileErrorsInCurrentArchive = 0;
++ }
++
++};
++
++#endif
diff --git a/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch
new file mode 100644
index 0000000..7678241
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch
@@ -0,0 +1,294 @@
+diff -dPNur p7zip-9.04~dfsg.1/C/rccrecode.c p7zip-9.04~dfsg.1-ds/C/rccrecode.c
+--- p7zip-9.04~dfsg.1/C/rccrecode.c 1970-01-01 03:00:00.000000000 +0300
++++ p7zip-9.04~dfsg.1-ds/C/rccrecode.c 2009-10-28 03:29:23.000000000 +0300
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip-9.04~dfsg.1/C/rccrecode.h p7zip-9.04~dfsg.1-ds/C/rccrecode.h
+--- p7zip-9.04~dfsg.1/C/rccrecode.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip-9.04~dfsg.1-ds/C/rccrecode.h 2009-10-28 03:29:23.000000000 +0300
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-10-28 03:49:06.000000000 +0300
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ #include "ZipIn.h"
+
+ #define Get16(p) GetUi16(p)
+@@ -17,7 +19,17 @@
+
+ namespace NArchive {
+ namespace NZip {
+-
++
++CInArchive::CInArchive()
++{
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive()
++{
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ _inBufMode = false;
+@@ -200,12 +212,20 @@
+
+ void CInArchive::ReadFileName(UInt32 nameSize, AString &dest)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ dest.Empty();
+ char *p = dest.GetBuffer((int)nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ dest.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)dest, 0);
++ if (rccrec) {
++ dest = rccrec;
++ free(rccrec);
++ }
+ }
+
+ void CInArchive::GetArchiveInfo(CInArchiveInfo &archiveInfo) const
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.h p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.h 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.h 2009-10-28 03:29:23.000000000 +0300
+@@ -114,6 +114,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.h p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.h 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.h 2009-10-28 05:49:05.000000000 +0300
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++ void Recode(CItem &item);
+ };
+
+ }}
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipUpdate.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2009-10-28 05:48:04.000000000 +0300
+@@ -87,6 +87,7 @@
+ item.NtfsATime = ui.NtfsATime;
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
++ archive.Recode(item);
+ }
+ else
+ isDir = item.IsDir();
+@@ -359,9 +360,11 @@
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
+
++ archive.Recode(item);
++
+ item.CentralExtra.RemoveUnknownSubBlocks();
+ item.LocalExtra.RemoveUnknownSubBlocks();
+-
++
+ archive.PrepareWriteCompressedData2((UInt16)item.Name.Length(), item.UnPackSize, item.PackSize, item.LocalExtra.HasWzAesField());
+ item.LocalHeaderPosition = archive.GetCurrentPosition();
+ archive.SeekToPackedDataPosition();
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile 2009-10-28 03:29:24.000000000 +0300
+@@ -244,6 +244,7 @@
+
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile.list p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile.list 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile.list 2009-10-28 03:40:17.000000000 +0300
+@@ -192,6 +192,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Aes.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Bra.c \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile 2009-10-28 03:29:24.000000000 +0300
+@@ -284,6 +284,7 @@
+
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-10-28 03:34:02.000000000 +0300
+@@ -218,6 +218,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zBuf2.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Aes.c \
+diff -dPNur p7zip-9.04~dfsg.1/makefile.machine p7zip-9.04~dfsg.1-ds/makefile.machine
+--- p7zip-9.04~dfsg.1/makefile.machine 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/makefile.machine 2009-10-28 03:29:24.000000000 +0300
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip-9.04~dfsg.1/makefile.rules p7zip-9.04~dfsg.1-ds/makefile.rules
+--- p7zip-9.04~dfsg.1/makefile.rules 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/makefile.rules 2009-10-28 03:29:24.000000000 +0300
+@@ -586,3 +586,5 @@
+ 7zCrcT8.o : ../../../../C/7zCrcT8.c
+ $(CC) $(CFLAGS) ../../../../C/7zCrcT8.c
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-10-28 05:49:01.000000000 +0300
+@@ -7,9 +7,24 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
++void COutArchive::Recode(CItem &item) {
++ char *rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) item.Name = rccrec;
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
diff --git a/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch b/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch
new file mode 100644
index 0000000..7f16a3a
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch
@@ -0,0 +1,12 @@
+diff -dPNur p7zip_9.13/CPP/Common/DynamicBuffer.h p7zip_9.13-ds/CPP/Common/DynamicBuffer.h
+--- p7zip_9.13/CPP/Common/DynamicBuffer.h 2008-08-25 21:40:32.000000000 +0200
++++ p7zip_9.13-ds/CPP/Common/DynamicBuffer.h 2013-07-14 01:31:24.000000000 +0200
+@@ -17,7 +17,7 @@
+ else
+ delta = 4;
+ delta = MyMax(delta, size);
+- SetCapacity(this->_capacity + delta);
++ this->SetCapacity(this->_capacity + delta);
+ }
+ public:
+ CDynamicBuffer(): CBuffer<T>() {};
diff --git a/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch
new file mode 100644
index 0000000..df27ac2
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch
@@ -0,0 +1,307 @@
+diff -dPNur p7zip_9.13/C/rccrecode.c p7zip_9.13-rusxmms/C/rccrecode.c
+--- p7zip_9.13/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_9.13-rusxmms/C/rccrecode.c 2010-07-31 20:32:27.000000000 +0200
+@@ -0,0 +1,73 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++// rccInitDefaultContext(NULL, 0, 0, classes, 0);
++// rccInitDb4(NULL, NULL, 0);
++// rccLoad(NULL, "zip");
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) {
++ rccInitDb4(ctx, NULL, 0);
++ rccLoad(ctx, "zip");
++ }
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_9.13/C/rccrecode.h p7zip_9.13-rusxmms/C/rccrecode.h
+--- p7zip_9.13/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_9.13-rusxmms/C/rccrecode.h 2010-07-31 14:07:34.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp 2010-04-25 17:14:42.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ #include "ZipIn.h"
+
+ #define Get16(p) GetUi16(p)
+@@ -17,7 +19,17 @@
+
+ namespace NArchive {
+ namespace NZip {
+-
++
++CInArchive::CInArchive()
++{
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive()
++{
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ _inBufMode = false;
+@@ -200,12 +212,20 @@
+
+ void CInArchive::ReadFileName(UInt32 nameSize, AString &dest)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ dest.Empty();
+ char *p = dest.GetBuffer((int)nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ dest.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)dest, 0);
++ if (rccrec) {
++ dest = rccrec;
++ free(rccrec);
++ }
+ }
+
+ void CInArchive::ReadExtra(UInt32 extraSize, CExtraBlock &extraBlock,
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h 2010-04-25 17:14:27.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h 2010-07-31 20:33:42.000000000 +0200
+@@ -117,6 +117,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp 2010-04-25 17:14:42.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -6,9 +6,24 @@
+
+ #include "ZipOut.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
++void COutArchive::Recode(CItem &item) {
++ char *rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) item.Name = rccrec;
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.h p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.h 2010-04-25 17:14:27.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.h 2010-07-31 20:33:42.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++ void Recode(CItem &item);
+ };
+
+ }}
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2010-04-25 17:25:47.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -86,6 +86,7 @@
+ item.NtfsATime = ui.NtfsATime;
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
++ archive.Recode(item);
+ }
+ else
+ isDir = item.IsDir();
+@@ -358,9 +359,11 @@
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
+
++ archive.Recode(item);
++
+ item.CentralExtra.RemoveUnknownSubBlocks();
+ item.LocalExtra.RemoveUnknownSubBlocks();
+-
++
+ archive.PrepareWriteCompressedData2((UInt16)item.Name.Length(), item.UnPackSize, item.PackSize, item.LocalExtra.HasWzAesField());
+ item.LocalHeaderPosition = archive.GetCurrentPosition();
+ archive.SeekToPackedDataPosition();
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_9.13/CPP/7zip/Bundles/Alone/makefile 2010-03-16 20:15:59.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile 2010-07-31 20:33:42.000000000 +0200
+@@ -251,6 +251,7 @@
+
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list 2010-03-16 20:17:05.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list 2010-07-31 20:33:42.000000000 +0200
+@@ -194,6 +194,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Aes.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Alloc.c \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile 2010-03-16 20:49:21.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile 2010-07-31 20:33:42.000000000 +0200
+@@ -298,6 +298,7 @@
+
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list 2010-03-16 20:50:11.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list 2010-07-31 20:33:42.000000000 +0200
+@@ -224,6 +224,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zBuf2.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Aes.c \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.orig
+diff -dPNur p7zip_9.13/makefile.machine p7zip_9.13-rusxmms/makefile.machine
+--- p7zip_9.13/makefile.machine 2010-05-30 10:33:48.000000000 +0200
++++ p7zip_9.13-rusxmms/makefile.machine 2010-07-31 20:33:42.000000000 +0200
+@@ -15,7 +15,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_9.13/makefile.machine.orig p7zip_9.13-rusxmms/makefile.machine.orig
+diff -dPNur p7zip_9.13/makefile.rules p7zip_9.13-rusxmms/makefile.rules
+--- p7zip_9.13/makefile.rules 2010-03-16 20:18:44.000000000 +0100
++++ p7zip_9.13-rusxmms/makefile.rules 2010-07-31 20:33:42.000000000 +0200
+@@ -655,3 +655,5 @@
+ LangUtils.o : ../../UI/FileManager/LangUtils.cpp
+ $(CXX) $(CXXFLAGS) ../../UI/FileManager/LangUtils.cpp
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+diff -dPNur p7zip_9.13/makefile.rules.orig p7zip_9.13-rusxmms/makefile.rules.orig
+diff -dPNur p7zip_9.13/p7zip_9.04-ds-rusxmms.patch p7zip_9.13-rusxmms/p7zip_9.04-ds-rusxmms.patch
diff --git a/app-arch/p7zip/p7zip-4.27-r1.ebuild b/app-arch/p7zip/p7zip-4.27-r1.ebuild
new file mode 100644
index 0000000..18f4baf
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.27-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.27.ebuild,v 1.5 2005/10/04 10:47:05 blubb Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86"
+IUSE="static doc"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ use static && epatch "${FILESDIR}"/p7zip-4.16_x86_static.patch
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/p7zip_4.27-libun7zip.patch
+#EDS
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:-O1 -s:${CXXFLAGS}:" \
+ makefile* || die "cleaning up makefiles"
+}
+
+src_compile() {
+ emake all2 || die "compilation error"
+#SDS
+ emake -C 7zip/Bundles/Un7Zip
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}/Codecs
+ doexe bin/Codecs/* || die "doexe Codecs"
+ exeinto /usr/$(get_libdir)/${PN}/Formats
+ doexe bin/Formats/* || die "doexe Formats"
+
+ doman man1/7z.1 man1/7za.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so
+ install -D -m 644 7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h
+#EDS
+
+}
diff --git a/app-arch/p7zip/p7zip-4.30-r1.ebuild b/app-arch/p7zip/p7zip-4.30-r1.ebuild
new file mode 100644
index 0000000..5ad62be
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.30-r1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.30.ebuild,v 1.1 2005/12/11 19:31:20 radek Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~hppa ~ppc x86"
+IUSE="static doc"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ use static && epatch "${FILESDIR}"/p7zip-4.16_x86_static.patch
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/p7zip_4.27-libun7zip.patch
+#EDS
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:-O1 -s:${CXXFLAGS}:" \
+ makefile* || die "cleaning up makefiles"
+}
+
+src_compile() {
+ emake all2 || die "compilation error"
+#SDS
+ emake -C 7zip/Bundles/Un7Zip
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}/Codecs
+ doexe bin/Codecs/* || die "doexe Codecs"
+ exeinto /usr/$(get_libdir)/${PN}/Formats
+ doexe bin/Formats/* || die "doexe Formats"
+
+ doman man1/7z.1 man1/7za.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so
+ install -D -m 644 7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h
+#EDS
+}
diff --git a/app-arch/p7zip/p7zip-4.42-r1.ebuild b/app-arch/p7zip/p7zip-4.42-r1.ebuild
new file mode 100644
index 0000000..160e40f
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.42-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.42.ebuild,v 1.4 2006/06/22 20:10:21 blubb Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~hppa ~ppc x86"
+IUSE="static doc"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ use static && epatch "${FILESDIR}"/p7zip-4.16_x86_static.patch
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/p7zip_4.27-libun7zip.patch || die
+ epatch ${FILESDIR}/p7zip-ds-442.patch || die
+#EDS
+
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ ewarn "Using suboptimal -fPIC upstream makefile due to amd64 being detected. See #126722"
+ cp -f makefile.linux_amd64 makefile.machine
+ fi
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+#SDS
+ emake -C 7zip/Bundles/Un7Zip || die
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/lib/${PN}/7zr"
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ dobin ${FILESDIR}/p7zip
+
+ # gzip introduced in 4.42 but i havent' got enough time to check it carefully
+ # so for now just leaving it commented
+ # mv needed just as rename, because dobin installs using old name
+ #mv contrib/gzip-like_CLI_wrapper_for_7z/p7zip contrib/gzip-like_CLI_wrapper_for_7z/7zg
+ #dobin contrib/gzip-like_CLI_wrapper_for_7z/7zg
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}/Codecs
+ doexe bin/Codecs/* || die "doexe Codecs"
+ exeinto /usr/$(get_libdir)/${PN}/Formats
+ doexe bin/Formats/* || die "doexe Formats"
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so || die
+ install -D -m 644 7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h || die
+#EDS
+}
diff --git a/app-arch/p7zip/p7zip-4.44-r1.ebuild b/app-arch/p7zip/p7zip-4.44-r1.ebuild
new file mode 100644
index 0000000..9853c2a
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.44-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.44.ebuild,v 1.7 2007/03/25 18:14:50 armin76 Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha amd64 hppa ~ia64 ~ppc ~ppc-macos ~ppc64 sparc x86 ~x86-fbsd"
+IUSE="static doc"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e 's:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ ewarn "Using suboptimal -fPIC upstream makefile due to amd64 being detected. See #126722"
+ cp -f makefile.linux_amd64 makefile.machine
+ elif use ppc-macos; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ cp -f makefile.macosx makefile.machine
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/p7zip_4.44-libun7zip.patch || die
+#EDS
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+#SDS
+ emake -C CPP/7zip/Bundles/Un7Zip || die
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/lib/${PN}/7zr"
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ dobin ${FILESDIR}/p7zip
+
+ # gzip introduced in 4.42, so beware :)
+ # mv needed just as rename, because dobin installs using old name
+ mv contrib/gzip-like_CLI_wrapper_for_7z/p7zip contrib/gzip-like_CLI_wrapper_for_7z/7zg
+ dobin contrib/gzip-like_CLI_wrapper_for_7z/7zg
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}/Codecs
+ doexe bin/Codecs/* || die "doexe Codecs"
+ exeinto /usr/$(get_libdir)/${PN}/Formats
+ doexe bin/Formats/* || die "doexe Formats"
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 CPP/7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so || die
+ install -D -m 644 CPP/7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h || die
+#EDS
+}
diff --git a/app-arch/p7zip/p7zip-4.44-r2.ebuild b/app-arch/p7zip/p7zip-4.44-r2.ebuild
new file mode 100644
index 0000000..2604381
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.44-r2.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.44.ebuild,v 1.7 2007/03/25 18:14:50 armin76 Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha amd64 hppa ~ia64 ~ppc ~ppc-macos ~ppc64 sparc x86 ~x86-fbsd"
+IUSE="static doc"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e 's:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ ewarn "Using suboptimal -fPIC upstream makefile due to amd64 being detected. See #126722"
+ cp -f makefile.linux_amd64 makefile.machine
+ elif use ppc-macos; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ cp -f makefile.macosx makefile.machine
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/p7zip_4.44-libun7zip.patch || die
+ epatch ${FILESDIR}/p7zip-ds-rcc.patch || die
+#EDS
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+#SDS
+ emake -C CPP/7zip/Bundles/Un7Zip || die
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/lib/${PN}/7zr"
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ dobin ${FILESDIR}/p7zip
+
+ # gzip introduced in 4.42, so beware :)
+ # mv needed just as rename, because dobin installs using old name
+ mv contrib/gzip-like_CLI_wrapper_for_7z/p7zip contrib/gzip-like_CLI_wrapper_for_7z/7zg
+ dobin contrib/gzip-like_CLI_wrapper_for_7z/7zg
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}/Codecs
+ doexe bin/Codecs/* || die "doexe Codecs"
+ exeinto /usr/$(get_libdir)/${PN}/Formats
+ doexe bin/Formats/* || die "doexe Formats"
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 CPP/7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so || die
+ install -D -m 644 CPP/7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h || die
+#EDS
+}
diff --git a/app-arch/p7zip/p7zip-4.57-r1.ebuild b/app-arch/p7zip/p7zip-4.57-r1.ebuild
new file mode 100644
index 0000000..1d34f55
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.57-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.57.ebuild,v 1.7 2008/03/16 17:40:56 nixnut Exp $
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha amd64 hppa ~ia64 ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="static doc rcc"
+
+DEPEND="rcc? ( app-i18n/librcc )"
+
+S=${WORKDIR}/${PN}_${PV}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+#SDS
+# Communism forever!
+# Removing nasty removal of non-free code (Rar line). ;)
+#EDS
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e 's:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ ewarn "Using suboptimal -fPIC upstream makefile due to amd64 being detected. See #126722"
+ cp -f makefile.linux_amd64 makefile.machine
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ cp -f makefile.macosx makefile.machine
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+#SDS
+ # patching to not included nonfree RAR decompression code is higher a sed call
+ # But we're removing nonfree code just in case sed wasnt enough
+# rm -rf CPP/7zip/Compress/Rar
+
+ EPATCH_OPTS="-p1" epatch "${FILESDIR}"/p7zip_4.57-libun7zip.patch || die
+ use rcc && ( epatch "${FILESDIR}"/p7zip_4.57-ds-rusxmms.patch || die )
+
+ find . -maxdepth 1 -name "makefile.linux*" -print0 | xargs -0 sed -i -e "s/LOCAL_LIBS=-lpthread/LOCAL_LIBS=-lpthread -lrcc/"
+#EDS
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+#SDS
+ emake -C CPP/7zip/Bundles/Un7Zip || die
+#EDS
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/lib/${PN}/7zr"
+ make_wrapper 7za "/usr/lib/${PN}/7za"
+ make_wrapper 7z "/usr/lib/${PN}/7z"
+
+ dobin "${FILESDIR}/p7zip" || die
+
+ # gzip introduced in 4.42, so beware :)
+ # mv needed just as rename, because dobin installs using old name
+ mv contrib/gzip-like_CLI_wrapper_for_7z/p7zip contrib/gzip-like_CLI_wrapper_for_7z/7zg || die
+ dobin contrib/gzip-like_CLI_wrapper_for_7z/7zg || die
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/*.so || die "doexe *.so files"
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 CPP/7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so || die
+ install -D -m 644 CPP/7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h || die
+#EDS
+
+# einfo "Please be aware that rar support was removed (it's nonfree)"
+# einfo "You can use app-arch/rar for rar support"
+}
diff --git a/app-arch/p7zip/p7zip-4.65-r2.ebuild b/app-arch/p7zip/p7zip-4.65-r2.ebuild
new file mode 100644
index 0000000..5b3eeb5
--- /dev/null
+++ b/app-arch/p7zip/p7zip-4.65-r2.ebuild
@@ -0,0 +1,150 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-4.65.ebuild,v 1.6 2009/05/03 07:12:52 dirtyepic Exp $
+
+EAPI="2"
+WX_GTK_VER="2.8"
+
+inherit eutils toolchain-funcs multilib wxwidgets
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1 rar? ( unRAR )"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd"
+#SDS
+IUSE="doc kde rar static wxwidgets rcc"
+#EDS
+
+RDEPEND="kde? ( x11-libs/wxGTK:2.8[X,-odbc] || ( kde-base/konqueror kde-base/kdebase-meta kde-base/kdebase ) )
+ wxwidgets? ( x11-libs/wxGTK:2.8[X,-odbc] )"
+
+#SDS
+DEPEND="${RDEPEND}
+ rcc? ( app-i18n/librcc )"
+#EDS
+
+S=${WORKDIR}/${PN}_${PV}
+
+pkg_setup() {
+ use wxwidgets && wxwidgets_pkg_setup
+}
+
+src_prepare() {
+ if use kde && ! use wxwidgets ; then
+ einfo "USE-flag kde needs wxwidgets flag"
+ einfo "silently enabling wxwidgets flag"
+ fi
+
+ # remove non-free RAR codec
+ if use rar; then
+ ewarn "Enabling nonfree RAR decompressor"
+ else
+ sed -e '/Rar/d' -i makefile*
+ rm -rf CPP/7zip/Compress/Rar
+ epatch "${FILESDIR}"/${PV}-makefile.patch
+ fi
+
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e 's:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ cp -f makefile.linux_amd64 makefile.machine
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ cp -f makefile.macosx makefile.machine
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+ # We can be more parallel
+ cp -f makefile.parallel_jobs makefile
+
+ epatch "${FILESDIR}"/${PV}-hardlink.patch
+
+#SDS
+ EPATCH_OPTS="-p1" epatch "${FILESDIR}"/p7zip_4.65-libun7zip.patch || die
+ use rcc && ( epatch "${FILESDIR}"/p7zip_4.65-ds-rusxmms.patch || die )
+
+ find . -maxdepth 1 -name "makefile.linux*" -print0 | xargs -0 sed -i -e "s/LOCAL_LIBS=-lpthread/LOCAL_LIBS=-lpthread -lrcc/"
+#EDS
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+ if use kde || use wxwidgets; then
+ emake 7zG || die "error building GUI"
+ fi
+#SDS
+ emake -C CPP/7zip/Bundles/Un7Zip || die
+#EDS
+}
+
+src_test() {
+ emake test_7z test_7zr || die "test failed"
+ if use kde || use wxwidgets; then
+ emake test_7zG || die "GUI test failed"
+ fi
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr"
+ make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za"
+ make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z"
+
+ if use kde || use wxwidgets; then
+ make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG"
+
+ dobin GUI/p7zipForFilemanager
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7zG
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r GUI/{Lang,help}
+
+ if use kde; then
+ insinto /usr/share/icons/hicolor/16x16/apps/
+ newins GUI/p7zip_16_ok.png p7zip.png
+
+ insinto /usr/share/apps/konqueror/servicemenus/
+ doins GUI/kde/*.desktop
+ fi
+ fi
+
+ dobin "${FILESDIR}/p7zip" || die
+
+ # gzip introduced in 4.42, so beware :)
+ newbin contrib/gzip-like_CLI_wrapper_for_7z/p7zip 7zg || die
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ doexe bin/*.so || die "doexe *.so files"
+ if use rar; then
+ exeinto /usr/$(get_libdir)/${PN}/Codecs/
+ doexe bin/Codecs/*.so || die "doexe Codecs/*.so files"
+ fi
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+
+#SDS
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/
+ install -s -D -m 755 CPP/7zip/Bundles/Un7Zip/libun7zip.so ${D}/usr/lib/libun7zip.so || die
+ install -D -m 644 CPP/7zip/Bundles/Un7Zip/u7zip.h ${D}/usr/include/u7zip.h || die
+#EDS
+}
diff --git a/app-arch/p7zip/p7zip-9.13-r2.ebuild b/app-arch/p7zip/p7zip-9.13-r2.ebuild
new file mode 100644
index 0000000..5328241
--- /dev/null
+++ b/app-arch/p7zip/p7zip-9.13-r2.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-9.13.ebuild,v 1.2 2010/07/04 21:58:55 hwoarang Exp $
+
+EAPI="2"
+WX_GTK_VER="2.8"
+
+inherit eutils toolchain-funcs multilib wxwidgets
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1 rar? ( unRAR )"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+#SDS
+IUSE="doc kde rar static wxwidgets rcc"
+#EDS
+
+RDEPEND="kde? ( x11-libs/wxGTK:2.8[X,-odbc] kde-base/konqueror )
+ wxwidgets? ( x11-libs/wxGTK:2.8[X,-odbc] )"
+
+#SDS
+DEPEND="${RDEPEND}
+ rcc? ( app-i18n/librcc )"
+#EDS
+
+
+S=${WORKDIR}/${PN}_${PV}
+
+pkg_setup() {
+ use wxwidgets && wxwidgets_pkg_setup
+}
+
+src_prepare() {
+ if use kde && ! use wxwidgets ; then
+ einfo "USE-flag kde needs wxwidgets flag"
+ einfo "silently enabling wxwidgets flag"
+ fi
+
+ # remove non-free RAR codec
+ if use rar; then
+ ewarn "Enabling nonfree RAR decompressor"
+ else
+ sed -e '/Rar/d' -i makefile*
+ rm -rf CPP/7zip/Compress/Rar
+ epatch "${FILESDIR}"/9.04-makefile.patch
+ fi
+
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e '/ALLFLAGS/s:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ cp -f makefile.linux_amd64 makefile.machine
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ [[ ${CHOST} == *64-* ]] \
+ && cp -f makefile.macosx_64bits makefile.machine \
+ || cp -f makefile.macosx_32bits makefile.machine
+ # bundles have extension .bundle but don't die because USE=-rar
+ # removes the Rar directory
+ sed -i -e '/^PROG=/s/\.so/.bundle/' \
+ CPP/7zip/Bundles/Format7zFree/makefile \
+ CPP/7zip/Compress/Rar/makefile
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+ # We can be more parallel
+ cp -f makefile.parallel_jobs makefile
+
+ epatch "${FILESDIR}"/9.04-kde4.patch
+
+#SDS
+# EPATCH_OPTS="-p1" epatch "${FILESDIR}"/p7zip_4.65-libun7zip.patch || die
+ use rcc && ( epatch "${FILESDIR}"/p7zip_9.13-ds-rusxmms.patch || die )
+
+ find . -maxdepth 1 -name "makefile.linux*" -print0 | xargs -0 sed -i -e "s/LOCAL_LIBS=-lpthread/LOCAL_LIBS=-lpthread -lrcc/"
+#EDS
+
+ if use kde || use wxwidgets; then
+ einfo "Preparing dependency list"
+ emake depend || die
+ fi
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+ if use kde || use wxwidgets; then
+ emake 7zG || die "error building GUI"
+ fi
+}
+
+src_test() {
+ emake test_7z test_7zr || die "test failed"
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr"
+ make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za"
+ make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z"
+
+ if use kde || use wxwidgets; then
+ make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG"
+
+ dobin GUI/p7zipForFilemanager
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7zG
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r GUI/{Lang,help}
+
+ if use kde; then
+ insinto /usr/share/icons/hicolor/16x16/apps/
+ newins GUI/p7zip_16_ok.png p7zip.png
+
+ insinto /usr/share/kde4/services/ServiceMenus
+ doins GUI/kde/*.desktop
+ fi
+ fi
+
+ dobin "${FILESDIR}/p7zip" || die
+
+ # gzip introduced in 4.42, so beware :)
+ newbin contrib/gzip-like_CLI_wrapper_for_7z/p7zip 7zg || die
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ doexe bin/*$(get_modname) || die "doexe *$(get_modname) files"
+ if use rar; then
+ exeinto /usr/$(get_libdir)/${PN}/Codecs/
+ doexe bin/Codecs/*$(get_modname) || die "doexe Codecs/*$(get_modname) files"
+ fi
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+}
diff --git a/app-arch/p7zip/p7zip-9.13-r3.ebuild b/app-arch/p7zip/p7zip-9.13-r3.ebuild
new file mode 100644
index 0000000..961654c
--- /dev/null
+++ b/app-arch/p7zip/p7zip-9.13-r3.ebuild
@@ -0,0 +1,152 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-9.13.ebuild,v 1.2 2010/07/04 21:58:55 hwoarang Exp $
+
+EAPI="2"
+WX_GTK_VER="2.8"
+
+inherit eutils toolchain-funcs multilib wxwidgets
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1 rar? ( unRAR )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+
+#SDS
+IUSE="doc kde rar static wxwidgets rcc"
+#EDS
+
+RDEPEND="kde? ( x11-libs/wxGTK:2.8[X,-odbc] kde-base/konqueror )
+ wxwidgets? ( x11-libs/wxGTK:2.8[X,-odbc] )"
+
+#SDS
+DEPEND="${RDEPEND}
+ rcc? ( app-i18n/librcc )"
+#EDS
+
+
+S=${WORKDIR}/${PN}_${PV}
+
+pkg_setup() {
+ use wxwidgets && wxwidgets_pkg_setup
+}
+
+src_prepare() {
+ if use kde && ! use wxwidgets ; then
+ einfo "USE-flag kde needs wxwidgets flag"
+ einfo "silently enabling wxwidgets flag"
+ fi
+
+ # remove non-free RAR codec
+ if use rar; then
+ ewarn "Enabling nonfree RAR decompressor"
+ else
+ sed -e '/Rar/d' -i makefile*
+ rm -rf CPP/7zip/Compress/Rar
+ epatch "${FILESDIR}"/9.04-makefile.patch
+ fi
+
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "s:OPTFLAGS=-O:OPTFLAGS=${CXXFLAGS}:" \
+ -e '/ALLFLAGS/s:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ cp -f makefile.linux_amd64 makefile.machine
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ [[ ${CHOST} == *64-* ]] \
+ && cp -f makefile.macosx_64bits makefile.machine \
+ || cp -f makefile.macosx_32bits makefile.machine
+ # bundles have extension .bundle but don't die because USE=-rar
+ # removes the Rar directory
+ sed -i -e '/^PROG=/s/\.so/.bundle/' \
+ CPP/7zip/Bundles/Format7zFree/makefile \
+ CPP/7zip/Compress/Rar/makefile
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+ # We can be more parallel
+ cp -f makefile.parallel_jobs makefile
+
+ epatch "${FILESDIR}"/9.04-kde4.patch
+
+#SDS
+# EPATCH_OPTS="-p1" epatch "${FILESDIR}"/p7zip_4.65-libun7zip.patch || die
+ epatch "${FILESDIR}"/p7zip_9.13-ds-dynbuf.patch || die
+ use rcc && ( epatch "${FILESDIR}"/p7zip_9.13-ds-rusxmms.patch || die )
+
+ find . -maxdepth 1 -name "makefile.linux*" -print0 | xargs -0 sed -i -e "s/LOCAL_LIBS=-lpthread/LOCAL_LIBS=-lpthread -lrcc/"
+#EDS
+
+ if use kde || use wxwidgets; then
+ einfo "Preparing dependency list"
+ emake depend || die
+ fi
+}
+
+src_compile() {
+ emake all3 || die "compilation error"
+ if use kde || use wxwidgets; then
+ emake 7zG || die "error building GUI"
+ fi
+}
+
+src_test() {
+ emake test_7z test_7zr || die "test failed"
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr"
+ make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za"
+ make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z"
+
+ if use kde || use wxwidgets; then
+ make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG"
+
+ dobin GUI/p7zipForFilemanager
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7zG
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r GUI/{Lang,help}
+
+ if use kde; then
+ insinto /usr/share/icons/hicolor/16x16/apps/
+ newins GUI/p7zip_16_ok.png p7zip.png
+
+ insinto /usr/share/kde4/services/ServiceMenus
+ doins GUI/kde/*.desktop
+ fi
+ fi
+
+ dobin "${FILESDIR}/p7zip" || die
+
+ # gzip introduced in 4.42, so beware :)
+ newbin contrib/gzip-like_CLI_wrapper_for_7z/p7zip 7zg || die
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx || die "doexe bins"
+ doexe bin/*$(get_modname) || die "doexe *$(get_modname) files"
+ if use rar; then
+ exeinto /usr/$(get_libdir)/${PN}/Codecs/
+ doexe bin/Codecs/*$(get_modname) || die "doexe Codecs/*$(get_modname) files"
+ fi
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc ; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+}
diff --git a/app-arch/p7zip/p7zip-9.20.1-r5.ebuild b/app-arch/p7zip/p7zip-9.20.1-r5.ebuild
new file mode 100644
index 0000000..797a51f
--- /dev/null
+++ b/app-arch/p7zip/p7zip-9.20.1-r5.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/p7zip/p7zip-9.20.1-r4.ebuild,v 1.3 2013/08/04 12:09:02 ago Exp $
+
+EAPI=4
+
+WX_GTK_VER="2.8"
+
+inherit eutils multilib toolchain-funcs wxwidgets
+
+DESCRIPTION="Port of 7-Zip archiver for Unix"
+HOMEPAGE="http://p7zip.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_src_all.tar.bz2"
+
+LICENSE="LGPL-2.1 rar? ( unRAR )"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 ~s390 sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris"
+
+#SDS
+IUSE="doc kde rar +pch static wxwidgets rcc"
+#EDS
+
+REQUIRED_USE="kde? ( wxwidgets )"
+
+RDEPEND="
+ kde? ( x11-libs/wxGTK:2.8[X,-odbc] kde-base/kdelibs )
+ wxwidgets? ( x11-libs/wxGTK:2.8[X,-odbc] )"
+
+#SDS
+DEPEND="${RDEPEND}
+ rcc? ( app-i18n/librcc )
+ amd64? ( dev-lang/yasm )
+ x86? ( dev-lang/nasm )"
+#EDS
+
+S=${WORKDIR}/${PN}_${PV}
+
+pkg_setup() {
+ use wxwidgets && wxwidgets_pkg_setup
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-execstack.patch \
+ "${FILESDIR}"/${P}-QA.patch
+
+ if ! use pch; then
+ sed "s:PRE_COMPILED_HEADER=StdAfx.h.gch:PRE_COMPILED_HEADER=:g" -i makefile.* || die
+ fi
+
+ sed \
+ -e 's:-m32 ::g' \
+ -e 's:-m64 ::g' \
+ -e 's:-O::g' \
+ -e 's:-pipe::g' \
+ -e "/^CC/s:\$(ALLFLAGS):${CFLAGS} \$(ALLFLAGS):g" \
+ -e "/^CXX/s:\$(ALLFLAGS):${CXXFLAGS} \$(ALLFLAGS):g" \
+ -i makefile* || die
+
+ # remove non-free RAR codec
+ if use rar; then
+ ewarn "Enabling nonfree RAR decompressor"
+ else
+ sed -e '/Rar/d' -i makefile* || die
+ rm -rf CPP/7zip/Compress/Rar || die
+ epatch "${FILESDIR}"/9.04-makefile.patch
+ fi
+
+ sed -i \
+ -e "/^CXX=/s:g++:$(tc-getCXX):" \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e '/ALLFLAGS/s:-s ::' \
+ makefile* || die "changing makefiles"
+
+ if use amd64; then
+ cp -f makefile.linux_amd64_asm makefile.machine || die
+ elif use x86; then
+ cp -f makefile.linux_x86_asm_gcc_4.X makefile.machine || die
+ elif [[ ${CHOST} == *-darwin* ]] ; then
+ # Mac OS X needs this special makefile, because it has a non-GNU linker
+ [[ ${CHOST} == *64-* ]] \
+ && cp -f makefile.macosx_64bits makefile.machine \
+ || cp -f makefile.macosx_32bits makefile.machine
+ # bundles have extension .bundle but don't die because USE=-rar
+ # removes the Rar directory
+ sed -i -e '/strcpy(name/s/\.so/.bundle/' \
+ CPP/Windows/DLL.cpp || die
+ sed -i -e '/^PROG=/s/\.so/.bundle/' \
+ CPP/7zip/Bundles/Format7zFree/makefile \
+ $(use rar && echo CPP/7zip/Compress/Rar/makefile) || die
+ elif use x86-fbsd; then
+ # FreeBSD needs this special makefile, because it hasn't -ldl
+ sed -e 's/-lc_r/-pthread/' makefile.freebsd > makefile.machine
+ fi
+
+ use static && sed -i -e '/^LOCAL_LIBS=/s/LOCAL_LIBS=/&-static /' makefile.machine
+
+#SDS
+# epatch "${FILESDIR}"/p7zip_9.13-ds-dynbuf.patch || die
+ use rcc && ( epatch "${FILESDIR}"/p7zip_9.13-ds-rusxmms.patch || die )
+
+ find . -maxdepth 1 -name "makefile.linux*" -print0 | xargs -0 sed -i -e "s/LOCAL_LIBS=-lpthread/LOCAL_LIBS=-lpthread -lrcc/"
+#EDS
+
+ if use kde || use wxwidgets; then
+ einfo "Preparing dependency list"
+ emake depend
+ fi
+}
+
+src_compile() {
+ emake all3
+ if use kde || use wxwidgets; then
+ emake -- 7zG
+ emake -- 7zFM
+ fi
+}
+
+src_test() {
+ emake test test_7z test_7zr
+}
+
+src_install() {
+ # this wrappers can not be symlinks, p7zip should be called with full path
+ make_wrapper 7zr "/usr/$(get_libdir)/${PN}/7zr"
+ make_wrapper 7za "/usr/$(get_libdir)/${PN}/7za"
+ make_wrapper 7z "/usr/$(get_libdir)/${PN}/7z"
+
+ if use kde || use wxwidgets; then
+ make_wrapper 7zG "/usr/$(get_libdir)/${PN}/7zG"
+ make_wrapper 7zFM "/usr/$(get_libdir)/${PN}/7zFM"
+
+ make_desktop_entry 7zFM "${PN} FM" ${PN}.png "GTK;Utility;Archiving;Compression"
+ make_desktop_entry 7zG "${PN} GUI" ${PN}.png "GTK;Utility;Archiving;Compression"
+
+ dobin GUI/p7zipForFilemanager
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z{G,FM}
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r GUI/{Lang,help}
+
+ insinto /usr/share/icons/hicolor/16x16/apps/
+ newins GUI/p7zip_16_ok.png p7zip.png
+
+ if use kde; then
+
+ rm GUI/kde4/p7zip_compress.desktop
+ insinto /usr/share/kde4/services/ServiceMenus
+ doins GUI/kde4/*.desktop
+ fi
+ fi
+
+ dobin contrib/gzip-like_CLI_wrapper_for_7z/p7zip
+ doman contrib/gzip-like_CLI_wrapper_for_7z/man1/p7zip.1
+
+ exeinto /usr/$(get_libdir)/${PN}
+ doexe bin/7z bin/7za bin/7zr bin/7zCon.sfx
+ doexe bin/*$(get_modname)
+ if use rar; then
+ exeinto /usr/$(get_libdir)/${PN}/Codecs/
+ doexe bin/Codecs/*$(get_modname)
+ fi
+
+ doman man1/7z.1 man1/7za.1 man1/7zr.1
+ dodoc ChangeLog README TODO
+
+ if use doc; then
+ dodoc DOCS/*.txt
+ dohtml -r DOCS/MANUAL/*
+ fi
+}
diff --git a/app-arch/ruszip/Manifest b/app-arch/ruszip/Manifest
new file mode 100644
index 0000000..367b9de
--- /dev/null
+++ b/app-arch/ruszip/Manifest
@@ -0,0 +1,6 @@
+AUX zip-2.3-unix_configure-pic.patch 444 RMD160 8fd81ff732abe0e6189cd593c98e0055a11dca36 SHA1 c08486c683a9a8d02dbb0d500f421b07c0bcc704 SHA256 3e348be7890f21280fceab6cb2a87f3020b08a31608ab93d1b5a53667760e556
+AUX zip-2.31-exec-stack.patch 407 RMD160 a27f0112dbbda418feef97b66240442190e8b5d7 SHA1 3043e8150222749b6f05fc10f8ab1c15da21c8d0 SHA256 108686d8854096422bd4895690a37202aee66757d0d2b43afa16d9fb914cbb29
+AUX zip-2.32-build.patch 2003 RMD160 3356051c53465fa70015818b6c8c364489bb5bf0 SHA1 34492ef0e226ff7912de01c9266580b148ff54f1 SHA256 3e4b94015c1448c8769d7154b308bd986e1d0e6e514da151d658d1b8ba3a774c
+AUX zip232-ds-recoderus.patch 4337 RMD160 506017b6a9be390a655e9e34a2c2d1cf91e85589 SHA1 52746bd086356085a1788547116c1132edd570a4 SHA256 a0e69f760c98fd900cffd31e8e02085189fc66c786be09784f64191401805530
+DIST zip232.tar.gz 807180 RMD160 6b9326c8a60bc6bf08825e416140fd0ca8a6a7f1 SHA1 5bc562bf95d9aee0cb6625e6038898e1f191a4aa SHA256 d0d3743f732a9baa162f80d0c4567b9c545b41a3385825042113810f2a56eb2f
+EBUILD ruszip-2.32-r1.ebuild 1041 RMD160 2dfe64ee0cd4e4dfe036746332f34aec14cf0c7b SHA1 6475d9f51b6afd11a9c1776c40bfcaecc40c04be SHA256 5232b35d2fddf8a207ba919b146847e8df9c8900f0627f9a70883d78211f6557
diff --git a/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch b/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch
new file mode 100644
index 0000000..45b137b
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.3-unix_configure-pic.patch
@@ -0,0 +1,12 @@
+--- unix/configure.orig 2004-09-28 06:45:33.000000000 +0000
++++ unix/configure 2004-09-28 06:54:53.000000000 +0000
+@@ -29,6 +29,9 @@
+
+ echo Check if we can use asm code
+ OBJA=""
++piclib="$(echo | $CPP -dM $CFLAGS - | grep -i __pic__)"
++echo "Checking if compiler wants to create pic code"
++[ "$piclib" == "" ] && \
+ if eval "$CPP match.S > _match.s 2>/dev/null"; then
+ if test ! -s _match.s || grep error < _match.s > /dev/null; then
+ :
diff --git a/app-arch/ruszip/files/zip-2.31-exec-stack.patch b/app-arch/ruszip/files/zip-2.31-exec-stack.patch
new file mode 100644
index 0000000..d3efbd9
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.31-exec-stack.patch
@@ -0,0 +1,20 @@
+--- zip-2.31/crc_i386.S
++++ zip-2.31/crc_i386.S
+@@ -238,3 +238,7 @@
+ #endif /* i386 || _i386 || _I386 || __i386 */
+
+ #endif /* !USE_ZLIB */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
+--- zip-2.31/match.S
++++ zip-2.31/match.S
+@@ -405,3 +405,7 @@
+ #endif /* i386 || _I386 || _i386 || __i386 */
+
+ #endif /* !USE_ZLIB */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",@progbits
++#endif
diff --git a/app-arch/ruszip/files/zip-2.32-build.patch b/app-arch/ruszip/files/zip-2.32-build.patch
new file mode 100644
index 0000000..61a2bae
--- /dev/null
+++ b/app-arch/ruszip/files/zip-2.32-build.patch
@@ -0,0 +1,89 @@
+respect build environment settings
+
+--- zip/unix/Makefile
++++ zip/unix/Makefile
+@@ -12,15 +12,15 @@
+
+ list: all
+
+-MAKE = make -f unix/Makefile
++MAKE := $(MAKE) -f unix/Makefile
+ SHELL = /bin/sh
+ LN = ln -s
+
+ # (to use the Gnu compiler, change cc to gcc in CC)
+-CC = cc
++CC ?= gcc
+ BIND = $(CC)
+ AS = $(CC) -c
+-CPP = /lib/cpp
++CPP ?= $(CC)
+ EXE =
+
+ # probably can change this to 'install' if you have it
+@@ -47,7 +47,7 @@
+ # LFLAGS1 flags after output file spec, before obj file list
+ # LFLAGS2 flags after obj file list (libraries, etc)
+ CFLAGS_NOOPT = -I. -DUNIX $(LOCAL_ZIP)
+-CFLAGS = -O2 $(CFLAGS_NOOPT)
++CFLAGS ?= -O2 $(CFLAGS_NOOPT)
+ LFLAGS1 =
+ LFLAGS2 = -s
+
+--- zip/unix/configure
++++ zip/unix/configure
+@@ -13,52 +13,13 @@
+
+ CC=${1-cc}
+-CFLAGS=${2-"-I. -DUNIX"}
+-LFLAGS1=""
++CFLAGS="${2--I. -DUNIX} ${CFLAGS} ${CPPFLAGS}"
++LFLAGS1="${LDFLAGS}"
+ LN="ln -s"
+-echo "Check C compiler type (optimization option)"
+-cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __SUNPRO_C
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+-$CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+-if test $? -eq 0; then
+- echo ' Sun C (-xO3)'
+- CFLAGS="${CFLAGS} -xO3"
+-else
+- cat > conftest.c << _EOF_
+-int main()
+-{
+-#ifndef __DECC
+- bad code
+-#endif
+- return 0;
+-}
+-_EOF_
+- $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
+- if test $? -eq 0; then
+- echo ' DEC C (-O3)'
+- CFLAGS="${CFLAGS} -O3"
+- else
+- echo ' Other (gcc?) (-O2)'
+- CFLAGS="${CFLAGS} -O2"
+- fi
+-fi
+
+ echo Check for the C preprocessor
+ # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
+ CPP="${CC} -E"
+ # solaris as(1) needs -P, maybe others as well ?
+-[ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
+-[ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
+-[ -f /lib/cpp ] && CPP=/lib/cpp
+-[ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
+-[ -f /xenix ] && CPP="${CC} -E"
+-[ -f /lynx.os ] && CPP="${CC} -E"
+
+ echo "#include <stdio.h>" > conftest.c
+ $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
diff --git a/app-arch/ruszip/files/zip232-ds-recoderus.patch b/app-arch/ruszip/files/zip232-ds-recoderus.patch
new file mode 100644
index 0000000..de3e337
--- /dev/null
+++ b/app-arch/ruszip/files/zip232-ds-recoderus.patch
@@ -0,0 +1,165 @@
+diff -dPNur zip-2.32/unix/dsrecode.h zip-2.32-2/unix/dsrecode.h
+--- zip-2.32/unix/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ zip-2.32-2/unix/dsrecode.h 2008-10-07 11:22:48.000000000 +0200
+@@ -0,0 +1,130 @@
++/******* WARNING: Multi-byte output encodings isn't supported! Comments
++may been striped!!!!
++I don't close 2 opened iconv descriptors. I think this wouldn't cause any
++problem. *******/
++
++#include <iconv.h>
++#include <errno.h>
++#include <locale.h>
++
++#define CHARSET_MAX_STRING_SIZE 4096
++#define LOCALE_STRING_LENGTH 64
++#define CHARSET_MAX_ERRORS 0
++#define ENV_VARIABLE "LC_CTYPE"
++#define LOCALE_VARIABLE LC_CTYPE
++
++static iconv_t ds_oem = (iconv_t)-1;
++static iconv_t ds_iso = (iconv_t)-1;
++
++extern int errno;
++static char xmms_charset_tmp[CHARSET_MAX_STRING_SIZE];
++static char charset_default[LOCALE_STRING_LENGTH]="";
++
++// Multi-byte strings still unsupported
++static void iconv_copysymbol(char **in_buf, size_t *in_left, char **out_buf, size_t *out_left) {
++ if ((out_left>0)&&(in_left>0)) {
++ (**out_buf)=(**in_buf);
++ (*out_buf)++;
++ (*in_buf)++;
++ (*in_left)--;
++ (*out_left)--;
++ }
++}
++
++static char *ds_recode(iconv_t icnv, char *buf, size_t len, size_t *rlen) {
++ char *in_buf, *out_buf, *res, err;
++ size_t in_left, out_left, olen;
++ int errors=0;
++
++ if (!len) {
++ len=strlen(buf);
++ } else {
++ olen=strlen(buf);
++ if (olen<len) len=olen;
++ }
++
++ if (iconv(icnv, NULL, NULL, NULL, NULL) == -1) return NULL;
++
++ in_buf = buf;
++ in_left = len;
++ out_buf = xmms_charset_tmp;
++ out_left = CHARSET_MAX_STRING_SIZE;
++
++loop:
++ err=iconv(icnv, &in_buf, &in_left, &out_buf, &out_left);
++ if (err<0) {
++ if (errno==E2BIG) {
++ *(int*)(xmms_charset_tmp+(CHARSET_MAX_STRING_SIZE-sizeof(int)))=0;
++ } else if (errno==EILSEQ) {
++ if (errors<CHARSET_MAX_ERRORS) {
++ errors++;
++ iconv_copysymbol(&in_buf, &in_left, &out_buf, &out_left);
++ if (in_left>0) goto loop;
++ } else return NULL;
++ } else return NULL;
++ }
++
++ olen = CHARSET_MAX_STRING_SIZE - out_left;
++ res = malloc(olen+1);
++ if (!res) return NULL;
++
++ memcpy(res,xmms_charset_tmp,olen);
++ res[olen]=0;
++ if (rlen) *rlen=olen;
++ return res;
++}
++
++
++static void charset_setdefault() {
++ char *str1, *str2;
++ str1 = (char*)setlocale(LOCALE_VARIABLE, NULL);
++ if (str1) {
++ if (!strcasecmp(str1,"C")) {
++ setlocale(LC_ALL, "");
++ str1 = setlocale(LOCALE_VARIABLE, NULL);
++ }
++ } else str1 = getenv(ENV_VARIABLE);
++ if (str1) {
++ str2 = strrchr(str1,'.');
++ if (str2) {
++ strncpy(charset_default,str2+1,LOCALE_STRING_LENGTH);
++ charset_default[LOCALE_STRING_LENGTH-1]=0;
++ str2 = strchr(charset_default,'@');
++ if (str2) *str2 = 0;
++ } else {
++ strcpy(charset_default,"KOI8-R");
++ }
++ } else {
++ strcpy(charset_default,"KOI8-R");
++ }
++}
++
++void ds_ex2in(char *string) {
++ char *str;
++ if (ds_oem == (iconv_t)-1) {
++ if (!charset_default[0]) charset_setdefault();
++ ds_oem = iconv_open("CP866",charset_default);
++ if (!ds_oem) return;
++ }
++ str=ds_recode(ds_oem,string,0,NULL);
++ if (str) {
++ strncpy(string,str,strlen(string)+1);
++ free(str);
++ }
++}
++
++void ds_in2ex(char *dst, char *string) {
++ char *str;
++ if (ds_iso == (iconv_t)-1) {
++ if (!charset_default[0]) charset_setdefault();
++ ds_iso = iconv_open(charset_default, "CP866");
++ if (!ds_iso) return;
++ }
++ str=ds_recode(ds_iso,string,0,NULL);
++ if (str) {
++ strncpy(dst,str,strlen(string)+1);
++ free(str);
++ } else {
++ strncpy(dst,string,strlen(string)+1);
++ }
++}
+diff -dPNur zip-2.32/unix/unix.c zip-2.32-2/unix/unix.c
+--- zip-2.32/unix/unix.c 2006-05-30 00:35:00.000000000 +0200
++++ zip-2.32-2/unix/unix.c 2008-10-07 11:23:45.000000000 +0200
+@@ -219,6 +219,8 @@
+ return ZE_OK;
+ }
+
++#include "dsrecode.h"
++
+ char *ex2in(x, isdir, pdosflag)
+ char *x; /* external file name */
+ int isdir; /* input: x is a directory */
+@@ -266,6 +268,8 @@
+
+ #ifdef EBCDIC
+ strtoasc(n, n); /* here because msname() needs native coding */
++#else
++ ds_ex2in(n);
+ #endif
+
+ /* Returned malloc'ed name */
+@@ -288,7 +292,8 @@
+ #ifdef EBCDIC
+ strtoebc(x, n);
+ #else
+- strcpy(x, n);
++// strcpy(x, n);
++ ds_in2ex(x,n);
+ #endif
+ return x;
+ }
diff --git a/app-arch/ruszip/ruszip-2.32-r1.ebuild b/app-arch/ruszip/ruszip-2.32-r1.ebuild
new file mode 100644
index 0000000..a38b851
--- /dev/null
+++ b/app-arch/ruszip/ruszip-2.32-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/zip/zip-2.32-r1.ebuild,v 1.8 2008/03/17 16:06:43 jer Exp $
+
+inherit toolchain-funcs eutils flag-o-matic
+
+DESCRIPTION="Info ZIP (encryption support) with CP866 recoding"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="ftp://ftp.info-zip.org/pub/infozip/src/zip${PV//.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="crypt"
+
+DEPEND=""
+
+#SDS
+S=${WORKDIR}/zip-${PV}
+#EDS
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/zip-2.3-unix_configure-pic.patch
+ epatch "${FILESDIR}"/zip-2.31-exec-stack.patch
+ epatch "${FILESDIR}"/zip-2.32-build.patch
+
+#SDS
+ epatch "${FILESDIR}"/zip232-ds-recoderus.patch
+#EDS
+}
+
+src_compile() {
+ tc-export CC CPP
+ use crypt || append-flags -DNO_CRYPT
+ append-lfs-flags
+ emake -f unix/Makefile generic || die
+}
+
+src_install() {
+#SDS
+ mv zip ruszip
+ dobin ruszip || die
+#EDS
+}
diff --git a/app-arch/unrar/Manifest b/app-arch/unrar/Manifest
new file mode 100644
index 0000000..0d97f37
--- /dev/null
+++ b/app-arch/unrar/Manifest
@@ -0,0 +1,11 @@
+AUX ftello_unrar_fix.patch 728 RMD160 cade46d01838baf26a44bf16f25133dec48974b7 SHA1 4aa3dd00ac19d76dc3d1c2e31015795e2408aa61 SHA256 79684ddb1efe9887225ad2f7f238b99ab7252a00616a68374425fafb7505690d
+AUX unrar-3.4.3_fix.patch 2167 RMD160 b332302c5dee6b3350d47014091fd6f39819d354 SHA1 fef7e65557c56861b4829cac8fadad2a37244c69 SHA256 970f41fbdf00397897ea201bc110ea6d028965061f4080b05e279f207b1856fd
+AUX unrar-3.5.3_fix.patch 1638 RMD160 3dadc43791e46d58ad77010d543b0a270abc003f SHA1 849bd263d693482b3c03b1bb1e039328d80b623d SHA256 da6c379c0b35ed47e76b29aaf881c53c8339e20432eb418ff6e53fa7bdc15a46
+DIST unrarsrc-3.4.3.tar.gz 120462 RMD160 ea0ce9915f8d29dc21e2cc22f811d2a14997de9d SHA1 ab9c9c6f55e4e13ada0b5aa74d58bdf5d0133dcc SHA256 f53533b44a9c17972aff6ac7047c6ac1e2e5e2930254eccdb1239678a6dd1793
+DIST unrarsrc-3.5.4.tar.gz 122801 RMD160 f8fd81e1e1b74bfd05eacf23d04b57a80fec3faa SHA1 e0bf07f8a36b738b1ed033b767155f27b51fc408 SHA256 caf75266a359456398b0bbfa4ea9c1c2d3fcc9088bfe6a1309bf51e3d5376989
+DIST unrarsrc-3.6.5.tar.gz 125045 RMD160 9aa3b60595a76208390655fa7a51127accb4b434 SHA1 2388fd40b2c8a0ce19f2eaa3dbd3b509e28a7b58 SHA256 34f3bfbe7d5e34f5dc5735d95e77670b4b1099f5a3059389a71750a58864236f
+DIST unrarsrc-3.7.3.tar.gz 129328 RMD160 155a244a149937bb5f91ea8041177bdb6fe6f788 SHA1 d4ba5c8f3acff759a847315697d418c089382d95 SHA256 fd91c11864746eaa7b70c8c47ed5e9e1c2f29a15a1e60550f185756599795999
+EBUILD unrar-3.4.3-r1.ebuild 1451 RMD160 aa4aae7bb14d7bfa54b8be766091616aaf345f4d SHA1 9a0a9e28711be0cd2ac01a8b667ef1fb7a87fcd6 SHA256 dbfa86937fb4667e14b2f2864addcc058e28a824a9ca461a09c2ca134da2e428
+EBUILD unrar-3.5.4-r2.ebuild 1250 RMD160 7924dc71ad4b1cce138d5b301a9051418d3a6025 SHA1 5b98e515b57db9ad388d9cea93471b0cd9a4b462 SHA256 288452c214aa6039e5c007ab2efb037c5df3c75f64252a7f519322e9199103f0
+EBUILD unrar-3.6.5-r1.ebuild 1346 RMD160 0486e6176c9e61aa7250ba13916175298221ed4d SHA1 07f5fe0f78d618698357ea4a8e79220cb59325ae SHA256 5cc172a75d74e327c126cf19d07e6ef337b5ba5ca5c79d6155012b782c336fa1
+EBUILD unrar-3.7.3-r1.ebuild 1339 RMD160 99d7dde283838f8b80b120337916a8d300e1dbf6 SHA1 627f48ac4ffa46d541593e4734d7fcd028cd7f22 SHA256 d7a3b2f5bb65aa7459c1cfcec5aa8cbf3a198382efde2abba54781656b4e2ac5
diff --git a/app-arch/unrar/files/ftello_unrar_fix.patch b/app-arch/unrar/files/ftello_unrar_fix.patch
new file mode 100644
index 0000000..a5f0d62
--- /dev/null
+++ b/app-arch/unrar/files/ftello_unrar_fix.patch
@@ -0,0 +1,16 @@
+diff -ruN unrar.orig/dll.cpp unrar/dll.cpp
+--- unrar.orig/dll.cpp 2005-08-03 20:34:30.000000000 +0400
++++ unrar/dll.cpp 2006-01-11 12:13:33.000000000 +0300
+@@ -271,8 +271,10 @@
+ strcpy(Data->Cmd.Command,Operation==RAR_EXTRACT ? "X":"T");
+ Data->Cmd.Test=Operation!=RAR_EXTRACT;
+ bool Repeat=false;
+- Data->Extract.ExtractCurrentFile(&Data->Cmd,Data->Arc,Data->HeaderSize,Repeat);
+-
++
++ if(Data->Extract.ExtractCurrentFile(&Data->Cmd,Data->Arc,Data->HeaderSize,Repeat) == false)
++ return (ERAR_UNKNOWN);
++
+ while (Data->Arc.ReadHeader()!=0 && Data->Arc.GetHeaderType()==NEWSUB_HEAD)
+ {
+ Data->Extract.ExtractCurrentFile(&Data->Cmd,Data->Arc,Data->HeaderSize,Repeat);
diff --git a/app-arch/unrar/files/unrar-3.4.3_fix.patch b/app-arch/unrar/files/unrar-3.4.3_fix.patch
new file mode 100644
index 0000000..aaa768e
--- /dev/null
+++ b/app-arch/unrar/files/unrar-3.4.3_fix.patch
@@ -0,0 +1,71 @@
+diff -ruN unrar.orig/consio.hpp unrar/consio.hpp
+--- unrar.orig/consio.hpp 2004-09-08 17:57:20.000000000 +0400
++++ unrar/consio.hpp 2004-10-22 10:43:08.000000000 +0400
+@@ -21,12 +21,16 @@
+ void OutComment(char *Comment,int Size);
+
+ #ifdef SILENT
++/*
+ inline void mprintf(const char *fmt,const char *a=NULL,const char *b=NULL) {}
+ inline void eprintf(const char *fmt,const char *a=NULL,const char *b=NULL) {}
+ inline void mprintf(const char *fmt,int b) {}
+ inline void eprintf(const char *fmt,int b) {}
+ inline void mprintf(const char *fmt,const char *a,int b) {}
+ inline void eprintf(const char *fmt,const char *a,int b) {}
++*/
++inline void mprintf(const char *fmt,...) {}
++inline void eprintf(const char *fmt,...) {}
+ inline void Alarm() {}
+ inline void GetPasswordText(char *Str,int MaxLength) {}
+ inline unsigned int GetKey() {return(0);}
+diff -ruN unrar.orig/dll.hpp unrar/dll.hpp
+--- unrar.orig/dll.hpp 2004-09-08 17:57:20.000000000 +0400
++++ unrar/dll.hpp 2004-10-22 10:43:08.000000000 +0400
+@@ -26,13 +26,13 @@
+
+ #define RAR_DLL_VERSION 4
+
+-#ifdef _UNIX
++//#ifdef _UNIX
+ #define CALLBACK
+ #define PASCAL
+ #define LONG long
+ #define HANDLE void *
+ #define UINT unsigned int
+-#endif
++//#endif
+
+ struct RARHeaderData
+ {
+diff -ruN unrar.orig/makefile.unix unrar/makefile.unix
+--- unrar.orig/makefile.unix 2004-07-26 11:57:26.000000000 +0400
++++ unrar/makefile.unix 2004-10-22 10:44:09.000000000 +0400
+@@ -7,9 +7,10 @@
+
+ # Linux using GCC
+ CXX=g++
+-CXXFLAGS=-O2
+-DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
++CXXFLAGS=-O2 -fPIC -DPIC
++DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DGUI -DSILENT
+ STRIP=strip
++RANLIB=ranlib
+
+ # Linux using LCC
+ #CXX=lcc
+@@ -114,6 +115,12 @@
+ $(STRIP) default.sfx
+
+ lib: WHAT=RARDLL
+-lib: $(OBJECTS) $(LIB_OBJ)
+- @rm -f libunrar.so
+- $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
++lib: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ @rm -f libunrar3.so
++ $(LINK) -shared -o libunrar3.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++
++liba: WHAT=RARDLL
++liba: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ @rm -f libunrar3.a
++ $(AR) rc libunrar3.a $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ $(RANLIB) libunrar3.a
diff --git a/app-arch/unrar/files/unrar-3.5.3_fix.patch b/app-arch/unrar/files/unrar-3.5.3_fix.patch
new file mode 100644
index 0000000..aedb98c
--- /dev/null
+++ b/app-arch/unrar/files/unrar-3.5.3_fix.patch
@@ -0,0 +1,60 @@
+diff -ruN unrar.orig/makefile.unix unrar/makefile.unix
+--- unrar.orig/makefile.unix 2005-04-30 11:00:12.000000000 +0400
++++ unrar/makefile.unix 2005-05-19 16:13:53.000000000 +0400
+@@ -7,9 +7,10 @@
+
+ # Linux using GCC
+ CXX=g++
+-CXXFLAGS=-O2
+-DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
++CXXFLAGS=-O2 -fPIC -DPIC
++DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DGUI -DSILENT
+ STRIP=strip
++RANLIB=ranlib
+
+ # Linux using LCC
+ #CXX=lcc
+@@ -86,7 +87,7 @@
+ LINK=$(CXX)
+
+ UNRAR_OBJ=filestr.o recvol.o rs.o scantree.o
+-LIB_OBJ=filestr.o scantree.o dll.o
++LIB_OBJ=dll.o
+
+ OBJECTS=rar.o strlist.o strfn.o pathfn.o int64.o savepos.o global.o file.o filefn.o filcreat.o \
+ archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o encname.o \
+@@ -114,6 +115,12 @@
+ $(STRIP) default.sfx
+
+ lib: WHAT=RARDLL
+-lib: $(OBJECTS) $(LIB_OBJ)
+- @rm -f libunrar.so
+- $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
++lib: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ @rm -f libunrar3.so
++ $(LINK) -shared -o libunrar3.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++
++liba: WHAT=RARDLL
++liba: $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ @rm -f libunrar3.a
++ $(AR) rc libunrar3.a $(OBJECTS) $(LIB_OBJ) $(UNRAR_OBJ)
++ $(RANLIB) libunrar3.a
+diff -ruN unrar.orig/dll.hpp unrar/dll.hpp
+--- unrar.orig/dll.hpp 2004-09-08 17:57:20.000000000 +0400
++++ unrar/dll.hpp 2004-10-22 10:43:08.000000000 +0400
+@@ -26,13 +26,13 @@
+
+ #define RAR_DLL_VERSION 4
+
+-#ifdef _UNIX
++//#ifdef _UNIX
+ #define CALLBACK
+ #define PASCAL
+ #define LONG long
+ #define HANDLE void *
+ #define UINT unsigned int
+-#endif
++//#endif
+
+ struct RARHeaderData
+ {
diff --git a/app-arch/unrar/unrar-3.4.3-r1.ebuild b/app-arch/unrar/unrar-3.4.3-r1.ebuild
new file mode 100644
index 0000000..d4713f1
--- /dev/null
+++ b/app-arch/unrar/unrar-3.4.3-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unrar/unrar-3.4.3.ebuild,v 1.11 2005/04/08 10:49:37 corsair Exp $
+
+#SDS
+inherit eutils
+#EDS
+
+MY_PN=${PN}src
+DESCRIPTION="Uncompress rar files"
+HOMEPAGE="http://www.rarlab.com/rar_add.htm"
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="unRAR"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ppc ppc64 ppc-macos sparc x86"
+IUSE=""
+
+DEPEND="!app-arch/unrar-gpl"
+
+S="${WORKDIR}/unrar"
+
+#SDS
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+# EPATCH_OPTS="-p1" epatch ${FILESDIR}/unrar-3.4.3_fix.patch || die
+}
+#EDS
+
+src_compile() {
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" || die "emake failed"
+#SDS
+# emake -f makefile.unix CXXFLAGS="$CXXFLAGS" lib || die "emake failed"
+#EDS
+}
+
+src_install() {
+ dobin unrar || die "dobin failed"
+ dodoc readme.txt
+#SDS
+ EPATCH_OPTS="-p1" epatch ${FILESDIR}/unrar-3.4.3_fix.patch || die
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" clean || die "emake failed"
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" lib || die "emake failed"
+
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/libunrar3/
+ install -s -D -m 755 libunrar3.so ${D}/usr/lib/libunrar3.so
+ install -D -m 644 dll.hpp ${D}/usr/include/libunrar3/dll.hpp
+#EDS
+}
diff --git a/app-arch/unrar/unrar-3.5.4-r2.ebuild b/app-arch/unrar/unrar-3.5.4-r2.ebuild
new file mode 100644
index 0000000..10231c0
--- /dev/null
+++ b/app-arch/unrar/unrar-3.5.4-r2.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unrar/unrar-3.5.4.ebuild,v 1.1 2005/11/09 01:38:07 vapier Exp $
+
+inherit eutils
+
+MY_PN=${PN}src
+DESCRIPTION="Uncompress rar files"
+HOMEPAGE="http://www.rarlab.com/rar_add.htm"
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="unRAR"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~hppa ~ppc ~ppc-macos ~ppc64 ~sparc x86"
+IUSE=""
+
+DEPEND="!app-arch/unrar-gpl"
+
+S=${WORKDIR}/unrar
+
+src_compile() {
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" || die "emake failed"
+}
+
+src_install() {
+ dobin unrar || die "dobin failed"
+ dodoc readme.txt
+#SDS
+ epatch "${FILESDIR}"/unrar-3.5.3_fix.patch || die
+ epatch "${FILESDIR}"/ftello_unrar_fix.patch || die
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" clean || die "emake failed"
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" lib || die "emake failed"
+
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/libunrar3/
+ install -s -D -m 755 libunrar3.so ${D}/usr/lib/libunrar3.so
+ install -D -m 644 dll.hpp ${D}/usr/include/libunrar3/dll.hpp
+#EDS
+}
diff --git a/app-arch/unrar/unrar-3.6.5-r1.ebuild b/app-arch/unrar/unrar-3.6.5-r1.ebuild
new file mode 100644
index 0000000..9369a90
--- /dev/null
+++ b/app-arch/unrar/unrar-3.6.5-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unrar/unrar-3.6.5.ebuild,v 1.1 2006/06/17 22:07:03 vapier Exp $
+
+#SDS
+inherit eutils
+#EDS
+
+inherit toolchain-funcs
+
+MY_PN=${PN}src
+DESCRIPTION="Uncompress rar files"
+HOMEPAGE="http://www.rarlab.com/rar_add.htm"
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="unRAR"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~hppa ~ppc ~ppc-macos ~ppc64 ~sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND="!app-arch/unrar-gpl"
+
+S=${WORKDIR}/unrar
+
+src_compile() {
+ emake \
+ -f makefile.unix \
+ CXXFLAGS="${CXXFLAGS}" \
+ CXX="$(tc-getCXX)" \
+ STRIP="true" || die "emake failed"
+}
+
+src_install() {
+ dobin unrar || die "dobin failed"
+ dodoc readme.txt
+
+#SDS
+ epatch "${FILESDIR}"/unrar-3.5.3_fix.patch || die
+ epatch "${FILESDIR}"/ftello_unrar_fix.patch || die
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" clean || die "emake failed"
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" lib || die "emake failed"
+
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/libunrar3/
+ install -s -D -m 755 libunrar3.so ${D}/usr/lib/libunrar3.so
+ install -D -m 644 dll.hpp ${D}/usr/include/libunrar3/dll.hpp
+#EDS
+}
diff --git a/app-arch/unrar/unrar-3.7.3-r1.ebuild b/app-arch/unrar/unrar-3.7.3-r1.ebuild
new file mode 100644
index 0000000..b3e6fd6
--- /dev/null
+++ b/app-arch/unrar/unrar-3.7.3-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unrar/unrar-3.7.3.ebuild,v 1.9 2007/02/17 15:12:18 vapier Exp $
+
+#SDS
+inherit toolchain-funcs eutils
+#EDS
+
+
+MY_PN=${PN}src
+DESCRIPTION="Uncompress rar files"
+HOMEPAGE="http://www.rarlab.com/rar_add.htm"
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="unRAR"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND="!app-arch/unrar-gpl"
+
+S=${WORKDIR}/unrar
+
+src_compile() {
+ emake \
+ -f makefile.unix \
+ CXXFLAGS="${CXXFLAGS}" \
+ CXX="$(tc-getCXX)" \
+ STRIP="true" || die "emake failed"
+}
+
+src_install() {
+ dobin unrar || die "dobin failed"
+ dodoc readme.txt
+
+#SDS
+ epatch "${FILESDIR}"/unrar-3.5.3_fix.patch || die
+ epatch "${FILESDIR}"/ftello_unrar_fix.patch || die
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" clean || die "emake failed"
+ emake -f makefile.unix CXXFLAGS="$CXXFLAGS" lib || die "emake failed"
+
+ mkdir -p ${D}/usr/lib/
+ mkdir -p ${D}/usr/include/libunrar3/
+ install -s -D -m 755 libunrar3.so ${D}/usr/lib/libunrar3.so
+ install -D -m 644 dll.hpp ${D}/usr/include/libunrar3/dll.hpp
+#EDS
+}
diff --git a/app-arch/unzip/Manifest b/app-arch/unzip/Manifest
new file mode 100644
index 0000000..b3e5e92
--- /dev/null
+++ b/app-arch/unzip/Manifest
@@ -0,0 +1,18 @@
+AUX librcc-0.2.7.h 62364 RMD160 d0c2ac61cfd9b9cd9fd038e14d6b9a4d79dc39b9 SHA1 9ea2c8a2d5d0ba2aef5ddcebf193f7391bcbb842 SHA256 64505886d4d68aac32b07bb69734bc932cea7eb3bf858b2cd5d4609595f06e7e
+AUX unzip-5.50-dotdot.patch 3195 RMD160 96b71d43c80ca9fb077c14184e416fa326bddf07 SHA1 2797603c3c749270b88786c9e4e10f119c2f83a1 SHA256 9b7e5cac2d23f840e3d9c9aff553649383c20acb0945d60dfca80b99c74a1666
+AUX unzip-5.52-CVE-2008-0888.patch 1075 RMD160 03d5ec7845ae9347a197c7d1484bb2d9ab96cb93 SHA1 a72e703048ddd2226d430b7375b531320997b98a SHA256 a93b927000ff5923c3e84fc4108a0f19d76a3a057a33556a2f761c18b270f87c
+AUX unzip-5.52-ds-rusxmms.patch 4353 RMD160 a318c923afe145da5b7b8a0870fd4097851c1ada SHA1 a2f3679246b0b5fee2912b922c0e1d4df1268208 SHA256 a2c2e1344953a010d1d866830a1196cb03e14193fea2876da55e2633cb6f06b3
+AUX unzip-5.52-ds-rusxmms2.patch 4257 RMD160 920ebae51a59341e1716695dfd24cc442b446d31 SHA1 879ea5a08971d780f00dd34ea168f545cb168e23 SHA256 09569c72cbf4ba63c280d6dfe56c86eb94879d8eaca8c64e9ba4e907bc698175
+AUX unzip-5.52-no-exec-stack.patch 334 RMD160 81d73b5bb66fb54f8f71252c1fe6e2036d488de9 SHA1 0f318fecebd548e9feb2e93a32c56258d5c552b1 SHA256 8e165db2c138f9729020f3e60e9d8be58d504f4cf8eb7aae18b9432d2d751d4f
+AUX unzip-6.0-no-exec-stack.patch 381 RMD160 c45c06fd6a4fc88ce051637b6d7f1f4b0e09fa48 SHA1 d26e9fb76d73d77c2651198a3b27ae8bfb06fb34 SHA256 ae62249dcf8bbc3c30468b07944df6c8777b565927d9ed6d1fdf7395899ea7c7
+AUX unzip-ds-lazyrcc.patch 4186 RMD160 627f00d0b27fff5d8489a4eada546c34a80f0170 SHA1 9b276df0666c6504f9811d083021568718e2c3b7 SHA256 e18d2dd4152ee50611e2d202d7387c3a8024eb7c88fad74a9cebe3fc6498f04a
+AUX unzip-ds-rcc.patch 2963 RMD160 c37a70a7939126bcab671cb5e7cac855f2d6455e SHA1 4571d02ea694b50e44d9e8502a6b1b49068b1cc8 SHA256 6c53432de2e23639b0b2e4c22c6b0ba1492d76f0634e5b257dc9a5c8312dc9e4
+AUX unzip-ds-unixenc.patch 421 RMD160 048d9763d22007de209cefafde63cdec3e94d251 SHA1 274a2748b33660ddb7e413290c6c7a9a1877d15a SHA256 98b39ee3b6c63164b5b59d6d8c4b1a5fb6f311e2c91b76c44292dda86d0b2c63
+AUX unzip60-ds-isprint.patch 489 RMD160 e46154bea0bddf000e66f4d335d7c6a1ac9ecabb SHA1 7f2e6243646ce22d764f4554cb89142656b12f4f SHA256 30123645d9f06a054d16ee58749c3d1f01db66e99de21e8d822847b353366e2c
+DIST unzip552.tar.gz 1140291 RMD160 b749b0923bc4cceaa6f937aef688e9713a84328c SHA1 1831bd59b9e607a69052f83b263384895e2d4a19 SHA256 145d95e2ef1ef9add2e3c97d1340907e33ab8749eb1235372e7f0b7af600a8e9
+DIST unzip60.tar.gz 1376845 RMD160 48af66606e9472e45fbb94bc4e285da23d1b89ba SHA1 abf7de8a4018a983590ed6f5cbd990d4740f8a22 SHA256 036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37
+EBUILD unzip-5.52-r3.ebuild 1407 RMD160 641f924d8a7dee2fe6e36ec3dfcce26db7d79784 SHA1 ac4c72209e524e9fd28be2a5919e60f8cfea1d40 SHA256 0b3617449ec68f7d53448c3562d06ca74852ae98e308912e8719edd1b3a42b73
+EBUILD unzip-5.52-r4.ebuild 2022 RMD160 aa19e8ed6cc1812ed082f5e9e52d802b3c85cce9 SHA1 0efa28ec77f9208852e9b2941754aa6ea4721de5 SHA256 20995dcfc98f80f9ebcdaabc47347dd1958b2ec061cdb71172b965dec8824117
+EBUILD unzip-5.52-r5.ebuild 2143 RMD160 2565645ed72eeac299cb5ec9223d51618886eee9 SHA1 a6fb8f869c67ea95fe9684304fee7d0275e4031f SHA256 dd52ad8a2d966fccdc136bd24025d5096072035c6a49b7be8e99868d8b37a15b
+EBUILD unzip-5.52-r6.ebuild 2144 RMD160 8bb960a3f85edf25286559c317f48fec7e07e06f SHA1 72b1fb98289aa8107961e3d36ac585892a792a56 SHA256 20076be2040d8387e00090efc6b3ec0dc3fdb30e0eb53ffe475f81550770db50
+EBUILD unzip-6.0-r3.ebuild 2483 RMD160 e1d57a618e2443ee951a2bc07dc84653df81c003 SHA1 12bc4e942384dfe0b360d68ff06039185c4554e6 SHA256 9356ab3f2c1fb594abd3f0d27f2bfd19645d460356b89cb58209cc9d984534e4
diff --git a/app-arch/unzip/files/librcc-0.2.7.h b/app-arch/unzip/files/librcc-0.2.7.h
new file mode 100644
index 0000000..88cc802
--- /dev/null
+++ b/app-arch/unzip/files/librcc-0.2.7.h
@@ -0,0 +1,1544 @@
+#ifndef _LIBRCC_H
+#define _LIBRCC_H
+
+#include <stdlib.h>
+
+/*******************************************************************************
+***************************** Global Defines ***********************************
+*******************************************************************************/
+
+#define RCC_MAX_CHARSETS 16
+#define RCC_MAX_ENGINES 5
+#define RCC_MAX_LANGUAGES 64
+#define RCC_MAX_ALIASES 64
+#define RCC_MAX_CLASSES 16
+
+/* ID's */
+/**
+ * Language ID.
+ * - 0 is default language
+ * - -1 is error
+ * - 1 usually represents "LibRCC off" language
+ * - >1 is some language
+ */
+typedef unsigned char rcc_language_id;
+/**
+ * Alias ID
+ */
+typedef unsigned char rcc_alias_id;
+/**
+ * Relation ID
+ */
+typedef unsigned char rcc_relation_id;
+/**
+ * Charset ID.
+ * - 0 is default charset
+ * - -1 is error
+ * - >0 is some charset
+ */
+typedef unsigned char rcc_charset_id;
+/**
+ * Autocharset ID.
+ * - -1 is error
+ * - >0 is some encoding
+ */
+typedef unsigned char rcc_autocharset_id;
+/**
+ * Engine ID.
+ * - -1 is non configured (first available will be used if any)
+ * - 0 autodetection is switched off
+ * - >0 is some auto-engine
+ */
+typedef unsigned char rcc_engine_id;
+/**
+ * Class ID.
+ */
+typedef int rcc_class_id;
+
+/* Opaque Pointer's */
+typedef struct rcc_context_t *rcc_context; /**< Current Working Context */
+/**
+ * Encoding Detection Engine Context. Containes considered information about
+ * engine, which can be extracted using API functions.
+ * @see rccEngineGetInternal
+ * @see rccEngineGetLanguage
+ * @see rccEngineGetRccContext
+ */
+typedef struct rcc_engine_context_t *rcc_engine_context;
+/**
+ * Current Language Configuration:
+ * Information about current 'class encodings', and selected 'Encoding Detection
+ * Engine'
+ */
+typedef struct rcc_language_config_t *rcc_language_config;
+typedef const struct rcc_class_t *rcc_class_ptr;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Library Initialization function. Should be called prior to all
+ * any library manipulation.
+ */
+int rccInit();
+
+/**
+ * Library Cleanup function.
+ */
+void rccFree();
+
+/*******************************************************************************
+**************************** Initialization ************************************
+*******************************************************************************/
+/**
+ * RCC context initialization flags
+ */
+typedef unsigned int rcc_init_flags;
+
+/**
+ * Do not load default language configuration
+ */
+#define RCC_FLAG_NO_DEFAULT_CONFIGURATION 1
+
+/**
+ * Initialize working context.
+ *
+ * @param locale_variable is variable to get locale from (Default: LC_CTYPE).
+ * @param max_languages is maximal number of languages supported by context. (Default: detect)
+ * @param max_classes is maximal number of classes (Default: detect)
+ * @param defclasses is list of encoding classes (Default: will add later)
+ * @param flags is option flag (Default: nothing)
+ * @see RCC_FLAG_NO_DEFAULT_CONFIGURATION
+ * @return working context or NULL in case of error
+ */
+rcc_context rccCreateContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
+/**
+ * Initialize default working context (used then no context supplied). Previously
+ * opened default context will be freed.
+ *
+ * @param locale_variable is variable to get locale from (Default: LC_CTYPE).
+ * @param max_languages is maximal number of languages supported by context. (Default: detect)
+ * @param max_classes is maximal number of classes (Default: detect)
+ * @param defclasses is list of encoding classes (Default: will add later)
+ * @param flags is option flag (Default: nothing)
+ * @see RCC_FLAG_NO_DEFAULT_CONFIGURATION
+ * @return non-zero value in case of error
+ */
+int rccInitDefaultContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
+
+/**
+ * Free all memory used by working context and destroy it.
+ *
+ * @param ctx is working context to be destroyed.
+ */
+void rccFreeContext(rcc_context ctx);
+
+
+/**
+ * Berkeley DB initialization flags
+ */
+typedef unsigned int rcc_db4_flags;
+
+/**
+ * Enables Berkeley DB recodings caching for specified working context.
+ *
+ * @param ctx is working context
+ * @param name is database name (can be shared between different applications)
+ * @param flags are reserved for future.
+ * @return non-zero value in case of error
+ */
+int rccInitDb4(rcc_context ctx, const char *name, rcc_db4_flags flags);
+
+int rccLockConfiguration(rcc_context ctx, unsigned int lock_code);
+int rccUnlockConfiguration(rcc_context ctx, unsigned int lock_code);
+
+/*******************************************************************************
+******************* Altering Language Configuaration ***************************
+*******************************************************************************/
+/**
+ * Encoding name.
+ */
+typedef const char *rcc_charset;
+/**
+ * List of Encoding names
+ */
+typedef rcc_charset rcc_charset_list[RCC_MAX_CHARSETS+1];
+
+/* Engines */
+/**
+ * Engine internal data
+ */
+typedef void *rcc_engine_internal;
+/**
+ * Engine constructor function
+ * @param ctx is engine context
+ * @see rccEngineGetInternal
+ * @see rccEngineGetLanguage
+ * @see rccEngineGetRccContext
+ * @return pointer on desired internal data to be stored in engine_context.
+ */
+typedef rcc_engine_internal (*rcc_engine_init_function)(rcc_engine_context ctx);
+/**
+ * Engine encoding detection function.
+ * @param ctx is engine context
+ * @param buf is string encoded in unknow encoding
+ * @param len is exact size of string or 0 (size will be detected with strlen)
+ * @return the #rcc_autocharset_id of the detected encoding or -1 in case of error
+ */
+typedef rcc_autocharset_id (*rcc_engine_function)(rcc_engine_context ctx, const char *buf, int len);
+/**
+ * Engine destructor function
+ */
+typedef void (*rcc_engine_free_function)(rcc_engine_context ctx);
+
+/**
+ * Encoding detection engine description. Init and Free functions can be omited.
+ * 'func' should analyze string and return position in the encodings list
+ * coresponding to string encoding.
+ */
+struct rcc_engine_t {
+ const char *title; /**< Short title*/
+ rcc_engine_init_function init_func; /**< Constructor function */
+ rcc_engine_free_function free_func; /**< Destructor function */
+ rcc_engine_function func; /**< Function performing encoding detection */
+ rcc_charset_list charsets; /**< List of supported encodings */
+};
+typedef struct rcc_engine_t rcc_engine;
+typedef rcc_engine *rcc_engine_ptr;
+typedef rcc_engine_ptr rcc_engine_list[RCC_MAX_ENGINES+1];
+
+/**
+ * Language description.
+ */
+struct rcc_language_t {
+ const char *sn; /**< Language ISO-639-1 (2 symbol) name */
+ rcc_charset_list charsets; /**< List of language encodings */
+ rcc_engine_list engines; /**< List of encoding detection engines supported by language */
+};
+typedef struct rcc_language_t rcc_language;
+typedef rcc_language *rcc_language_ptr;
+typedef rcc_language_ptr rcc_language_list[RCC_MAX_LANGUAGES+1];
+
+/**
+ * Language Aliases.
+ * For example: ru_UA = uk, cs_SK = sk
+ */
+struct rcc_language_alias_t {
+ const char *alias; /**< Long locale name */
+ const char *lang; /**< Coresponded language ISO-639-1 name */
+};
+typedef struct rcc_language_alias_t rcc_language_alias;
+typedef rcc_language_alias *rcc_language_alias_ptr;
+typedef rcc_language_alias_ptr rcc_language_alias_list[RCC_MAX_ALIASES+1];
+
+/**
+ * Language relations.
+ * Meaning: sentence in considered language may contain words from all his parents. This
+ * knowledge will help Autodetection Engine to guess right language.
+ *
+ * For example: Russian is parent language for Ukrainian. This means it is possible
+ * to encounter russian words in ukrainian sentence.
+ *
+ * All languages by default are related to english language.
+ */
+struct rcc_language_relation_t {
+ const char *lang; /**< Coresponded language ISO-639-1 name */
+ const char *parent; /**< Parent language */
+};
+typedef struct rcc_language_relation_t rcc_language_relation;
+
+/**
+ * Register new language in supplied working context
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language is pointer on language description (shouldn't be freed before library deinitialization).
+ * @return registered language id or -1 in case of a error.
+ */
+rcc_language_id rccRegisterLanguage(rcc_context ctx, rcc_language *language);
+/**
+ * Register new encoding belonging to language in supplied working context
+ * @param language is language charset should be added to ( or default one if NULL supplied )
+ * @param charset is pointer on charset name (shouldn't be freed before library deinitialization).
+ * @return registered charset id or -1 in case of a error.
+ */
+rcc_charset_id rccLanguageRegisterCharset(rcc_language *language, rcc_charset charset);
+/**
+ * Register new Engine in supplied working context
+ * @param language is language charset should be added to ( or default one if NULL supplied )
+ * @param engine is pointer on engine description (shouldn't be freed before library deinitialization).
+ * @return registered engine id or -1 in case of a error.
+ */
+rcc_engine_id rccLanguageRegisterEngine(rcc_language *language, rcc_engine *engine);
+/**
+ * Register new language alias in supplied working context
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param alias is pointer on alias description (shouldn't be freed before library deinitialization).
+ * @return registered alias id or -1 in case of a error.
+ */
+rcc_alias_id rccRegisterLanguageAlias(rcc_context ctx, rcc_language_alias *alias);
+/**
+ * Register new language relation in supplied working context
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param relation is pointer on relation description (shouldn't be freed before library deinitialization).
+ * @return registered relation id or -1 in case of a error.
+ */
+rcc_relation_id rccRegisterLanguageRelation(rcc_context ctx, rcc_language_relation *relation);
+
+/*******************************************************************************
+************************ Altering Configuaration *******************************
+*******************************************************************************/
+/**
+ * Enumeration represents type of class.
+ */
+typedef enum rcc_class_type_t {
+ RCC_CLASS_INVALID = 0, /**< Invalid value */
+ RCC_CLASS_STANDARD, /**< Standard class */
+ RCC_CLASS_KNOWN, /**< Class encoding is known and no autodetection should be performed */
+ RCC_CLASS_FS, /**< Class strings are representing file names */
+ RCC_CLASS_TRANSLATE_LOCALE, /**< It is permited to translate class strings to current Locale Language in rccTo */
+ RCC_CLASS_TRANSLATE_CURRENT,/**< It is permited to translate class strings to Current Language in rccTo */
+ RCC_CLASS_TRANSLATE_FROM, /**< It is permited to translate class strings to Current Language in rccFrom */
+} rcc_class_type;
+
+/**
+ * Provides information about default encoding for specific language
+ */
+struct rcc_class_default_charset_t {
+ const char *lang; /**< Language */
+ const char *charset; /**< Default encoding for #lang */
+};
+typedef const struct rcc_class_default_charset_t rcc_class_default_charset;
+
+/** Forbid change class value using Library API */
+#define RCC_CLASS_FLAG_CONST 0x01
+/** Forbid saving and loading of class value */
+#define RCC_CLASS_FLAG_SKIP_SAVELOAD 0x02
+
+/** Encoding class description. Encoding classes are main concept of LibRCC library.
+ * The strings are recoded between different classes (for example in RusXMMS2 project
+ * ID3 titles are recoded between ID3 and Output classes). The current encoding of
+ * each class can be set using configuration file or API call, otherwise it will
+ * be detected automatically using current locale or default encoding.
+ *
+ * If the #defvalue is not NULL, it provides information about detection of
+ * the default encoding. The are following possibilities for that value:
+ * - Detect default encoding using specified locale variable (LC_CTYPE for example).
+ * . - The current encoding of the another class will be used instead of default encodings. Short name of considered class should be specified.
+ * - Just use specified multibyte encoding for all languages.
+ * In case of detection failure using all these methods, the #defcharset will
+ * be examined if default encoding for current language is available. If not,
+ * the first encoding in the list will be used as current.
+ *
+ * Additionaly it is possible to set special flags to prevent user from
+ * modifying class value. It is possible to protect class from changing
+ * ether using API, or configuration files.
+ *
+ * @see rcc_class_default_charset_t
+ * @see RCC_CLASS_FLAG_CONST
+ * @see RCC_CLASS_FLAG_SKIP_SAVELOAD
+ *
+ * The class type provides information for recoding functions about
+ * automatic detection of the class chrset. The encodings of the
+ * #RCC_CLASS_STANDARD classes will be detected using autoengine (if available
+ * for current language. The #RCC_CLASS_FS classes are associated with files
+ * and encoding will be guessed using find_file.
+ *
+ * @see rcc_class_type_t
+ *
+ */
+struct rcc_class_t {
+ const char *name; /**< Short class name */
+ const rcc_class_type class_type; /**< specifies type of class (Standard, File System, Known) */
+ const char *defvalue; /**< locale variable name or parent name or multibyte encoding name */
+ rcc_class_default_charset *defcharset; /**< default class encodings. Should be specified on per-language basys */
+ const char *fullname; /**< Full name of the class */
+ const unsigned long flags; /**< Class flags. (CONST, SKIP_SAVELOAD) */
+};
+typedef const struct rcc_class_t rcc_class;
+typedef rcc_class_ptr rcc_class_list[RCC_MAX_CLASSES+1];
+
+/**
+ * Register additional class
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param cl is pointer on the class description (shouldn't be freed before library deinitialization).
+ * @return registered class id or -1 in case of a error.
+ */
+rcc_class_id rccRegisterClass(rcc_context ctx, rcc_class *cl);
+/**
+ * Register additional charsets for the current class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id.
+ * @param charsets is NULL terminated list of classes.
+ * @return non zero value in the case of a error.
+ */
+int rccRegisterAdditionalCharsets(rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets);
+/**
+ * Register names of charsets disabled in the specified class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id.
+ * @param charsets is NULL terminated list of classes ("unicode" / "nonunicode" specifies corespondent group of charsets).
+ * @return non zero value in the case of a error.
+ */
+int rccRegisterDisabledCharsets(rcc_context ctx, rcc_class_id class_id, rcc_charset *charsets);
+/**
+ * Checks if charset is disabled for the specified class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id.
+ * @param charset is charset name.
+ * @return 1 if charset is disabled, 0 if charset is enabled, -1 in the case of error.
+ */
+int rccIsDisabledCharsetName(rcc_context ctx, rcc_class_id class_id, const char *charset);
+
+/**
+ * Determines 'class type' of supplied class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id
+ * @return class type or -1 in case of a error.
+ */
+rcc_class_type rccGetClassType(rcc_context ctx, rcc_class_id class_id);
+/**
+ * Returns name of supplied class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id
+ * @return class name or NULL in case of a error.
+ */
+const char *rccGetClassName(rcc_context ctx, rcc_class_id class_id);
+/**
+ * Returns full name of supplied class.
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is class id
+ * @return class full name or NULL in case of a error.
+ */
+const char *rccGetClassFullName(rcc_context ctx, rcc_class_id class_id);
+
+/*******************************************************************************
+************************ Altering Configuaration *******************************
+*******************************************************************************/
+typedef int rcc_option_value;
+
+/**
+ * Use BerkeleyDB recodings cache for encoding detection
+ */
+#define RCC_OPTION_LEARNING_FLAG_USE 1
+/**
+ * Cache recodings in BerkeleyDB recoding cache for future use
+ */
+#define RCC_OPTION_LEARNING_FLAG_LEARN 2
+
+typedef enum rcc_option_translate_t {
+ RCC_OPTION_TRANSLATE_OFF = 0, /**< Switch translation off. */
+ RCC_OPTION_TRANSLATE_TRANSLITERATE, /**< Transliterate data. */
+ RCC_OPTION_TRANSLATE_TO_ENGLISH, /**< Translate data to english language (Current language don't matter). */
+ RCC_OPTION_TRANSLATE_SKIP_RELATED, /**< Skip translation of the text's between related languages. */
+ RCC_OPTION_TRANSLATE_SKIP_PARENT, /**< Skip translation of the text's from parent languages (from english). */
+ RCC_OPTION_TRANSLATE_FULL /**< Translate whole data to the current language */
+} rcc_option_translate;
+
+/**
+ * List of options available
+ */
+typedef enum rcc_option_t {
+ RCC_OPTION_LEARNING_MODE = 0, /**< Recoding Caching mode (OFF/ON/RELEARN/LEARN) */
+ RCC_OPTION_AUTODETECT_FS_TITLES, /**< Detect titles of #RCC_CLASS_FS classes */
+ RCC_OPTION_AUTODETECT_FS_NAMES, /**< Try to find encoding of #RCC_CLASS_FS by accessing fs */
+ RCC_OPTION_CONFIGURED_LANGUAGES_ONLY, /**< Use only configured languages or languages with auto-engines */
+ RCC_OPTION_AUTOENGINE_SET_CURRENT, /**< If enabled autodetection engine will set current charset */
+ RCC_OPTION_AUTODETECT_LANGUAGE, /**< Enables language detection */
+ RCC_OPTION_TRANSLATE, /**< Translate #rcc_string if it's language differs from current one */
+ RCC_OPTION_TIMEOUT, /**< Recoding timeout. Currently it is only used to limit translation time */
+ RCC_OPTION_OFFLINE, /**< Allows external module to finish it's job in offline after the main program is terminated */
+ RCC_MAX_OPTIONS,
+ RCC_OPTION_ALL
+} rcc_option;
+
+/**
+ * List of option types
+ */
+typedef enum rcc_option_type_t {
+ RCC_OPTION_TYPE_INVISIBLE = 0, /**< Invisible option. Wouldn't be represented in UI menu */
+ RCC_OPTION_TYPE_STANDARD, /**< Standard option. */
+ RCC_OPTION_TYPE_MAX
+} rcc_option_type;
+
+/**
+ * Description of option values range type
+ */
+typedef enum rcc_option_range_type_t {
+ RCC_OPTION_RANGE_TYPE_BOOLEAN = 0, /**< Boolean option */
+ RCC_OPTION_RANGE_TYPE_RANGE, /**< Range of integer values */
+ RCC_OPTION_RANGE_TYPE_FLAGS, /**< Set of boolean flags */
+ RCC_OPTION_RANGE_TYPE_MENU, /**< Enumeration */
+ RCC_OPTION_RANGE_TYPE_MAX
+} rcc_option_range_type;
+
+/**
+ * Descriptionm of value range
+ */
+typedef struct rcc_option_range_t {
+ rcc_option_range_type type; /**< Value range type */
+ rcc_option_value min; /**< Minimal acceptable option value */
+ rcc_option_value max; /**< Maximal acceptable option value */
+ rcc_option_value step; /**< Preccision step */
+}rcc_option_range;
+
+/* lng.c */
+
+/**
+ * Return number of configured languages
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return number of configured languages or 0 in the case of error
+ */
+int rccGetLanguageNumber(rcc_context ctx);
+/**
+ * Return number of configured classes
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return number of configured classes or 0 in the case of error
+ */
+int rccGetClassNumber(rcc_context ctx);
+/**
+ * Determines name of the supplied language.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is 'language id' of desired language. For default language the 'default' value will be returned.
+ * @return language name or NULL in case of a error.
+ */
+const char *rccGetLanguageName(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Finds language id by the supplied name.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param name is language name
+ * @return language id [0-n] or -1 if not found.
+ */
+rcc_language_id rccGetLanguageByName(rcc_context ctx, const char *name);
+/**
+ * This function resolves default languages. If positive language id is supplied
+ * it will be returned back unchanged. The default language (0 is supplied as
+ * language id) will be resolved to some particular language.
+ * The following procedure will be used:
+ * - 1. Detect Language by locale
+ * - 2. Check if language intialized if RCC_OPTION_CONFIGURED_LANGUAGES_ONLY is set
+ * - 3. If one of the previous steps is failed, select first available language (id=1). Usually it should be 'LibRCC off'.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is language id
+ * @return resolved language id [1-n] or -1 in case of error.
+ */
+rcc_language_id rccGetRealLanguage(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Return considered language name, resolving default language if necessary.
+ * @see rccGetRealLanguage
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is language id
+ * @return resolved language name or NULL in case of error.
+ */
+const char *rccGetRealLanguageName(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Return selected language id.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return selected language id [0-n] or -1 in case of error
+ */
+rcc_language_id rccGetSelectedLanguage(rcc_context ctx);
+/**
+ * Return selected language name.
+ * @see rccGetSelectedLanguage
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return selected language name or NULL in case of error.
+ */
+const char *rccGetSelectedLanguageName(rcc_context ctx);
+/**
+ * Return current language id, resolving default language to particular one if necessary.
+ * See more details how default language is resolved: @see rccGetRealLanguage
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return current language id [1-n] or -1 in case of error
+ */
+rcc_language_id rccGetCurrentLanguage(rcc_context ctx);
+/**
+ * Return current language name.
+ # @see rccGetCurrentLanguage
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return current language id [1-n] or -1 in case of error
+ */
+const char *rccGetCurrentLanguageName(rcc_context ctx);
+
+
+/**
+ * Set current language.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is new language id [0-n]. Set to default state is Ok.
+ * @return non-zero value in case of error
+ */
+int rccSetLanguage(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Set current language by name.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param name is the short name of new language.
+ * @return non-zero value in case of error
+ */
+int rccSetLanguageByName(rcc_context ctx, const char *name);
+
+/* opt.c */
+/**
+ * Return option value.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @return current option value or -1 in case of error
+ */
+rcc_option_value rccGetOption(rcc_context ctx, rcc_option option);
+/**
+ * Tests if option have unchanged default value.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @return current option value or -1 in case of error
+ */
+int rccOptionIsDefault(rcc_context ctx, rcc_option option);
+/**
+ * Sets option to its default value.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @return non-zero value in case of error
+ */
+int rccOptionSetDefault(rcc_context ctx, rcc_option option);
+/**
+ * Set option value.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @param value is option value
+ * @return non-zero value in case of erros
+ */
+int rccSetOption(rcc_context ctx, rcc_option option, rcc_option_value value);
+/**
+ * Get current option type.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @return current option type or -1 in case of error
+ */
+rcc_option_type rccOptionGetType(rcc_context ctx, rcc_option option);
+/**
+ * Return range description for specified option
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param option is option
+ * @return option range or -1 in case of error
+ */
+rcc_option_range *rccOptionGetRange(rcc_context ctx, rcc_option option);
+
+/**
+ * Get short name of supplied option.
+ *
+ * @param option is option
+ * @return option range or NULL in case of error
+ */
+const char *rccGetOptionName(rcc_option option);
+
+/**
+ * Get short name of supplied option value.
+ *
+ * @param option is option
+ * @param value is value of #option
+ * @return option value name or NULL in case of error
+ */
+const char *rccGetOptionValueName(rcc_option option, rcc_option_value value);
+/**
+ * Get option by short name.
+ *
+ * @param name is option name
+ * @return option or -1 in case of error
+ */
+rcc_option rccGetOptionByName(const char *name);
+/**
+ * Get option value by short name.
+ *
+ * @param option is option
+ * @param name is value name
+ * @return option value or -1 in case of error
+ */
+rcc_option_value rccGetOptionValueByName(rcc_option option, const char *name);
+
+
+/* lngconfig.c */
+/**
+ * Check if configuration is initialized for supplied language.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is concerned language id
+ * @return configuration context if:
+ * - language_id is particular language, not default one
+ * - language already intialized
+ * - language is not dummy (Disable LibRCC) language
+ * otherwise NULL is returned
+ */
+rcc_language_config rccCheckConfig(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Initializes language configuration if not yet configured and returns pointer on
+ * that configuration. If default language is supplied (language_id = 0), the
+ * language id will be resolved to particular language and config of that language
+ * will be returned.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is concerned language id
+ * @return configuration context. The NULL is returned in the case of errors or
+ * dummy (Disable LibRCC) language is selected.
+ */
+rcc_language_config rccGetConfig(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Checks if supplied language is usable. The usability of language is determined
+ * regarding #RCC_OPTION_CONFIGURED_LANGUAGES_ONLY option. Depending on that
+ * option there are several possibilities for language usability:
+ * Any non-dummy language is usable
+ * Any configured or AutoEngine enabled language is usable
+ * Only configured languages are usable
+ *
+ * Language configuration is initialized if not yet configured. And pointer on
+ * that configuration is returned. If default language is supplied (language_id = 0), the
+ * language id will be resolved to particular language and config of that language
+ * will be returned.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param language_id is concerned language id
+ * @return configuration context. The NULL is returned in the case of errors or
+ * if unusable language is supplied.
+ */
+rcc_language_config rccGetUsableConfig(rcc_context ctx, rcc_language_id language_id);
+/**
+ * Initializes language configuration if not yet configured and returns pointer on
+ * that configuration.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param name is concerned language name
+ * @return configuration context or NULL in case of error
+ */
+rcc_language_config rccGetConfigByName(rcc_context ctx, const char *name);
+/**
+ * Returns pointer on the current language configuration (Initializes it as well
+ * if required)
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @return configuration context or NULL in case of error
+ */
+rcc_language_config rccGetCurrentConfig(rcc_context ctx);
+
+/**
+ * Return language associated with supplied configuration.
+ *
+ * @param config is language configuration
+ */
+rcc_language_id rccConfigGetLanguage(rcc_language_config config);
+/**
+ * Return name of the language associated with supplied configuration.
+ *
+ * @param config is language configuration
+ */
+const char *rccConfigGetLanguageName(rcc_language_config config);
+
+/**
+ * Return number of configured charsets
+ *
+ * @param config is language configuration
+ * @return number of charsets available in the configuration or 0 in the case of error
+ */
+int rccConfigGetCharsetNumber(rcc_language_config config);
+/**
+ * Return number of configured charsets
+ *
+ * @param config is language configuration
+ * @param class_id is class id.
+ * @return number of charsets available in the configuration or 0 in the case of error
+ */
+int rccConfigGetClassCharsetNumber(rcc_language_config config, rcc_class_id class_id);
+/**
+ * Return number of configured encoding auto-detection engines
+ *
+ * @param config is language configuration
+ * @return number of engines or 0 in the case of error
+ */
+int rccConfigGetEngineNumber(rcc_language_config config);
+
+/**
+ * Return supplied engine name
+ *
+ * @param config is language configuration
+ * @param engine_id is desired engine
+ * @return selected engine name or NULL in case of error.
+ */
+const char *rccConfigGetEngineName(rcc_language_config config, rcc_engine_id engine_id);
+/**
+ * Return supplied encoding name
+ *
+ * @param config is language configuration
+ * @param charset_id is desired charset
+ * @return selected encoding name or NULL in case of error.
+ */
+const char *rccConfigGetCharsetName(rcc_language_config config, rcc_charset_id charset_id);
+/**
+ * Return supplied encoding name
+ *
+ * @param config is language configuration
+ * @param class_id is charset encodings
+ * @param charset_id is desired charset
+ * @return selected encoding name or NULL in case of error.
+ */
+const char *rccConfigGetClassCharsetName(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id);
+
+/**
+ * Function finds engine id by the supplied name.
+ *
+ * @param config is language configuration
+ * @param name is engine name
+ * @return engine id [0-n] or -1 if not found
+ */
+rcc_engine_id rccConfigGetEngineByName(rcc_language_config config, const char *name);
+/**
+ * Function finds encoding id by the supplied name.
+ *
+ * @param config is language configuration
+ * @param name is encoding name
+ * @return encoding id [0-n] or -1 if not found.
+ */
+rcc_charset_id rccConfigGetCharsetByName(rcc_language_config config, const char *name);
+/**
+ * Function finds encoding id by the supplied name.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param name is encoding name
+ * @return encoding id [0-n] or -1 if not found.
+ */
+rcc_charset_id rccConfigGetClassCharsetByName(rcc_language_config config, rcc_class_id class_id, const char *name);
+/**
+ * Checks if charset is disabled for the specified class.
+ * @param config is language configuration
+ * @param class_id is class id.
+ * @param charset_id is charset id.
+ * @return 1 if charset is disabled, 0 if charset is enabled, -1 in the case of error.
+ */
+int rccConfigIsDisabledCharset(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id);
+/**
+ * Return selected engin id.
+ *
+ * @param config is language configuration
+ * @return selected engine id [-1-n]
+ * - -1 engine is not configured and first available will be used
+ * - 0 engines are disabled
+ * - >0 paticular engine id
+ */
+rcc_engine_id rccConfigGetSelectedEngine(rcc_language_config config);
+/**
+ * Return selected engine name.
+ * @see rccConfigGetSelectedEngine
+ *
+ * @param config is language configuration
+ * @return selected engine name ('default' will be returned if engine not configured) or NULL in case of error.
+ */
+const char *rccConfigGetSelectedEngineName(rcc_language_config config);
+/**
+ * Return current engine_id. The default value will be resolved to paticular engine id. Normally,
+ * the id of the first available engine will be returned. If no engines registered for supplied
+ * language the 0 will be returned, indicating id of dummy(disabled) engine.
+ *
+ * @param config is language configuration
+ * @return selected engine id [0-n] or -1 in case of error
+ * - 0 engines are disabled
+ * - >0 paticular engine id
+ */
+rcc_engine_id rccConfigGetCurrentEngine(rcc_language_config config);
+/**
+ * Return current engine name.
+ * @see rccConfigGetCurrentEngine
+ *
+ * @param config is language configuration
+ * @return current engine name or NULL in case of error.
+ */
+const char *rccConfigGetCurrentEngineName(rcc_language_config config);
+
+/**
+ * Return selected encoding id.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @return selected encoding id [0-n] or -1 in case of error
+ * - 0 default encoding
+ * - >0 paticular encoding id
+ */
+rcc_charset_id rccConfigGetSelectedCharset(rcc_language_config config, rcc_class_id class_id);
+/**
+ * Return selected encoding name.
+ * @see rccConfigGetSelectedCharset
+ *
+ * @param config is language configuration
+ * @param class_id is charset encodings
+ * @return selected encodings name ('default' will be returned if engine not configured) or NULL in case of error.
+ */
+const char *rccConfigGetSelectedCharsetName(rcc_language_config config, rcc_class_id class_id);
+/**
+ * Return current encoding_id. The default value will be resolved to paticular encoding id.
+ * The following procedure is used to detect default encoding:
+ * - If Unicode encoding selected for the same class english language. Return this encoding.
+ * - If the parent class is defined in #defcharset, - return current encoding of parent class.
+ * - If the locale variable is defined in #defcharset and either config language coincide with locale language or unciode encoding defined, use locale encoding.
+ * - If the default value for config language is defined in #defvalue return that default value.
+ * - If the default value for all languages is defined in #defvalue return that default value.
+ * - If either config language is coincide with locale language or unicode locale is used, return locale encoding.
+ * - Return first by the list non-dissabled encoding.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @return selected charset id [1-n] or -1 in case of error
+ */
+rcc_charset_id rccConfigGetCurrentCharset(rcc_language_config config, rcc_class_id class_id);
+/**
+ * Return current encoding name.
+ * @see rccConfigGetCurrentCharset
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @return current charset name or NULL in case of error.
+ */
+const char *rccConfigGetCurrentCharsetName(rcc_language_config config, rcc_class_id class_id);
+
+/**
+ * Set current engine.
+ *
+ * @param config is language configuration
+ * @param engine_id is new language id [-1-n]. If -1 supplied the engine will go in non-configured state.
+ * @return non-zero value in case of error
+ */
+int rccConfigSetEngine(rcc_language_config config, rcc_engine_id engine_id);
+/**
+ * Set current encoding.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param charset_id is new charset id [0-n]. The 0 will switch charset to encoding state.
+ * @return non-zero value in case of error
+ */
+int rccConfigSetCharset(rcc_language_config config, rcc_class_id class_id, rcc_charset_id charset_id);
+/**
+ * Set current engine by name.
+ *
+ * @param config is language configuration
+ * @param name is the short name of new engine ("default" is okey).
+ * @return non-zero value in case of error
+ */
+int rccConfigSetEngineByName(rcc_language_config config, const char *name);
+/**
+ * Set current encoding by name.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param name is the short name of new encoding ("default" is okey).
+ * @return non-zero value in case of error
+ */
+int rccConfigSetCharsetByName(rcc_language_config config, rcc_class_id class_id, const char *name);
+
+/**
+ * Function will return encoding id of charset specified by locale configuration.
+ *
+ * @param config is language configuration
+ * @param locale_variable is locale variable (Default(NULL) is LC_CTYPE)
+ * @return encoding id
+ */
+rcc_charset_id rccConfigGetLocaleCharset(rcc_language_config config, const char *locale_variable);
+/**
+ * Function will return encoding id of charset specified by locale configuration.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param locale_variable is locale variable (Default(NULL) is LC_CTYPE)
+ * @return encoding id
+ */
+rcc_charset_id rccConfigGetLocaleClassCharset(rcc_language_config config, rcc_class_id class_id, const char *locale_variable);
+
+/* curconfig.c */
+int rccGetCharsetNumber(rcc_context ctx);
+int rccGetClassCharsetNumber(rcc_context ctx, rcc_class_id class_id);
+int rccGetEngineNumber(rcc_context ctx);
+
+const char *rccGetEngineName(rcc_context ctx, rcc_engine_id engine_id);
+const char *rccGetCharsetName(rcc_context ctx, rcc_charset_id charset_id);
+const char *rccGetClassCharsetName(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id);
+
+rcc_engine_id rccGetEngineByName(rcc_context ctx, const char *name);
+rcc_charset_id rccGetCharsetByName(rcc_context ctx, const char *name);
+rcc_charset_id rccGetClassCharsetByName(rcc_context ctx, rcc_class_id class_id, const char *name);
+
+int rccIsDisabledCharset(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id);
+
+rcc_engine_id rccGetSelectedEngine(rcc_context ctx);
+const char *rccGetSelectedEngineName(rcc_context ctx);
+rcc_engine_id rccGetCurrentEngine(rcc_context ctx);
+const char *rccGetCurrentEngineName(rcc_context ctx);
+rcc_charset_id rccGetSelectedCharset(rcc_context ctx, rcc_class_id class_id);
+const char *rccGetSelectedCharsetName(rcc_context ctx, rcc_class_id class_id);
+rcc_charset_id rccGetCurrentCharset(rcc_context ctx, rcc_class_id class_id);
+const char *rccGetCurrentCharsetName(rcc_context ctx, rcc_class_id class_id);
+
+int rccSetEngine(rcc_context ctx, rcc_engine_id engine_id);
+int rccSetCharset(rcc_context ctx, rcc_class_id class_id, rcc_charset_id charset_id);
+int rccSetEngineByName(rcc_context ctx, const char *name);
+int rccSetCharsetByName(rcc_context ctx, rcc_class_id class_id, const char *name);
+
+rcc_charset_id rccGetLocaleCharset(rcc_context ctx, const char *locale_variable);
+rcc_charset_id rccGetLocaleClassCharset(rcc_context ctx, rcc_class_id class_id, const char *locale_variable);
+
+rcc_autocharset_id rccDetectCharset(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
+
+/*******************************************************************************
+************************ Language Configuaration *******************************
+*******************************************************************************/
+
+/*******************************************************************************
+************************ RCC_STRING Manipulations ******************************
+*******************************************************************************/
+/* string.c */
+/**
+ * Intermediate string format. RCC_string can be manipulated as standard NULL terminated string.
+ * However it contains small header with information about string language. All strings are
+ * encoded using UTF-8 encoding.
+ */
+typedef char *rcc_string;
+/**
+ * Intermediate string format. RCC_string can be manipulated as standard NULL terminated string.
+ * However it contains small header with information about string language. All strings are
+ * encoded using UTF-8 encoding.
+ */
+typedef const char *rcc_const_string;
+
+/**
+ * Check string header and verify if it is really correct #rcc_string.
+ *
+ * @param str is verifying string
+ */
+size_t rccStringCheck(const char *str);
+/**
+ * Check string header and verify if it is really correct #rcc_string.
+ *
+ * @param str is verifying string
+ * @param len is preciese size of str.
+ * @return size of string in bytes or -1 if check failed
+ */
+size_t rccStringSizedCheck(const char *str, size_t len);
+
+/**
+ * Extract language from #rcc_string.
+ *
+ * @param str is #rcc_string
+ * @return size of string in bytes or -1 if check failed
+ */
+rcc_language_id rccStringGetLanguage(rcc_const_string str);
+/**
+ * Returns pointer on UTF-8 string kept inside of #rcc_string.
+ *
+ * @param str is #rcc_string
+ * @return pointer on constant string or NULL in the case of error
+ */
+const char *rccStringGetString(rcc_const_string str);
+/**
+ * Extract UTF-8 string from #rcc_string.
+ *
+ * @param str is #rcc_string
+ * @return pointer on string or NULL in the case of error. The string should be freed by the caller.
+ */
+char *rccStringExtractString(rcc_const_string str);
+
+/**
+ * If str is #rcc_string function will return pointer on UTF-8 string kept inside, otherwise
+ * pointer on the passed string is returned.
+ *
+ * @param str is null-terminated string
+ * @return pointer on constant string
+ */
+const char *rccGetString(const char *str);
+/**
+ * If str is #rcc_string function will return pointer on UTF-8 string kept inside, otherwise
+ * pointer on the passed string is returned.
+ *
+ * @param str is string (perhaps not zero terminated)
+ * @param len is exact length of string or 0 (in this case length will be computed using 'strlen'
+ * @return pointer on constant string
+ */
+const char *rccSizedGetString(const char *str, size_t len);
+
+int rccStringCmp(const char *str1, const char *str2);
+int rccStringNCmp(const char *str1, const char *str2, size_t n);
+int rccStringCaseCmp(const char *str1, const char *str2);
+int rccStringNCaseCmp(const char *str1, const char *str2, size_t n);
+
+/*******************************************************************************
+******************************** Recoding **************************************
+*******************************************************************************/
+/* rcciconv.c */
+
+/**
+ * recoding context
+ */
+typedef struct rcc_iconv_t *rcc_iconv;
+
+/**
+ * Open recoding context.
+ *
+ * @param from is source encoding
+ * @param to is destination encoding
+ * @result
+ * - NULL if no recoding is required
+ * - Pointer on initialized context if successful
+ */
+rcc_iconv rccIConvOpen(const char *from, const char *to);
+/**
+ * Close recoding context.
+ *
+ * @param icnv is recoding context */
+void rccIConvClose(rcc_iconv icnv);
+/**
+ * Recodes chunk of data.
+ *
+ * @param icnv is recoding context
+ * @param buf is data for recoding
+ * @param len is size of the data
+ * @param rlen is size of recoded data
+ * @return recoded string or NULL in the case of error
+ */
+char *rccIConv(rcc_iconv icnv, const char *buf, size_t len, size_t *rlen);
+
+/* rcctranslate.c */
+
+/**
+ * translating context
+ */
+typedef struct rcc_translate_t *rcc_translate;
+
+/**
+ * Open translating context.
+ *
+ * @param from is source language
+ * @param to is destination language
+ * @return
+ * - NULL if translation is not required or possible
+ * - Pointer on initialized context if successful
+ */
+rcc_translate rccTranslateOpen(const char *from, const char *to);
+/**
+ * Close translating context.
+ *
+ * @param translate is translating context
+ */
+void rccTranslateClose(rcc_translate translate);
+
+/*
+ * Set translation timeout
+ *
+ * @param translate is translating context
+ * @param us is timeout in microseconds (0 - no timeout)
+ * @return non-zero value is returned in the case of errror
+ */
+int rccTranslateSetTimeout(rcc_translate translate, unsigned long us);
+
+/*
+ * Allows translation engine to perform pending task after the main program is
+ * being terminated
+ *
+ * @param translate is translating context
+ * @return non-zero value is returned in the case of errror
+ */
+int rccTranslateAllowOfflineMode(rcc_translate translate);
+
+/**
+ * Translate string.
+ *
+ * @param translate is translating context
+ * @param buf is UTF-8 encoded string for translating
+ * @return recoded string or NULL in the case of error
+ */
+char *rccTranslate(rcc_translate translate, const char *buf);
+
+
+/* rccspell.c */
+
+/**
+ * spelling context
+ */
+typedef struct rcc_speller_t *rcc_speller;
+
+/**
+ * result of spelling
+ */
+typedef enum rcc_speller_result_t {
+ RCC_SPELLER_INCORRECT = 0, /**< Word not found in dictionaries */
+ RCC_SPELLER_ALMOST_PARENT, /**< Similliar word is found in parents dictionary */
+ RCC_SPELLER_ALMOST_CORRECT, /**< Similliar word is found in dictionary */
+ RCC_SPELLER_PARENT, /**< Word is found in parent dictionary */
+ RCC_SPELLER_CORRECT /**< Word is found in dictionary */
+} rcc_speller_result;
+
+int rccSpellerResultIsOwn(rcc_speller_result res);
+int rccSpellerResultIsPrecise(rcc_speller_result res);
+int rccSpellerResultIsCorrect(rcc_speller_result res);
+
+/**
+ * Open spelling context.
+ *
+ * @param lang is language
+ * @return
+ * - NULL if language is not supported and in the case of error.
+ * - Pointer on initialized context if successful
+ */
+rcc_speller rccSpellerCreate(const char *lang);
+/**
+ * Close spelling context.
+ *
+ * @param speller is spelling context
+ */
+void rccSpellerFree(rcc_speller speller);
+/**
+ * Add parent to the spelling context.
+ *
+ * @param speller is spelling context
+ * @param parent is parent spelling context
+ * @return non-zero value in the case of error
+ */
+int rccSpellerAddParent(rcc_speller speller, rcc_speller parent);
+/**
+ * Spell a word.
+ *
+ * @param speller is spelling context
+ * @param word is UTF-8 encoded word for spelling
+ * @return FALSE if word is not found in dictionary
+ */
+rcc_speller_result rccSpeller(rcc_speller speller, const char *word);
+
+/* recode.c */
+
+/**
+ * Tries to detect language of string
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @result is language_id or -1 if autodetection is failed
+ */
+rcc_language_id rccDetectLanguage(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
+
+/**
+ * Tries to detect charset of string
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @result is auto_charset_id or -1 if autodetection is failed
+ */
+rcc_autocharset_id rccConfigDetectCharset(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len);
+
+/**
+ * Recode string from specified encoding class to #rcc_string. Encoding detection engines and
+ * recoding cache are used (if possible) to detect original 'buf' encoding. Otherwise the
+ * preconfigured encoding of class is assumed.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+rcc_string rccSizedFrom(rcc_context ctx, rcc_class_id class_id, const char *buf, size_t len);
+/**
+ * Recode string from #rcc_string to specified encoding class. If encoding class is of
+ * 'File System' type, the autoprobing for file names can be performed. In the other cases
+ * the rcc_string will be recoded in preconfigured class encoding.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is encoding class
+ * @param buf is original zero terminated string
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccSizedTo(rcc_context ctx, rcc_class_id class_id, rcc_const_string buf, size_t *rlen);
+/**
+ * Recode string between different encoding classes. The conversion is relays on rccSizedFrom
+ * and rccSizedTo functions.
+ * @see rccSizedFrom
+ * @see rccSizedTo
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param from is source encoding class
+ * @param to is destination encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccSizedRecode(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
+/**
+ * Recode file name between different encoding classes. Normally, should be used to convert
+ * string from the file list to real file system names. The autoprobing of names is enabled
+ * depending on the output encoding class configuration and current options.
+ * @see rcc_class_t
+ * @see rcc_class_type_t
+ * @see rcc_option_t
+
+ * The conversion is partly relays on rccSizedFrom.
+ * @see rccSizedFrom
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param from is source encoding class
+ * @param to is destination encoding class
+ * @param fspath is path to the filesystem where file are located.
+ * @param path is file path
+ * @param filename is file name
+ * @result is recoded file name or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccFS(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *fspath, const char *path, const char *filename);
+
+/**
+ * Recode string from specified encoding to #rcc_string.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param charset is source encoding
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+rcc_string rccSizedFromCharset(rcc_context ctx, const char *charset, const char *buf, size_t len);
+/**
+ * Recode string from #rcc_string to specified encoding.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param charset is destination encoding
+ * @param buf is original zero terminated string
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccSizedToCharset(rcc_context ctx, const char *charset, rcc_const_string buf, size_t *rlen);
+/**
+ * Recode string between specified encoding class and encoding.
+ *
+ * The conversion is partly relays on rccSizedFrom.
+ * @see rccSizedFrom
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is source encoding class
+ * @param charset is destination encoding
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccSizedRecodeToCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen);
+/**
+ * Recode string between specified encoding and encoding class.
+ *
+ * The conversion is partly relays on rccSizedTo
+ * @see rccSizedTo
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param class_id is destination encoding class
+ * @param charset is source encoding
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+rcc_string rccSizedRecodeFromCharset(rcc_context ctx, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen);
+/**
+ * Recode string between specified encodings.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param from is source encoding
+ * @param to is destination encoding
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccSizedRecodeCharsets(rcc_context ctx, const char *from, const char *to, const char *buf, size_t len, size_t *rlen);
+
+
+/**
+ * Recode string from specified encoding class to #rcc_string. Encoding detection engines and
+ * recoding cache are used (if possible) to detect original 'buf' encoding. Otherwise the
+ * preconfigured encoding of class is assumed.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+rcc_string rccConfigSizedFrom(rcc_language_config config, rcc_class_id class_id, const char *buf, size_t len);
+/**
+ * Recode string from #rcc_string to specified encoding class. If encoding class is of
+ * 'File System' type, the autoprobing for file names can be performed. In the other cases
+ * the rcc_string will be recoded in preconfigured class encoding.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param buf is original zero terminated string
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccConfigSizedTo(rcc_language_config config, rcc_class_id class_id, rcc_const_string buf, size_t *rlen);
+/**
+ * Recode string between different encoding classes. The conversion is relays on rccConfigSizedFrom
+ * and rccConfigSizedTo functions.
+ * @see rccConfigSizedFrom
+ * @see rccConfigSizedTo
+ *
+ * @param config is language configuration
+ * @param from is source encoding class
+ * @param to is destination encoding class
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccConfigSizedRecode(rcc_language_config config, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
+/**
+ * Recode string from specified encoding to #rcc_string.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param charset is source encoding
+ * @param buf is original string (perhaps not zero terminated)
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+rcc_string rccConfigSizedRecodeFromCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, const char *buf, size_t len, size_t *rlen);
+/**
+ * Recode string from #rcc_string to specified encoding.
+ *
+ * @param config is language configuration
+ * @param class_id is encoding class
+ * @param charset is destination encoding
+ * @param buf is original zero terminated string
+ * @param len is exact size of string or 0. In the last case the size is determined using 'strlen' function.
+ * @param rlen in rlen the size of recoded string will be returned.
+ * @result is recoded string or NULL if recoding is not required or failed. It is up to the caller to free memory.
+ */
+char *rccConfigSizedRecodeToCharset(rcc_language_config config, rcc_class_id class_id, const char *charset, rcc_const_string buf, size_t len, size_t *rlen);
+
+
+#define rccFrom(ctx, class_id, buf) rccSizedFrom(ctx, class_id, buf, 0)
+#define rccTo(ctx, class_id, buf) rccSizedTo(ctx, class_id, buf, NULL)
+#define rccRecode(ctx, from, to, buf) rccSizedRecode(ctx, from, to, buf, 0, NULL)
+
+#define rccFromCharset(ctx, charset, buf) rccSizedFromCharset(ctx, charset, buf, 0)
+#define rccToCharset(ctx, charset, buf) rccSizedToCharset(ctx, charset, buf, NULL)
+#define rccRecodeToCharset(ctx, class_id, charset, buf) rccSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
+#define rccRecodeFromCharset(ctx, class_id, charset, buf) rccSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
+#define rccRecodeCharsets(ctx, from, to, buf) rccSizedRecodeCharsets(ctx, from, to, buf, 0, NULL)
+
+#define rccConfigFrom(ctx, class_id, buf) rccConfigSizedFrom(ctx, class_id, buf, 0)
+#define rccConfigTo(ctx, class_id, buf) rccConfigSizedTo(ctx, class_id, buf, NULL)
+#define rccConfigRecode(ctx, from, to, buf) rccConfigSizedRecode(ctx, from, to, buf, 0, NULL)
+#define rccConfigRecodeToCharset(ctx, class_id, charset, buf) rccConfigSizedRecodeToCharset(ctx, class_id, charset, buf, 0, NULL)
+#define rccConfigRecodeFromCharset(ctx, class_id, charset, buf) rccConfigSizedRecodeFromCharset(ctx, class_id, charset, buf, 0, NULL)
+
+/*******************************************************************************
+******************************** Options ***************************************
+*******************************************************************************/
+
+/* xml.c */
+typedef void *rcc_config;
+rcc_config rccGetConfiguration();
+
+/**
+ * Save Configuration.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param name is configuration file name ( can be shared between multiple applications! )
+ * @return non-zero in the case of errors.
+ */
+int rccSave(rcc_context ctx, const char *name);
+/**
+ * Load Configuration.
+ *
+ * @param ctx is working context ( or default one if NULL supplied )
+ * @param name is configuration file name ( can be shared between multiple applications! )
+ * @return non-zero in the case of errors.
+ */
+int rccLoad(rcc_context ctx, const char *name);
+
+/*******************************************************************************
+**************************** Engine Plugins ************************************
+*******************************************************************************/
+
+typedef rcc_engine *(*rcc_plugin_engine_info_function)(const char *lang);
+
+rcc_engine_internal rccEngineGetInternal(rcc_engine_context ctx);
+rcc_language *rccEngineGetLanguage(rcc_engine_context ctx);
+rcc_context rccEngineGetRccContext(rcc_engine_context ctx);
+rcc_engine *rccEngineGetInfo(rcc_engine_context ctx);
+rcc_autocharset_id rccEngineGetAutoCharsetByName(rcc_engine_context ctx, const char *name);
+
+
+/*******************************************************************************
+**************************** Configuration *************************************
+*******************************************************************************/
+
+/**
+ * The Berkley DB support is compiled in
+ */
+#define RCC_CC_FLAG_HAVE_BERKLEY_DB 0x01
+/**
+ * The dynamic engine plugins support is compiled in
+ */
+#define RCC_CC_FLAG_HAVE_DYNAMIC_ENGINES 0x02
+/**
+ * Enca engine is compiled in
+ */
+#define RCC_CC_FLAG_HAVE_ENCA 0x04
+/**
+ * LibRCD engine is compiled in
+ */
+#define RCC_CC_FLAG_HAVE_RCD 0x08
+/**
+ * Libtranslate translation engine compiled in
+ */
+#define RCC_CC_FLAG_HAVE_LIBTRANSLATE 0x10
+
+/**
+ * The library build environment is represented by this structure
+ */
+struct rcc_compiled_configuration_t {
+ unsigned long flags; /**< compilation flags */
+};
+typedef struct rcc_compiled_configuration_t rcc_compiled_configuration_s;
+typedef const struct rcc_compiled_configuration_t *rcc_compiled_configuration;
+
+/**
+ * Get information about library compilation environment
+ */
+rcc_compiled_configuration rccGetCompiledConfiguration();
+
+int rccLocaleGetClassByName(const char *locale);
+int rccLocaleGetLanguage(char *result, const char *lv, unsigned int n);
+int rccLocaleGetCharset(char *result, const char *lv, unsigned int n);
+
+
+/**
+ * For compatibilty reasons
+ */
+#define RCC_OPTION_TRANSLATE_SKIP_PARRENT RCC_OPTION_TRANSLATE_SKIP_PARENT
+#define RCC_SPELLER_ALMOST_PARRENT RCC_SPELLER_ALMOST_PARENT
+#define RCC_SPELLER_PARRENT RCC_SPELLER_PARENT
+#define rccSpellerAddParrent rccSpellerAddParent
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _LIBRCC_H */
diff --git a/app-arch/unzip/files/unzip-5.50-dotdot.patch b/app-arch/unzip/files/unzip-5.50-dotdot.patch
new file mode 100644
index 0000000..962a302
--- /dev/null
+++ b/app-arch/unzip/files/unzip-5.50-dotdot.patch
@@ -0,0 +1,84 @@
+Only in unzip-5.50-lhh/: cscope.files
+Only in unzip-5.50-lhh/: cscope.out
+diff -ur unzip-5.50/unix/unix.c unzip-5.50-lhh/unix/unix.c
+--- unzip-5.50/unix/unix.c 2002-01-21 17:54:42.000000000 -0500
++++ unzip-5.50-lhh/unix/unix.c 2003-06-11 18:35:38.000000000 -0400
+@@ -421,7 +421,8 @@
+ */
+ {
+ char pathcomp[FILNAMSIZ]; /* path-component buffer */
+- char *pp, *cp=(char *)NULL; /* character pointers */
++ char *pp, *cp=(char *)NULL, /* character pointers */
++ *dp=(char *)NULL;
+ char *lastsemi=(char *)NULL; /* pointer to last semi-colon in pathcomp */
+ #ifdef ACORN_FTYPE_NFS
+ char *lastcomma=(char *)NULL; /* pointer to last comma in pathcomp */
+@@ -429,6 +430,7 @@
+ #endif
+ int quote = FALSE; /* flags */
+ int killed_ddot = FALSE; /* is set when skipping "../" pathcomp */
++ int snarf_ddot = FALSE; /* Is set while scanning for "../" */
+ int error = MPN_OK;
+ register unsigned workch; /* hold the character being tested */
+
+@@ -467,6 +469,9 @@
+ while ((workch = (uch)*cp++) != 0) {
+
+ if (quote) { /* if character quoted, */
++ if ((pp == pathcomp) && (workch == '.'))
++ /* Oh no you don't... */
++ goto ddot_hack;
+ *pp++ = (char)workch; /* include it literally */
+ quote = FALSE;
+ } else
+@@ -481,15 +486,44 @@
+ break;
+
+ case '.':
+- if (pp == pathcomp) { /* nothing appended yet... */
++ if (pp == pathcomp) {
++ddot_hack:
++ /* nothing appended yet... */
+ if (*cp == '/') { /* don't bother appending "./" to */
+ ++cp; /* the path: skip behind the '/' */
+ break;
+- } else if (!uO.ddotflag && *cp == '.' && cp[1] == '/') {
+- /* "../" dir traversal detected */
+- cp += 2; /* skip over behind the '/' */
+- killed_ddot = TRUE; /* set "show message" flag */
+- break;
++ } else if (!uO.ddotflag) {
++
++ /*
++ * SECURITY: Skip past control characters if the user
++ * didn't OK use of absolute pathnames. lhh - this is
++ * a very quick, ugly, inefficient fix.
++ */
++ dp = cp;
++ do {
++ workch = (uch)(*dp);
++ if (workch == '/' && snarf_ddot) {
++ /* "../" dir traversal detected */
++ cp = dp + 1; /* skip past the '/' */
++ killed_ddot = TRUE; /* set "show msg" flag */
++ break;
++ } else if (workch == '.' && !snarf_ddot) {
++ snarf_ddot = TRUE;
++ } else if (isprint(workch) ||
++ ((workch > 127) && (workch <= 254))) {
++ /*
++ * Since we found a printable, non-ctrl char,
++ * we can stop looking for '../', the amount
++ * in ../!
++ */
++ break;
++ }
++
++ dp++;
++ } while (*dp != 0);
++
++ if (killed_ddot)
++ break;
+ }
+ }
+ *pp++ = '.';
diff --git a/app-arch/unzip/files/unzip-5.52-CVE-2008-0888.patch b/app-arch/unzip/files/unzip-5.52-CVE-2008-0888.patch
new file mode 100644
index 0000000..368b3ee
--- /dev/null
+++ b/app-arch/unzip/files/unzip-5.52-CVE-2008-0888.patch
@@ -0,0 +1,35 @@
+http://bugs.gentoo.org/213761
+
+fix for CVE-2008-0888
+
+--- inflate.c
++++ inflate.c
+@@ -983,6 +983,7 @@
+ unsigned l; /* last length */
+ unsigned m; /* mask for bit lengths table */
+ unsigned n; /* number of lengths to get */
++ struct huft *tlp;
+ struct huft *tl; /* literal/length code table */
+ struct huft *td; /* distance code table */
+ unsigned bl; /* lookup bits for tl */
+@@ -996,6 +997,8 @@
+ int retval = 0; /* error code returned: initialized to "no error" */
+
+
++ td = tlp = tl = (struct huft *)NULL;
++
+ /* make local bit buffer */
+ Trace((stderr, "\ndynamic block"));
+ b = G.bb;
+@@ -1047,9 +1050,9 @@
+ while (i < n)
+ {
+ NEEDBITS(bl)
+- j = (td = tl + ((unsigned)b & m))->b;
++ j = (tlp = tl + ((unsigned)b & m))->b;
+ DUMPBITS(j)
+- j = td->v.n;
++ j = tlp->v.n;
+ if (j < 16) /* length of code in bits (0..15) */
+ ll[i++] = l = j; /* save last length in l */
+ else if (j == 16) /* repeat last length 3 to 6 times */
diff --git a/app-arch/unzip/files/unzip-5.52-ds-rusxmms.patch b/app-arch/unzip/files/unzip-5.52-ds-rusxmms.patch
new file mode 100644
index 0000000..8d55b94
--- /dev/null
+++ b/app-arch/unzip/files/unzip-5.52-ds-rusxmms.patch
@@ -0,0 +1,150 @@
+diff -dPNur unzip-5.52/fileio.c unzip-5.52-ds/fileio.c
+--- unzip-5.52/fileio.c 2005-02-27 03:10:12.000000000 +0100
++++ unzip-5.52-ds/fileio.c 2008-04-11 22:25:31.000000000 +0200
+@@ -78,7 +78,7 @@
+ # endif
+ #endif
+ #include "ebcdic.h" /* definition/initialization of ebcdic[] */
+-
++#include "dsrecode.h"
+
+ /*
+ Note: Under Windows, the maximum size of the buffer that can be used
+diff -dPNur unzip-5.52/unzpriv.h unzip-5.52-ds/unzpriv.h
+--- unzip-5.52/unzpriv.h 2005-02-04 00:26:42.000000000 +0100
++++ unzip-5.52-ds/unzpriv.h 2008-04-11 22:25:31.000000000 +0200
+@@ -2564,9 +2564,9 @@
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+ ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
+- _OEM_INTERN((string)); \
++ _DS_OEM_INTERN((string)); \
+ } else { \
+- _ISO_INTERN((string)); \
++ _DS_ISO_INTERN((string)); \
+ }
+ #endif
+
+diff -dPNur unzip-5.52/dsrecode.h unzip-5.52-ds/dsrecode.h
+--- unzip-5.52/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ unzip-5.52-ds/dsrecode.h 2008-04-11 22:24:24.000000000 +0200
+@@ -0,0 +1,119 @@
++#include "librcc.h"
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define OEM_CLASS 0
++#define ISO_CLASS 1
++#define OUT_CLASS 2
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM_INTERN", 0 },
++ { "iso", RCC_CLASS_STANDARD, NULL, default_iso, "ISO_INTERN", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++int initialized = 0;
++
++#ifdef RCC_LAZY
++#include <dlfcn.h>
++# define RCC_LIBRARY "librcc.so.0"
++int (*rccInit2)();
++int (*rccFree2)();
++int (*rccInitDefaultContext2)(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
++int (*rccInitDb42)(rcc_context ctx, const char *name, rcc_db4_flags flags);
++char* (*rccSizedRecode2)(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
++int (*rccLoad2)(rcc_context ctx, const char *name);
++
++
++static char *rccRecode2(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf) {
++ return rccSizedRecode2(ctx, from, to, buf, 0, NULL);
++}
++
++void *rcc_handle;
++#else /* RCC_LAZY */
++#define rccInit2 rccInit
++#define rccFree2 rccFree
++#define rccInitDefaultContext2 rccInitDefaultContext
++#define rccInitDb42 rccInitDb4
++#define rccRecode2 rccRecode
++#define rccLoad2 rccLoad
++#endif /* RCC_LAZY */
++
++static void rccUnzipFree() {
++ if (initialized > 0) {
++ rccFree2();
++#ifdef RCC_LAZY
++ dlclose(rcc_handle);
++#endif /* RCC_LAZY */
++ initialized = 0;
++ }
++}
++
++
++static int rccUnzipInit() {
++ if (initialized) return 0;
++
++#ifdef RCC_LAZY
++ rcc_handle = dlopen("/usr/lib/" RCC_LIBRARY, RTLD_NOW);
++ if (!rcc_handle) rcc_handle = dlopen("/usr/local/lib/" RCC_LIBRARY, RTLD_NOW);
++ if (!rcc_handle) {
++ initialized = -1;
++ return 1;
++ }
++
++ rccInit2 = dlsym(rcc_handle, "rccInit");
++ rccFree2 = dlsym(rcc_handle, "rccFree");
++ rccInitDefaultContext2 = dlsym(rcc_handle, "rccInitDefaultContext");
++ rccInitDb42 = dlsym(rcc_handle, "rccInitDb4");
++ rccSizedRecode2 = dlsym(rcc_handle, "rccSizedRecode");
++ rccLoad2 = dlsym(rcc_handle, "rccLoad");
++
++ if ((!rccInit2)||(!rccFree2)||(!rccInitDefaultContext2)||(!rccInitDb42)||(!rccSizedRecode2)||(!rccLoad2)) {
++ dlclose(rcc_handle);
++ initialized = -1;
++ return 1;
++ }
++#endif /* RCC_LAZY */
++
++ rccInit2();
++ rccInitDefaultContext2(NULL, 0, 0, classes, 0);
++ rccLoad2(NULL, "zip");
++ rccInitDb42(NULL, NULL, 0);
++ atexit(rccUnzipFree);
++ initialized = 1;
++ return 0;
++}
++
++
++
++void _DS_OEM_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, OEM_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
++
++void _DS_ISO_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, ISO_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
diff --git a/app-arch/unzip/files/unzip-5.52-ds-rusxmms2.patch b/app-arch/unzip/files/unzip-5.52-ds-rusxmms2.patch
new file mode 100644
index 0000000..6670a10
--- /dev/null
+++ b/app-arch/unzip/files/unzip-5.52-ds-rusxmms2.patch
@@ -0,0 +1,149 @@
+diff -dPNur unzip-5.52/fileio.c unzip-5.52-ds/fileio.c
+--- unzip-5.52/fileio.c 2005-02-27 03:10:12.000000000 +0100
++++ unzip-5.52-ds/fileio.c 2008-04-11 22:25:31.000000000 +0200
+@@ -78,7 +78,7 @@
+ # endif
+ #endif
+ #include "ebcdic.h" /* definition/initialization of ebcdic[] */
+-
++#include "dsrecode.h"
+
+ /*
+ Note: Under Windows, the maximum size of the buffer that can be used
+diff -dPNur unzip-5.52/unzpriv.h unzip-5.52-ds/unzpriv.h
+--- unzip-5.52/unzpriv.h 2005-02-04 00:26:42.000000000 +0100
++++ unzip-5.52-ds/unzpriv.h 2008-04-11 22:25:31.000000000 +0200
+@@ -2564,9 +2564,9 @@
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+ ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
+- _OEM_INTERN((string)); \
++ _DS_OEM_INTERN((string)); \
+ } else { \
+- _ISO_INTERN((string)); \
++ _DS_ISO_INTERN((string)); \
+ }
+ #endif
+
+diff -dPNur unzip-5.52/dsrecode.h unzip-5.52-ds/dsrecode.h
+--- unzip-5.52/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ unzip-5.52-ds/dsrecode.h 2008-04-11 22:24:24.000000000 +0200
+@@ -0,0 +1,118 @@
++#include "librcc.h"
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define OEM_CLASS 0
++#define ISO_CLASS 1
++#define OUT_CLASS 2
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM_INTERN", 0 },
++ { "iso", RCC_CLASS_STANDARD, NULL, default_iso, "ISO_INTERN", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++int initialized = 0;
++
++#ifdef RCC_LAZY
++#include <dlfcn.h>
++# define RCC_LIBRARY "librcc.so.0"
++int (*rccInit2)();
++int (*rccFree2)();
++int (*rccInitDefaultContext2)(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
++int (*rccInitDb42)(rcc_context ctx, const char *name, rcc_db4_flags flags);
++char* (*rccSizedRecode2)(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
++int (*rccLoad2)(rcc_context ctx, const char *name);
++
++
++static char *rccRecode2(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf) {
++ return rccSizedRecode2(ctx, from, to, buf, 0, NULL);
++}
++
++void *rcc_handle;
++#else /* RCC_LAZY */
++#define rccInit2 rccInit
++#define rccFree2 rccFree
++#define rccInitDefaultContext2 rccInitDefaultContext
++#define rccInitDb42 rccInitDb4
++#define rccRecode2 rccRecode
++#define rccLoad2 rccLoad
++#endif /* RCC_LAZY */
++
++static void rccUnzipFree() {
++ if (initialized > 0) {
++ rccFree2();
++#ifdef RCC_LAZY
++ dlclose(rcc_handle);
++#endif /* RCC_LAZY */
++ initialized = 0;
++ }
++}
++
++
++static int rccUnzipInit() {
++ if (initialized) return 0;
++
++#ifdef RCC_LAZY
++ rcc_handle = dlopen(RCC_LIBRARY, RTLD_NOW);
++ if (!rcc_handle) {
++ initialized = -1;
++ return 1;
++ }
++
++ rccInit2 = dlsym(rcc_handle, "rccInit");
++ rccFree2 = dlsym(rcc_handle, "rccFree");
++ rccInitDefaultContext2 = dlsym(rcc_handle, "rccInitDefaultContext");
++ rccInitDb42 = dlsym(rcc_handle, "rccInitDb4");
++ rccSizedRecode2 = dlsym(rcc_handle, "rccSizedRecode");
++ rccLoad2 = dlsym(rcc_handle, "rccLoad");
++
++ if ((!rccInit2)||(!rccFree2)||(!rccInitDefaultContext2)||(!rccInitDb42)||(!rccSizedRecode2)||(!rccLoad2)) {
++ dlclose(rcc_handle);
++ initialized = -1;
++ return 1;
++ }
++#endif /* RCC_LAZY */
++
++ rccInit2();
++ rccInitDefaultContext2(NULL, 0, 0, classes, 0);
++ rccLoad2(NULL, "zip");
++ rccInitDb42(NULL, NULL, 0);
++ atexit(rccUnzipFree);
++ initialized = 1;
++ return 0;
++}
++
++
++
++void _DS_OEM_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, OEM_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
++
++void _DS_ISO_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, ISO_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
diff --git a/app-arch/unzip/files/unzip-5.52-no-exec-stack.patch b/app-arch/unzip/files/unzip-5.52-no-exec-stack.patch
new file mode 100644
index 0000000..e2869bf
--- /dev/null
+++ b/app-arch/unzip/files/unzip-5.52-no-exec-stack.patch
@@ -0,0 +1,13 @@
+Make sure that the asm files don't incorrectly trigger an executable
+stack marking in the final shared library. That's bad, mmmkay.
+
+--- unzip/crc_i386.S
++++ unzip/crc_i386.S
+@@ -238,3 +238,7 @@
+ #endif /* i386 || _i386 || _I386 || __i386 */
+
+ #endif /* !USE_ZLIB */
++
++#ifdef __ELF__
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/app-arch/unzip/files/unzip-6.0-no-exec-stack.patch b/app-arch/unzip/files/unzip-6.0-no-exec-stack.patch
new file mode 100644
index 0000000..7973378
--- /dev/null
+++ b/app-arch/unzip/files/unzip-6.0-no-exec-stack.patch
@@ -0,0 +1,13 @@
+Make sure that the asm files don't incorrectly trigger an executable
+stack marking in the final shared library. That's bad, mmmkay.
+
+--- unzip/crc_i386.S
++++ unzip/crc_i386.S
+@@ -302,3 +302,7 @@
+ #endif /* i386 || _i386 || _I386 || __i386 */
+
+ #endif /* !USE_ZLIB && !CRC_TABLE_ONLY */
++
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
diff --git a/app-arch/unzip/files/unzip-ds-lazyrcc.patch b/app-arch/unzip/files/unzip-ds-lazyrcc.patch
new file mode 100644
index 0000000..e2fbfa7
--- /dev/null
+++ b/app-arch/unzip/files/unzip-ds-lazyrcc.patch
@@ -0,0 +1,146 @@
+diff -dPNur unzip-5.52/dsrecode.h unzip-5.52-new/dsrecode.h
+--- unzip-5.52/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ unzip-5.52-new/dsrecode.h 2007-04-04 21:20:31.000000000 +0200
+@@ -0,0 +1,115 @@
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define OEM_CLASS 0
++#define ISO_CLASS 1
++#define OUT_CLASS 2
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM_INTERN", 0 },
++ { "iso", RCC_CLASS_STANDARD, NULL, default_iso, "ISO_INTERN", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++int initialized = 0;
++
++#ifdef RCC_LAZY
++#include <dlfcn.h>
++# define RCC_LIBRARY "librcc.so.0"
++int (*rccInit2)();
++int (*rccFree2)();
++int (*rccInitDefaultContext2)(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags);
++int (*rccInitDb42)(rcc_context ctx, const char *name, rcc_db4_flags flags);
++char* (*rccSizedRecode2)(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf, size_t len, size_t *rlen);
++
++static char *rccRecode2(rcc_context ctx, rcc_class_id from, rcc_class_id to, const char *buf) {
++ rccSizedRecode2(ctx, from, to, buf, 0, NULL);
++}
++
++void *rcc_handle;
++#else /* RCC_LAZY */
++#define rccInit2 rccInit
++#define rccFree2 rccFree
++#define rccInitDefaultContext2 rccInitDefaultContext
++#define rccInitDb42 rccInitDb4
++#define rccRecode2 rccRecode
++
++#endif /* RCC_LAZY */
++
++static void rccUnzipFree() {
++ if (initialized > 0) {
++ rccFree2();
++#ifdef RCC_LAZY
++ dlclose(rcc_handle);
++#endif /* RCC_LAZY */
++ initialized = 0;
++ }
++}
++
++
++static int rccUnzipInit() {
++ if (initialized) return 0;
++
++#ifdef RCC_LAZY
++ rcc_handle = dlopen("/usr/lib/" RCC_LIBRARY, RTLD_NOW);
++ if (!rcc_handle) rcc_handle = dlopen("/usr/local/lib/" RCC_LIBRARY, RTLD_NOW);
++ if (!rcc_handle) {
++ initialized = -1;
++ return 1;
++ }
++
++ rccInit2 = dlsym(rcc_handle, "rccInit");
++ rccFree2 = dlsym(rcc_handle, "rccFree");
++ rccInitDefaultContext2 = dlsym(rcc_handle, "rccInitDefaultContext");
++ rccInitDb42 = dlsym(rcc_handle, "rccInitDb4");
++ rccSizedRecode2 = dlsym(rcc_handle, "rccSizedRecode");
++
++ if ((!rccInit2)||(!rccFree2)||(!rccInitDefaultContext2)||(!rccInitDb42)||(!rccSizedRecode2)) {
++ dlclose(rcc_handle);
++ initialized = -1;
++ return 1;
++ }
++#endif /* RCC_LAZY */
++
++ rccInit2();
++ rccInitDefaultContext2(NULL, 0, 0, classes, 0);
++ rccInitDb42(NULL, NULL, 0);
++ atexit(rccUnzipFree);
++ initialized = 1;
++ return 0;
++}
++
++
++
++void _DS_OEM_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, OEM_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
++
++void _DS_ISO_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ if (initialized>0) {
++ str = rccRecode2(NULL, ISO_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++ }
++}
+diff -dPNur unzip-5.52/fileio.c unzip-5.52-new/fileio.c
+--- unzip-5.52/fileio.c 2005-02-27 03:10:12.000000000 +0100
++++ unzip-5.52-new/fileio.c 2007-04-04 21:16:58.000000000 +0200
+@@ -78,7 +78,7 @@
+ # endif
+ #endif
+ #include "ebcdic.h" /* definition/initialization of ebcdic[] */
+-
++#include "dsrecode.h"
+
+ /*
+ Note: Under Windows, the maximum size of the buffer that can be used
+diff -dPNur unzip-5.52/unzpriv.h unzip-5.52-new/unzpriv.h
+--- unzip-5.52/unzpriv.h 2005-02-04 00:26:42.000000000 +0100
++++ unzip-5.52-new/unzpriv.h 2007-04-04 21:16:58.000000000 +0200
+@@ -2564,9 +2564,9 @@
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+ ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
+- _OEM_INTERN((string)); \
++ _DS_OEM_INTERN((string)); \
+ } else { \
+- _ISO_INTERN((string)); \
++ _DS_ISO_INTERN((string)); \
+ }
+ #endif
+
diff --git a/app-arch/unzip/files/unzip-ds-rcc.patch b/app-arch/unzip/files/unzip-ds-rcc.patch
new file mode 100644
index 0000000..6b70685
--- /dev/null
+++ b/app-arch/unzip/files/unzip-ds-rcc.patch
@@ -0,0 +1,105 @@
+diff -dPNur unzip-5.51/dsrecode.h unzip-5.51-new/dsrecode.h
+--- unzip-5.51/dsrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ unzip-5.51-new/dsrecode.h 2005-07-19 05:03:50.000000000 +0200
+@@ -0,0 +1,62 @@
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define OEM_CLASS 0
++#define ISO_CLASS 1
++#define OUT_CLASS 2
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM_INTERN", 0 },
++ { "iso", RCC_CLASS_STANDARD, NULL, default_iso, "ISO_INTERN", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++int initialized = 0;
++
++static void rccUnzipFree() {
++ if (initialized) {
++ rccFree();
++ initialized = 0;
++ }
++}
++
++static int rccUnzipInit() {
++ if (initialized) return 0;
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccInitDb4(NULL, NULL, 0);
++ atexit(rccUnzipFree);
++ initialized = 1;
++ return 0;
++}
++
++
++
++void _DS_OEM_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ str = rccRecode(NULL, OEM_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++}
++
++void _DS_ISO_INTERN(char *string) {
++ char *str;
++ rccUnzipInit();
++ str = rccRecode(NULL, ISO_CLASS, OUT_CLASS, string);
++ if (str) {
++ strncpy(string,str,FILNAMSIZ);
++ free(str);
++ }
++}
+diff -dPNur unzip-5.51/fileio.c unzip-5.51-new/fileio.c
+--- unzip-5.51/fileio.c 2004-05-23 03:01:20.000000000 +0200
++++ unzip-5.51-new/fileio.c 2005-04-19 17:19:25.000000000 +0200
+@@ -78,7 +78,7 @@
+ # endif
+ #endif
+ #include "ebcdic.h" /* definition/initialization of ebcdic[] */
+-
++#include "dsrecode.h"
+
+ /*
+ Note: Under Windows, the maximum size of the buffer that can be used
+diff -dPNur unzip-5.51/unix/Makefile unzip-5.51-new/unix/Makefile
+--- unzip-5.51/unix/Makefile 2004-03-01 18:37:24.000000000 +0100
++++ unzip-5.51-new/unix/Makefile 2005-07-19 04:03:11.000000000 +0200
+@@ -43,7 +43,7 @@
+
+ # UnZip flags
+ CC = cc# try using "gcc" target rather than changing this (CC and LD
+-LD = $(CC)# must match, else "unresolved symbol: ___main" is possible)
++LD = $(CC) -lrcc# must match, else "unresolved symbol: ___main" is possible)
+ AS = as
+ LOC = $(LOCAL_UNZIP)
+ AF = $(LOC)
+diff -dPNur unzip-5.51/unzpriv.h unzip-5.51-new/unzpriv.h
+--- unzip-5.51/unzpriv.h 2004-03-01 19:09:04.000000000 +0100
++++ unzip-5.51-new/unzpriv.h 2005-04-19 17:19:25.000000000 +0200
+@@ -2521,9 +2521,9 @@
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
+ ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
+- _OEM_INTERN((string)); \
++ _DS_OEM_INTERN((string)); \
+ } else { \
+- _ISO_INTERN((string)); \
++ _DS_ISO_INTERN((string)); \
+ }
+ #endif
+
diff --git a/app-arch/unzip/files/unzip-ds-unixenc.patch b/app-arch/unzip/files/unzip-ds-unixenc.patch
new file mode 100644
index 0000000..e33e6ba
--- /dev/null
+++ b/app-arch/unzip/files/unzip-ds-unixenc.patch
@@ -0,0 +1,9 @@
+diff -dPNur unzip-5.50/unzpriv.h unzip-5.50-new/unzpriv.h
+--- unzip-5.50/unzpriv.h Sun Feb 17 21:01:48 2002
++++ unzip-5.50-new/unzpriv.h Tue Jun 10 07:16:23 2003
+@@ -2424,4 +2424,5 @@
+ !(((islochdr) || (isuxatt)) && \
+ ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+ (hostnum) == FS_HPFS_ || \
++ (hostnum) == UNIX_ || \
+ ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
diff --git a/app-arch/unzip/files/unzip60-ds-isprint.patch b/app-arch/unzip/files/unzip60-ds-isprint.patch
new file mode 100644
index 0000000..64ea1ee
--- /dev/null
+++ b/app-arch/unzip/files/unzip60-ds-isprint.patch
@@ -0,0 +1,12 @@
+diff -dPNur unzip60/extract.c unzip60-ds/extract.c
+--- unzip60/extract.c 2009-03-14 02:32:52.000000000 +0100
++++ unzip60-ds/extract.c 2010-07-06 16:34:09.000000000 +0200
+@@ -2596,7 +2596,7 @@
+ */
+ # define UZ_FNFILTER_REPLACECHAR '?'
+ # endif
+- if (!isprint(*r)) {
++ if (*r < 32) { //(!isprint(*r)) {
+ if (*r < 32) {
+ /* ASCII control codes are escaped as "^{letter}". */
+ if (se != NULL && (s > (space + (size-4)))) {
diff --git a/app-arch/unzip/unzip-5.52-r3.ebuild b/app-arch/unzip/unzip-5.52-r3.ebuild
new file mode 100644
index 0000000..e5b581e
--- /dev/null
+++ b/app-arch/unzip/unzip-5.52-r3.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-5.52.ebuild,v 1.2 2005/05/31 15:18:54 swegener Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Unzipper for pkzip-compressed files"
+HOMEPAGE="ftp://ftp.info-zip.org/pub/infozip/UnZip.html"
+SRC_URI="ftp://ftp.info-zip.org/pub/infozip/src/${PN}${PV/.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86"
+IUSE="rcc"
+
+DEPEND="rcc? ( app-i18n/librcc )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ use rcc && ( epatch ${FILESDIR}/${PN}-ds-lazyrcc.patch || die )
+ use rcc && ( epatch ${FILESDIR}/${PN}-ds-unixenc.patch || die )
+
+ ld_opts=""
+# use rcc && ld_opts="-lrcc"
+ use rcc && ld_opts="-ldl"
+ use rcc && cc_opts="-DRCC_LAZY=1"
+
+ sed -i \
+ -e "s:-O3:${CFLAGS}:" \
+ -e "s:CC=gcc :CC=\"$(tc-getCC) ${cc_opts}\" :" \
+ -e "s:LD=gcc :LD=\"$(tc-getCC) ${ld_opts}\" :" \
+ -e "s:-O :${CFLAGS} :" \
+ -e "s:LF2 = -s:LF2 = :" \
+ unix/Makefile \
+ || die "sed unix/Makefile failed"
+}
+
+src_compile() {
+ use x86 \
+ && TARGET=linux \
+ || TARGET=linux_noasm
+ emake -f unix/Makefile ${TARGET} || die "emake failed"
+}
+
+src_install() {
+ dobin unzip funzip unzipsfx unix/zipgrep || die "dobin failed"
+ dosym unzip /usr/bin/zipinfo
+ doman man/*.1
+ dodoc BUGS History* README ToDo WHERE
+}
diff --git a/app-arch/unzip/unzip-5.52-r4.ebuild b/app-arch/unzip/unzip-5.52-r4.ebuild
new file mode 100644
index 0000000..fe8d65e
--- /dev/null
+++ b/app-arch/unzip/unzip-5.52-r4.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-5.52-r2.ebuild,v 1.6 2008/03/29 16:57:06 jer Exp $
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="unzipper for pkzip-compressed files"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="mirror://gentoo/${PN}${PV/.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE="rcc"
+
+DEPEND="rcc? ( app-i18n/librcc )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-no-exec-stack.patch
+ epatch "${FILESDIR}"/${P}-CVE-2008-0888.patch #213761
+#SDS
+ use rcc && ( epatch ${FILESDIR}/${P}-ds-rusxmms.patch || die )
+ use rcc && ( epatch ${FILESDIR}/${PN}-ds-unixenc.patch || die )
+
+ ld_opts=""
+# use rcc && ld_opts="-lrcc"
+ use rcc && ld_opts="-ldl"
+ use rcc && cc_opts="-DRCC_LAZY=1"
+#EDS
+
+ sed -i \
+ -e 's:-O3:$(CFLAGS) $(CPPFLAGS):' \
+ -e 's:-O :$(CFLAGS) $(CPPFLAGS) :' \
+ -e "s:CC=gcc :CC=\"$(tc-getCC) ${cc_opts}\" :" \
+ -e "s:LD=gcc :LD=\"$(tc-getCC) ${ld_opts}\" :" \
+ -e 's:LF2 = -s:LF2 = :' \
+ -e 's:LF = :LF = $(LDFLAGS) :' \
+ -e 's:SL = :SL = $(LDFLAGS) :' \
+ -e 's:FL = :FL = $(LDFLAGS) :' \
+ unix/Makefile \
+ || die "sed unix/Makefile failed"
+}
+
+src_compile() {
+ local TARGET
+ case ${CHOST} in
+ i?86*-linux*) TARGET=linux_asm ;;
+ *-linux*) TARGET=linux_noasm ;;
+ i?86*-freebsd* | i?86*-dragonfly* | i?86*-openbsd* | i?86*-netbsd*)
+ TARGET=freebsd ;; # mislabelled bsd with x86 asm
+ *-freebsd* | *-dragonfly* | *-openbsd* | *-netbsd*)
+ TARGET=bsd ;;
+ *-darwin*) TARGET=macosx ;;
+ *) die "Unknown target, you suck" ;;
+ esac
+ append-lfs-flags #104315
+ emake -f unix/Makefile ${TARGET} || die "emake failed"
+}
+
+src_install() {
+ dobin unzip funzip unzipsfx unix/zipgrep || die "dobin failed"
+ dosym unzip /usr/bin/zipinfo || die
+ doman man/*.1
+ dodoc BUGS History* README ToDo WHERE
+}
diff --git a/app-arch/unzip/unzip-5.52-r5.ebuild b/app-arch/unzip/unzip-5.52-r5.ebuild
new file mode 100644
index 0000000..81f9392
--- /dev/null
+++ b/app-arch/unzip/unzip-5.52-r5.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-5.52-r2.ebuild,v 1.6 2008/03/29 16:57:06 jer Exp $
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="unzipper for pkzip-compressed files"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="mirror://gentoo/${PN}${PV/.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE="rcc"
+
+#To overcome circular dependencies
+PDEPEND="rcc? ( app-i18n/librcc )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-no-exec-stack.patch
+ epatch "${FILESDIR}"/${P}-CVE-2008-0888.patch #213761
+
+#SDS
+ use rcc && (
+ epatch ${FILESDIR}/${P}-ds-rusxmms.patch || die
+ epatch ${FILESDIR}/${PN}-ds-unixenc.patch || die
+ if [ ! -a /usr/include/librcc.h ]; then
+ cp "${FILESDIR}"/librcc-0.2.7.h librcc.h || die
+ fi
+ )
+
+ ld_opts=""
+ cc_opts=""
+ use rcc && ld_opts="-ldl"
+ use rcc && cc_opts="-DRCC_LAZY=1"
+#EDS
+
+ sed -i \
+ -e 's:-O3:$(CFLAGS) $(CPPFLAGS):' \
+ -e 's:-O :$(CFLAGS) $(CPPFLAGS) :' \
+ -e "s:CC=gcc :CC=\"$(tc-getCC) ${cc_opts}\" :" \
+ -e "s:LD=gcc :LD=\"$(tc-getCC) ${ld_opts}\" :" \
+ -e 's:LF2 = -s:LF2 = :' \
+ -e 's:LF = :LF = $(LDFLAGS) :' \
+ -e 's:SL = :SL = $(LDFLAGS) :' \
+ -e 's:FL = :FL = $(LDFLAGS) :' \
+ unix/Makefile \
+ || die "sed unix/Makefile failed"
+}
+
+src_compile() {
+ local TARGET
+ case ${CHOST} in
+ i?86*-linux*) TARGET=linux_asm ;;
+ *-linux*) TARGET=linux_noasm ;;
+ i?86*-freebsd* | i?86*-dragonfly* | i?86*-openbsd* | i?86*-netbsd*)
+ TARGET=freebsd ;; # mislabelled bsd with x86 asm
+ *-freebsd* | *-dragonfly* | *-openbsd* | *-netbsd*)
+ TARGET=bsd ;;
+ *-darwin*) TARGET=macosx ;;
+ *) die "Unknown target, you suck" ;;
+ esac
+ append-lfs-flags #104315
+ emake -f unix/Makefile ${TARGET} || die "emake failed"
+}
+
+src_install() {
+ dobin unzip funzip unzipsfx unix/zipgrep || die "dobin failed"
+ dosym unzip /usr/bin/zipinfo || die
+ doman man/*.1
+ dodoc BUGS History* README ToDo WHERE
+}
diff --git a/app-arch/unzip/unzip-5.52-r6.ebuild b/app-arch/unzip/unzip-5.52-r6.ebuild
new file mode 100644
index 0000000..b8dedcc
--- /dev/null
+++ b/app-arch/unzip/unzip-5.52-r6.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-5.52-r2.ebuild,v 1.6 2008/03/29 16:57:06 jer Exp $
+
+inherit eutils toolchain-funcs flag-o-matic
+
+DESCRIPTION="unzipper for pkzip-compressed files"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="mirror://gentoo/${PN}${PV/.}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE="rcc"
+
+#To overcome circular dependencies
+PDEPEND="rcc? ( app-i18n/librcc )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-no-exec-stack.patch
+ epatch "${FILESDIR}"/${P}-CVE-2008-0888.patch #213761
+
+#SDS
+ use rcc && (
+ epatch ${FILESDIR}/${P}-ds-rusxmms2.patch || die
+ epatch ${FILESDIR}/${PN}-ds-unixenc.patch || die
+ if [ ! -a /usr/include/librcc.h ]; then
+ cp "${FILESDIR}"/librcc-0.2.7.h librcc.h || die
+ fi
+ )
+
+ ld_opts=""
+ cc_opts=""
+ use rcc && ld_opts="-ldl"
+ use rcc && cc_opts="-DRCC_LAZY=1"
+#EDS
+
+ sed -i \
+ -e 's:-O3:$(CFLAGS) $(CPPFLAGS):' \
+ -e 's:-O :$(CFLAGS) $(CPPFLAGS) :' \
+ -e "s:CC=gcc :CC=\"$(tc-getCC) ${cc_opts}\" :" \
+ -e "s:LD=gcc :LD=\"$(tc-getCC) ${ld_opts}\" :" \
+ -e 's:LF2 = -s:LF2 = :' \
+ -e 's:LF = :LF = $(LDFLAGS) :' \
+ -e 's:SL = :SL = $(LDFLAGS) :' \
+ -e 's:FL = :FL = $(LDFLAGS) :' \
+ unix/Makefile \
+ || die "sed unix/Makefile failed"
+}
+
+src_compile() {
+ local TARGET
+ case ${CHOST} in
+ i?86*-linux*) TARGET=linux_asm ;;
+ *-linux*) TARGET=linux_noasm ;;
+ i?86*-freebsd* | i?86*-dragonfly* | i?86*-openbsd* | i?86*-netbsd*)
+ TARGET=freebsd ;; # mislabelled bsd with x86 asm
+ *-freebsd* | *-dragonfly* | *-openbsd* | *-netbsd*)
+ TARGET=bsd ;;
+ *-darwin*) TARGET=macosx ;;
+ *) die "Unknown target, you suck" ;;
+ esac
+ append-lfs-flags #104315
+ emake -f unix/Makefile ${TARGET} || die "emake failed"
+}
+
+src_install() {
+ dobin unzip funzip unzipsfx unix/zipgrep || die "dobin failed"
+ dosym unzip /usr/bin/zipinfo || die
+ doman man/*.1
+ dodoc BUGS History* README ToDo WHERE
+}
diff --git a/app-arch/unzip/unzip-6.0-r3.ebuild b/app-arch/unzip/unzip-6.0-r3.ebuild
new file mode 100644
index 0000000..d2176aa
--- /dev/null
+++ b/app-arch/unzip/unzip-6.0-r3.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/unzip/unzip-6.0-r1.ebuild,v 1.10 2010/01/10 00:28:54 jer Exp $
+
+inherit eutils toolchain-funcs flag-o-matic
+
+MY_P="${PN}${PV/.}"
+
+DESCRIPTION="unzipper for pkzip-compressed files"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="mirror://sourceforge/infozip/${MY_P}.tar.gz"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm hppa ~ia64 m68k ~ppc ppc64 s390 sh ~sparc x86"
+#SDS
+IUSE="bzip2 unicode rcc"
+#To overcome circular dependencies
+PDEPEND="rcc? ( app-i18n/librcc )"
+#EDS
+
+DEPEND="bzip2? ( app-arch/bzip2 )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-no-exec-stack.patch
+
+
+#SDS
+ use rcc && (
+ epatch ${FILESDIR}/${PN}60-ds-isprint.patch || die
+ epatch ${FILESDIR}/${PN}-5.52-ds-rusxmms2.patch || die
+ epatch ${FILESDIR}/${PN}-ds-unixenc.patch || die
+ if [ ! -a /usr/include/librcc.h ]; then
+ cp "${FILESDIR}"/librcc-0.2.7.h librcc.h || die
+ fi
+ )
+
+ ld_opts=""
+ use rcc && ld_opts="-ldl"
+#EDS
+
+ sed -i \
+ -e '/^CFLAGS/d' \
+ -e '/CFLAGS/s:-O[0-9]\?:$(CFLAGS) $(CPPFLAGS):' \
+ -e '/^STRIP/s:=.*:=true:' \
+ -e "s:CC=gcc :CC=$(tc-getCC) :" \
+ -e "s:LD=gcc :LD=$(tc-getCC) :" \
+ -e "s:AS=gcc :AS=$(tc-getCC) :" \
+ -e "s:LF2 = -s:LF2 = ${ld_opts} :" \
+ -e 's:LF = :LF = $(LDFLAGS) :' \
+ -e 's:SL = :SL = $(LDFLAGS) :' \
+ -e 's:FL = :FL = $(LDFLAGS) :' \
+ -e "/^#L_BZ2/s:^$(use bzip2 && echo .)::" \
+ unix/Makefile \
+ || die "sed unix/Makefile failed"
+}
+
+src_compile() {
+ local TARGET
+ case ${CHOST} in
+ i?86*-*linux*) TARGET=linux_asm ;;
+ *linux*) TARGET=linux_noasm ;;
+ i?86*-*bsd* | \
+ i?86*-dragonfly*) TARGET=freebsd ;; # mislabelled bsd with x86 asm
+ *bsd* | *dragonfly*) TARGET=bsd ;;
+ *-darwin*) TARGET=macosx ;;
+ *) die "Unknown target, you suck" ;;
+ esac
+
+ [[ ${CHOST} == *linux* ]] && append-cppflags -DNO_LCHMOD
+ use bzip2 && append-cppflags -DUSE_BZIP2
+ use unicode && append-cppflags -DUNICODE_SUPPORT -DUNICODE_WCHAR -DUTF8_MAYBE_NATIVE
+ append-cppflags -DLARGE_FILE_SUPPORT #281473
+#SDS
+ use rcc && append-cppflags -DRCC_LAZY=1
+#EDS
+
+ emake \
+ -f unix/Makefile \
+ ${TARGET} || die "emake failed"
+}
+
+src_install() {
+ dobin unzip funzip unzipsfx unix/zipgrep || die "dobin failed"
+ dosym unzip /usr/bin/zipinfo || die
+ doman man/*.1
+ dodoc BUGS History* README ToDo WHERE
+}