From 4c0327aa7aa93167b77e92431e1f1555927095f8 Mon Sep 17 00:00:00 2001 From: Yuriy Ustushenko Date: Thu, 5 May 2016 18:29:04 +0300 Subject: v1.9.10, v1.9.12 --- README.md | 38 ++ www-servers/nginx/ChangeLog | 53 ++ www-servers/nginx/Manifest | 19 +- www-servers/nginx/files/check_1.7.2+.patch | 201 -------- www-servers/nginx/files/nginx.logrotate-r1 | 4 +- www-servers/nginx/nginx-1.9.10-r100.ebuild | 713 -------------------------- www-servers/nginx/nginx-1.9.12-r100.ebuild | 779 ----------------------------- www-servers/nginx/nginx-1.9.14-r100.ebuild | 779 +++++++++++++++++++++++++++++ www-servers/nginx/nginx-1.9.15-r100.ebuild | 779 +++++++++++++++++++++++++++++ 9 files changed, 1660 insertions(+), 1705 deletions(-) create mode 100644 README.md delete mode 100644 www-servers/nginx/files/check_1.7.2+.patch delete mode 100644 www-servers/nginx/nginx-1.9.10-r100.ebuild delete mode 100644 www-servers/nginx/nginx-1.9.12-r100.ebuild create mode 100644 www-servers/nginx/nginx-1.9.14-r100.ebuild create mode 100644 www-servers/nginx/nginx-1.9.15-r100.ebuild diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d55e4d --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +Yoreek ebuild repository +============================================ + +Introduction +------------ + +This personal repository contains ebuilds and fixes for packages that +i'm interested in. + + +Using repository with newer portage +----------------------------------- + +A package manager with git repository support can be used for sync. +Portage version 2.2.16 and later supports git sync. + +The `repos.conf` entry for repository sync may look like the following: + + [yoreek] + location = /usr/local/portage/yoreek + sync-type = git + sync-uri = https://github.com/gentoo-mirror/yoreek.git + auto-sync = true + +Please note that if you use existing repository location, you *need to +remove the existing repository first*. + + +Using repository with layman +---------------------------- + +With layman repository must be added first using command: + + layman -a yoreek + +Synchronization can be done with command: + + layman -s yoreek diff --git a/www-servers/nginx/ChangeLog b/www-servers/nginx/ChangeLog index 3e91c93..48c8844 100644 --- a/www-servers/nginx/ChangeLog +++ b/www-servers/nginx/ChangeLog @@ -257,3 +257,56 @@ Package-Manager: portage-2.2.27 + 06 Mar 2016; Manuel Rüger -nginx-1.9.10.ebuild, + -nginx-1.9.10-r3.ebuild: + Remove old + + Package-Manager: portage-2.2.27 + +*nginx-1.9.13 (31 Mar 2016) + + 31 Mar 2016; Ian Delaney +nginx-1.9.13.ebuild: + version bump to 1.9.13 + + Update 3rd party modules: + - lua + - modsecurity + + Upstream changes: http://nginx.org/en/CHANGES + Closes: https://github.com/gentoo/gentoo/pull/1169 + + Signed-off-by: Ian Delaney + + 10 Apr 2016; Manuel Rüger files/nginx.logrotate-r1: + Revert "www-servers/nginx: use the nginx utility command for log reopening" + + Gentoo Bug: #576558 + + This reverts commit 3e8c33b631035683ce988e0988a06661524164f5. + +*nginx-1.9.14 (10 Apr 2016) + + 10 Apr 2016; Manuel Rüger +nginx-1.9.14.ebuild: + Version bump to 1.9.14 + + Package-Manager: portage-2.2.28 + + 21 Apr 2016; Zac Medico -files/check_1.7.2+.patch, + nginx-1.8.1.ebuild: + fix nginx_modules_upstream_check for 1.8.1 (bug 580764) + + Package-Manager: portage-2.2.28 + +*nginx-1.9.15 (24 Apr 2016) + + 24 Apr 2016; Manuel Rüger +nginx-1.9.15.ebuild: + Version bump to 1.9.15 + + Package-Manager: portage-2.2.28 + + 24 Apr 2016; Manuel Rüger -nginx-1.9.12.ebuild, + -nginx-1.9.13.ebuild: + Remove old + + Package-Manager: portage-2.2.28 + diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest index 90ebc3d..ea4e6e7 100644 --- a/www-servers/nginx/Manifest +++ b/www-servers/nginx/Manifest @@ -1,23 +1,24 @@ AUX AJP-nginx-1.7.9+.patch 5674 SHA256 b4e01204056ed43d03c06e7955564ecd7f9b581cc238e93a14a64fc898cc3a66 SHA512 8b7cae860c6637b4cffa9c60cc624d8d22702030183d261efef77fc3ec964fb4c23360f4c9868a41a3de4584aed3e2e288c3dd173e0a4a727bba3da00e3979a5 WHIRLPOOL 4da8d0865319d2673ee032fec3ef9e8f0c6161bbc77a2cab959af50bf5aea35812ac80d66f19202b2deac56d4d47d84ce06b356495a1de60c8343eef5c9d252c AUX check-1.9.2.patch 8509 SHA256 49be9b3241d0956b1101488cd632eb5f7acd32da7a9677ce09ee700d5e7b35b0 SHA512 63be2c2819ec753031393481ab87910b186909ddc4df85fa3acca9d0d176c5126e24d9c066cb77b6f601acce295de1136b9faad7bbcc01121aae68c99d938ca2 WHIRLPOOL bc6db9dd0eb96f91119cd9a1a072728d6895eae37959d3b53c05c81d2ab7e17cb072a8a53045c3e698621248c5addacbe8055329b6788632f3772e2d0933b105 -AUX check_1.7.2+.patch 6822 SHA256 e90d8d25d35c2315e3008c60954c4e57aed48d1eb9cab91466356d4967bc46ae SHA512 2857b3e2ae058601e7a1af9b6e7f41e01d4c47ec442df89c3dc407cf9fb6867ab126081547cf9336ccdc40a2a15ea8ab3ed024376d9fbb628432fa3057064440 WHIRLPOOL a96e88f5ff0e3a22745b662c79ed6c15e42ebe121e74f294f17f767e18f77dbecc6c6c105ea13c47d2a298a504115bbd1c9bed4189de2677485fd0eda5108ec8 AUX lua-nginx-1.7.6.patch 1362 SHA256 02e8eca7895831ef34690286338509f652d4376ef0d7b93bcf2e794e2e20de48 SHA512 ebe40dbc7ad6983d91243e30bda5b87e2b947ff5c94db2287ee75c281cc95f567f3140abd6099cbfd2f0454e1eb71423e464ff8c4931148379812512aaa168d5 WHIRLPOOL 5e07e50bddaaeb4213104ff89b95a1a07096daeed910edb8e729783daa650b591ca963c79b1a88007f216c51c8b44fc6e52a70877aa3d1beeff36682e327e293 AUX nginx-1.4.1-fix-perl-install-path.patch 403 SHA256 0f10cf594208d99942cd07b13799bdd62ad9dc62479b302c0390de381c7fdf28 SHA512 b8f6876831e1149b1421fff4919f8d4893e5fc46aad8a91d4cf2e0b21767b59820b8e227e3b722b80060832844ef191f30aa5dc056daeb49e55a05702d72858f WHIRLPOOL a29dc1b707695ad29b5e967c545b6059120ce9d1a95b828062f6507d8ccd730c95fc82843564baa51d644e138d40fc93b0a84c916a4d77a51c1495625a103809 AUX nginx.conf 1358 SHA256 6ff6c9301ea2a4d74a335b9119d7f9dba87d4e83793cf22d837d49f061763096 SHA512 1873c9e54ea5020160c86da3f300e3eac589c0d30cdbe3446476b5b3f5bd388da95224cfb1a020b41720c9ce55ab6bb945dcc41612d5850da0e2ae0ceeeaa587 WHIRLPOOL 7672245bd11d6ed987e13d6bfe4dbc2140cc3d2e22616c49ab7ed5f42135c96b5779e4dfd16ba9e2d82aa59d98cd56a4872d18c3774e357ef79385fc874387d2 AUX nginx.conf-r2 1292 SHA256 5386dfa5a9d3ecd724f59b77f5bf67aa195cb9ea2c16b71f97ce54c19e336577 SHA512 de9ffb84d7de468fa7aebfb205529edb1c372f3ff6990b0cac9d1f3012be9ced65db4d260fd852c91cc033805c023a02790770cca43c6ad6335fb58a9c694c95 WHIRLPOOL 70dacd19de8c56f1072f254185b97620fa7928815a94058468fb822e2696f0cd9ee9032af046b281f0ac3d52ed5f00fcb25da6b11b31c0b80001591bfb961f94 AUX nginx.initd-r2 1897 SHA256 be2b1b26637d4d1963e1b1f1da25c4fdefdb30d9ed31cf26f0fa63ff8a084c07 SHA512 52dc259cbabdbfe7943b952f4555fef253b97d151362a89601c8b8673f245d836265b78b2d5dbbe6bc479ca046c27c73f36d26986934b8b9fba4a798377f2e85 WHIRLPOOL 528872f8c4f73b25b9c3abc10c87a955cd46b87e270b04f823ec9dae8a165e2737d7a3eb389b05328440dcde57664cb7337d35030cfc641be70fcc8857875c0a -AUX nginx.logrotate-r1 222 SHA256 f767edba3f8578d153bcfd3ff39c7e205109afb1c357558ef73590c19d2a9a1d SHA512 e74f19d8f668e791134bcd179f2ce1ba4b9c413213d5fbab5a3ac780171a504003c274232affdd5983ee807cea38bb10310be694f1d5e06ac8e38b578fd9af93 WHIRLPOOL 946090a1ffb56807b6ac348e078d0254bea6da7c7779360a41b3b07ee978df99b0b781cebe46efe6ab03b42147fba8ae1195b91f68f02613a5895ff29e5e586f +AUX nginx.logrotate-r1 264 SHA256 6db8b0bb0df76766e713ff3cfeb186647c19db89d07ebeefc899f4d8e74f563b SHA512 833b4b14756970cf7902d5ef239ff212cccf54a88f95bc2d50b83d08afaa9bbc5fe538d64fa87e440077d289d12894bd053a37bba8d8ded4bec5a994d4c81550 WHIRLPOOL ed3d4389a973433715ca7e00c9eae4f1747ba8b3e6f8f2744c82f6aed8c799713beaa1ad83edef96256954ba412e59199ef84eee6181a3bfa6bb4f3bc05bcf4d AUX nginx.service-r1 327 SHA256 17c404c5130115e3ebadb09e25cff0103b48ae7dbff2284fa690161fda7888ae SHA512 9b6bcf74df2f74ae6a2c255ebf2d826ea92ed9921b9995da6c9a0c5656e2863a2fe5293ef8a656fbd36298602cc88ffc5d7acfbbf143c23a78c9689d61b05df9 WHIRLPOOL 126c56732b8bd9948595727aa8c056c44df05f4c8e708b00c9de715a7260e4e120fd9e076672312b55c889ff4a3ca100ce696165a4eaf93d89e808e1e28653fa AUX rtmp-nginx-1.7.6.patch 2507 SHA256 c5b6a884e7f097bcb405fdc2011e39ea699f50f8e51a2c3daab2e40dd86fe524 SHA512 ee3c3e91ad88aa245d7563fea537585a493718c1e770c23919118bfb6306a076b82356406af512e79a162aab09fc72fd73af1e2918b9fd9cb06c47df5a798aa8 WHIRLPOOL 0c655c186d4832426628277c99869715d46e2f0909e7ea74a000cd36fcb398e7571afb81287540d1e0fe544f09197f71c0ae143f9ca169329f936b8359bc645a DIST modsecurity-2.9.0.tar.gz 4246467 SHA256 e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434 SHA512 1af04f29bf23c51d03cdd3795c530f88b523a645aa02d776a6b23dcbc31decec7cd574919e5c7c7cf82684df2774062de5e465bddbbaf4c01a442c6d49401d3d WHIRLPOOL 1167ba6048a3ca05dcdabf03c67ae12720cca0cec74547fc223ee92ff76b6d5131785fa77b5f16da180e56590c851c192eaf02817b798e4d6f41fa6bfb2735a6 +DIST modsecurity-2.9.1.tar.gz 4261212 SHA256 958cc5a7a7430f93fac0fd6f8b9aa92fc1801efce0cda797d6029d44080a9b24 SHA512 374733cbfc26e53d95b78c8f268a4e465d838163e9893fc24e33a9d272b114f1b287147bab6d0289575074cbbd94f48983e23fa59832cbcb32950046cea59269 WHIRLPOOL 5f41bebf032f8a269412d104b7632a06af4d4c495658c9cd1ebf69b82c10ce1bbcb34b9dd159a7b00e57348714a5e93ad3db19701dda51479accd3a9dc79a9cb DIST nginx-1.8.1.tar.gz 833473 SHA256 8f4b3c630966c044ec72715754334d1fdf741caa1d5795fb4646c27d09f797b7 SHA512 546eba1749af0034cb8b924d2432be2f0e82a75c545aa929391ef7234103c3f29376235a2ef1363b120e1825cda15aeb085a05f9ce3596c88466e112e82aa882 WHIRLPOOL cd399083fb14bdb3498f1cd91a1cb59a73d37f323ce7c2a32500c9443f654cb5449137708cf149a0126aedb77abec9d1eb3dce3121f0b378d7d70e8eb18062af -DIST nginx-1.9.10.tar.gz 889267 SHA256 fb14d76844cab0a5a0880768be28965e74f9956790f618c454ef6098e26631d9 SHA512 60a736afe98e46abeb572c938702b09b0098164584bf8b5c1978c2b83269b6c2b99a60b7c8c9482230c26eebaeeb684f3aa7db52af4d7a3c18434542730873e0 WHIRLPOOL 8f285f6d4c4f7e312791d7dc6fc072dbb1207315fcb7facac0ce958389473641de2f2c2cd03cfd11c0df3a16abd84522bb150090b561a46752e8b6317363fbeb -DIST nginx-1.9.12.tar.gz 899183 SHA256 1af2eb956910ed4b11aaf525a81bc37e135907e7127948f9179f5410337da042 SHA512 b5f4cae48c85cdc9a95006b6a321834de9d18981cb1a25670c9fc948d86b9a8906d25a1ca174626eb418b0afdb3f2e1df3cbb6f5a48bd781e39e2470a4d52520 WHIRLPOOL 0b6300528ae1c29e4f7647cdbe0ea6254b1bccbdcd7f0185b2bff25409aba093c089e5fa3c1a828e2cf7f55fa6d9d2f8b818f85014f37ccbf335a71cb2e93e32 +DIST nginx-1.9.14.tar.gz 908191 SHA256 2b4893076d28e6b4384bba8c4fdebfca6de6f8f68ec48a1ca94b9b855ff457d2 SHA512 e73a10495a8b199856f4e5d6f428b46e0b1148cee26c8517e360130d9f1e85028b28f311879d31f37e1d3facccf6f215377e984ae937a44f45245fe09a3be90e WHIRLPOOL c4e1d2b8181b9c8c967de2d68314c05c28a1fe44bd35809f3672c2ff9b02d08e2f572970ab0328f85dbe9b29c6dae0c4ebb33586a8c70053e764158c055fa8d8 +DIST nginx-1.9.15.tar.gz 908984 SHA256 cc89b277cc03f403c0b746d60aa5943cdecf59ae48278f8cb7e2df0cbdb6dac3 SHA512 563cec7828d1e398ded83579c3c4afcd83fd809662e64a0212e25a34ce1b599135558e9fd8cee3e07ba028ee4b308e40ce9910a5071a3d8e3b7ec9f9bdef95f0 WHIRLPOOL b87dd96b1fa34824fb6ca16da39d72cf6036f6276766ef420c3be8ceac8e8639ff74e842c1ffd5f8f2dd03d7c411197a05049c1673dc70862cee662b494da88f DIST nginx-auth-ldap-8517bb05ecc896b54429ca5e95137b0a386bd41a.tar.gz 16950 SHA256 2f0b1a65847ea1da801a99b654f132e1c814d2fa49a43a324d8fc4ce6327935f SHA512 65b0aec3a4b28625ef93d166f659d63b9ef7d971dea78b09987eaa02f632bf5b8f6c9afdb6ef444afa466dba7ff67180cad27e138e6818c2ba80bc804f140ca6 WHIRLPOOL 9ef896fa3501415e2c7022448783626af256c6c3878fcca5d6cc042a9789937147eb4c3743f92002ab8d09e4ce828532b9ae321dc284ef2560801da98153d146 DIST nginx_http_sticky_module_ng-1.2.5.tar.bz2 124072 SHA256 f975c033eb3c342f7247f6524774bbb727aaf630ed984576dbafe5de7a790c58 SHA512 d6ae723f739efb2f0548461931b1c395801684759962beda08067111426b1c9787ceaede91b0e984c023108fd17864c53c53925506f7e8e25ec8d2fc065585f6 WHIRLPOOL 1013c6a51f5989c8131392b3d9704d42c99f9727a673f6205878d0b7dfd265bb6042c1d30089603c9b38e339d48302e6873e77fe380b7e8edba25b71e9e84ba6 DIST nginx_http_sticky_module_ng-1.2.6.tar.bz2 124089 SHA256 e47b9fd435d7a5a3200f945a9745aaa7b9446495bda76df48f211129f88d6b26 SHA512 2632b04c94f523aa7c9726db182cba11d83e642c2db5798274e67fbef30de95d02e4e95cbfb98bc429d4244d630b5d9617405b43f728ae0117a5c134940c0ded WHIRLPOOL 1b754c02f834c6b4d4930e9c46b8c5accb6c9663718fb9296c92d79bc33206e66e49e4234ca4db9a5afcd42fa23273bdf0e675aa7b38927c4e46a85318c189eb DIST ngx_devel_kit-0.2.19-r1.tar.gz 65029 SHA256 501f299abdb81b992a980bda182e5de5a4b2b3e275fbf72ee34dd7ae84c4b679 SHA512 915954acf16a27fbd3c93c154012d38e864f1d8dfd51cde401bba26e46eb3e3c778ec4c92f4f8ed83ac001e96cee72765554d0e4da06acf6a4be5184b23b3657 WHIRLPOOL 0ce6bffc0fe2cef28ee74f5862ca6d914ed18fdee18d900608ff2a9983594c707aab3e335957b79dd7e77ae1beed054d8f71965ca0f57fc5f1d41ac06106c5a4 DIST ngx_http_auth_pam-1.4.tar.gz 6502 SHA256 095742c5bcb86f2431e215db785bdeb238d594f085a0ac00d16125876a157409 SHA512 8d60347c666736ef39161b287ad32820ad6be4695f1c0f27a000d46bfc7e26c95233247d39cf37296518a6329ba73f06756d0b0b68157b0e5f67796f73264db3 WHIRLPOOL 2f0e60366cf43727c9b3aa07d2cb803a997cb9a4f48ba28e575f470bbb7c28115f41d390e306219ad130501a62e204d403bbca5ee784628fbca35b407f51702c +DIST ngx_http_auth_pam-1.5.1.tar.gz 6863 SHA256 77676842919134af88a7b4bfca4470223e3a00d287d17c0dbdc9a114a685b6e7 SHA512 973b94874d8a58c0df0ac2d31571eafc1e80b11179cba33ec88421a826207fbf7e99b0387e135a1ca48d82daacb78f19a4c21d3a27b49b16dc86b4748bb72261 WHIRLPOOL 4fcaadee859f325c734aa16763702ee40284d1debcfbf5df1cb9aadf2bfc72c1e8d0e5b9d1495f34fc719f4d7fa3e653797fa7917f8fd0437fa2023a1930f667 DIST ngx_http_cache_purge-2.3.tar.gz 12248 SHA256 279e0d8a46d3b1521fd43b3f78bc1c08b263899142a7cc5058c1c0361a92c89c SHA512 50a31dbf2216a6fae74a186af56dec4600cf55777e76a10ac0075f609e7737135aab063a64f2590dddcd0369ebebd4a523027f3d9ebcca74f7b4355be1c5dcc0 WHIRLPOOL 5451ef3e33044210453995ea916acec679599c0ded5471d464db5003a07e7a06e9690812091148c2af7b50384e52b32e49136eac02e0330724ba2408d893f96c DIST ngx_http_dav_ext-0.0.3.tar.gz 6260 SHA256 d428a0236c933779cb40ac8c91afb19d5c25a376dc3caab825bfd543e1ee530d SHA512 4763b1c5e417248d80acfacf20bfc5ba3e06675ff08e37703867daef99a400980b536941e4955c259432905bd11ab998bc2e2489a50350413c7bf37e18eafb74 WHIRLPOOL 5adbcea768fbb179249a03fe69304505ec09a1dafac848dd5e3cde96693c6fbcf6cf6c128ca116d02b36c1be0008807d9e86fee5b411e137b18b15a60291f29b DIST ngx_http_echo-0.57.tar.gz 65073 SHA256 8467237ca0fae74ca7a32fbd34fc6044df307098415d48068214c9c235695a07 SHA512 c89780eca9267c9984a022a4dbd9ebf603dbd5c323bfea5ea7898ca9fc0a744388ce7520e7a9799aeabd6573f8e71ee595fe9998fa54e5d5c412b21031edd31d WHIRLPOOL e481b6f57a6ff48706fa7e281f31f15a5522c29b98620559cebe8412207d5595497cdce9156e7762cceff6369e9f678d5a81bf3c83fb2e8c5d8786622f1c27b8 @@ -25,11 +26,9 @@ DIST ngx_http_echo-0.58.tar.gz 64779 SHA256 190fe3977dd1910e82059f30f9baae3da2ee DIST ngx_http_fancyindex-0.3.5.tar.gz 14837 SHA256 e0998e83be58bc5787fa9243a76a9d21de3cd01088d3cf63177ba88a562634a1 SHA512 ddb4ab3e8e47e1c49680db3e9f648f7cd582c07f963204105118e61432fa1e80c3f1bce69ed689db383011a9c155184bcc7e931eeae20bbd7cbdb5d4eb35a0a8 WHIRLPOOL a45db854d75f05a59c6f5e67c652850b5410162e7852abda20bb6720d29cc716f25ce7ea93ef52f9ff3f11d6d3a744c1fa4c7a6270fc1bd6d42f6743accb8e73 DIST ngx_http_fancyindex-0.3.6.tar.gz 17252 SHA256 e73f1f0444f8c53601b51da8684b174c5ffd3b4ed6eb7956dd57f8b95485b68f SHA512 ca2de16eef7d5e94104f44f180ebd98674c5799409d70d95fd6359512861efaa95d5242a9eb661363bcc5110032965f326e735a2b8fcfaaf29381023fd11a76e WHIRLPOOL 68c089a11a39685e3cb934c12daf12bd4c7176da6d17a26d4ec18f5bb44c480695e622c732925255c10af4bf819aa52da0dcf457ca40bffdc8a6673a10440823 DIST ngx_http_headers_more-0.26.tar.gz 28028 SHA256 d6bdc51f9e778a3b23e41a51cae542c1467a1e5e55c1329a7ffc454be084fb6f SHA512 842927de67d28f3cff596607f209d1004b6d49f1d45b861758405ed6fe6f7aab76ad63530ccdfff1c1947db1190dd65dee0a29f50026bfa7a39a9a051561cf88 WHIRLPOOL 0dc37c36717be40a07112388d913d20bc99d76f90604da618d5547f24d93c636c14c2cca18191ff5916b40ec0113da648cfc07e1c00b1853f2b15ce056d5f3d7 -DIST ngx_http_headers_more-0.28.tar.gz 26948 SHA256 67e5ca6cd9472938333c4530ab8c8b8bc9fe910a8cb237e5e5f1853e14725580 SHA512 ed39930ddb416ab3510c3649f296e55474584bf1e9c9855c2330c0ec04d208865d242f54c55dbac79a4871803197fd930c20396a3b70f0f5fb009318d3c12254 WHIRLPOOL 7c0455c6ac15a033e62126ff8bb246d3d0315a2b18c095bdb0867669daa2387a5dfa4fdfbf038b8392ac4ee42c671a49ac742bd28352b2f5fbcf6fee423df1a2 DIST ngx_http_headers_more-0.29.tar.gz 27144 SHA256 0a5f3003b5851373b03c542723eb5e7da44a01bf4c4c5f20b4de53f355a28d33 SHA512 50a45922f8d2d54fca345bf47df71035362a6868b86872528f2414386c15cdcdb5466ea2c0b7c7303dc85084f94ee05e7411da8836cde3cd549c576431c7ef14 WHIRLPOOL bfc3261b6b0a4add707069383ae1241b2bad02099c86985b87cdc595a49eb3eea0c5295d912f536c01110f7954f6738870ad72f1230a202824b5bc00293c7ddd -DIST ngx_http_lua-0.10.1rc1.tar.gz 574793 SHA256 7b741a45ba8c66972fc7261cd191bdc89179ad9cebbc5af59c899c56811b8838 SHA512 6d9ab941bd89b6a4effb6ccec8aca7058ae4d0f1baa712616222f2fc7d60d78c76c33113a04c5ef71d28cfe55b6247720bd902726f8e93ed64ae50a84f653c0f WHIRLPOOL c494bec5318590f2c1e9e2ed06d4e2d15eb88d6feecb1208a1f968f466309742445c5316bdfbc4170aa5468f654399657799f3ae8a85248a8daa8a0b0ddd0cdd +DIST ngx_http_lua-0.10.2.tar.gz 575525 SHA256 155feeff08a0b2efaf980705b9ef83d0b341e6d011adad8e2679ea4105668134 SHA512 33ad538f0f63aae91b691ceda593899881b3ac0ea48da6814724d9bfe3d74b323ac5f3b8bc2fa03116c5cd1045e2a12db4e9bf96c8172a96ec1c6cd0b30199fa WHIRLPOOL 6450f144fcae55756b1c2f879cf68a1d2369475ece910951c54e10cd7c4ef266ead56397cef5c4d6c4963f5c11124af635daa415af05524703ff96b9ff5edcfb DIST ngx_http_lua-0.9.15.tar.gz 520190 SHA256 659fe4c201f4a4ae1007fa029cef472aaa837bf0904babb6158f83b86536c5b7 SHA512 1d809f873ced8e50422298bb4b730b8e7aaf442c11570cbe892fd73a414ff4f6d6eca7be8b2d2dbf57a136136b17d80596ee2f2f195dcb59776e78df5a94ae92 WHIRLPOOL caf128254f99d674eb370779c6e41c0b459be1c5a2baac7df1ff3498a38349bd2c140594eea3eb29c468a366e265421f90363886be73db0b3484cc6f386cb563 -DIST ngx_http_lua-0.9.19.tar.gz 542445 SHA256 2b41d4d2627fda76946f194aae6c2b4d89bb59afd792d397c6b481ee82c10eb4 SHA512 9467742c4f5ac164fd33263990bbc5719069a7549413486586406e007156719de77e95944db8201deb2f3e7fc4ce9aa4ada027f89f0e421117dc29018b2fed1c WHIRLPOOL 9853ee88a491fd3844975a8c920032e76f36ed8d7d34033f3a744acb7ed8116fd45efb75a37c918edb912d3c5d203f5c83111ec82b5ab8acdad13632e47df1e8 DIST ngx_http_naxsi-0.53-2.tar.gz 165690 SHA256 3eadff1d91995beae41b92733ade28091c2075a24ae37058f4d6aa90b0f4b660 SHA512 ada592f5e7f80a6d549cc435ee8720df01a788dc88cf27a7d55521bb7e4c66fa11b9ec28216aff7e13c70a5faf12cb745bd398b8a782ed4dea1eecd04b07e24c WHIRLPOOL c5b736dbe9bd66daf7e023f176a08f78225b61990781d7ad5a55d0f35391df7e05bf1b2623a6227e0355cf0204ef9eac1b9fa03aa62b3c0d6eac515f1213f270 DIST ngx_http_naxsi-0.54.tar.gz 163809 SHA256 9cc2c09405bc71f78ef26a8b6d70afcea3fccbe8125df70cb0cfc480133daba5 SHA512 91934bfd41495715269cc6e549d17f6da66f2bdd0c9a6821fa9096b694dd3927109c4aad2f8b327620ae7c34f76a0839ac16669cd8c65081bc01fa7f829c1d43 WHIRLPOOL ef68cfecc9849086527c3590744d3c0d73cec830c6cf1ebca63566a7444438757a85d0c79fa552c4763e0416a615f4cf8d99622e2f36d3713b7072138a82f5a8 DIST ngx_http_push_stream-0.4.1.tar.gz 166928 SHA256 553584f557a3faec73702550e7e1417cbc0021f4f98468cc83e61e9d94def5cc SHA512 3b2289cc3abe6df0ee39360816675a39de1669a284e23770aa04b29e1e5dc73f5d99f3db6c7e8e4895a4abad0602aa64024ec19a2e741e138a70191501f038be WHIRLPOOL 9d203d4a78a3bd189527ebeaf1ff98613ee6a3150ae433efa17ed45dd9f6cb263b2a4c329a6fc2d04c6583ac2beaf24e87e3263d71a910f720b80038c9bc09c2 @@ -43,8 +42,8 @@ DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 SHA256 7ac230d30907f013dff8d435a1186 DIST ngx_rtmp-1.1.7.tar.gz 519735 SHA256 7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3 SHA512 9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e WHIRLPOOL e9c1fc9c3c965ae7047657f76e0997d5da107aff7dd9e5cf3ddb5a2d8f388efd8439b82923e199dc36def449567b8529e06c80f69c36f42128236ac0be5719d5 DIST ngx_xsltproc-0.16.tar.gz 535696 SHA256 9003d5aa7bff157577d1f8fb5ee070ee52544fc53c48bb9aa0bdd092e5f39bcf SHA512 6f3c83f69ffa356d9fd32130e6a49b5948047de15c11272223bbdd4eaeb8404422e1e02bf688c86a19fd8f8bb6e3727f8247ec697fa54c364395daa64ed0f971 WHIRLPOOL 4f93fcd7cb89531ba186258e6a93d655d064334c3b9956a15d72fdb8ab360bb967ad1353597f966529ec0ea66a3da0575d13fab2cca7f3d468c5f54fcea17a60 EBUILD nginx-1.8.1-r100.ebuild 25717 SHA256 d871b91c48f8b3b0969b0b26af0b166321b9aab10d401e2e44869a6b4765d879 SHA512 91a90e21ecfd992d148b37632491328a1236cb03c3374ceb8428a4fea41365f61ccddcd35476d3621ab32a8fd014b556f0220142028d29441c0b4c852efd3478 WHIRLPOOL fc67e3989e037e0227c0bcdf80e9f1b73f2d670eac322a71d3b4f225b86a023680cc1eaa0de10d6e0f85815fc3665889dc1ceed14967e485643768e099ff9778 -EBUILD nginx-1.9.10-r100.ebuild 26898 SHA256 649cbe7dfd85f65d09a0357a2de70bbb76c73b9cd8c01d140abba268bd38c6a7 SHA512 21454bea1a9eb80b3f86a38069ce68d7e61ddf58ea7782ea9bf7a325c6ed642b939ab96bc5850015c0b741f18a860ddec6f3ceac4d1d637a0c0e35e529e3d424 WHIRLPOOL 63d8269ce52cb1bb3199cb8d7cb35fd6a13b099b1fcd5759fa96cffd780870aeb1e13cbc833466b173a0a1abfa94244bb2dfe32361616b64986bd2324b2697c8 -EBUILD nginx-1.9.12-r100.ebuild 28774 SHA256 2c642e5da9186622b6c5054354ced5d9d1df7db12fcc5ec082c583af133c040d SHA512 a6c9eecabba31b101fb79b4fd7092a96ded13af8c3277a699a6c89604a9685fdefe4796a780228f87259b43fd550813b55bcc7878f7cae2233b048488b92eff5 WHIRLPOOL 0252ee7315d5c94d49f8b7dbaa8dfe59f4f95a0f52caff53ee68401c6b33f6f2ad6dd0698c1004d3b2ad67073d2d4981578fd1096b46e17e5981b63ad3133e13 -MISC ChangeLog 7691 SHA256 847080261fb1db3edab87b27558d9b34ee01ba8a3f64638fa80f0e7e2929c838 SHA512 74a024783d8c4c1b6d701eac600fb4cab11021b7d2f82e5c8124cf0011019a2198793f2b8c3b037f4e4847db16f41f7742447deb1e6431d7da573ddc5db49785 WHIRLPOOL 4477687ee9fd487ef7c1b1783b68810ab50715571f663b54fd31b8cd99e1ef27e65d589b4298b2f7910000215a4e466c1a315d5073c4625e8bbf51a9a0333729 +EBUILD nginx-1.9.14-r100.ebuild 28773 SHA256 bc8d03318e5d36db3ff5b18dc417f41c09a35e8b094268e63706080df840fd21 SHA512 159664b5d221a2305b724db6648590b66dcff47e27e4a01ed8e1460b887c57624d6d121a858b4b5c017ffa0d036a6c4e0e5416d1dc0498a3cd935f6270657cd4 WHIRLPOOL 18795671c47134b04013ce48df06a8869990a6e46b639e7d6b68e894646d0d438b51cf70a51b5edf4a9de78069865abe134e6e47d279536bddbdf146f387eab2 +EBUILD nginx-1.9.15-r100.ebuild 28773 SHA256 bc8d03318e5d36db3ff5b18dc417f41c09a35e8b094268e63706080df840fd21 SHA512 159664b5d221a2305b724db6648590b66dcff47e27e4a01ed8e1460b887c57624d6d121a858b4b5c017ffa0d036a6c4e0e5416d1dc0498a3cd935f6270657cd4 WHIRLPOOL 18795671c47134b04013ce48df06a8869990a6e46b639e7d6b68e894646d0d438b51cf70a51b5edf4a9de78069865abe134e6e47d279536bddbdf146f387eab2 +MISC ChangeLog 9064 SHA256 9604f62913f0db9af513bf0906ee1fc277aa3701a464f5fa26413e6740e3147b SHA512 65bdc82a3ff78e9402c8e070a2ce6f8f1d889df287db924f8f36efb14ff2bb654d89ddc14bd25562fe3fd6aba401042d3d2c28507ac8898a54a74e98c1814907 WHIRLPOOL 834706ff8e11947e5adc589bc18ab09dd50304c76670c1a3c7dfeeb4cc039fdde827bcb495775885bc953c85a3fd03df938ed767244174e2302f971bb6984ecd MISC ChangeLog-2015 69680 SHA256 10720899590f9065076fca43d949a1fc45b04562b93ca1b47f8bce211bc26a50 SHA512 2c149e4a9a2d37127b9520aa09fe789216a1498d73351b0563c45d8838abdc7788ad3d34ccddfd8b27d7eb386a1344e1726f2ee93a29c886e018057d0ade5546 WHIRLPOOL fcb612cb6854cd2644344220c0fabd8cffeb548008327920eb535986af33c7ad3ae4c31ac57497d9f35bfeabb10cbca1e9897d42009dcfd8a8a7b1dfc0fb9d30 MISC metadata.xml 1489 SHA256 b3219224633a318ea08cfcd5c07885c65d0e25815641a87387aa9dd57bf47110 SHA512 2f9ba33e607ef7aeb67319579107cba6d3534aa1db4bff37b2c79246cfdc79b5481b17288a67b68724fcaa3d1c83dd1284c7e3fc6cea536f3a8e27fe6e0f197e WHIRLPOOL c9f01b67541a462dcc21ffd510dc6d6151c7cfb4107d48e061a6aad800a2e7ac0a661e4d3e5df8fe77f1a81ca9840da22dbf09af0d0b82dc9f758e9c315123d4 diff --git a/www-servers/nginx/files/check_1.7.2+.patch b/www-servers/nginx/files/check_1.7.2+.patch deleted file mode 100644 index 50405a5..0000000 --- a/www-servers/nginx/files/check_1.7.2+.patch +++ /dev/null @@ -1,201 +0,0 @@ -commit 21116e1c0bba730ca59327ffba9320bc63f11462 -Author: Johan Bergström -Date: Thu Jun 19 10:17:22 2014 +1000 - - Add support for upstream_check to nginx 1.7.2 - -diff --git src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c -index 148d73a..be9e03d 100644 ---- src/http/modules/ngx_http_upstream_ip_hash_module.c -+++ src/http/modules/ngx_http_upstream_ip_hash_module.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif - - typedef struct { - /* the round robin data must be first */ -@@ -212,6 +215,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data) - goto next_try; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get ip_hash peer, check_index: %ui", -+ peer->check_index); -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ goto next_try; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -diff --git src/http/modules/ngx_http_upstream_least_conn_module.c src/http/modules/ngx_http_upstream_least_conn_module.c -index dbef95d..14e9e40 100644 ---- src/http/modules/ngx_http_upstream_least_conn_module.c -+++ src/http/modules/ngx_http_upstream_least_conn_module.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif - - typedef struct { - ngx_uint_t *conns; -@@ -203,6 +206,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -@@ -256,6 +269,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, -+ "get least_conn peer, check_index: %ui", -+ peer->check_index); -+ -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (lcp->conns[i] * best->weight != lcp->conns[p] * peer->weight) { - continue; - } -diff --git src/http/ngx_http_upstream_round_robin.c src/http/ngx_http_upstream_round_robin.c -index 37c835c..43ccdcf 100644 ---- src/http/ngx_http_upstream_round_robin.c -+++ src/http/ngx_http_upstream_round_robin.c -@@ -9,6 +9,9 @@ - #include - #include - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+#include "ngx_http_upstream_check_handler.h" -+#endif - - static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer( - ngx_http_upstream_rr_peer_data_t *rrp); -@@ -88,6 +91,14 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - peer[n].fail_timeout = server[i].fail_timeout; - peer[n].down = server[i].down; - peer[n].server = server[i].name; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (!server[i].down) { -+ peers->peer[n].check_index = -+ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]); -+ } else { -+ peers->peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif - n++; - } - } -@@ -144,6 +155,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - peer[n].fail_timeout = server[i].fail_timeout; - peer[n].down = server[i].down; - peer[n].server = server[i].name; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (!server[i].down) { -+ backup->peer[n].check_index = -+ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]); -+ } -+ else { -+ backup->peer[n].check_index = (ngx_uint_t) NGX_ERROR; -+ } -+#endif - n++; - } - } -@@ -203,6 +223,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf, - peer[i].current_weight = 0; - peer[i].max_fails = 1; - peer[i].fail_timeout = 10; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - } - - us->peer.data = peers; -@@ -312,7 +335,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, - peer[0].current_weight = 0; - peer[0].max_fails = 1; - peer[0].fail_timeout = 10; -- -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[0].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - } else { - - for (i = 0; i < ur->naddrs; i++) { -@@ -352,6 +377,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r, - peer[i].current_weight = 0; - peer[i].max_fails = 1; - peer[i].fail_timeout = 10; -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR; -+#endif - } - } - -@@ -411,6 +439,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data) - goto failed; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ goto failed; -+ } -+#endif -+ - } else { - - /* there are several peers */ -@@ -508,6 +542,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp) - continue; - } - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ if (ngx_http_check_peer_down(peer->check_index)) { -+ continue; -+ } -+#endif -+ - if (peer->max_fails - && peer->fails >= peer->max_fails - && now - peer->checked <= peer->fail_timeout) -diff --git src/http/ngx_http_upstream_round_robin.h src/http/ngx_http_upstream_round_robin.h -index 9db82a6..2fedd46 100644 ---- src/http/ngx_http_upstream_round_robin.h -+++ src/http/ngx_http_upstream_round_robin.h -@@ -31,6 +31,10 @@ typedef struct { - ngx_uint_t max_fails; - time_t fail_timeout; - -+#if (NGX_UPSTREAM_CHECK_MODULE) -+ ngx_uint_t check_index; -+#endif -+ - ngx_uint_t down; /* unsigned down:1; */ - - #if (NGX_HTTP_SSL) diff --git a/www-servers/nginx/files/nginx.logrotate-r1 b/www-servers/nginx/files/nginx.logrotate-r1 index 23665e5..a78ed7a 100644 --- a/www-servers/nginx/files/nginx.logrotate-r1 +++ b/www-servers/nginx/files/nginx.logrotate-r1 @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -7,6 +7,6 @@ delaycompress sharedscripts postrotate - nginx -s reopen + test -r /run/nginx.pid && kill -USR1 `cat /run/nginx.pid` endscript } diff --git a/www-servers/nginx/nginx-1.9.10-r100.ebuild b/www-servers/nginx/nginx-1.9.10-r100.ebuild deleted file mode 100644 index c831d61..0000000 --- a/www-servers/nginx/nginx-1.9.10-r100.ebuild +++ /dev/null @@ -1,713 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -# Maintainer notes: -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite -# - any http-module activates the main http-functionality and overrides USE=-http -# - keep the following requirements in mind before adding external modules: -# * alive upstream -# * sane packaging -# * builds cleanly -# * does not need a patch for nginx core -# - TODO: test the google-perftools module (included in vanilla tarball) - -# prevent perl-module from adding automagic perl DEPENDs -GENTOO_DEPEND_ON_PERL="no" - -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) -DEVEL_KIT_MODULE_PV="0.2.19" -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1" -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" - -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1" -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" - -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) -HTTP_HEADERS_MORE_MODULE_PV="0.28" -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" - -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) -HTTP_CACHE_PURGE_MODULE_PV="2.3" -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" - -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) -HTTP_SLOWFS_CACHE_MODULE_PV="1.10" -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" - -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) -HTTP_FANCYINDEX_MODULE_PV="0.3.5" -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" - -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) -HTTP_LUA_MODULE_PV="0.9.19" -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" - -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) -HTTP_AUTH_PAM_MODULE_PV="1.4" -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" - -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) -HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0" -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" - -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) -HTTP_METRICS_MODULE_PV="0.1.1" -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" - -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) -HTTP_NAXSI_MODULE_PV="0.54" -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" - -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) -RTMP_MODULE_PV="1.1.7" -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" - -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) -HTTP_DAV_EXT_MODULE_PV="0.0.3" -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" - -# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license) -HTTP_ECHO_MODULE_PV="0.58" -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" -HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" - -# mod_security for nginx (https://modsecurity.org/, Apache-2.0) -# keep the MODULE_P here consistent with upstream to avoid tarball duplication -HTTP_SECURITY_MODULE_PV="2.9.0" -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" - -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) -HTTP_PUSH_STREAM_MODULE_PV="0.5.1" -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" - -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) -HTTP_STICKY_MODULE_PV="1.2.6" -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d" - -# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2) -HTTP_MOGILEFS_MODULE_PV="1.0.4" -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" -HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz" -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" - -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) -HTTP_MEMC_MODULE_PV="0.16" -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" - -HTTP_XSLTPROC_MODULE_PV="0.16" -HTTP_XSLTPROC_MODULE_P="ngx_xsltproc-${HTTP_XSLTPROC_MODULE_PV}" -HTTP_XSLTPROC_MODULE_URI="https://github.com/yoreek/nginx-xsltproc-module/archive/v${HTTP_XSLTPROC_MODULE_PV}.tar.gz" -HTTP_XSLTPROC_MODULE_WD="${WORKDIR}/nginx-xsltproc-module-${HTTP_XSLTPROC_MODULE_PV}" - -inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib - -DESCRIPTION="Robust, small and high performance http and reverse proxy server" -HOMEPAGE="http://nginx.org" -SRC_URI="http://nginx.org/download/${P}.tar.gz - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz ) - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) - nginx_modules_http_xsltproc? ( ${HTTP_XSLTPROC_MODULE_URI} -> ${HTTP_XSLTPROC_MODULE_P}.tar.gz )" - -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ - nginx_modules_http_security? ( Apache-2.0 ) - nginx_modules_http_push_stream? ( GPL-3 )" - -SLOT="mainline" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" - -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi -geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi -split_clients upstream_ip_hash userid uwsgi" -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static -image_filter mp4 perl random_index realip secure_link stub_status sub" -NGINX_MODULES_MAIL="imap pop3 smtp" -NGINX_MODULES_3RD=" - http_upload_progress - http_headers_more - http_cache_purge - http_slowfs_cache - http_fancyindex - http_lua - http_auth_pam - http_upstream_check - http_metrics - http_naxsi - http_dav_ext - http_echo - http_security - http_push_stream - http_sticky - http_ajp - http_mogilefs - http_memc - http_xsltproc" - -IUSE="aio debug +http http2 +http-cache ipv6 libatomic luajit +pcre pcre-jit rtmp -selinux ssl threads userland_GNU vim-syntax +nginx_modules_http_xsltproc xsltproc-memcached" - -for mod in $NGINX_MODULES_STD; do - IUSE="${IUSE} +nginx_modules_http_${mod}" -done - -for mod in $NGINX_MODULES_OPT; do - IUSE="${IUSE} nginx_modules_http_${mod}" -done - -for mod in $NGINX_MODULES_MAIL; do - IUSE="${IUSE} nginx_modules_mail_${mod}" -done - -for mod in $NGINX_MODULES_3RD; do - IUSE="${IUSE} nginx_modules_${mod}" -done - -# Add so we can warn users updating about config changes -IUSE="${IUSE} nginx_modules_http_spdy" - -CDEPEND=" - pcre? ( >=dev-libs/libpcre-4.2 ) - pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) - ssl? ( dev-libs/openssl:0= ) - http2? ( >=dev-libs/openssl-1.0.1c:0= ) - http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) ) - nginx_modules_http_geoip? ( dev-libs/geoip ) - nginx_modules_http_gunzip? ( sys-libs/zlib ) - nginx_modules_http_gzip? ( sys-libs/zlib ) - nginx_modules_http_gzip_static? ( sys-libs/zlib ) - nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) - nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) - nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) - nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) ) - nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) ) - nginx_modules_http_auth_pam? ( virtual/pam ) - nginx_modules_http_metrics? ( dev-libs/yajl ) - nginx_modules_http_dav_ext? ( dev-libs/expat ) - nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache ) - nginx_modules_http_xsltproc? ( dev-libs/libxml2 dev-libs/libxslt dev-libs/icu ) - xsltproc-memcached? ( dev-libs/libmemcached )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-nginx ) - !www-servers/nginx:0" -DEPEND="${CDEPEND} - arm? ( dev-libs/libatomic_ops ) - libatomic? ( dev-libs/libatomic_ops )" -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" - -REQUIRED_USE="pcre-jit? ( pcre ) - nginx_modules_http_lua? ( nginx_modules_http_rewrite ) - nginx_modules_http_naxsi? ( pcre ) - nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) - nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) - nginx_modules_http_security? ( pcre ) - nginx_modules_http_push_stream? ( ssl ) - xsltproc-memcached? ( nginx_modules_http_xsltproc )" - -pkg_setup() { - NGINX_HOME="/var/lib/nginx" - NGINX_HOME_TMP="${NGINX_HOME}/tmp" - - ebegin "Creating nginx user and group" - enewgroup ${PN} - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} - eend $? - - if use libatomic; then - ewarn "GCC 4.1+ features built-in atomic operations." - ewarn "Using libatomic_ops is only needed if using" - ewarn "a different compiler or a GCC prior to 4.1" - fi - - if [[ -n $NGINX_ADD_MODULES ]]; then - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" - ewarn "This nginx installation is not supported!" - ewarn "Make sure you can reproduce the bug without those modules" - ewarn "_before_ reporting bugs." - fi - - if use !http; then - ewarn "To actually disable all http-functionality you also have to disable" - ewarn "all nginx http modules." - fi - - if use nginx_modules_http_ajp; then - eerror "The AJP module currently doesn't build for nginx >1.8." - eerror "It will be reintroduced with the 1.9 series when proven stable." - eerror "Either disable it or stick with nginx 1.7.x." - die "AJP module not supported" - fi - - if use nginx_modules_http_mogilefs && use threads; then - eerror "mogilefs won't compile with threads support." - eerror "Please disable either flag and try again." - die "Can't compile mogilefs with threads support" - fi -} - -src_prepare() { - epatch_user - - epatch "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" - - if use nginx_modules_http_upstream_check; then - epatch "${FILESDIR}/check-1.9.2".patch - fi - - if use nginx_modules_http_lua; then - sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die - fi - - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die - # We have config protection, don't rename etc files - sed -i 's:.default::' auto/install || die - # remove useless files - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die - - # don't install to /etc/nginx/ if not in use - local module - for module in fastcgi scgi uwsgi ; do - if ! use nginx_modules_http_${module}; then - sed -i -e "/${module}/d" auto/install || die - fi - done - - if use xsltproc-memcached; then - sed -i -e 's/LIBMEMCACHED_ENABLED=no/LIBMEMCACHED_ENABLED=yes/' "${HTTP_XSLTPROC_MODULE_WD}/config" || die - fi -} - -src_configure() { - # mod_security needs to generate nginx/modsecurity/config before including it - if use nginx_modules_http_security; then - cd "${HTTP_SECURITY_MODULE_WD}" - if use luajit ; then - sed -i \ - -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ - configure || die - fi - ./configure \ - --enable-standalone-module \ - $(use_enable pcre-jit) \ - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" - fi - - cd "${S}" - - local myconf=() http_enabled= mail_enabled= - - use aio && myconf+=( --with-file-aio ) - use debug && myconf+=( --with-debug ) - use http2 && myconf+=( --with-http_v2_module ) - use ipv6 && myconf+=( --with-ipv6 ) - use libatomic && myconf+=( --with-libatomic ) - use pcre && myconf+=( --with-pcre ) - use pcre-jit && myconf+=( --with-pcre-jit ) - use threads && myconf+=( --with-threads ) - - # HTTP modules - for mod in $NGINX_MODULES_STD; do - if use nginx_modules_http_${mod}; then - http_enabled=1 - else - myconf+=( --without-http_${mod}_module ) - fi - done - - for mod in $NGINX_MODULES_OPT; do - if use nginx_modules_http_${mod}; then - http_enabled=1 - myconf+=( --with-http_${mod}_module ) - fi - done - - if use nginx_modules_http_fastcgi; then - myconf+=( --with-http_realip_module ) - fi - - # third-party modules - if use nginx_modules_http_upload_progress; then - http_enabled=1 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) - fi - - if use nginx_modules_http_headers_more; then - http_enabled=1 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) - fi - - if use nginx_modules_http_cache_purge; then - http_enabled=1 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) - fi - - if use nginx_modules_http_slowfs_cache; then - http_enabled=1 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) - fi - - if use nginx_modules_http_fancyindex; then - http_enabled=1 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) - fi - - if use nginx_modules_http_lua; then - http_enabled=1 - if use luajit; then - export LUAJIT_LIB=$(pkg-config --variable libdir luajit) - export LUAJIT_INC=$(pkg-config --variable includedir luajit) - else - export LUA_LIB=$(pkg-config --variable libdir lua) - export LUA_INC=$(pkg-config --variable includedir lua) - fi - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) - fi - - if use nginx_modules_http_auth_pam; then - http_enabled=1 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) - fi - - if use nginx_modules_http_upstream_check; then - http_enabled=1 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) - fi - - if use nginx_modules_http_metrics; then - http_enabled=1 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) - fi - - if use nginx_modules_http_naxsi ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) - fi - - if use rtmp ; then - http_enabled=1 - myconf+=( --add-module=${RTMP_MODULE_WD} ) - fi - - if use nginx_modules_http_dav_ext ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) - fi - - if use nginx_modules_http_echo ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) - fi - - if use nginx_modules_http_security ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) - fi - - if use nginx_modules_http_push_stream ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) - fi - - if use nginx_modules_http_sticky ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) - fi - - if use nginx_modules_http_mogilefs ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) - fi - - if use nginx_modules_http_memc ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) - fi - - if use nginx_modules_http_xsltproc; then - http_enabled=1 - myconf+=( --add-module=${HTTP_XSLTPROC_MODULE_WD} ) - fi - - if use http || use http-cache || use http2; then - http_enabled=1 - fi - - if [ $http_enabled ]; then - use http-cache || myconf+=( --without-http-cache ) - use ssl && myconf+=( --with-http_ssl_module ) - else - myconf+=( --without-http --without-http-cache ) - fi - - # MAIL modules - for mod in $NGINX_MODULES_MAIL; do - if use nginx_modules_mail_${mod}; then - mail_enabled=1 - else - myconf+=( --without-mail_${mod}_module ) - fi - done - - if [ $mail_enabled ]; then - myconf+=( --with-mail ) - use ssl && myconf+=( --with-mail_ssl_module ) - fi - - # custom modules - for mod in $NGINX_ADD_MODULES; do - myconf+=( --add-module=${mod} ) - done - - # https://bugs.gentoo.org/286772 - export LANG=C LC_ALL=C - tc-export CC - - if ! use prefix; then - myconf+=( --user=${PN}" "--group=${PN} ) - fi - - ./configure \ - --prefix="${EPREFIX}"/usr \ - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ - --pid-path="${EPREFIX}"/run/${PN}.pid \ - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ - --with-cc-opt="-I${EROOT}usr/include" \ - --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ - "${myconf[@]}" || die "configure failed" - - # A purely cosmetic change that makes nginx -V more readable. This can be - # good if people outside the gentoo community would troubleshoot and - # question the users setup. - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die -} - -src_compile() { - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" - - # https://bugs.gentoo.org/286772 - export LANG=C LC_ALL=C - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" -} - -src_install() { - emake DESTDIR="${D%/}" install - - cp "${FILESDIR}"/nginx.conf "${ED}"etc/nginx/nginx.conf || die - - newinitd "${FILESDIR}"/nginx.initd-r2 nginx - - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service - - doman man/nginx.8 - dodoc CHANGES* README - - # just keepdir. do not copy the default htdocs files (bug #449136) - keepdir /var/www/localhost - rm -rf "${D}"usr/html || die - - # set up a list of directories to keep - local keepdir_list="${NGINX_HOME_TMP}"/client - local module - for module in proxy fastcgi scgi uwsgi; do - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" - done - - keepdir /var/log/nginx ${keepdir_list} - - # this solves a problem with SELinux where nginx doesn't see the directories - # as root and tries to create them as nginx - fperms 0750 "${NGINX_HOME_TMP}" - fowners ${PN}:0 "${NGINX_HOME_TMP}" - - fperms 0700 /var/log/nginx ${keepdir_list} - fowners ${PN}:${PN} /var/log/nginx ${keepdir_list} - - # logrotate - insinto /etc/logrotate.d - newins "${FILESDIR}"/nginx.logrotate-r1 nginx - - if use nginx_modules_http_perl; then - cd "${S}"/objs/src/http/modules/perl/ - emake DESTDIR="${D}" INSTALLDIRS=vendor - perl_delete_localpod - fi - - if use nginx_modules_http_cache_purge; then - docinto ${HTTP_CACHE_PURGE_MODULE_P} - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} - fi - - if use nginx_modules_http_slowfs_cache; then - docinto ${HTTP_SLOWFS_CACHE_MODULE_P} - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} - fi - - if use nginx_modules_http_fancyindex; then - docinto ${HTTP_FANCYINDEX_MODULE_P} - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst - fi - - if use nginx_modules_http_lua; then - docinto ${HTTP_LUA_MODULE_P} - dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown} - fi - - if use nginx_modules_http_auth_pam; then - docinto ${HTTP_AUTH_PAM_MODULE_P} - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} - fi - - if use nginx_modules_http_upstream_check; then - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} - fi - - if use nginx_modules_http_naxsi; then - insinto /etc/nginx - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules - fi - - if use rtmp; then - docinto ${RTMP_MODULE_P} - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} - fi - - if use nginx_modules_http_dav_ext; then - docinto ${HTTP_DAV_EXT_MODULE_P} - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README - fi - - if use nginx_modules_http_echo; then - docinto ${HTTP_ECHO_MODULE_P} - dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki} - fi - - if use nginx_modules_http_security; then - docinto ${HTTP_SECURITY_MODULE_P} - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt} - fi - - if use nginx_modules_http_push_stream; then - docinto ${HTTP_PUSH_STREAM_MODULE_P} - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} - fi - - if use nginx_modules_http_sticky; then - docinto ${HTTP_STICKY_MODULE_P} - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} - fi - - if use nginx_modules_http_memc; then - docinto ${HTTP_MEMC_MODULE_P} - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown - fi -} - -pkg_postinst() { - if use ssl; then - if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then - install_cert /etc/ssl/${PN}/${PN} - use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} - fi - fi - - if use nginx_modules_http_spdy; then - ewarn "In nginx 1.9.5 the spdy module was superseded by http2." - ewarn "Update your configs and package.use accordingly." - fi - - if use nginx_modules_http_lua && use http2; then - ewarn "Lua 3rd party module author warns against using ${P} with" - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg" - fi - - # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for - # existing installations - local fix_perms=0 - - for rv in ${REPLACING_VERSIONS} ; do - version_compare ${rv} 1.4.1-r2 - [[ $? -eq 1 ]] && fix_perms=1 - done - - if [[ $fix_perms -eq 1 ]] ; then - ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following" - ewarn "directories the world-readable bit removed (if set):" - ewarn " ${EPREFIX}/var/log/nginx" - ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" - ewarn "Check if this is correct for your setup before restarting nginx!" - ewarn "This is a one-time change and will not happen on subsequent updates." - ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}" - chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} - fi - - # If the nginx user can't change into or read the dir, display a warning. - # If su is not available we display the warning nevertheless since we can't check properly - su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null - if [ $? -ne 0 ] ; then - ewarn "Please make sure that the nginx user or group has at least" - ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)" - ewarn "Otherwise you end up with empty log files after a logrotate." - fi -} diff --git a/www-servers/nginx/nginx-1.9.12-r100.ebuild b/www-servers/nginx/nginx-1.9.12-r100.ebuild deleted file mode 100644 index 3758e0e..0000000 --- a/www-servers/nginx/nginx-1.9.12-r100.ebuild +++ /dev/null @@ -1,779 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=6 - -# Maintainer notes: -# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite -# - any http-module activates the main http-functionality and overrides USE=-http -# - keep the following requirements in mind before adding external modules: -# * alive upstream -# * sane packaging -# * builds cleanly -# * does not need a patch for nginx core -# - TODO: test the google-perftools module (included in vanilla tarball) - -# prevent perl-module from adding automagic perl DEPENDs -GENTOO_DEPEND_ON_PERL="no" - -# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) -DEVEL_KIT_MODULE_PV="0.2.19" -DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1" -DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" -DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" - -# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) -HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1" -HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" -HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" -HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" - -# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) -HTTP_HEADERS_MORE_MODULE_PV="0.29" -HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" -HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" -HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" - -# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) -HTTP_CACHE_PURGE_MODULE_PV="2.3" -HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" -HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" -HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" - -# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) -HTTP_SLOWFS_CACHE_MODULE_PV="1.10" -HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" -HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" -HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" - -# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) -HTTP_FANCYINDEX_MODULE_PV="0.3.6" -HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" -HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" -HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" - -# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) -HTTP_LUA_MODULE_PV="0.10.1rc1" -HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" -HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" -HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" - -# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) -HTTP_AUTH_PAM_MODULE_PV="1.4" -HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" -HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" -HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" - -# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) -HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0" -HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" -HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" -HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" - -# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) -HTTP_METRICS_MODULE_PV="0.1.1" -HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" -HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" -HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" - -# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) -HTTP_NAXSI_MODULE_PV="0.54" -HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" -HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" -HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" - -# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) -RTMP_MODULE_PV="1.1.7" -RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" -RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" -RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" - -# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) -HTTP_DAV_EXT_MODULE_PV="0.0.3" -HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" -HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" -HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" - -# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license) -HTTP_ECHO_MODULE_PV="0.58" -HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" -HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" -HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" - -# mod_security for nginx (https://modsecurity.org/, Apache-2.0) -# keep the MODULE_P here consistent with upstream to avoid tarball duplication -HTTP_SECURITY_MODULE_PV="2.9.0" -HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" -HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" -HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" - -# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) -HTTP_PUSH_STREAM_MODULE_PV="0.5.1" -HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" -HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" -HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" - -# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) -HTTP_STICKY_MODULE_PV="1.2.6" -HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" -HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" -HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d" - -# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) -HTTP_MOGILEFS_MODULE_PV="1.0.4" -HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" -HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" -HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" - -# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) -HTTP_MEMC_MODULE_PV="0.16" -HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" -HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" -HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" - -# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) -HTTP_LDAP_MODULE_PV="8517bb05ecc896b54429ca5e95137b0a386bd41a" -HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" -HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" -HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" - -HTTP_XSLTPROC_MODULE_PV="0.16" -HTTP_XSLTPROC_MODULE_P="ngx_xsltproc-${HTTP_XSLTPROC_MODULE_PV}" -HTTP_XSLTPROC_MODULE_URI="https://github.com/yoreek/nginx-xsltproc-module/archive/v${HTTP_XSLTPROC_MODULE_PV}.tar.gz" -HTTP_XSLTPROC_MODULE_WD="${WORKDIR}/nginx-xsltproc-module-${HTTP_XSLTPROC_MODULE_PV}" - -# We handle deps below ourselves -SSL_DEPS_SKIP=1 - -inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib - -DESCRIPTION="Robust, small and high performance http and reverse proxy server" -HOMEPAGE="http://nginx.org" -SRC_URI="http://nginx.org/download/${P}.tar.gz - ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz - nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) - nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) - nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) - nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) - nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) - nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) - nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) - nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) - nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) - nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) - rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz ) - nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) - nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) - nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) - nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) - nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) - nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) - nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) - nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) - nginx_modules_http_xsltproc? ( ${HTTP_XSLTPROC_MODULE_URI} -> ${HTTP_XSLTPROC_MODULE_P}.tar.gz )" - -LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ - nginx_modules_http_security? ( Apache-2.0 ) - nginx_modules_http_push_stream? ( GPL-3 )" - -SLOT="mainline" -KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" - -NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif - fastcgi geo gzip limit_req limit_conn map memcached proxy referer - rewrite scgi ssi split_clients upstream_ip_hash userid uwsgi" -NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip - gzip_static image_filter mp4 perl random_index realip secure_link - slice stub_status sub" -NGINX_MODULES_STREAM="access limit_conn upstream" -NGINX_MODULES_MAIL="imap pop3 smtp" -NGINX_MODULES_3RD=" - http_upload_progress - http_headers_more - http_cache_purge - http_slowfs_cache - http_fancyindex - http_lua - http_auth_pam - http_upstream_check - http_metrics - http_naxsi - http_dav_ext - http_echo - http_security - http_push_stream - http_sticky - http_ajp - http_mogilefs - http_memc - http_auth_ldap - http_xsltproc" - -IUSE="aio debug +http +http2 +http-cache ipv6 libatomic libressl luajit +pcre - pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax +nginx_modules_http_xsltproc xsltproc-memcached" - -for mod in $NGINX_MODULES_STD; do - IUSE="${IUSE} +nginx_modules_http_${mod}" -done - -for mod in $NGINX_MODULES_OPT; do - IUSE="${IUSE} nginx_modules_http_${mod}" -done - -for mod in $NGINX_MODULES_STREAM; do - IUSE="${IUSE} nginx_modules_stream_${mod}" -done - -for mod in $NGINX_MODULES_MAIL; do - IUSE="${IUSE} nginx_modules_mail_${mod}" -done - -for mod in $NGINX_MODULES_3RD; do - IUSE="${IUSE} nginx_modules_${mod}" -done - -# Add so we can warn users updating about config changes -# @TODO: jbergstroem: remove on next release series -IUSE="${IUSE} nginx_modules_http_spdy" - -CDEPEND=" - pcre? ( >=dev-libs/libpcre-4.2 ) - pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) - ssl? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:= ) - ) - http2? ( - !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) - libressl? ( dev-libs/libressl:= ) - ) - http-cache? ( - userland_GNU? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:= ) - ) - ) - nginx_modules_http_geoip? ( dev-libs/geoip ) - nginx_modules_http_gunzip? ( sys-libs/zlib ) - nginx_modules_http_gzip? ( sys-libs/zlib ) - nginx_modules_http_gzip_static? ( sys-libs/zlib ) - nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) - nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) - nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) - nginx_modules_http_secure_link? ( - userland_GNU? ( - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:= ) - ) - ) - nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) ) - nginx_modules_http_auth_pam? ( virtual/pam ) - nginx_modules_http_metrics? ( dev-libs/yajl ) - nginx_modules_http_dav_ext? ( dev-libs/expat ) - nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache ) - nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) - nginx_modules_http_xsltproc? ( dev-libs/libxml2 dev-libs/libxslt dev-libs/icu ) - xsltproc-memcached? ( dev-libs/libmemcached )" -RDEPEND="${CDEPEND} - selinux? ( sec-policy/selinux-nginx ) - !www-servers/nginx:0" -DEPEND="${CDEPEND} - arm? ( dev-libs/libatomic_ops ) - libatomic? ( dev-libs/libatomic_ops )" -PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" - -REQUIRED_USE="pcre-jit? ( pcre ) - nginx_modules_http_lua? ( nginx_modules_http_rewrite ) - nginx_modules_http_naxsi? ( pcre ) - nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) - nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) - nginx_modules_http_security? ( pcre ) - nginx_modules_http_push_stream? ( ssl ) - xsltproc-memcached? ( nginx_modules_http_xsltproc )" - -pkg_setup() { - NGINX_HOME="/var/lib/nginx" - NGINX_HOME_TMP="${NGINX_HOME}/tmp" - - ebegin "Creating nginx user and group" - enewgroup ${PN} - enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} - eend $? - - if use libatomic; then - ewarn "GCC 4.1+ features built-in atomic operations." - ewarn "Using libatomic_ops is only needed if using" - ewarn "a different compiler or a GCC prior to 4.1" - fi - - if [[ -n $NGINX_ADD_MODULES ]]; then - ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" - ewarn "This nginx installation is not supported!" - ewarn "Make sure you can reproduce the bug without those modules" - ewarn "_before_ reporting bugs." - fi - - if use !http; then - ewarn "To actually disable all http-functionality you also have to disable" - ewarn "all nginx http modules." - fi - - if use nginx_modules_http_ajp; then - eerror "The AJP module currently doesn't build for nginx >1.8." - eerror "It will be reintroduced with the 1.9 series when proven stable." - eerror "Either disable it or stick with nginx 1.7.x." - die "AJP module not supported" - fi - - if use nginx_modules_http_mogilefs && use threads; then - eerror "mogilefs won't compile with threads support." - eerror "Please disable either flag and try again." - die "Can't compile mogilefs with threads support" - fi -} - -src_prepare() { - eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" - - if use nginx_modules_http_upstream_check; then - eapply -p0 "${FILESDIR}/check-1.9.2".patch - fi - - if use nginx_modules_http_lua; then - sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die - fi - - find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die - # We have config protection, don't rename etc files - sed -i 's:.default::' auto/install || die - # remove useless files - sed -i -e '/koi-/d' -e '/win-/d' auto/install || die - - # don't install to /etc/nginx/ if not in use - local module - for module in fastcgi scgi uwsgi ; do - if ! use nginx_modules_http_${module}; then - sed -i -e "/${module}/d" auto/install || die - fi - done - - if use xsltproc-memcached; then - sed -i -e 's/LIBMEMCACHED_ENABLED=no/LIBMEMCACHED_ENABLED=yes/' "${HTTP_XSLTPROC_MODULE_WD}/config" || die - fi - - eapply_user -} - -src_configure() { - # mod_security needs to generate nginx/modsecurity/config before including it - if use nginx_modules_http_security; then - cd "${HTTP_SECURITY_MODULE_WD}" - if use luajit ; then - sed -i \ - -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ - configure || die - fi - ./configure \ - --enable-standalone-module \ - $(use_enable pcre-jit) \ - $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" - fi - - cd "${S}" - - local myconf=() http_enabled= mail_enabled= stream_enabled= - - use aio && myconf+=( --with-file-aio ) - use debug && myconf+=( --with-debug ) - use http2 && myconf+=( --with-http_v2_module ) - use ipv6 && myconf+=( --with-ipv6 ) - use libatomic && myconf+=( --with-libatomic ) - use pcre && myconf+=( --with-pcre ) - use pcre-jit && myconf+=( --with-pcre-jit ) - use threads && myconf+=( --with-threads ) - - # HTTP modules - for mod in $NGINX_MODULES_STD; do - if use nginx_modules_http_${mod}; then - http_enabled=1 - else - myconf+=( --without-http_${mod}_module ) - fi - done - - for mod in $NGINX_MODULES_OPT; do - if use nginx_modules_http_${mod}; then - http_enabled=1 - myconf+=( --with-http_${mod}_module ) - fi - done - - if use nginx_modules_http_fastcgi; then - myconf+=( --with-http_realip_module ) - fi - - # third-party modules - if use nginx_modules_http_upload_progress; then - http_enabled=1 - myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) - fi - - if use nginx_modules_http_headers_more; then - http_enabled=1 - myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) - fi - - if use nginx_modules_http_cache_purge; then - http_enabled=1 - myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) - fi - - if use nginx_modules_http_slowfs_cache; then - http_enabled=1 - myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) - fi - - if use nginx_modules_http_fancyindex; then - http_enabled=1 - myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) - fi - - if use nginx_modules_http_lua; then - http_enabled=1 - if use luajit; then - export LUAJIT_LIB=$(pkg-config --variable libdir luajit) - export LUAJIT_INC=$(pkg-config --variable includedir luajit) - else - export LUA_LIB=$(pkg-config --variable libdir lua) - export LUA_INC=$(pkg-config --variable includedir lua) - fi - myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) - myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) - fi - - if use nginx_modules_http_auth_pam; then - http_enabled=1 - myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) - fi - - if use nginx_modules_http_upstream_check; then - http_enabled=1 - myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) - fi - - if use nginx_modules_http_metrics; then - http_enabled=1 - myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) - fi - - if use nginx_modules_http_naxsi ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) - fi - - if use rtmp ; then - http_enabled=1 - myconf+=( --add-module=${RTMP_MODULE_WD} ) - fi - - if use nginx_modules_http_dav_ext ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) - fi - - if use nginx_modules_http_echo ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) - fi - - if use nginx_modules_http_security ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) - fi - - if use nginx_modules_http_push_stream ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) - fi - - if use nginx_modules_http_sticky ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) - fi - - if use nginx_modules_http_mogilefs ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) - fi - - if use nginx_modules_http_memc ; then - http_enabled=1 - myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) - fi - - if use nginx_modules_http_auth_ldap; then - http_enabled=1 - myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) - fi - - if use nginx_modules_http_xsltproc; then - http_enabled=1 - myconf+=( --add-module=${HTTP_XSLTPROC_MODULE_WD} ) - fi - - if use http || use http-cache || use http2; then - http_enabled=1 - fi - - if [ $http_enabled ]; then - use http-cache || myconf+=( --without-http-cache ) - use ssl && myconf+=( --with-http_ssl_module ) - else - myconf+=( --without-http --without-http-cache ) - fi - - # Stream modules - for mod in $NGINX_MODULES_STREAM; do - if use nginx_modules_stream_${mod}; then - stream_enabled=1 - else - # Treat stream upstream slightly differently - if ! use nginx_modules_stream_upstream; then - myconf+=( --without-stream_upstream_hash_module ) - myconf+=( --without-stream_upstream_least_conn_module ) - myconf+=( --without-stream_upstream_zone_module ) - else - myconf+=( --without-stream_${stream}_module ) - fi - fi - done - - if [ $stream_enabled ]; then - myconf+=( --with-stream ) - use ssl && myconf+=( --with-stream_ssl_module ) - fi - - # MAIL modules - for mod in $NGINX_MODULES_MAIL; do - if use nginx_modules_mail_${mod}; then - mail_enabled=1 - else - myconf+=( --without-mail_${mod}_module ) - fi - done - - if [ $mail_enabled ]; then - myconf+=( --with-mail ) - use ssl && myconf+=( --with-mail_ssl_module ) - fi - - # custom modules - for mod in $NGINX_ADD_MODULES; do - myconf+=( --add-module=${mod} ) - done - - # https://bugs.gentoo.org/286772 - export LANG=C LC_ALL=C - tc-export CC - - if ! use prefix; then - myconf+=( --user=${PN}" "--group=${PN} ) - fi - - ./configure \ - --prefix="${EPREFIX}"/usr \ - --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ - --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ - --pid-path="${EPREFIX}"/run/${PN}.pid \ - --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ - --with-cc-opt="-I${EROOT}usr/include" \ - --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ - --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ - --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ - --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ - --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ - --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ - --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ - "${myconf[@]}" || die "configure failed" - - # A purely cosmetic change that makes nginx -V more readable. This can be - # good if people outside the gentoo community would troubleshoot and - # question the users setup. - sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die -} - -src_compile() { - use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" - - # https://bugs.gentoo.org/286772 - export LANG=C LC_ALL=C - emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" -} - -src_install() { - emake DESTDIR="${D%/}" install - - cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die - - newinitd "${FILESDIR}"/nginx.initd-r2 nginx - - systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service - - doman man/nginx.8 - dodoc CHANGES* README - - # just keepdir. do not copy the default htdocs files (bug #449136) - keepdir /var/www/localhost - rm -rf "${D}"usr/html || die - - # set up a list of directories to keep - local keepdir_list="${NGINX_HOME_TMP}"/client - local module - for module in proxy fastcgi scgi uwsgi; do - use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" - done - - keepdir /var/log/nginx ${keepdir_list} - - # this solves a problem with SELinux where nginx doesn't see the directories - # as root and tries to create them as nginx - fperms 0750 "${NGINX_HOME_TMP}" - fowners ${PN}:0 "${NGINX_HOME_TMP}" - - fperms 0700 /var/log/nginx ${keepdir_list} - fowners ${PN}:${PN} /var/log/nginx ${keepdir_list} - - # logrotate - insinto /etc/logrotate.d - newins "${FILESDIR}"/nginx.logrotate-r1 nginx - - if use nginx_modules_http_perl; then - cd "${S}"/objs/src/http/modules/perl/ - emake DESTDIR="${D}" INSTALLDIRS=vendor - perl_delete_localpod - fi - - if use nginx_modules_http_cache_purge; then - docinto ${HTTP_CACHE_PURGE_MODULE_P} - dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} - fi - - if use nginx_modules_http_slowfs_cache; then - docinto ${HTTP_SLOWFS_CACHE_MODULE_P} - dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} - fi - - if use nginx_modules_http_fancyindex; then - docinto ${HTTP_FANCYINDEX_MODULE_P} - dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst - fi - - if use nginx_modules_http_lua; then - docinto ${HTTP_LUA_MODULE_P} - dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown} - fi - - if use nginx_modules_http_auth_pam; then - docinto ${HTTP_AUTH_PAM_MODULE_P} - dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} - fi - - if use nginx_modules_http_upstream_check; then - docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} - dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} - fi - - if use nginx_modules_http_naxsi; then - insinto /etc/nginx - doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules - fi - - if use rtmp; then - docinto ${RTMP_MODULE_P} - dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} - fi - - if use nginx_modules_http_dav_ext; then - docinto ${HTTP_DAV_EXT_MODULE_P} - dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README - fi - - if use nginx_modules_http_echo; then - docinto ${HTTP_ECHO_MODULE_P} - dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki} - fi - - if use nginx_modules_http_security; then - docinto ${HTTP_SECURITY_MODULE_P} - dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt} - fi - - if use nginx_modules_http_push_stream; then - docinto ${HTTP_PUSH_STREAM_MODULE_P} - dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} - fi - - if use nginx_modules_http_sticky; then - docinto ${HTTP_STICKY_MODULE_P} - dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} - fi - - if use nginx_modules_http_memc; then - docinto ${HTTP_MEMC_MODULE_P} - dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown - fi - - if use nginx_modules_http_auth_ldap; then - docinto ${HTTP_LDAP_MODULE_P} - dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf - fi -} - -pkg_postinst() { - if use ssl; then - if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then - install_cert /etc/ssl/${PN}/${PN} - use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} - fi - fi - - if use nginx_modules_http_spdy; then - ewarn "In nginx 1.9.5 the spdy module was superseded by http2." - ewarn "Update your configs and package.use accordingly." - fi - - if use nginx_modules_http_lua && use http2; then - ewarn "Lua 3rd party module author warns against using ${P} with" - ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg" - fi - - # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for - # existing installations - local fix_perms=0 - - for rv in ${REPLACING_VERSIONS} ; do - version_compare ${rv} 1.4.1-r2 - [[ $? -eq 1 ]] && fix_perms=1 - done - - if [[ $fix_perms -eq 1 ]] ; then - ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following" - ewarn "directories the world-readable bit removed (if set):" - ewarn " ${EPREFIX}/var/log/nginx" - ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" - ewarn "Check if this is correct for your setup before restarting nginx!" - ewarn "This is a one-time change and will not happen on subsequent updates." - ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}" - chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} - fi - - # If the nginx user can't change into or read the dir, display a warning. - # If su is not available we display the warning nevertheless since we can't check properly - su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null - if [ $? -ne 0 ] ; then - ewarn "Please make sure that the nginx user or group has at least" - ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)" - ewarn "Otherwise you end up with empty log files after a logrotate." - fi -} diff --git a/www-servers/nginx/nginx-1.9.14-r100.ebuild b/www-servers/nginx/nginx-1.9.14-r100.ebuild new file mode 100644 index 0000000..e967cc9 --- /dev/null +++ b/www-servers/nginx/nginx-1.9.14-r100.ebuild @@ -0,0 +1,779 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +# Maintainer notes: +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite +# - any http-module activates the main http-functionality and overrides USE=-http +# - keep the following requirements in mind before adding external modules: +# * alive upstream +# * sane packaging +# * builds cleanly +# * does not need a patch for nginx core +# - TODO: test the google-perftools module (included in vanilla tarball) + +# prevent perl-module from adding automagic perl DEPENDs +GENTOO_DEPEND_ON_PERL="no" + +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) +DEVEL_KIT_MODULE_PV="0.2.19" +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1" +DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" +DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" + +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1" +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" +HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" +HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" + +# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) +HTTP_HEADERS_MORE_MODULE_PV="0.29" +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" +HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" +HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" + +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) +HTTP_CACHE_PURGE_MODULE_PV="2.3" +HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" +HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" + +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) +HTTP_SLOWFS_CACHE_MODULE_PV="1.10" +HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" +HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" + +# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) +HTTP_FANCYINDEX_MODULE_PV="0.3.6" +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" +HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" + +# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) +HTTP_LUA_MODULE_PV="0.10.2" +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" +HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" +HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" + +# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) +HTTP_AUTH_PAM_MODULE_PV="1.5.1" +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" +HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" +HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" + +# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) +HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0" +HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" +HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" + +# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) +HTTP_METRICS_MODULE_PV="0.1.1" +HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" +HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" +HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" + +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) +HTTP_NAXSI_MODULE_PV="0.54" +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" +HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" + +# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) +RTMP_MODULE_PV="1.1.7" +RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" +RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" +RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" + +# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) +HTTP_DAV_EXT_MODULE_PV="0.0.3" +HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" +HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" +HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" + +# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license) +HTTP_ECHO_MODULE_PV="0.58" +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" +HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" +HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" + +# mod_security for nginx (https://modsecurity.org/, Apache-2.0) +# keep the MODULE_P here consistent with upstream to avoid tarball duplication +HTTP_SECURITY_MODULE_PV="2.9.1" +HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" +HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" +HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" + +# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) +HTTP_PUSH_STREAM_MODULE_PV="0.5.1" +HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" +HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" +HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" + +# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) +HTTP_STICKY_MODULE_PV="1.2.6" +HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" +HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" +HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d" + +# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) +HTTP_MOGILEFS_MODULE_PV="1.0.4" +HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" +HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" +HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" + +# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) +HTTP_MEMC_MODULE_PV="0.16" +HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" +HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" +HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" + +# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) +HTTP_LDAP_MODULE_PV="8517bb05ecc896b54429ca5e95137b0a386bd41a" +HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" +HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" +HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" + +HTTP_XSLTPROC_MODULE_PV="0.16" +HTTP_XSLTPROC_MODULE_P="ngx_xsltproc-${HTTP_XSLTPROC_MODULE_PV}" +HTTP_XSLTPROC_MODULE_URI="https://github.com/yoreek/nginx-xsltproc-module/archive/v${HTTP_XSLTPROC_MODULE_PV}.tar.gz" +HTTP_XSLTPROC_MODULE_WD="${WORKDIR}/nginx-xsltproc-module-${HTTP_XSLTPROC_MODULE_PV}" + +# We handle deps below ourselves +SSL_DEPS_SKIP=1 + +inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib + +DESCRIPTION="Robust, small and high performance http and reverse proxy server" +HOMEPAGE="http://nginx.org" +SRC_URI="http://nginx.org/download/${P}.tar.gz + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz ) + nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) + nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) + nginx_modules_http_xsltproc? ( ${HTTP_XSLTPROC_MODULE_URI} -> ${HTTP_XSLTPROC_MODULE_P}.tar.gz )" + +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ + nginx_modules_http_security? ( Apache-2.0 ) + nginx_modules_http_push_stream? ( GPL-3 )" + +SLOT="mainline" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" + +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif + fastcgi geo gzip limit_req limit_conn map memcached proxy referer + rewrite scgi ssi split_clients upstream_ip_hash userid uwsgi" +NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip + gzip_static image_filter mp4 perl random_index realip secure_link + slice stub_status sub" +NGINX_MODULES_STREAM="access limit_conn upstream" +NGINX_MODULES_MAIL="imap pop3 smtp" +NGINX_MODULES_3RD=" + http_upload_progress + http_headers_more + http_cache_purge + http_slowfs_cache + http_fancyindex + http_lua + http_auth_pam + http_upstream_check + http_metrics + http_naxsi + http_dav_ext + http_echo + http_security + http_push_stream + http_sticky + http_ajp + http_mogilefs + http_memc + http_auth_ldap + http_xsltproc" + +IUSE="aio debug +http +http2 +http-cache ipv6 libatomic libressl luajit +pcre + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax +nginx_modules_http_xsltproc xsltproc-memcached" + +for mod in $NGINX_MODULES_STD; do + IUSE="${IUSE} +nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_OPT; do + IUSE="${IUSE} nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_STREAM; do + IUSE="${IUSE} nginx_modules_stream_${mod}" +done + +for mod in $NGINX_MODULES_MAIL; do + IUSE="${IUSE} nginx_modules_mail_${mod}" +done + +for mod in $NGINX_MODULES_3RD; do + IUSE="${IUSE} nginx_modules_${mod}" +done + +# Add so we can warn users updating about config changes +# @TODO: jbergstroem: remove on next release series +IUSE="${IUSE} nginx_modules_http_spdy" + +CDEPEND=" + pcre? ( >=dev-libs/libpcre-4.2 ) + pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + http2? ( + !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) + libressl? ( dev-libs/libressl:= ) + ) + http-cache? ( + userland_GNU? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + ) + nginx_modules_http_geoip? ( dev-libs/geoip ) + nginx_modules_http_gunzip? ( sys-libs/zlib ) + nginx_modules_http_gzip? ( sys-libs/zlib ) + nginx_modules_http_gzip_static? ( sys-libs/zlib ) + nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) + nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) + nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) + nginx_modules_http_secure_link? ( + userland_GNU? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + ) + nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) ) + nginx_modules_http_auth_pam? ( virtual/pam ) + nginx_modules_http_metrics? ( dev-libs/yajl ) + nginx_modules_http_dav_ext? ( dev-libs/expat ) + nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache ) + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) + nginx_modules_http_xsltproc? ( dev-libs/libxml2 dev-libs/libxslt dev-libs/icu ) + xsltproc-memcached? ( dev-libs/libmemcached )" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-nginx ) + !www-servers/nginx:0" +DEPEND="${CDEPEND} + arm? ( dev-libs/libatomic_ops ) + libatomic? ( dev-libs/libatomic_ops )" +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" + +REQUIRED_USE="pcre-jit? ( pcre ) + nginx_modules_http_lua? ( nginx_modules_http_rewrite ) + nginx_modules_http_naxsi? ( pcre ) + nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) + nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) + nginx_modules_http_security? ( pcre ) + nginx_modules_http_push_stream? ( ssl ) + xsltproc-memcached? ( nginx_modules_http_xsltproc )" + +pkg_setup() { + NGINX_HOME="/var/lib/nginx" + NGINX_HOME_TMP="${NGINX_HOME}/tmp" + + ebegin "Creating nginx user and group" + enewgroup ${PN} + enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} + eend $? + + if use libatomic; then + ewarn "GCC 4.1+ features built-in atomic operations." + ewarn "Using libatomic_ops is only needed if using" + ewarn "a different compiler or a GCC prior to 4.1" + fi + + if [[ -n $NGINX_ADD_MODULES ]]; then + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" + ewarn "This nginx installation is not supported!" + ewarn "Make sure you can reproduce the bug without those modules" + ewarn "_before_ reporting bugs." + fi + + if use !http; then + ewarn "To actually disable all http-functionality you also have to disable" + ewarn "all nginx http modules." + fi + + if use nginx_modules_http_ajp; then + eerror "The AJP module currently doesn't build for nginx >1.8." + eerror "It will be reintroduced with the 1.9 series when proven stable." + eerror "Either disable it or stick with nginx 1.7.x." + die "AJP module not supported" + fi + + if use nginx_modules_http_mogilefs && use threads; then + eerror "mogilefs won't compile with threads support." + eerror "Please disable either flag and try again." + die "Can't compile mogilefs with threads support" + fi +} + +src_prepare() { + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" + + if use nginx_modules_http_upstream_check; then + eapply -p0 "${FILESDIR}/check-1.9.2".patch + fi + + if use nginx_modules_http_lua; then + sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die + fi + + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die + # We have config protection, don't rename etc files + sed -i 's:.default::' auto/install || die + # remove useless files + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die + + # don't install to /etc/nginx/ if not in use + local module + for module in fastcgi scgi uwsgi ; do + if ! use nginx_modules_http_${module}; then + sed -i -e "/${module}/d" auto/install || die + fi + done + + if use xsltproc-memcached; then + sed -i -e 's/LIBMEMCACHED_ENABLED=no/LIBMEMCACHED_ENABLED=yes/' "${HTTP_XSLTPROC_MODULE_WD}/config" || die + fi + + eapply_user +} + +src_configure() { + # mod_security needs to generate nginx/modsecurity/config before including it + if use nginx_modules_http_security; then + cd "${HTTP_SECURITY_MODULE_WD}" + if use luajit ; then + sed -i \ + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ + configure || die + fi + ./configure \ + --enable-standalone-module \ + $(use_enable pcre-jit) \ + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" + fi + + cd "${S}" + + local myconf=() http_enabled= mail_enabled= stream_enabled= + + use aio && myconf+=( --with-file-aio ) + use debug && myconf+=( --with-debug ) + use http2 && myconf+=( --with-http_v2_module ) + use ipv6 && myconf+=( --with-ipv6 ) + use libatomic && myconf+=( --with-libatomic ) + use pcre && myconf+=( --with-pcre ) + use pcre-jit && myconf+=( --with-pcre-jit ) + use threads && myconf+=( --with-threads ) + + # HTTP modules + for mod in $NGINX_MODULES_STD; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + else + myconf+=( --without-http_${mod}_module ) + fi + done + + for mod in $NGINX_MODULES_OPT; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + myconf+=( --with-http_${mod}_module ) + fi + done + + if use nginx_modules_http_fastcgi; then + myconf+=( --with-http_realip_module ) + fi + + # third-party modules + if use nginx_modules_http_upload_progress; then + http_enabled=1 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) + fi + + if use nginx_modules_http_headers_more; then + http_enabled=1 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) + fi + + if use nginx_modules_http_cache_purge; then + http_enabled=1 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) + fi + + if use nginx_modules_http_slowfs_cache; then + http_enabled=1 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) + fi + + if use nginx_modules_http_fancyindex; then + http_enabled=1 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) + fi + + if use nginx_modules_http_lua; then + http_enabled=1 + if use luajit; then + export LUAJIT_LIB=$(pkg-config --variable libdir luajit) + export LUAJIT_INC=$(pkg-config --variable includedir luajit) + else + export LUA_LIB=$(pkg-config --variable libdir lua) + export LUA_INC=$(pkg-config --variable includedir lua) + fi + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) + fi + + if use nginx_modules_http_auth_pam; then + http_enabled=1 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) + fi + + if use nginx_modules_http_upstream_check; then + http_enabled=1 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) + fi + + if use nginx_modules_http_metrics; then + http_enabled=1 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) + fi + + if use nginx_modules_http_naxsi ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) + fi + + if use rtmp ; then + http_enabled=1 + myconf+=( --add-module=${RTMP_MODULE_WD} ) + fi + + if use nginx_modules_http_dav_ext ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) + fi + + if use nginx_modules_http_echo ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) + fi + + if use nginx_modules_http_security ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) + fi + + if use nginx_modules_http_push_stream ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) + fi + + if use nginx_modules_http_sticky ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) + fi + + if use nginx_modules_http_mogilefs ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) + fi + + if use nginx_modules_http_memc ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) + fi + + if use nginx_modules_http_auth_ldap; then + http_enabled=1 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) + fi + + if use nginx_modules_http_xsltproc; then + http_enabled=1 + myconf+=( --add-module=${HTTP_XSLTPROC_MODULE_WD} ) + fi + + if use http || use http-cache || use http2; then + http_enabled=1 + fi + + if [ $http_enabled ]; then + use http-cache || myconf+=( --without-http-cache ) + use ssl && myconf+=( --with-http_ssl_module ) + else + myconf+=( --without-http --without-http-cache ) + fi + + # Stream modules + for mod in $NGINX_MODULES_STREAM; do + if use nginx_modules_stream_${mod}; then + stream_enabled=1 + else + # Treat stream upstream slightly differently + if ! use nginx_modules_stream_upstream; then + myconf+=( --without-stream_upstream_hash_module ) + myconf+=( --without-stream_upstream_least_conn_module ) + myconf+=( --without-stream_upstream_zone_module ) + else + myconf+=( --without-stream_${stream}_module ) + fi + fi + done + + if [ $stream_enabled ]; then + myconf+=( --with-stream ) + use ssl && myconf+=( --with-stream_ssl_module ) + fi + + # MAIL modules + for mod in $NGINX_MODULES_MAIL; do + if use nginx_modules_mail_${mod}; then + mail_enabled=1 + else + myconf+=( --without-mail_${mod}_module ) + fi + done + + if [ $mail_enabled ]; then + myconf+=( --with-mail ) + use ssl && myconf+=( --with-mail_ssl_module ) + fi + + # custom modules + for mod in $NGINX_ADD_MODULES; do + myconf+=( --add-module=${mod} ) + done + + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + tc-export CC + + if ! use prefix; then + myconf+=( --user=${PN}" "--group=${PN} ) + fi + + ./configure \ + --prefix="${EPREFIX}"/usr \ + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ + --pid-path="${EPREFIX}"/run/${PN}.pid \ + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ + --with-cc-opt="-I${EROOT}usr/include" \ + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ + "${myconf[@]}" || die "configure failed" + + # A purely cosmetic change that makes nginx -V more readable. This can be + # good if people outside the gentoo community would troubleshoot and + # question the users setup. + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die +} + +src_compile() { + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" + + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" +} + +src_install() { + emake DESTDIR="${D%/}" install + + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die + + newinitd "${FILESDIR}"/nginx.initd-r2 nginx + + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service + + doman man/nginx.8 + dodoc CHANGES* README + + # just keepdir. do not copy the default htdocs files (bug #449136) + keepdir /var/www/localhost + rm -rf "${D}"usr/html || die + + # set up a list of directories to keep + local keepdir_list="${NGINX_HOME_TMP}"/client + local module + for module in proxy fastcgi scgi uwsgi; do + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" + done + + keepdir /var/log/nginx ${keepdir_list} + + # this solves a problem with SELinux where nginx doesn't see the directories + # as root and tries to create them as nginx + fperms 0750 "${NGINX_HOME_TMP}" + fowners ${PN}:0 "${NGINX_HOME_TMP}" + + fperms 0700 /var/log/nginx ${keepdir_list} + fowners ${PN}:${PN} /var/log/nginx ${keepdir_list} + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate-r1 nginx + + if use nginx_modules_http_perl; then + cd "${S}"/objs/src/http/modules/perl/ + emake DESTDIR="${D}" INSTALLDIRS=vendor + perl_delete_localpod + fi + + if use nginx_modules_http_cache_purge; then + docinto ${HTTP_CACHE_PURGE_MODULE_P} + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} + fi + + if use nginx_modules_http_slowfs_cache; then + docinto ${HTTP_SLOWFS_CACHE_MODULE_P} + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} + fi + + if use nginx_modules_http_fancyindex; then + docinto ${HTTP_FANCYINDEX_MODULE_P} + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst + fi + + if use nginx_modules_http_lua; then + docinto ${HTTP_LUA_MODULE_P} + dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown} + fi + + if use nginx_modules_http_auth_pam; then + docinto ${HTTP_AUTH_PAM_MODULE_P} + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} + fi + + if use nginx_modules_http_upstream_check; then + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} + fi + + if use nginx_modules_http_naxsi; then + insinto /etc/nginx + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules + fi + + if use rtmp; then + docinto ${RTMP_MODULE_P} + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} + fi + + if use nginx_modules_http_dav_ext; then + docinto ${HTTP_DAV_EXT_MODULE_P} + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README + fi + + if use nginx_modules_http_echo; then + docinto ${HTTP_ECHO_MODULE_P} + dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki} + fi + + if use nginx_modules_http_security; then + docinto ${HTTP_SECURITY_MODULE_P} + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt} + fi + + if use nginx_modules_http_push_stream; then + docinto ${HTTP_PUSH_STREAM_MODULE_P} + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} + fi + + if use nginx_modules_http_sticky; then + docinto ${HTTP_STICKY_MODULE_P} + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} + fi + + if use nginx_modules_http_memc; then + docinto ${HTTP_MEMC_MODULE_P} + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown + fi + + if use nginx_modules_http_auth_ldap; then + docinto ${HTTP_LDAP_MODULE_P} + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf + fi +} + +pkg_postinst() { + if use ssl; then + if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then + install_cert /etc/ssl/${PN}/${PN} + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} + fi + fi + + if use nginx_modules_http_spdy; then + ewarn "In nginx 1.9.5 the spdy module was superseded by http2." + ewarn "Update your configs and package.use accordingly." + fi + + if use nginx_modules_http_lua && use http2; then + ewarn "Lua 3rd party module author warns against using ${P} with" + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg" + fi + + # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for + # existing installations + local fix_perms=0 + + for rv in ${REPLACING_VERSIONS} ; do + version_compare ${rv} 1.4.1-r2 + [[ $? -eq 1 ]] && fix_perms=1 + done + + if [[ $fix_perms -eq 1 ]] ; then + ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following" + ewarn "directories the world-readable bit removed (if set):" + ewarn " ${EPREFIX}/var/log/nginx" + ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" + ewarn "Check if this is correct for your setup before restarting nginx!" + ewarn "This is a one-time change and will not happen on subsequent updates." + ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}" + chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + fi + + # If the nginx user can't change into or read the dir, display a warning. + # If su is not available we display the warning nevertheless since we can't check properly + su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null + if [ $? -ne 0 ] ; then + ewarn "Please make sure that the nginx user or group has at least" + ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)" + ewarn "Otherwise you end up with empty log files after a logrotate." + fi +} diff --git a/www-servers/nginx/nginx-1.9.15-r100.ebuild b/www-servers/nginx/nginx-1.9.15-r100.ebuild new file mode 100644 index 0000000..e967cc9 --- /dev/null +++ b/www-servers/nginx/nginx-1.9.15-r100.ebuild @@ -0,0 +1,779 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +# Maintainer notes: +# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite +# - any http-module activates the main http-functionality and overrides USE=-http +# - keep the following requirements in mind before adding external modules: +# * alive upstream +# * sane packaging +# * builds cleanly +# * does not need a patch for nginx core +# - TODO: test the google-perftools module (included in vanilla tarball) + +# prevent perl-module from adding automagic perl DEPENDs +GENTOO_DEPEND_ON_PERL="no" + +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) +DEVEL_KIT_MODULE_PV="0.2.19" +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1" +DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz" +DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" + +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1" +HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1" +HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz" +HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}" + +# http_headers_more (https://github.com/agentzh/headers-more-nginx-module, BSD license) +HTTP_HEADERS_MORE_MODULE_PV="0.29" +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}" +HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz" +HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}" + +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) +HTTP_CACHE_PURGE_MODULE_PV="2.3" +HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" +HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz" +HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}" + +# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license) +HTTP_SLOWFS_CACHE_MODULE_PV="1.10" +HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" +HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz" +HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}" + +# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license) +HTTP_FANCYINDEX_MODULE_PV="0.3.6" +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" +HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz" +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" + +# http_lua (https://github.com/openresty/lua-nginx-module, BSD license) +HTTP_LUA_MODULE_PV="0.10.2" +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" +HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz" +HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}" + +# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license) +HTTP_AUTH_PAM_MODULE_PV="1.5.1" +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" +HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz" +HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}" + +# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license) +HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0" +HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}" +HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz" +HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}" + +# http_metrics (https://github.com/zenops/ngx_metrics, BSD license) +HTTP_METRICS_MODULE_PV="0.1.1" +HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}" +HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz" +HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}" + +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) +HTTP_NAXSI_MODULE_PV="0.54" +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" +HTTP_NAXSI_MODULE_URI="https://github.com/nbs-system/naxsi/archive/${HTTP_NAXSI_MODULE_PV}.tar.gz" +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-${HTTP_NAXSI_MODULE_PV}/naxsi_src" + +# nginx-rtmp-module (https://github.com/arut/nginx-rtmp-module, BSD license) +RTMP_MODULE_PV="1.1.7" +RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}" +RTMP_MODULE_URI="https://github.com/arut/nginx-rtmp-module/archive/v${RTMP_MODULE_PV}.tar.gz" +RTMP_MODULE_WD="${WORKDIR}/nginx-rtmp-module-${RTMP_MODULE_PV}" + +# nginx-dav-ext-module (https://github.com/arut/nginx-dav-ext-module, BSD license) +HTTP_DAV_EXT_MODULE_PV="0.0.3" +HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}" +HTTP_DAV_EXT_MODULE_URI="https://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz" +HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}" + +# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license) +HTTP_ECHO_MODULE_PV="0.58" +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" +HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz" +HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}" + +# mod_security for nginx (https://modsecurity.org/, Apache-2.0) +# keep the MODULE_P here consistent with upstream to avoid tarball duplication +HTTP_SECURITY_MODULE_PV="2.9.1" +HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}" +HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz" +HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}" + +# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3) +HTTP_PUSH_STREAM_MODULE_PV="0.5.1" +HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}" +HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz" +HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}" + +# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2) +HTTP_STICKY_MODULE_PV="1.2.6" +HTTP_STICKY_MODULE_P="nginx_http_sticky_module_ng-${HTTP_STICKY_MODULE_PV}" +HTTP_STICKY_MODULE_URI="https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/get/${HTTP_STICKY_MODULE_PV}.tar.bz2" +HTTP_STICKY_MODULE_WD="${WORKDIR}/nginx-goodies-nginx-sticky-module-ng-c78b7dd79d0d" + +# mogilefs-module (https://github.com/vkholodkov/nginx-mogilefs-module, BSD-2) +HTTP_MOGILEFS_MODULE_PV="1.0.4" +HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" +HTTP_MOGILEFS_MODULE_URI="https://github.com/vkholodkov/nginx-mogilefs-module/archive/${HTTP_MOGILEFS_MODULE_PV}.tar.gz" +HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}" + +# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2) +HTTP_MEMC_MODULE_PV="0.16" +HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}" +HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz" +HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}" + +# nginx-ldap-auth-module (https://github.com/kvspb/nginx-auth-ldap, BSD-2) +HTTP_LDAP_MODULE_PV="8517bb05ecc896b54429ca5e95137b0a386bd41a" +HTTP_LDAP_MODULE_P="nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" +HTTP_LDAP_MODULE_URI="https://github.com/kvspb/nginx-auth-ldap/archive/${HTTP_LDAP_MODULE_PV}.tar.gz" +HTTP_LDAP_MODULE_WD="${WORKDIR}/nginx-auth-ldap-${HTTP_LDAP_MODULE_PV}" + +HTTP_XSLTPROC_MODULE_PV="0.16" +HTTP_XSLTPROC_MODULE_P="ngx_xsltproc-${HTTP_XSLTPROC_MODULE_PV}" +HTTP_XSLTPROC_MODULE_URI="https://github.com/yoreek/nginx-xsltproc-module/archive/v${HTTP_XSLTPROC_MODULE_PV}.tar.gz" +HTTP_XSLTPROC_MODULE_WD="${WORKDIR}/nginx-xsltproc-module-${HTTP_XSLTPROC_MODULE_PV}" + +# We handle deps below ourselves +SSL_DEPS_SKIP=1 + +inherit ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib + +DESCRIPTION="Robust, small and high performance http and reverse proxy server" +HOMEPAGE="http://nginx.org" +SRC_URI="http://nginx.org/download/${P}.tar.gz + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz ) + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) + nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz ) + nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz ) + nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz ) + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) + nginx_modules_http_xsltproc? ( ${HTTP_XSLTPROC_MODULE_URI} -> ${HTTP_XSLTPROC_MODULE_P}.tar.gz )" + +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+ + nginx_modules_http_security? ( Apache-2.0 ) + nginx_modules_http_push_stream? ( GPL-3 )" + +SLOT="mainline" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux" + +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif + fastcgi geo gzip limit_req limit_conn map memcached proxy referer + rewrite scgi ssi split_clients upstream_ip_hash userid uwsgi" +NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip + gzip_static image_filter mp4 perl random_index realip secure_link + slice stub_status sub" +NGINX_MODULES_STREAM="access limit_conn upstream" +NGINX_MODULES_MAIL="imap pop3 smtp" +NGINX_MODULES_3RD=" + http_upload_progress + http_headers_more + http_cache_purge + http_slowfs_cache + http_fancyindex + http_lua + http_auth_pam + http_upstream_check + http_metrics + http_naxsi + http_dav_ext + http_echo + http_security + http_push_stream + http_sticky + http_ajp + http_mogilefs + http_memc + http_auth_ldap + http_xsltproc" + +IUSE="aio debug +http +http2 +http-cache ipv6 libatomic libressl luajit +pcre + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax +nginx_modules_http_xsltproc xsltproc-memcached" + +for mod in $NGINX_MODULES_STD; do + IUSE="${IUSE} +nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_OPT; do + IUSE="${IUSE} nginx_modules_http_${mod}" +done + +for mod in $NGINX_MODULES_STREAM; do + IUSE="${IUSE} nginx_modules_stream_${mod}" +done + +for mod in $NGINX_MODULES_MAIL; do + IUSE="${IUSE} nginx_modules_mail_${mod}" +done + +for mod in $NGINX_MODULES_3RD; do + IUSE="${IUSE} nginx_modules_${mod}" +done + +# Add so we can warn users updating about config changes +# @TODO: jbergstroem: remove on next release series +IUSE="${IUSE} nginx_modules_http_spdy" + +CDEPEND=" + pcre? ( >=dev-libs/libpcre-4.2 ) + pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) + ssl? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + http2? ( + !libressl? ( >=dev-libs/openssl-1.0.1c:0= ) + libressl? ( dev-libs/libressl:= ) + ) + http-cache? ( + userland_GNU? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + ) + nginx_modules_http_geoip? ( dev-libs/geoip ) + nginx_modules_http_gunzip? ( sys-libs/zlib ) + nginx_modules_http_gzip? ( sys-libs/zlib ) + nginx_modules_http_gzip_static? ( sys-libs/zlib ) + nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] ) + nginx_modules_http_perl? ( >=dev-lang/perl-5.8 ) + nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 ) + nginx_modules_http_secure_link? ( + userland_GNU? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + ) + nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) ) + nginx_modules_http_auth_pam? ( virtual/pam ) + nginx_modules_http_metrics? ( dev-libs/yajl ) + nginx_modules_http_dav_ext? ( dev-libs/expat ) + nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache ) + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) + nginx_modules_http_xsltproc? ( dev-libs/libxml2 dev-libs/libxslt dev-libs/icu ) + xsltproc-memcached? ( dev-libs/libmemcached )" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-nginx ) + !www-servers/nginx:0" +DEPEND="${CDEPEND} + arm? ( dev-libs/libatomic_ops ) + libatomic? ( dev-libs/libatomic_ops )" +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" + +REQUIRED_USE="pcre-jit? ( pcre ) + nginx_modules_http_lua? ( nginx_modules_http_rewrite ) + nginx_modules_http_naxsi? ( pcre ) + nginx_modules_http_dav_ext? ( nginx_modules_http_dav ) + nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) + nginx_modules_http_security? ( pcre ) + nginx_modules_http_push_stream? ( ssl ) + xsltproc-memcached? ( nginx_modules_http_xsltproc )" + +pkg_setup() { + NGINX_HOME="/var/lib/nginx" + NGINX_HOME_TMP="${NGINX_HOME}/tmp" + + ebegin "Creating nginx user and group" + enewgroup ${PN} + enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN} + eend $? + + if use libatomic; then + ewarn "GCC 4.1+ features built-in atomic operations." + ewarn "Using libatomic_ops is only needed if using" + ewarn "a different compiler or a GCC prior to 4.1" + fi + + if [[ -n $NGINX_ADD_MODULES ]]; then + ewarn "You are building custom modules via \$NGINX_ADD_MODULES!" + ewarn "This nginx installation is not supported!" + ewarn "Make sure you can reproduce the bug without those modules" + ewarn "_before_ reporting bugs." + fi + + if use !http; then + ewarn "To actually disable all http-functionality you also have to disable" + ewarn "all nginx http modules." + fi + + if use nginx_modules_http_ajp; then + eerror "The AJP module currently doesn't build for nginx >1.8." + eerror "It will be reintroduced with the 1.9 series when proven stable." + eerror "Either disable it or stick with nginx 1.7.x." + die "AJP module not supported" + fi + + if use nginx_modules_http_mogilefs && use threads; then + eerror "mogilefs won't compile with threads support." + eerror "Please disable either flag and try again." + die "Can't compile mogilefs with threads support" + fi +} + +src_prepare() { + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" + + if use nginx_modules_http_upstream_check; then + eapply -p0 "${FILESDIR}/check-1.9.2".patch + fi + + if use nginx_modules_http_lua; then + sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die + fi + + find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die + # We have config protection, don't rename etc files + sed -i 's:.default::' auto/install || die + # remove useless files + sed -i -e '/koi-/d' -e '/win-/d' auto/install || die + + # don't install to /etc/nginx/ if not in use + local module + for module in fastcgi scgi uwsgi ; do + if ! use nginx_modules_http_${module}; then + sed -i -e "/${module}/d" auto/install || die + fi + done + + if use xsltproc-memcached; then + sed -i -e 's/LIBMEMCACHED_ENABLED=no/LIBMEMCACHED_ENABLED=yes/' "${HTTP_XSLTPROC_MODULE_WD}/config" || die + fi + + eapply_user +} + +src_configure() { + # mod_security needs to generate nginx/modsecurity/config before including it + if use nginx_modules_http_security; then + cd "${HTTP_SECURITY_MODULE_WD}" + if use luajit ; then + sed -i \ + -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \ + configure || die + fi + ./configure \ + --enable-standalone-module \ + $(use_enable pcre-jit) \ + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" + fi + + cd "${S}" + + local myconf=() http_enabled= mail_enabled= stream_enabled= + + use aio && myconf+=( --with-file-aio ) + use debug && myconf+=( --with-debug ) + use http2 && myconf+=( --with-http_v2_module ) + use ipv6 && myconf+=( --with-ipv6 ) + use libatomic && myconf+=( --with-libatomic ) + use pcre && myconf+=( --with-pcre ) + use pcre-jit && myconf+=( --with-pcre-jit ) + use threads && myconf+=( --with-threads ) + + # HTTP modules + for mod in $NGINX_MODULES_STD; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + else + myconf+=( --without-http_${mod}_module ) + fi + done + + for mod in $NGINX_MODULES_OPT; do + if use nginx_modules_http_${mod}; then + http_enabled=1 + myconf+=( --with-http_${mod}_module ) + fi + done + + if use nginx_modules_http_fastcgi; then + myconf+=( --with-http_realip_module ) + fi + + # third-party modules + if use nginx_modules_http_upload_progress; then + http_enabled=1 + myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} ) + fi + + if use nginx_modules_http_headers_more; then + http_enabled=1 + myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} ) + fi + + if use nginx_modules_http_cache_purge; then + http_enabled=1 + myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} ) + fi + + if use nginx_modules_http_slowfs_cache; then + http_enabled=1 + myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} ) + fi + + if use nginx_modules_http_fancyindex; then + http_enabled=1 + myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} ) + fi + + if use nginx_modules_http_lua; then + http_enabled=1 + if use luajit; then + export LUAJIT_LIB=$(pkg-config --variable libdir luajit) + export LUAJIT_INC=$(pkg-config --variable includedir luajit) + else + export LUA_LIB=$(pkg-config --variable libdir lua) + export LUA_INC=$(pkg-config --variable includedir lua) + fi + myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} ) + myconf+=( --add-module=${HTTP_LUA_MODULE_WD} ) + fi + + if use nginx_modules_http_auth_pam; then + http_enabled=1 + myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} ) + fi + + if use nginx_modules_http_upstream_check; then + http_enabled=1 + myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} ) + fi + + if use nginx_modules_http_metrics; then + http_enabled=1 + myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} ) + fi + + if use nginx_modules_http_naxsi ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} ) + fi + + if use rtmp ; then + http_enabled=1 + myconf+=( --add-module=${RTMP_MODULE_WD} ) + fi + + if use nginx_modules_http_dav_ext ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} ) + fi + + if use nginx_modules_http_echo ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} ) + fi + + if use nginx_modules_http_security ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity ) + fi + + if use nginx_modules_http_push_stream ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} ) + fi + + if use nginx_modules_http_sticky ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} ) + fi + + if use nginx_modules_http_mogilefs ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} ) + fi + + if use nginx_modules_http_memc ; then + http_enabled=1 + myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} ) + fi + + if use nginx_modules_http_auth_ldap; then + http_enabled=1 + myconf+=( --add-module=${HTTP_LDAP_MODULE_WD} ) + fi + + if use nginx_modules_http_xsltproc; then + http_enabled=1 + myconf+=( --add-module=${HTTP_XSLTPROC_MODULE_WD} ) + fi + + if use http || use http-cache || use http2; then + http_enabled=1 + fi + + if [ $http_enabled ]; then + use http-cache || myconf+=( --without-http-cache ) + use ssl && myconf+=( --with-http_ssl_module ) + else + myconf+=( --without-http --without-http-cache ) + fi + + # Stream modules + for mod in $NGINX_MODULES_STREAM; do + if use nginx_modules_stream_${mod}; then + stream_enabled=1 + else + # Treat stream upstream slightly differently + if ! use nginx_modules_stream_upstream; then + myconf+=( --without-stream_upstream_hash_module ) + myconf+=( --without-stream_upstream_least_conn_module ) + myconf+=( --without-stream_upstream_zone_module ) + else + myconf+=( --without-stream_${stream}_module ) + fi + fi + done + + if [ $stream_enabled ]; then + myconf+=( --with-stream ) + use ssl && myconf+=( --with-stream_ssl_module ) + fi + + # MAIL modules + for mod in $NGINX_MODULES_MAIL; do + if use nginx_modules_mail_${mod}; then + mail_enabled=1 + else + myconf+=( --without-mail_${mod}_module ) + fi + done + + if [ $mail_enabled ]; then + myconf+=( --with-mail ) + use ssl && myconf+=( --with-mail_ssl_module ) + fi + + # custom modules + for mod in $NGINX_ADD_MODULES; do + myconf+=( --add-module=${mod} ) + done + + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + tc-export CC + + if ! use prefix; then + myconf+=( --user=${PN}" "--group=${PN} ) + fi + + ./configure \ + --prefix="${EPREFIX}"/usr \ + --conf-path="${EPREFIX}"/etc/${PN}/${PN}.conf \ + --error-log-path="${EPREFIX}"/var/log/${PN}/error_log \ + --pid-path="${EPREFIX}"/run/${PN}.pid \ + --lock-path="${EPREFIX}"/run/lock/${PN}.lock \ + --with-cc-opt="-I${EROOT}usr/include" \ + --with-ld-opt="-L${EROOT}usr/$(get_libdir)" \ + --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \ + --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \ + --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \ + --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \ + --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \ + --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \ + "${myconf[@]}" || die "configure failed" + + # A purely cosmetic change that makes nginx -V more readable. This can be + # good if people outside the gentoo community would troubleshoot and + # question the users setup. + sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die +} + +src_compile() { + use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}" + + # https://bugs.gentoo.org/286772 + export LANG=C LC_ALL=C + emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}" +} + +src_install() { + emake DESTDIR="${D%/}" install + + cp "${FILESDIR}"/nginx.conf-r2 "${ED}"etc/nginx/nginx.conf || die + + newinitd "${FILESDIR}"/nginx.initd-r2 nginx + + systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service + + doman man/nginx.8 + dodoc CHANGES* README + + # just keepdir. do not copy the default htdocs files (bug #449136) + keepdir /var/www/localhost + rm -rf "${D}"usr/html || die + + # set up a list of directories to keep + local keepdir_list="${NGINX_HOME_TMP}"/client + local module + for module in proxy fastcgi scgi uwsgi; do + use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}" + done + + keepdir /var/log/nginx ${keepdir_list} + + # this solves a problem with SELinux where nginx doesn't see the directories + # as root and tries to create them as nginx + fperms 0750 "${NGINX_HOME_TMP}" + fowners ${PN}:0 "${NGINX_HOME_TMP}" + + fperms 0700 /var/log/nginx ${keepdir_list} + fowners ${PN}:${PN} /var/log/nginx ${keepdir_list} + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate-r1 nginx + + if use nginx_modules_http_perl; then + cd "${S}"/objs/src/http/modules/perl/ + emake DESTDIR="${D}" INSTALLDIRS=vendor + perl_delete_localpod + fi + + if use nginx_modules_http_cache_purge; then + docinto ${HTTP_CACHE_PURGE_MODULE_P} + dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md} + fi + + if use nginx_modules_http_slowfs_cache; then + docinto ${HTTP_SLOWFS_CACHE_MODULE_P} + dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md} + fi + + if use nginx_modules_http_fancyindex; then + docinto ${HTTP_FANCYINDEX_MODULE_P} + dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst + fi + + if use nginx_modules_http_lua; then + docinto ${HTTP_LUA_MODULE_P} + dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown} + fi + + if use nginx_modules_http_auth_pam; then + docinto ${HTTP_AUTH_PAM_MODULE_P} + dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog} + fi + + if use nginx_modules_http_upstream_check; then + docinto ${HTTP_UPSTREAM_CHECK_MODULE_P} + dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES} + fi + + if use nginx_modules_http_naxsi; then + insinto /etc/nginx + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules + fi + + if use rtmp; then + docinto ${RTMP_MODULE_P} + dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl} + fi + + if use nginx_modules_http_dav_ext; then + docinto ${HTTP_DAV_EXT_MODULE_P} + dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README + fi + + if use nginx_modules_http_echo; then + docinto ${HTTP_ECHO_MODULE_P} + dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki} + fi + + if use nginx_modules_http_security; then + docinto ${HTTP_SECURITY_MODULE_P} + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt} + fi + + if use nginx_modules_http_push_stream; then + docinto ${HTTP_PUSH_STREAM_MODULE_P} + dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile} + fi + + if use nginx_modules_http_sticky; then + docinto ${HTTP_STICKY_MODULE_P} + dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf} + fi + + if use nginx_modules_http_memc; then + docinto ${HTTP_MEMC_MODULE_P} + dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown + fi + + if use nginx_modules_http_auth_ldap; then + docinto ${HTTP_LDAP_MODULE_P} + dodoc "${HTTP_LDAP_MODULE_WD}"/example.conf + fi +} + +pkg_postinst() { + if use ssl; then + if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then + install_cert /etc/ssl/${PN}/${PN} + use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem} + fi + fi + + if use nginx_modules_http_spdy; then + ewarn "In nginx 1.9.5 the spdy module was superseded by http2." + ewarn "Update your configs and package.use accordingly." + fi + + if use nginx_modules_http_lua && use http2; then + ewarn "Lua 3rd party module author warns against using ${P} with" + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see http://git.io/OldLsg" + fi + + # This is the proper fix for bug #458726/#469094, resp. CVE-2013-0337 for + # existing installations + local fix_perms=0 + + for rv in ${REPLACING_VERSIONS} ; do + version_compare ${rv} 1.4.1-r2 + [[ $? -eq 1 ]] && fix_perms=1 + done + + if [[ $fix_perms -eq 1 ]] ; then + ewarn "To fix a security bug (CVE-2013-0337, bug #458726) had the following" + ewarn "directories the world-readable bit removed (if set):" + ewarn " ${EPREFIX}/var/log/nginx" + ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" + ewarn "Check if this is correct for your setup before restarting nginx!" + ewarn "This is a one-time change and will not happen on subsequent updates." + ewarn "Furthermore nginx' temp directories got moved to ${NGINX_HOME_TMP}" + chmod -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + fi + + # If the nginx user can't change into or read the dir, display a warning. + # If su is not available we display the warning nevertheless since we can't check properly + su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null + if [ $? -ne 0 ] ; then + ewarn "Please make sure that the nginx user or group has at least" + ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)" + ewarn "Otherwise you end up with empty log files after a logrotate." + fi +} -- cgit v1.2.3-65-gdbad