summaryrefslogtreecommitdiff
path: root/dev-db/redis
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/redis')
-rw-r--r--dev-db/redis/Manifest34
-rw-r--r--dev-db/redis/files/configure.ac-2.258
-rw-r--r--dev-db/redis/files/configure.ac-3.266
-rw-r--r--dev-db/redis/files/redis-2.8.17-config.patch46
-rw-r--r--dev-db/redis/files/redis-2.8.3-shared.patch36
-rw-r--r--dev-db/redis/files/redis-3.0.0-sharedlua.patch44
-rw-r--r--dev-db/redis/files/redis-3.2.0-config.patch37
-rw-r--r--dev-db/redis/files/redis-3.2.0-sharedlua.patch36
-rw-r--r--dev-db/redis/files/redis-3.2.3-config.patch40
-rw-r--r--dev-db/redis/files/redis-3.2.3-sharedlua.patch60
-rw-r--r--dev-db/redis/files/redis-3.2.5-shared.patch30
-rw-r--r--dev-db/redis/files/redis-4.0.1-shared.patch32
-rw-r--r--dev-db/redis/files/redis-4.0.1-sharedlua.patch60
-rw-r--r--dev-db/redis/files/redis.confd20
-rw-r--r--dev-db/redis/files/redis.confd-r120
-rw-r--r--dev-db/redis/files/redis.initd-431
-rw-r--r--dev-db/redis/files/redis.initd-523
-rw-r--r--dev-db/redis/files/redis.service-214
-rw-r--r--dev-db/redis/files/redis.tmpfiles2
-rw-r--r--dev-db/redis/metadata.xml19
-rw-r--r--dev-db/redis/redis-3.0.7-r1.ebuild115
-rw-r--r--dev-db/redis/redis-3.0.7.ebuild115
-rw-r--r--dev-db/redis/redis-3.2.5.ebuild123
-rw-r--r--dev-db/redis/redis-3.2.8-r2.ebuild123
-rw-r--r--dev-db/redis/redis-3.2.8-r4.ebuild131
-rw-r--r--dev-db/redis/redis-4.0.1-r1.ebuild128
-rw-r--r--dev-db/redis/redis-4.0.1.ebuild122
-rw-r--r--dev-db/redis/redis-4.0.2.ebuild130
28 files changed, 1695 insertions, 0 deletions
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
new file mode 100644
index 000000000000..020cb70b610b
--- /dev/null
+++ b/dev-db/redis/Manifest
@@ -0,0 +1,34 @@
+AUX configure.ac-2.2 1522 SHA256 349b9f826578a886930bf395b59e6bdf1802c453ffd4cadbfcc3cca49c07313f SHA512 7a67bbd2f5fcfd7e1bfe18b739438342d40484c3f178ef5e2ddb617480715626e7f5a47d58660761489867ae460a58457a85a14bb2af90fe2e2ab3b8bd940b34 WHIRLPOOL a78a56a8e5963fee703b90d4eba112591693ded8ff8b780b049864be4fe712815ef0743d32b120edadca4e5909982d841cfa4ed1483b9eb91bc030ecdf3d7c70
+AUX configure.ac-3.2 1882 SHA256 abc988876ec5e00afec596ff27430403a248805fe5872db4566d2d523b9446b6 SHA512 13d9f16cde8a95c96bcd726056d670d390dea6e2752ac607bc68eefb6214f0ab18b0e27d3283f2b219febd2da82e6489bd434215c9380c3c85c711aa00cb2be5 WHIRLPOOL 8fcdc27c607cc9dc1e5b7277ec8438bd72a5f5f862ef79eb2b30218d2eb1c62e3764a62b286bf180b0ada2414d47db597f589f18005b638e7f61d196bfb12919
+AUX redis-2.8.17-config.patch 1660 SHA256 2fe9ddae4bd1198850eabd1c2c34258cf0e089aa79575124a72e2333b634392a SHA512 4b7f88361ca33fb676d47e6e5e364cd33731031cf83d0cec34d6542e6e832a6b7187b847fde7c65b8c838b309feec7033e0d44f5a5690d6ed0e6694773d4195e WHIRLPOOL 9dde5a6b75a3d91d5ff785c4d4fa96ee0ccbc6c4d853e41073d957b11176265f1ded151f3a62a23228e28f1da604c9c64a5b0ae6b718b2f8d0e84221b048be74
+AUX redis-2.8.3-shared.patch 909 SHA256 fe95148b87d4fe70b655638a3355865fdb5f52d344d07dfd60ae2350d04b7862 SHA512 1070d9d22654a0ee00ecb2536dd2644cc59917650aa56af10689302c3ac962c172bc24a0c493c17f78aa2632bfd3d924ceef221340622d46fd6bf7346e69f49d WHIRLPOOL eeedadd088bf9a2449406d62bfd386b2c8bf484d6b835948d879d6441e35ee20e80c489fc8d81b4c9cb23dd4ebfe1dc07217fed058bd4e5be44f9c6f17a9ac81
+AUX redis-3.0.0-sharedlua.patch 1900 SHA256 6d3e84831d98fe0251a3f4dbcfa941df7eb40eaba6137a18296a4609d9eec471 SHA512 817719139b500073ab038286e2457f5ce5978a88ceb910cccf51015d607b4d9b640d1d5ffeeb55f06781cd04a1f7d604bf1cceddd3cab480753c8c119ecda49d WHIRLPOOL 7265392ff47e29e00fae5161d3492b726b0a930cd340e96b564c6c36389bac27bedac7b867f4887512d9b2a9f5d2ff4a71d595437fd1f2c5ad96c90459b64fc2
+AUX redis-3.2.0-config.patch 1352 SHA256 5a0210b3fa593530eecbbc7503cd61fd946d97bc525eb362848456825dc23862 SHA512 b72b6a6b44e534616183aed23fed0300d02337f10dccad2bd94c803788fcbeaa9a6f3252b5232a149a0a6928c4fda200e84e6d6846f0c0556aad273d9445fccb WHIRLPOOL 91c048aafb79f3856e1ed107518fc22159c9627930a68b3ea2a3ec223e9ae03fa7c51c2b878b993ccf4660e9ab829a61ff10a66bf9647aa7907d506c60081e32
+AUX redis-3.2.0-sharedlua.patch 1923 SHA256 3ede6adb41bfc72241eb928c52643148ecb4f1af13efb0c2658e8eeb9125cc51 SHA512 c0c34644531a206880184102beafd881866209c76672e5d2bbc560e0edb9e469c3c2035ee437326980d97d0220b87f1df6d0a4d5c3e47804bacabdd93c74536e WHIRLPOOL f66482f9ee9da81ab053199559a6682ae729c251052fc5bd6af60cf1c8fb21d207a46c482e51c62d2e25e7cd1eee997752b0274c6394db342a5cbdca8acb71a6
+AUX redis-3.2.3-config.patch 1495 SHA256 48988330395b43a7551e7a285f597a4052b50e17616d5ea7763daa561d184149 SHA512 d71c918ea4952ecb55cc4c87649745ee468587c289d60bd1bee87a2948a6e882d42afe36bb113392b5aaab17d315732cabfc472804204d3a043305a5488a4124 WHIRLPOOL 1360d39ba816e9cc6adefff587f7773743250a518bf3351c0afa6e94aaa394710ef3de0a6deea3fe15d54ae506d5abdb02795d9bcb19b445408ffef3e67951e1
+AUX redis-3.2.3-sharedlua.patch 2535 SHA256 0056ddcb8552da5ce424d0f016fabafbff552734e632377403521f611f667bcf SHA512 4b60271a24a27f69292450575f9316dd009e154980db2b70d7035794bc1f332fe54957558037c75de625d1eaf98cc0f1ec02fcd0ef510c86a3c605c474c1117e WHIRLPOOL 672185942783ccd8d5c635a8d8d2aec839ff68770b42d7acd8cd059aa046b2b5550164564a6b63696cfb4e4bcb31fc04de2b427ca7dcd85f3dfe2806207a457d
+AUX redis-3.2.5-shared.patch 754 SHA256 008cd244b40d6a3bef804a6aa30c4592a7ad8480ea1358112071f079ed284d47 SHA512 dcb0755a0cc24b4dc21c7a20891df5fa0c643beb8f411779548893ac9681c41510ecba79b0ba031d7eeeccbf5b15ae32be04241b197524de4f8f9aafa02ccaab WHIRLPOOL be653deb553aa59102ea6af2c7870b90f0b9d2f989aee677bb6e9e81b89ce818e49484fba83d813cf0902c714da42ec6dd86a8daa20c32e50bdb65c8b8b8eaec
+AUX redis-4.0.1-shared.patch 866 SHA256 d0b6186ddbe0f7912405e06c01987d5fbbcb4ea2759b93cbf4ea44ab6df6ad72 SHA512 f58ae83d3370949187325b1f1f75feb7d85d3112ae65e7cd330d193490c42aa6288f05cd4d2309dbde5d32015a067ec831255a3dab937cd0889970c8eecfb3f1 WHIRLPOOL 3601bf1a7e743819e8191a19639d62dec8e929c15b2010d82b2b109605eb7997f36d9c15ba8e3778640dbced8e23637c0c03ae6385308e4c02c6eac64a4ac556
+AUX redis-4.0.1-sharedlua.patch 2568 SHA256 76a14354c456cdcb50507392d34a6b126706fd9780e38ded66eecd420dfdf8a3 SHA512 c7c08b67c09425876da513bbeb52667fe5917b56a43749a914dac356fa37c091b696765eabca100f2506cf461107abdbf22bce075879a8aa82a0e8d54f696fee WHIRLPOOL b15f8c5c57a6da05577894a7bd8eb7bcca420184d0c80435fbaa884d23f125de6d9b6bcb93ec4c6ab7409d2fc878906dcbc988551105d8958d3aa6aef350a475
+AUX redis.confd 450 SHA256 8c68e29dc88c8ad99b9212a448d313d1406ef02c7638398b2e48ea1ca8aa937b SHA512 c6347cc6e17e9ce93fd081608b19c4977c3e1ffd58d2a417804ca3e647967800ac11859bd05d5437c36310dcd7552c11f35965e4521c5266c3414387d4796a6b WHIRLPOOL 72fb07431293f0e382af98c5a0b7eeca146cab84153befdd808328aa27404cd74d55d524b5442ad10de5989917351299bc7610e0be75d11d2e31fb5353beb45a
+AUX redis.confd-r1 511 SHA256 d995e4b96a4e11e8012edd470288f9b48b87b5a144a357bbaedd411c9bb1329d SHA512 f041e6b1da2c579a7dcf40e411ff47bc4675e5931e04f4353888ed5864b7e0c94d53fc98faee982c65a69d0154ee1f624fbadbbcc3a324aec583eefee6fb7133 WHIRLPOOL e819dddfbfe2730a30e1d85b85a68908abe573788b2ef13fb73d2e0e561c22845e2e564643ee93a76df2f22508280de753fc8f4708b23436d3599dd70d478635
+AUX redis.initd-4 780 SHA256 94257e625ee8c0212dd8afdaa9871796f9944a3ee68641cbde902a1a8a9c6fa9 SHA512 779a35db0f603956c9ab7827f1d0a0b20d5dcab041aafca2055dfd413056de5e572c9996929ef9bf3c54b5f56e4a3a20f2eaaec306b5790252b46ebae30e74b6 WHIRLPOOL 22af0f74c4b1c1120288264d3c1261e38d51b30b0e01e0fd1693e2f4568e1252662ec31e26591142c9e32ffdaa0d0ab89b66bcdf2fbb2f67932735b1a5dc87e5
+AUX redis.initd-5 590 SHA256 b7d0b0fe1467507ba15be1aa009a355279bd8318880d37289f6534bd753bcf30 SHA512 1f9b065c7facece193556d923016a977da811deb1bb19d1607a3f6ac257b78de5d91b829a66d799e54c40e93d00bf3eb43a97476c79b6b46c38c3fd25dd7a702 WHIRLPOOL cc010188604f33fa7994738fe881d0cfed46fabd4afb849c983dcaa93362588c73c6704fba2afec5964abf4e60edeb33b22261186bb7cfeb517b2181adf83709
+AUX redis.service-2 253 SHA256 e65ec7fdac98f30fb72ab73656e4467e74c8900d2664cba64d9baf9e16eaee1b SHA512 b42b73bb54ccc0d16adafb91aabe010092f548ec7979d8a0ed1c4563d9fca378eeb74c0c556f7565a32199ed30ca8a13d6b610d9cda39fd23da1428a410f62cc WHIRLPOOL e2b041b37bf95cbe4ed6684238034497c971352db602a86adbb5ef0626967b4ab20dd9ae412c0cae009a8470e502426b0135e4c676858c11d6e10c97a677baee
+AUX redis.tmpfiles 61 SHA256 68e4c7e3159068400cbc7d07e84b5618f9d829dc7a4f18253783c6256a53031a SHA512 741ff5a4df5b04e7af4e81357812bf5b6cf992bc18b6052074aef134401d0a92703a2e41f52966012c05ea80fac5636435c8d3e6ed55e62a5711526ba67ee738 WHIRLPOOL 2c6f4d9e5382c43e935db16bf120b24cd8de517bc067dcab91b3230a8ddced7ecc5ed37626464d3f1a7880d2d41efdf3cecfd1029a38aaa2edf3d20de74489b4
+DIST redis-3.0.7.tar.gz 1375200 SHA256 b2a791c4ea3bb7268795c45c6321ea5abcc24457178373e6a6e3be6372737f23 SHA512 6c8f4c88d911e1433fd28efff2f6d62763e08be89814ebf4aa4e68e2c8bd605eba24ca3410548b2f480ae094437ce96c0bafa7a5762b3b405d5d850886297ba3 WHIRLPOOL 53c2c967b999bbcb5b45117bbad74b46457158ad94e8c43566311dd3d58c63c2d0cc2dac5dc9e8806821c2532ee4beded17e039da4ddeae958e5a0092429ee3a
+DIST redis-3.2.5.tar.gz 1544040 SHA256 8509ceb1efd849d6b2346a72a8e926b5a4f6ed3cc7c3cd8d9f36b2e9ba085315 SHA512 4ecf6277c8fdf4411223b9f5a5c8308829da9bd756b45de5217d469e9def8faad8c05b6348c06aef99eca9245d45abfd52df056c3c819723da66a2ca20c381dd WHIRLPOOL db1eecac5e407734002d39cc16f708fcb1f506829df4dabda53bffc7012746a23ea2342cded4d90f39db72ba61eda349b80b4a3e4f1eba06dbaa6cad8c50264e
+DIST redis-3.2.8.tar.gz 1547237 SHA256 61b373c23d18e6cc752a69d5ab7f676c6216dc2853e46750a8c4ed791d68482c SHA512 7334faf73af3644f7f9dcaddd322955d5df1e88a1640b509ae623f322615a20f6dc143eb57dd89ff3a278557df309ac4215c3fb458235682ce28e16c817068ba WHIRLPOOL 50ffecd1891051a3e28028065bfaf090b2eec42a757cdf61c6d22b051c8ba4fc78809b3198182d2333bedb4715d9a8d70bf04f605030abe6e33cc6b9b7161cf7
+DIST redis-4.0.1.tar.gz 1711660 SHA256 2049cd6ae9167f258705081a6ef23bb80b7eff9ff3d0d7481e89510f27457591 SHA512 62dec537aebd12340b9642f5f8b07fd98757c9e648dcd539a0411f207db3495923c5a6a9941036c56b2d574ee38b46d08558668111e322345ef549f93fada26f WHIRLPOOL 90b6a7a81e6d5302a28c49a8a1ea479f80f7924eb2f69d0b17d48cf15c9ba769a8ef425ae9bec44d3cbd81816b43fe7997adeb73caa6d2b64f7657e60cb2fb82
+DIST redis-4.0.2.tar.gz 1713990 SHA256 b1a0915dbc91b979d06df1977fe594c3fa9b189f1f3d38743a2948c9f7634813 SHA512 1458909c6fc16cff8ca5e6dddff23b988ee1e447f2d0bccf5941553b22bab6abb851732b3fe53dafb8a69d6c0939c3ce7e0686d51e03be720fb018c038d3b1b4 WHIRLPOOL 24834b1fbedaea75f245c9f3f7dc29444b34bccdac08b060dee5ff78b23ee60cb029d8a255f69df7a7a3a54c7440bb37390361a2d995eb0bc7534273570adfc3
+EBUILD redis-3.0.7-r1.ebuild 3312 SHA256 178857c68ff546fe0e5a5bd968afc0979e17e60ab41ed3539655d836c1f036d6 SHA512 de42869cd28e6b9f7ce63ef0baaa64acc0b5465d2bb2a0c23013a42c0a00059a18620ab428eae88b33f4d6a3b37b2e6cc0dc71135af807dbd9d524908d1d80fb WHIRLPOOL 26d3325a56be5d02fa6571d3bfca3a399c765f7ba2e7d6577b13f0117ea5d4b97c7449d1dd2c3eb942f8711bf5c22ec38dd2db42af455b3e2c1d93be40b54e37
+EBUILD redis-3.0.7.ebuild 3312 SHA256 178857c68ff546fe0e5a5bd968afc0979e17e60ab41ed3539655d836c1f036d6 SHA512 de42869cd28e6b9f7ce63ef0baaa64acc0b5465d2bb2a0c23013a42c0a00059a18620ab428eae88b33f4d6a3b37b2e6cc0dc71135af807dbd9d524908d1d80fb WHIRLPOOL 26d3325a56be5d02fa6571d3bfca3a399c765f7ba2e7d6577b13f0117ea5d4b97c7449d1dd2c3eb942f8711bf5c22ec38dd2db42af455b3e2c1d93be40b54e37
+EBUILD redis-3.2.5.ebuild 3578 SHA256 1c935a9f011cf9ceba6a75fb2b0d204817b4aa70cb7bd7e003aa94f98473e627 SHA512 72d8563a1eee0e62d34a3c04583c210a95c0fdd306512f63714324ac6e1302f5a06debb56bae083f9102eef9cade1674f6d5dd746ca7ab796e70592aef659021 WHIRLPOOL ef8f61ee53edbd01e55119105a961bddd4188b92dc55ae54a1ff9a4fe02f0b9139c06abf54864180529a569442785e84592f952e8df0d694f28606835f6d9e07
+EBUILD redis-3.2.8-r2.ebuild 3579 SHA256 7e4ea5f0a2396bd4c0a5e0da06c42422ff58b3fc8d165f00f52012f38749045d SHA512 3acf577e2509cf29ae5274117ec5c512fe390167d88c38b6fd375a5d145e4b94704990b23e3a18d6e8ab6c91e5d5bebb5d6c9330a9975b7ef9aa2d14c0914282 WHIRLPOOL 227ca8851ce549c4947c9a258071b44a1f4c5c3a779946a1d998fbe468741e9be73a275ce01337ab9a02840e5f7452268abd92d396fe3179746a8f767fda7382
+EBUILD redis-3.2.8-r4.ebuild 3891 SHA256 3a9ceddc4b209bf1952223300badbf5ab81d72533485d4248422594d828f5d05 SHA512 00d62cc9e030912c942030466b397accc11100e64175df3031b9e9e67c11d4ac62b0fea66fea903264c3e0eedd883c4c188d563e24a74e9ec1af3cc54ade0bda WHIRLPOOL 8a887d676f07f8116f00c05ef220e22be0b81a17abce12e0e89f3cf112e226cb083c347ee41a5d4b6a8b3eec48b6f5b743d1eba375cfa091157eac876592a915
+EBUILD redis-4.0.1-r1.ebuild 3722 SHA256 4305a38f60f529600e36ced799a5c780c32a152e5d4e2efcdbf200bb92b8ab0a SHA512 d928b9714a9c028fbe14286c975a5ba385384c4ff32311e060252ccf9802e2f58d945d261a9fd5cd512d7142cb82fdb41a44955c046c253ee399e09578b42a0d WHIRLPOOL cf4a5bd6128143c87808282e24a439d527c6f3efde4308231d8fafd393a41b3869fdebf61c0791ad350ff2665651b4816e46377f8e62820da819d51647cba068
+EBUILD redis-4.0.1.ebuild 3507 SHA256 8e8281d3c068e21e6e925ff905603dc645262577eaa898a4c7032ab479ad7dfb SHA512 e0a258e5e2333d9c88d5ebba37f52cb772bb17d77b719edc0ce443a3a2ac09cd064766fcf7541503fe656ca2f77d890ae911f518b2552e2673f650cc8bd4d13d WHIRLPOOL 62f2267dceddce78da7b81aa49d40087afb39981743ec02a3337c11202e880fbc9126b49a88dc38cfec8d6bc4391565b1573fcbcab420019cb674271e8b40e4b
+EBUILD redis-4.0.2.ebuild 3814 SHA256 949258b27da78e4663f65e1eea15882543cb8978c0dd90e83334026c17cc461e SHA512 3e053a76b16dd7a73cadd890bd5d3afc9a4652f4b5503d0a0c9f135e0c4711e085533cdf3422cdca571ea49ee7769b62145421423a0d619e3941620ab173bd52 WHIRLPOOL 916a0944ff241821cebf34b748c6ef30d80a6cd90fab53e0ba0eb2a15ada43a1a00035b145cab77bbb88727ba674f7edd40c8b4d2d0bc723ddfc4bf58d98caba
+MISC ChangeLog 9085 SHA256 ed9cb241c3bfe71d3211e01c2a198c4d8e42fbfd42633487141ec65e7c3bd7e4 SHA512 ebcb05824a18732c1daf72785a6ef59305378ea215f3910487fec354771f7a9137d27f0c4bf50a935829f2bd3bce5dbe2bb1a7faf478fc1c8dc01398e435f8b2 WHIRLPOOL e9bce2718149978854fc4adbc99db7daadd1687bf67e68b075ccea02659c71dad7c620a39740d1ac70e0f6a855cc5638b4a3237b85b4719a0ea8100d7524d959
+MISC ChangeLog-2015 14790 SHA256 2b26170b052d7ee86954593cf4c8ac44c071e702b546cfb10b5821371efa5bea SHA512 80ece5f6c84ad894aad3290665c6d2099f7c57eee8682fe85d2ab59969099d5f7e229a81968c02f63601b7e40123073394ffeccb58edfa8c374b6148213956f5 WHIRLPOOL c8828bedd95dc6814790355ad42ed2d378831f821c5185a1db2a45c89ebb770a5fbc3453b4893e7d9831ac98a5384fcaecc920cbda97ba5d7c4a98a4121f33b3
+MISC metadata.xml 632 SHA256 623fd6b8e252684955a557e3bd26a6fa237dce08702e8373a9eb65207a609a14 SHA512 a032eb7204137f8c5e7b75f8b214b0b6fd7f2a119b261a3da2e0cf8979fda5a5f25643870515a8e8d821ff63df3d17808a6e3189cc16a0f87c88f479571e8ef5 WHIRLPOOL 652c5fcb32bf4a79400534743cb5b4803d813daf9ec363ca38c5c1c2c7f3292b16a50e99845274486fbe5c8dda2abe1ce98da28350f18c06a5d508146a7bd172
diff --git a/dev-db/redis/files/configure.ac-2.2 b/dev-db/redis/files/configure.ac-2.2
new file mode 100644
index 000000000000..3ff6650407ca
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-2.2
@@ -0,0 +1,58 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 2.0.0, antirez@gmail.com)
+AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
+if test x"$CFLAGS" = x""; then
+ AM_CFLAGS="$AM_CFLAGS -O2"
+else
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
+fi
+
+# options
+AC_MSG_CHECKING([whether to build with debug information])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debug data generation (def=no)])],
+ [debugit="$enableval"],
+ [debugit=no])
+AC_MSG_RESULT([$debugit])
+
+if test x"$debugit" = x"yes"; then
+ AC_DEFINE([DEBUG],[],[Debug Mode])
+ AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
+else
+ AC_DEFINE([NDEBUG],[],[No-debug Mode])
+fi
+AC_SUBST([AM_CFLAGS])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/configure.ac-3.2 b/dev-db/redis/files/configure.ac-3.2
new file mode 100644
index 000000000000..3e2cf9267266
--- /dev/null
+++ b/dev-db/redis/files/configure.ac-3.2
@@ -0,0 +1,66 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.63)
+AC_INIT(redis, 3.2.3, antirez@gmail.com)
+AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
+if test x"$CFLAGS" = x""; then
+ AM_CFLAGS="$AM_CFLAGS -O2"
+else
+ AM_CFLAGS="$AM_CFLAGS $CFLAGS"
+fi
+
+# options
+AC_MSG_CHECKING([whether to build with debug information])
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [enable debug data generation (def=no)])],
+ [debugit="$enableval"],
+ [debugit=no])
+AC_MSG_RESULT([$debugit])
+
+if test x"$debugit" = x"yes"; then
+ AC_DEFINE([DEBUG],[],[Debug Mode])
+ AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
+else
+ AC_DEFINE([NDEBUG],[],[No-debug Mode])
+fi
+AC_SUBST([AM_CFLAGS])
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_INLINE
+AC_TYPE_INT16_T
+AC_TYPE_INT32_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_FORK
+AC_FUNC_STRCOLL
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])
+
+# Check for lua-5.1 or luajit
+AC_ARG_WITH([luajit],
+ AS_HELP_STRING([--with-luajit], [Use luajit instead of lua]))
+
+AS_IF([test "x$with_luajit" = "xyes"],
+ [PKG_CHECK_MODULES([LUA], [luajit >= 2], [], [AC_MSG_ERROR([luajit requested but not found])])],
+ [PKG_CHECK_MODULES([LUA], [lua5.1], [], [AC_MSG_ERROR([lua-5.1 required but not found])])])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/dev-db/redis/files/redis-2.8.17-config.patch b/dev-db/redis/files/redis-2.8.17-config.patch
new file mode 100644
index 000000000000..c9f6b2af172b
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.17-config.patch
@@ -0,0 +1,46 @@
+--- a/redis.conf 2014-12-02 16:22:38.722433643 +0100
++++ b/redis.conf 2014-12-02 16:22:16.252249350 +0100
+@@ -38,7 +38,7 @@
+
+ # When running daemonized, Redis writes a pid file in /var/run/redis.pid by
+ # default. You can specify a custom pid file location here.
+-pidfile /var/run/redis.pid
++pidfile /run/redis/redis.pid
+
+ # Accept connections on the specified port, default is 6379.
+ # If port 0 is specified Redis will not listen on a TCP socket.
+@@ -61,7 +61,7 @@
+ # Examples:
+ #
+ # bind 192.168.1.100 10.0.0.1
+-# bind 127.0.0.1
++bind 127.0.0.1
+
+ # Specify the path for the Unix socket that will be used to listen for
+ # incoming connections. There is no default, so Redis will not listen
+@@ -100,7 +100,7 @@
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -184,7 +184,7 @@
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -403,6 +403,7 @@
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+ # maxmemory <bytes>
++maxmemory 67108864
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-2.8.3-shared.patch b/dev-db/redis/files/redis-2.8.3-shared.patch
new file mode 100644
index 000000000000..d32484f0cd18
--- /dev/null
+++ b/dev-db/redis/files/redis-2.8.3-shared.patch
@@ -0,0 +1,36 @@
+commit 388a76f24c96767c831ee7682234fd9f2bc5b9ac
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Mon Nov 25 09:17:14 2013 +1100
+
+ Use shared jemalloc
+
+diff --git src/Makefile src/Makefile
+index c37549d..77e6255 100644
+--- src/Makefile
++++ src/Makefile
+@@ -26,12 +26,7 @@ PREFIX?=/usr/local
+ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -79,9 +74,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-3.0.0-sharedlua.patch b/dev-db/redis/files/redis-3.0.0-sharedlua.patch
new file mode 100644
index 000000000000..ba983efafc7c
--- /dev/null
+++ b/dev-db/redis/files/redis-3.0.0-sharedlua.patch
@@ -0,0 +1,44 @@
+commit fd0fc43f6e0ea45bce0e1a68c1f736e481fc4429
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Thu Apr 2 14:33:51 2015 +1100
+
+ Use shared LUA
+
+diff --git src/Makefile src/Makefile
+index a88f1d2..f71e7b5 100644
+--- src/Makefile
++++ src/Makefile
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua
++DEPENDENCY_TARGETS=hiredis linenoise
+
+ # Default settings
+ STD=-std=c99 -pedantic
+@@ -47,6 +47,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=$(shell pkg-config --libs lua)
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -108,6 +109,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o sds.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+ REDIS_BENCHMARK_NAME=redis-benchmark
+@@ -162,7 +164,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.0-config.patch b/dev-db/redis/files/redis-3.2.0-config.patch
new file mode 100644
index 000000000000..8d93a0e7b62a
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.0-config.patch
@@ -0,0 +1,37 @@
+--- a/redis.conf 2016-05-06 09:11:36.000000000 +0200
++++ b/redis.conf 2016-06-14 09:20:05.980855432 +0200
+@@ -146,7 +146,7 @@
+ #
+ # Creating a pid file is best effort: if Redis is not able to create it
+ # nothing bad happens, the server will start and run normally.
+-pidfile /var/run/redis.pid
++pidfile /run/redis/redis.pid
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -159,7 +159,7 @@
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -243,7 +243,7 @@
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -505,6 +505,7 @@
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+ # maxmemory <bytes>
++maxmemory 67108864
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-3.2.0-sharedlua.patch b/dev-db/redis/files/redis-3.2.0-sharedlua.patch
new file mode 100644
index 000000000000..248e990cf59c
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.0-sharedlua.patch
@@ -0,0 +1,36 @@
+--- a/src/Makefile 2016-06-14 09:21:51.613721601 +0200
++++ b/src/Makefile 2016-06-14 09:25:21.262442026 +0200
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
++DEPENDENCY_TARGETS=hiredis linenoise geohash-int
+
+ # Default settings
+ STD=-std=c99 -pedantic -DREDIS_STATIC=''
+@@ -51,6 +51,7 @@
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=$(shell pkg-config --libs lua)
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -112,6 +113,7 @@
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+@@ -166,7 +168,7 @@
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.3-config.patch b/dev-db/redis/files/redis-3.2.3-config.patch
new file mode 100644
index 000000000000..bde0ef7cbaf1
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-config.patch
@@ -0,0 +1,40 @@
+diff --git a/redis.conf b/redis.conf
+index 22e00bc..b09de57 100644
+--- a/redis.conf
++++ b/redis.conf
+@@ -147,7 +147,7 @@ supervised no
+ #
+ # Creating a pid file is best effort: if Redis is not able to create it
+ # nothing bad happens, the server will start and run normally.
+-pidfile /var/run/redis_6379.pid
++pidfile /run/redis/redis.pid
+
+ # Specify the server verbosity level.
+ # This can be one of:
+@@ -160,7 +160,7 @@ loglevel notice
+ # Specify the log file name. Also the empty string can be used to force
+ # Redis to log on the standard output. Note that if you use standard
+ # output for logging but daemonize, logs will be sent to /dev/null
+-logfile ""
++logfile /var/log/redis/redis.log
+
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes,
+ # and optionally update the other syslog parameters to suit your needs.
+@@ -244,7 +244,7 @@ dbfilename dump.rdb
+ # The Append Only File will also be created inside this directory.
+ #
+ # Note that you must specify a directory here, not a file name.
+-dir ./
++dir /var/lib/redis/
+
+ ################################# REPLICATION #################################
+
+@@ -534,7 +534,7 @@ slave-priority 100
+ # limit for maxmemory so that there is some free RAM on the system for slave
+ # output buffers (but this is not needed if the policy is 'noeviction').
+ #
+-# maxmemory <bytes>
++maxmemory 64MB
+
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
+ # is reached. You can select among five behaviors:
diff --git a/dev-db/redis/files/redis-3.2.3-sharedlua.patch b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
new file mode 100644
index 000000000000..52de9048463f
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.3-sharedlua.patch
@@ -0,0 +1,60 @@
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7..fa50c41 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -46,7 +46,7 @@
+ #include "strbuf.h"
+ #include "fpconv.h"
+
+-#include "../../../src/solarisfixes.h"
++#include "solarisfixes.h"
+
+ #ifndef CJSON_MODNAME
+ #define CJSON_MODNAME "cjson"
+diff --git a/src/Makefile b/src/Makefile
+index 648127a..1f96d98 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -15,7 +15,7 @@
+ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua geohash-int
++DEPENDENCY_TARGETS=hiredis linenoise geohash-int
+
+ # Default settings
+ STD=-std=c99 -pedantic -DREDIS_STATIC=''
+@@ -56,6 +56,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -I../deps/geohash-int
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=@LUA_LIBS@
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -80,7 +81,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@
+
+ ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -118,6 +119,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o geo.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_GEOHASH_OBJ=../deps/geohash-int/geohash.o ../deps/geohash-int/geohash_helper.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+@@ -172,7 +174,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(REDIS_GEOHASH_OBJ) $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis-3.2.5-shared.patch b/dev-db/redis/files/redis-3.2.5-shared.patch
new file mode 100644
index 000000000000..7ebff12b5196
--- /dev/null
+++ b/dev-db/redis/files/redis-3.2.5-shared.patch
@@ -0,0 +1,30 @@
+diff --git a/src/Makefile b/src/Makefile
+index fdbe36a..df224ae 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -26,12 +26,7 @@ PREFIX?=/usr/local
+ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+-# Default allocator
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-else
+- MALLOC=libc
+-endif
++MALLOC?=jemalloc
+
+ # Backwards compatibility for selecting an allocator
+ ifeq ($(USE_TCMALLOC),yes)
+@@ -103,9 +98,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-4.0.1-shared.patch b/dev-db/redis/files/redis-4.0.1-shared.patch
new file mode 100644
index 000000000000..945d114ae2fb
--- /dev/null
+++ b/dev-db/redis/files/redis-4.0.1-shared.patch
@@ -0,0 +1,32 @@
+diff --git a/src/Makefile b/src/Makefile
+index 86e0b3fe..c7db0ee9 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -29,14 +29,7 @@ INSTALL_BIN=$(PREFIX)/bin
+ INSTALL=install
+
+ # Default allocator defaults to Jemalloc if it's not an ARM
+-MALLOC=libc
+-ifneq ($(uname_M),armv6l)
+-ifneq ($(uname_M),armv7l)
+-ifeq ($(uname_S),Linux)
+- MALLOC=jemalloc
+-endif
+-endif
+-endif
++MALLOC?=jemalloc
+
+ # To get ARM stack traces if Redis crashes we need a special C flag.
+ ifneq (,$(findstring armv,$(uname_M)))
+@@ -120,9 +113,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
+ endif
+
+ ifeq ($(MALLOC),jemalloc)
+- DEPENDENCY_TARGETS+= jemalloc
+- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
+- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a
++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
++ FINAL_LIBS+= -ljemalloc -ldl
+ endif
+
+ REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
diff --git a/dev-db/redis/files/redis-4.0.1-sharedlua.patch b/dev-db/redis/files/redis-4.0.1-sharedlua.patch
new file mode 100644
index 000000000000..d2b572250e86
--- /dev/null
+++ b/dev-db/redis/files/redis-4.0.1-sharedlua.patch
@@ -0,0 +1,60 @@
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
+index c26c0d7b..fa50c410 100644
+--- a/deps/lua/src/lua_cjson.c
++++ b/deps/lua/src/lua_cjson.c
+@@ -46,7 +46,7 @@
+ #include "strbuf.h"
+ #include "fpconv.h"
+
+-#include "../../../src/solarisfixes.h"
++#include "solarisfixes.h"
+
+ #ifndef CJSON_MODNAME
+ #define CJSON_MODNAME "cjson"
+diff --git a/src/Makefile b/src/Makefile
+index 86e0b3fe..09630321 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh')
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
+ OPTIMIZATION?=-O2
+-DEPENDENCY_TARGETS=hiredis linenoise lua
++DEPENDENCY_TARGETS=hiredis linenoise
+ NODEPS:=clean distclean
+
+ # Default settings
+@@ -66,6 +66,7 @@ endif
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
+ FINAL_LIBS=-lm
++FINAL_LIBS+=@LUA_LIBS@
+ DEBUG=-g -ggdb
+
+ ifeq ($(uname_S),SunOS)
+@@ -107,7 +108,7 @@ endif
+ endif
+ endif
+ # Include paths to dependencies
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@
+
+ ifeq ($(MALLOC),tcmalloc)
+ FINAL_CFLAGS+= -DUSE_TCMALLOC
+@@ -145,6 +146,7 @@ endif
+ REDIS_SERVER_NAME=redis-server
+ REDIS_SENTINEL_NAME=redis-sentinel
+ REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
+ REDIS_CLI_NAME=redis-cli
+ REDIS_CLI_OBJ=anet.o adlist.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o
+ REDIS_BENCHMARK_NAME=redis-benchmark
+@@ -196,7 +198,7 @@ endif
+
+ # redis-server
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS)
+
+ # redis-sentinel
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
diff --git a/dev-db/redis/files/redis.confd b/dev-db/redis/files/redis.confd
new file mode 100644
index 000000000000..07585fa7a116
--- /dev/null
+++ b/dev-db/redis/files/redis.confd
@@ -0,0 +1,20 @@
+# Redis user.
+REDIS_USER="redis"
+
+# Redis group.
+REDIS_GROUP="redis"
+
+# Redis configuration file.
+REDIS_CONF="/etc/redis.conf"
+
+# Redis dump directory.
+REDIS_DIR="/var/lib/redis"
+
+# Redis pid file.
+# (Be sure to change the main redis configuration file as well if you change
+# this from the default.)
+REDIS_PID="/var/run/redis/redis.pid"
+
+# Redis options.
+# (Redis expects the first argument to be the configuration file.)
+REDIS_OPTS="${REDIS_CONF}"
diff --git a/dev-db/redis/files/redis.confd-r1 b/dev-db/redis/files/redis.confd-r1
new file mode 100644
index 000000000000..1f4ff23f211b
--- /dev/null
+++ b/dev-db/redis/files/redis.confd-r1
@@ -0,0 +1,20 @@
+# Redis user.
+REDIS_USER="redis"
+
+# Redis group.
+REDIS_GROUP="redis"
+
+# Redis configuration file.
+REDIS_CONF="/etc/redis.conf"
+
+# Redis dump directory.
+REDIS_DIR="/var/lib/redis"
+
+# Redis options.
+# (Redis expects the first argument to be the configuration file.)
+REDIS_OPTS="${REDIS_CONF}"
+
+# Specify the network service that corresponds to the "bind" setting
+# in your redis.conf. For example, if you bind to 127.0.0.1, this should
+# be set to "net.lo" which provides the loopback interface.
+rc_need="net.lo"
diff --git a/dev-db/redis/files/redis.initd-4 b/dev-db/redis/files/redis.initd-4
new file mode 100644
index 000000000000..5c12fdc7c79d
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-4
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+
+REDIS_DIR=${REDIS_DIR:-/var/lib/redis}
+REDIS_CONF=${REDIS_CONF:-/etc/redis.conf}
+REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"}
+REDIS_USER=${REDIS_USER:-redis}
+REDIS_GROUP=${REDIS_GROUP:-redis}
+REDIS_TIMEOUT=${REDIS_TIMEOUT:-30}
+
+command=/usr/sbin/redis-server
+pidfile=${REDIS_PID:-/run/redis/redis.pid}
+start_stop_daemon_args="--background --pidfile ${pidfile} --chdir \"${REDIS_DIR}\" --user ${REDIS_USER} --group ${REDIS_GROUP}"
+command_args="${REDIS_OPTS}"
+
+depend() {
+ use net localmount logger
+ after keepalived
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${REDIS_USER}:${REDIS_GROUP} $(dirname ${REDIS_PID})
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --exec ${command} \
+ --retry ${REDIS_TIMEOUT} \
+ --pidfile ${pidfile}
+ eend
+}
diff --git a/dev-db/redis/files/redis.initd-5 b/dev-db/redis/files/redis.initd-5
new file mode 100644
index 000000000000..a567b1e210d8
--- /dev/null
+++ b/dev-db/redis/files/redis.initd-5
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${REDIS_DIR:=/var/lib/redis}
+: ${REDIS_CONF:=/etc/redis.conf}
+: ${REDIS_OPTS:="${REDIS_CONF}"}
+: ${REDIS_USER:=redis}
+: ${REDIS_GROUP:=redis}
+: ${REDIS_TIMEOUT:=30}
+
+command="/usr/sbin/redis-server"
+command_args="${REDIS_OPTS}"
+command_background="true"
+command_user="${REDIS_USER}:${REDIS_GROUP}"
+pidfile="/run/${RC_SVCNAME}.pid"
+retry="${REDIS_TIMEOUT}"
+start_stop_daemon_args="--chdir \"${REDIS_DIR}\""
+
+depend() {
+ use localmount logger
+ after keepalived
+}
diff --git a/dev-db/redis/files/redis.service-2 b/dev-db/redis/files/redis.service-2
new file mode 100644
index 000000000000..c36d7960ef71
--- /dev/null
+++ b/dev-db/redis/files/redis.service-2
@@ -0,0 +1,14 @@
+[Unit]
+Description=A persistent key-value database
+After=syslog.target network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/redis/redis.pid
+ExecStart=/usr/sbin/redis-server /etc/redis.conf
+User=redis
+Group=redis
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/dev-db/redis/files/redis.tmpfiles b/dev-db/redis/files/redis.tmpfiles
new file mode 100644
index 000000000000..657d8a551d4b
--- /dev/null
+++ b/dev-db/redis/files/redis.tmpfiles
@@ -0,0 +1,2 @@
+# redis runtime directory
+d /var/run/redis 0755 redis root -
diff --git a/dev-db/redis/metadata.xml b/dev-db/redis/metadata.xml
new file mode 100644
index 000000000000..872bd8ba741e
--- /dev/null
+++ b/dev-db/redis/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ultrabug@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>robbat2@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="jemalloc">
+ Use <pkg>dev-libs/jemalloc</pkg> for allocations.
+ </flag>
+ <flag name="tcmalloc">
+ Use tcmalloc from <pkg>dev-util/google-perftools</pkg> for allocations.
+ </flag>
+ <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of <pkg>dev-lang/lua</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/dev-db/redis/redis-3.0.7-r1.ebuild b/dev-db/redis/redis-3.0.7-r1.ebuild
new file mode 100644
index 000000000000..e46c5c221e5a
--- /dev/null
+++ b/dev-db/redis/redis-3.0.7-r1.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc test"
+SLOT="0"
+
+RDEPEND=">=dev-lang/lua-5.1:*
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.3-shared.patch
+ epatch "${FILESDIR}"/${PN}-2.8.17-config.patch
+ epatch "${FILESDIR}"/${PN}-3.0.0-sharedlua.patch
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-2.2 configure.ac
+ sed -i -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoconf
+}
+
+src_configure() {
+ econf
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-dump
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.0.7.ebuild b/dev-db/redis/redis-3.0.7.ebuild
new file mode 100644
index 000000000000..e46c5c221e5a
--- /dev/null
+++ b/dev-db/redis/redis-3.0.7.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc test"
+SLOT="0"
+
+RDEPEND=">=dev-lang/lua-5.1:*
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-2.8.3-shared.patch
+ epatch "${FILESDIR}"/${PN}-2.8.17-config.patch
+ epatch "${FILESDIR}"/${PN}-3.0.0-sharedlua.patch
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-2.2 configure.ac
+ sed -i -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoconf
+}
+
+src_configure() {
+ econf
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-dump
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.5.ebuild b/dev-db/redis/redis-3.2.5.ebuild
new file mode 100644
index 000000000000..125fe7e3d229
--- /dev/null
+++ b/dev-db/redis/redis-3.2.5.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 ~arm arm64 hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.8-r2.ebuild b/dev-db/redis/redis-3.2.8-r2.ebuild
new file mode 100644
index 000000000000..9ad05c87cf7c
--- /dev/null
+++ b/dev-db/redis/redis-3.2.8-r2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm ~arm64 ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-3.2.8-r4.ebuild b/dev-db/redis/redis-3.2.8-r4.ebuild
new file mode 100644
index 000000000000..cb1541102b7c
--- /dev/null
+++ b/dev-db/redis/redis-3.2.8-r4.ebuild
@@ -0,0 +1,131 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Redis does NOT build with Lua 5.2 or newer at this time.
+# This should link correctly with both unslotted & slotted Lua, without
+# changes.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.2.5-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-3.2.3-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # geohash-int can't be built with -std=c99 either
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/geohash-int/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd-r1" redis
+ newinitd "${FILESDIR}/redis.initd-5" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.1-r1.ebuild b/dev-db/redis/redis-4.0.1-r1.ebuild
new file mode 100644
index 000000000000..c93a6b4061fc
--- /dev/null
+++ b/dev-db/redis/redis-4.0.1-r1.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Does NOT build with Lua 5.2 or newer at this time.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.1.ebuild b/dev-db/redis/redis-4.0.1.ebuild
new file mode 100644
index 000000000000..aece2a0822b3
--- /dev/null
+++ b/dev-db/redis/redis-4.0.1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( >=dev-lang/lua-5.1:* )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd" redis
+ newinitd "${FILESDIR}/redis.initd-4" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}
diff --git a/dev-db/redis/redis-4.0.2.ebuild b/dev-db/redis/redis-4.0.2.ebuild
new file mode 100644
index 000000000000..1449a3567826
--- /dev/null
+++ b/dev-db/redis/redis-4.0.2.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic systemd toolchain-funcs user
+
+DESCRIPTION="A persistent caching system, key-value and data structures database"
+HOMEPAGE="http://redis.io/"
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
+IUSE="+jemalloc tcmalloc luajit test"
+SLOT="0"
+
+# Redis does NOT build with Lua 5.2 or newer at this time.
+# This should link correctly with both unslotted & slotted Lua, without
+# changes.
+RDEPEND="luajit? ( dev-lang/luajit:2 )
+ !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
+ tcmalloc? ( dev-util/google-perftools )
+ jemalloc? ( >=dev-libs/jemalloc-3.2 )"
+DEPEND="virtual/pkgconfig
+ >=sys-devel/autoconf-2.63
+ test? ( dev-lang/tcl:0= )
+ ${RDEPEND}"
+REQUIRED_USE="?? ( tcmalloc jemalloc )"
+
+S="${WORKDIR}/${PN}-${PV/_/-}"
+
+pkg_setup() {
+ enewgroup redis 75
+ enewuser redis 75 -1 /var/lib/redis redis
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-4.0.1-shared.patch \
+ "${FILESDIR}"/${PN}-3.2.3-config.patch \
+ "${FILESDIR}"/${PN}-4.0.1-sharedlua.patch
+ eapply_user
+
+ # Copy lua modules into build dir
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
+ # Append cflag for lua_cjson
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
+ append-cflags "-DENABLE_CJSON_GLOBAL"
+
+ # now we will rewrite present Makefiles
+ local makefiles=""
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do
+ mv "${MKF}" "${MKF}.in"
+ sed -i -e 's:$(CC):@CC@:g' \
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
+ -e 's: $(DEBUG)::g' \
+ -e 's:$(OBJARCH)::g' \
+ -e 's:ARCH:TARCH:g' \
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
+ "${MKF}.in" \
+ || die "Sed failed for ${MKF}"
+ makefiles+=" ${MKF}"
+ done
+ # autodetection of compiler and settings; generates the modified Makefiles
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+ # Use the correct pkgconfig name for Lua
+ has_version 'dev-lang/lua:5.1' \
+ && LUAPKGCONFIG=lua5.1 \
+ || LUAPKGCONFIG=lua
+ sed -i \
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
+ configure.ac || die "Sed failed for configure.ac"
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_with luajit)
+
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
+ # also, don't define ANSI/c99 for lua twice
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
+}
+
+src_compile() {
+ tc-export CC AR RANLIB
+
+ local myconf=""
+
+ if use tcmalloc ; then
+ myconf="${myconf} USE_TCMALLOC=yes"
+ elif use jemalloc ; then
+ myconf="${myconf} JEMALLOC_SHARED=yes"
+ else
+ myconf="${myconf} MALLOC=yes"
+ fi
+
+ emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
+}
+
+src_install() {
+ insinto /etc/
+ doins redis.conf sentinel.conf
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
+ fperms 0644 /etc/{redis,sentinel}.conf
+
+ newconfd "${FILESDIR}/redis.confd-r1" redis
+ newinitd "${FILESDIR}/redis.initd-5" redis
+
+ systemd_newunit "${FILESDIR}/redis.service-2" redis.service
+ systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles" redis.conf
+
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
+
+ dobin src/redis-cli
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
+ fperms 0750 /usr/sbin/redis-benchmark
+ dosym redis-server /usr/sbin/redis-sentinel
+
+ if use prefix; then
+ diropts -m0750
+ else
+ diropts -m0750 -o redis -g redis
+ fi
+ keepdir /var/{log,lib}/redis
+}