From 7218e1b46bceac05841e90472501742d905fb3fc Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 12 Mar 2021 21:55:15 +0000 Subject: gentoo resync : 12.03.2021 --- www-servers/Manifest.gz | Bin 5044 -> 5043 bytes www-servers/adsf/Manifest | 2 + www-servers/adsf/adsf-1.4.5.ebuild | 40 + www-servers/lighttpd/Manifest | 2 +- www-servers/lighttpd/lighttpd-1.4.55-r100.ebuild | 4 +- www-servers/nginx/Manifest | 3 + www-servers/nginx/nginx-1.19.8.ebuild | 1090 ++++++++++++++++++++ www-servers/puma/Manifest | 1 - .../puma/files/puma-4.3.4-cve-2020-11077.patch | 115 --- www-servers/tomcat/Manifest | 4 + www-servers/tomcat/tomcat-8.5.64.ebuild | 159 +++ www-servers/tomcat/tomcat-9.0.44.ebuild | 187 ++++ 12 files changed, 1488 insertions(+), 119 deletions(-) create mode 100644 www-servers/adsf/adsf-1.4.5.ebuild create mode 100644 www-servers/nginx/nginx-1.19.8.ebuild delete mode 100644 www-servers/puma/files/puma-4.3.4-cve-2020-11077.patch create mode 100644 www-servers/tomcat/tomcat-8.5.64.ebuild create mode 100644 www-servers/tomcat/tomcat-9.0.44.ebuild (limited to 'www-servers') diff --git a/www-servers/Manifest.gz b/www-servers/Manifest.gz index 2764631945b8..0b2ee05bb623 100644 Binary files a/www-servers/Manifest.gz and b/www-servers/Manifest.gz differ diff --git a/www-servers/adsf/Manifest b/www-servers/adsf/Manifest index 190cd493f94b..cd9bd78df03c 100644 --- a/www-servers/adsf/Manifest +++ b/www-servers/adsf/Manifest @@ -1,3 +1,5 @@ DIST adsf-1.4.3.tar.gz 171000 BLAKE2B 7e3a524957edfd56382c788e2c551ec693dcbcac2bb807417ac63e1dffba9a8033cb058ad7bed425b7d0448ae98dc14ca53f935c83d1c699ad4f38a8700e402b SHA512 f9b30844bb1d48f139b8f8fe1a65ca404a2a9c3e98b24729bcbb08d083f1f332ecc6e2fc3ca139d1cb69bd7c49a629eaeddfbc6f5f16e4f223cda63f726e1dfc +DIST adsf-1.4.5.tar.gz 171986 BLAKE2B c8d2b732d5930b3ab2da9b016f1b1962c07fad85e740532f3e68102dc6f34c7033b6a4ad2beca88410fda03426d3eca12a85996c695f4a2208f4d5a62855f4c8 SHA512 eeca0b837999f66aaea7787b759c635a2eb6b7d19f6dfa92416fcce5bfe499e6b0c8f8c2515750801af90b7e4af9d5bacc257f0b303d4367134c5f4730a87484 EBUILD adsf-1.4.3.ebuild 1092 BLAKE2B e28630172fd9b75c701ab328c7af735ade44da3065438fbfe6002af70295f0a3b7b068e4e500a687322dfb9278510f20b5ce174a5c1e76ce900499d18860fe21 SHA512 d800172b2ae21a70c1f0577d3a8a1f06b42db5bef619b110df007a07cc63024afb265069b0360eae1d412a9e1b44f316cc80db1964a5908e91e576aa4d2d8a4a +EBUILD adsf-1.4.5.ebuild 1181 BLAKE2B 30fbb5eb7827ee81f9f7c48c062a82d87277cba3567913950c2efdde679bb52e6dbe6aaec982a913f481ba568139fcba70e43610aade9dcc2ffd4d5e3adb6f39 SHA512 a1837552c27d08cbe422a0d94446f3e67302f279dff03f27303d5387bcf2595c173d1fcbd1e89b55b387c1325dfa439d86d25a314e2f59839de922b7b24a97c9 MISC metadata.xml 295 BLAKE2B 300607324d7aca3f9af7cf195244b3426a78be1ab6875fc10e645d50e8aad1e4fc6abbaa555cd94248db86afc83bfdd5d58fa78cbf74d0c56b1cfa303dc87b75 SHA512 640f33b2433c2259e00d0fa1daca377084010d7fc28da599ea0d3d4264567691bd4d0ad3033f1c1d852d1cdcf179b88c1e22c75e5955e344c9dfca1e82a79e9c diff --git a/www-servers/adsf/adsf-1.4.5.ebuild b/www-servers/adsf/adsf-1.4.5.ebuild new file mode 100644 index 000000000000..70f2b793b1d1 --- /dev/null +++ b/www-servers/adsf/adsf-1.4.5.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +USE_RUBY="ruby25 ruby26 ruby27" + +RUBY_FAKEGEM_EXTRADOC="NEWS.md ../README.md" + +RUBY_FAKEGEM_RECIPE_DOC="none" + +RUBY_FAKEGEM_GEMSPEC="adsf.gemspec" + +inherit ruby-fakegem + +DESCRIPTION="A Dead Simple Fileserver is a static file server that can launch in a directory" +HOMEPAGE="https://github.com/ddfreyne/adsf/" +SRC_URI="https://github.com/ddfreyne/adsf/archive/${PV}.tar.gz -> ${P}.tar.gz" +RUBY_S="${P}/adsf" +LICENSE="MIT" + +KEYWORDS="~amd64" +SLOT="0" +IUSE="" + +ruby_add_rdepend ">=dev-ruby/rack-1.0.0:*" + +ruby_add_bdepend "test? ( dev-ruby/rack-test )" + +all_ruby_prepare() { + sed -i -e '/simplecov/,/SimpleCov.command_name/ s:^:#:' \ + -e '/websocket/ s:^:#:' test/helper.rb || die + sed -e '/test_receives_update/,/^ end/ s:^:#:' \ + -e '/test_non_local_interfaces/askip "networking"' \ + -e '/test_default_config__serve_index_html_in_subdir_missing_slash/askip "encoding"' \ + -i test/test_server.rb || die + sed -i -e '/rubocop/I s:^:#:' Rakefile || die + rm -f test/test_version.rb || die + + sed -i -e "s:require_relative ':require './:" ${RUBY_FAKEGEM_GEMSPEC} || die +} diff --git a/www-servers/lighttpd/Manifest b/www-servers/lighttpd/Manifest index 23dd31191181..0915d9a99b09 100644 --- a/www-servers/lighttpd/Manifest +++ b/www-servers/lighttpd/Manifest @@ -9,6 +9,6 @@ AUX lighttpd.service 257 BLAKE2B 7e60ad2f87ece8547cd3e39fc2121ea4664d9015722469a AUX lighttpd.tmpfiles.conf 41 BLAKE2B a159ae17094377d927bcf51078d40c322e5213d62064a271a7a0cf5b32423b349ac13d2ebc38a8de5c6478823ac022e46eef60a830e6ae9598e848b8c220bc2f SHA512 3fda360423a7a406a2981de647dac6b4419fe60c649bf3cc21fad566e8513293f6e81d4f5b777eaf06a056beedbf44360a39894ca3a2d05d3fc3a2d26c339efe DIST lighttpd-1.4.55.tar.xz 765660 BLAKE2B 7b972de86e7d1a51438718e4d5bd49188c107b0f2e656ead597085ae84f3d41cdb662a7774c6655155d390c26f3e4f0b0dc4243c85cb0255a91d8ca57742f402 SHA512 023d5a54079e710a89a59e259c0b5798103ef6fce4544c36110dc4c5281ef429ef99369923d74123fcf8be37afe622d44cd7149078d21971ff26f3f4ee37c439 DIST lighttpd-1.4.58.tar.xz 956828 BLAKE2B b8b0a111db64a8af429dd9922503991e55276808b58143ffce3268bc8b20a39cfec9d8c1e2917b34326ac5502801a6ca3b9bae26874f86b6749c363a09225ca3 SHA512 b7f18223e46bf78f866eb22f44a7702df07424271e085da9f0d03e626198c30e87a3959536d02e3588aa47ba4bc7db7c432307175fb3b25a2984f9cf692c0ca4 -EBUILD lighttpd-1.4.55-r100.ebuild 6978 BLAKE2B 9874063095036a6d9acf9d67a7e530a7e48d1a3068cfb905fdc150212016fb373f3d623fcf992c955881fbd3391247de8847b7a9f279f8cc89713630c8529ee1 SHA512 5e6ce1b10c2304f7c09993f8b93ae256e86dae99d1ede5c6e22cefa8aaefd9127c142a212180dc4b12db7bef1b9d981bb85327828f5094118f1382ba975a062c +EBUILD lighttpd-1.4.55-r100.ebuild 6978 BLAKE2B 349d99b2b1422cfb962124b02013b2af9f151442bc1da262e24c83855c4aa028d9701731a37be2fd9f66b4f45cfd226abfd34ad470b3d856c3e264a353a46550 SHA512 3cdbf07a0b2ca79283dd35db0b14029fc99b44ffaa9967412fb5c0021a5bcb2f77d653084961386553ba82bec1df5b680bb6b372d6ad556d067a4c376c642cd2 EBUILD lighttpd-1.4.58.ebuild 7531 BLAKE2B 6e3a0fb9e4a7ce2dc1a8e6665d278cb20840f0826dcd0ff44b05fa3858b5462b640b290093f5650a5b3fbfd4e461464e593a448f13d7835a56297428a3283d87 SHA512 6e4c7986dd9fdd863e2f11377ef8869c18a2807431bcd2f71ff42839732bd664524249920d68c35958c324738344ec47daa28154f1de5627b3d92db914477682 MISC metadata.xml 1688 BLAKE2B f6042bc167676e39c31d0e6dff0b6d502de63df9ae457e2665482a386d1ecc16033483496558bf3b814c128a2b79452e1d1376dc41a716c07b34436ce45f1412 SHA512 9d68b66e9ce74f262cabf0f6b02d9da4130292b0e0e701dea991b66771a84e5da4d07705e5bf5a2546026f5452ad7991c3f4e04d698a11c4a0fc473c388562cb diff --git a/www-servers/lighttpd/lighttpd-1.4.55-r100.ebuild b/www-servers/lighttpd/lighttpd-1.4.55-r100.ebuild index fb2eb51853fa..ccd168dd6046 100644 --- a/www-servers/lighttpd/lighttpd-1.4.55-r100.ebuild +++ b/www-servers/lighttpd/lighttpd-1.4.55-r100.ebuild @@ -5,7 +5,7 @@ EAPI=7 LUA_COMPAT=( lua5-{1..3} ) -inherit autotools flag-o-matic lua-single readme.gentoo-r1 systemd toolchain-funcs +inherit autotools flag-o-matic lua-single readme.gentoo-r1 systemd toolchain-funcs tmpfiles DESCRIPTION="Lightweight high-performance web server" HOMEPAGE="https://www.lighttpd.net https://github.com/lighttpd" @@ -225,7 +225,7 @@ src_install() { use minimal && remove_non_essential systemd_dounit "${FILESDIR}/${PN}.service" - systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf" + dotmpfiles "${FILESDIR}/${PN}.tmpfiles.conf" } pkg_postinst() { diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest index 17cae117af93..e7f224889f70 100644 --- a/www-servers/nginx/Manifest +++ b/www-servers/nginx/Manifest @@ -17,6 +17,7 @@ DIST nginx-1.19.4.tar.gz 1054974 BLAKE2B 7f6cff700fe4816d724abef427775525956f1be DIST nginx-1.19.5.tar.gz 1055590 BLAKE2B dc838848829553205886f1d538009ecccfd4b0d45bae3268e40eaad6ff1cfd4c4b8f4f93bfcd241e1e17d81c3276298dc047e08f1edabe0a8c941752689c1bb9 SHA512 169bdbbea82127b83c51e818df3dc9056070f0cc56d10257aa7fa7bd6aedc7b70fdfe236ac06bd6442ff4990b36132b054d2654de51a9fe86a19e7cb63edf05c DIST nginx-1.19.6.tar.gz 1055982 BLAKE2B 6d818122b3bdf46b6c9ecb83a00d470b3db0f26f05140340c033d1d0851d679d077ce1853f8d0a1c0140bfdac2764e5702913e87149dccefda2c6f7bf8ac8845 SHA512 1249c56b124a8de71f5d722e53d599f3b0cb14dc0f95b1eb905a6a8019b2d33f8e76874de2a88d49c4c82ee4fa7aabd42e5044a0a110892c23b50f71cb632148 DIST nginx-1.19.7.tar.gz 1056631 BLAKE2B f7a62a2b7c1a8c91a01e54954323cddc7a948ab5b65f51594549b8b67e50ea954c4cd5b740f538472c6de7c4041b39b22a48beac37083900e6f0a015408316bc SHA512 660f03533581f350bbfe9a519fd0ee59c543c78be98aa5287df20a89653545b29fc98282548eab1741fb1d5c26da140166b6712ee06e498ba518019588f9b747 +DIST nginx-1.19.8.tar.gz 1060155 BLAKE2B c540cfb86886ad60beefcaffa7c9ad4f79807bdff3fed9f6c2f23d38d46aaba4f0489ada289f14881f206de290a37b58934254e9690a707ac639204602530218 SHA512 da548dc459f7a921e2f6ea54f543496244e820acbdf3effc4db331717f69b710181fbfdac3be101cd7d1c39e3ca37a94f9a9c4017f11da843ed85a34acf26bc2 DIST nginx-auth-ldap-42d195d7a7575ebab1c369ad3fc5d78dc2c2669c.tar.gz 18457 BLAKE2B 22225ca9e5299b20ab5a93a001cac48e446bd86b3a24ac49e716bc975b128890bdb4b0dbbf5730fbaaeadfd958160093c7a6af798dd0e6de27062f149a760333 SHA512 ec59637fda5acac053e815cb1d04b545fc6b765e5ec63d8c2c9c301abad87afaa2698145acac08e9e14c91e1423ebff7aff0cca2b940b19ccccbf4cf53973269 DIST nginx_http_sticky_module_ng-1.2.6-10-g08a395c66e42.tar.bz2 124047 BLAKE2B d37ef9a15c91abe3c6258e420d1f99fa452f9d9966a0e13102174973314a3bac5413957a5fe632a9dcb1163b3be5df8116e05cc053ee061e19319ec25f341570 SHA512 6c1bfdcf89884b2855d51ae7da0f6e53a4ca3629e1aaf58433b70c07dcb2af797ba6e87d9b3eb4fe2fb6d4d697e862f2b4c2f8d8b3fdaea201740c97ec936529 DIST ngx_brotli-1.0.0rc.tar.gz 16207 BLAKE2B 450d0ea693bd98d4a1b615f2cdcaad41ccd28266f6d80beec7fe77fe750ab8c5d1bb55aabe15161b9b6d819d2b4d99a7774f2706f2f6fd084b52a7c7dddbc00c SHA512 05a880d5e48ac83be84498ed41fb4750211b827a9d7541acfd6ef494e5205a6e853d5594bfec3ab4ae668ea3f803e4f4b0ba550c76811971c8e266e42663c56d @@ -44,6 +45,7 @@ DIST njs-0.4.3.tar.gz 460997 BLAKE2B 373a4aca51ada84d628ae6b6254c9268b4cec4ac887 DIST njs-0.4.4.tar.gz 486870 BLAKE2B 9390bfe35249ea34b9edd4b7c2360a25c9ecb232e10f35a2324fd8586f5f74e2083d5bd7481c084065d0651ba4fed56958bc2cd1f002d12622238ebc81b9f7c5 SHA512 1bf88d23f99532bb32e96de79e49cc27b60d6231207eb06ea2f6a6884d725f7bbe7b426664aa4c872f7c40549f81489c04c2ae4a7ddd2d03c8cf1d66b9c62c78 DIST njs-0.5.0.tar.gz 505568 BLAKE2B 5dc2a91bffa4eb2364d96e26def0959b111cc8bf88841f581e3c0d43fcb88ba1ea24b24339cb1f51b8290c08dd930dc18a274a7ab6a21ee4ba8b0e6c4f5a1ba0 SHA512 182a64ba519b1a1d29ac71ffe2c9ef8e5a6f9aaf3db9f327ac926114db73b339a424801b558068fc7ae06ae88a4dea0a601c749db4b6f2b579e427181e41d11b DIST njs-0.5.1.tar.gz 516345 BLAKE2B b861ff1e62eddeb8aabf6908253dba1393a32a04636a082dee979a52d320a7ecb12f961213652886a210ee9569460a3214d823cb5f7c3b025378b7cf6d64659f SHA512 bbc06e57a152a5dc5c71305a4bec80d6d3d6f886a82d6c39d82aa8f52add56029b7f38199f11789648539bcbba2a488dc6e64874fef0222479775708559f4da9 +DIST njs-0.5.2.tar.gz 519331 BLAKE2B d2315ce563650a3985c1e40e3fcf17cdd69de5379f4213674db39bb2c7fb3f62df710e3bfccc0391e4bba2c19362f69d6574b4691e858c60af398c1131e3b79a SHA512 47ac82edd63059a38753371deafb5efe8e1c71f2533f1bf78e8ed56d6e7bfea801cb4a1213597bd73fc3e51263b394750efa29c5f1f3581c62f99c935fdfec99 EBUILD nginx-1.18.0-r2.ebuild 40458 BLAKE2B bab6ebfd5a4ef14026cf3149757dcf207dad0245b48a31bcb93a61709bb6a9a656ebb0d8ebcc0f502daab9b7b9a0a7a4dc5d00cb2ececc4606f508d87e8e23f2 SHA512 54651ac56efa4ed927189dbbc2165af8d916097c0e623fcd7427096be4605d093772913511372dd5040ff2c7c9d305d0686ccf713205eff3c3cf41e3fa12a241 EBUILD nginx-1.19.2-r1.ebuild 40460 BLAKE2B 620254271c03d328f5377c23307af52838a8f2eaa8e60a91eed785fdf2c02c8cf3ae349e2b7b04a29024ee14247c001253e234c1551ac2fcb665ab98ca1674a8 SHA512 0a9c9d53cf47520c5f2f04a72b6f64d5399571ce371b31a09d1d81f160ffa88e461b6e335d0ea05428d62612e014f682bfeefeb25d6b05eaf1690c31f822e134 EBUILD nginx-1.19.3.ebuild 40431 BLAKE2B f78ec32446bf5017b58fda56370b72d1b2fc7176f2b4fcec70e4b22a00b124b96eb4d2d28182ecbf13ccd1c6ce43ee7324b36608ae13fdc1fd6d3ca947e0b52b SHA512 6445a587721d55fd09505970db538cbd2cdb9d72820526869a2d910a049b479f01ea968434eb7f2f1c4889f03fcf6921025530a686693a380f381017e40b34fb @@ -53,4 +55,5 @@ EBUILD nginx-1.19.5.ebuild 40431 BLAKE2B f78ec32446bf5017b58fda56370b72d1b2fc717 EBUILD nginx-1.19.6-r100.ebuild 40436 BLAKE2B 643795722ca90b1d70f6a0a4917c9166f06802ae13a8a93b10e1a4e3b7eb4410091aba0980365b4d82a8117e625b5fe9c4468e7806769c7717284abaf67ea68c SHA512 9317b221e52c5097062f413c01be6dc3661a55215acba1933601cb0df002abf642413074752a052bf2740110bd754a8f62aae90468e4b7bc0e7ec4409026ffab EBUILD nginx-1.19.6.ebuild 40431 BLAKE2B cf9bfea11e1845eb2c810c474dde72f275166bb55c48cb9658f71a512ede464b953dcc3f3fd9b0e0763190d856a4aa0585414f0bcf91cc5e29dde9e259dab9c7 SHA512 d92bacc4b3d5e97e7b85485507f8483f9f5166b43c4ed95c3e04a50b77aeaf10ce2a4609cf1d25357a88bb4516e5f05b020f37d666a81e1976a689e34ab8e794 EBUILD nginx-1.19.7.ebuild 40436 BLAKE2B 9c8e3bcf2329c8a8ec88cbd1e3c2a801212195f4b004f23530da65c5893f94e7ec7cdc6e8713ffd4a84061d6b1a98e503c27b521595c2df629c72b4a35ea1acb SHA512 a2b8915f3e8359d21853152494ac033b9ec96c0d675a751f2f9906a71bcd550fea6f725633311b1cfe2262b2dce9bd523f0e59aa6f7f2daff4d14d1be0893c89 +EBUILD nginx-1.19.8.ebuild 40436 BLAKE2B 8d7c0d16ce37a2e0b69a963cbc074ff9583e2ac80fce6ce612e1d10e0c48f03933ed4600084d8d13524340247697e3c724024ce79d6c0ddf0775717d62c5e009 SHA512 2cec93a5f7a075fa3de7fdf3be679a86290a1e52d99eaa34845d1944ef2bab7dcd94b87ee741c56386d27ce58957b75a102b9e94fbdfa123fceb892996636dbb MISC metadata.xml 1193 BLAKE2B aeb293cf75ed650c946910222d6396f726dc5ed49f1213e6a5664613d78e3b27616399bc1c9f0a360f5303b16931da7016cdf540b24601afafc3ada4428b33a9 SHA512 a96002bc9845bc465542c753c738899b77ad7a32fac7f5f9a7049336868bc41199e926422e3dc23e47f34656c9aaea255511d2ef91e9d59f48c9cd0b4a3c4903 diff --git a/www-servers/nginx/nginx-1.19.8.ebuild b/www-servers/nginx/nginx-1.19.8.ebuild new file mode 100644 index 000000000000..ef29be90f4d7 --- /dev/null +++ b/www-servers/nginx/nginx-1.19.8.ebuild @@ -0,0 +1,1090 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# 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.3.1" +DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}" +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}" + +# ngx_brotli (https://github.com/google/ngx_brotli, BSD-2) +HTTP_BROTLI_MODULE_PV="1.0.0rc" +HTTP_BROTLI_MODULE_P="ngx_brotli-${HTTP_BROTLI_MODULE_PV}" +HTTP_BROTLI_MODULE_URI="https://github.com/google/ngx_brotli/archive/v${HTTP_BROTLI_MODULE_PV}.tar.gz" +HTTP_BROTLI_MODULE_WD="${WORKDIR}/ngx_brotli-${HTTP_BROTLI_MODULE_PV}" + +# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license) +HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.2" +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.33" +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/, https://github.com/FRiCKLE/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.4.4" +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.15" +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}" +LUA_COMPAT=( luajit ) + +# 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.2" +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="9aecf15ec379fe98f62355c57b60c0bc83296f04" +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/${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}" + +# http_vhost_traffic_status (https://github.com/vozlt/nginx-module-vts, BSD license) +HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV="46d85558e344dfe2b078ce757fd36c69a1ec2dd3" +HTTP_VHOST_TRAFFIC_STATUS_MODULE_P="ngx_http_vhost_traffic_status-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" +HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI="https://github.com/vozlt/nginx-module-vts/archive/${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}.tar.gz" +HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD="${WORKDIR}/nginx-module-vts-${HTTP_VHOST_TRAFFIC_STATUS_MODULE_PV}" + +# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+) +HTTP_NAXSI_MODULE_PV="0.56" +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.2.1" +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="3.0.0" +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/openresty/echo-nginx-module, BSD license) +HTTP_ECHO_MODULE_PV="0.62" +HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}" +HTTP_ECHO_MODULE_URI="https://github.com/openresty/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.3" +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.4" +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-10-g08a395c66e42" +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-08a395c66e42" + +# 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.19" +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="42d195d7a7575ebab1c369ad3fc5d78dc2c2669c" +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}" + +# geoip2 (https://github.com/leev/ngx_http_geoip2_module, BSD-2) +GEOIP2_MODULE_PV="3.3" +GEOIP2_MODULE_P="ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" +GEOIP2_MODULE_URI="https://github.com/leev/ngx_http_geoip2_module/archive/${GEOIP2_MODULE_PV}.tar.gz" +GEOIP2_MODULE_WD="${WORKDIR}/ngx_http_geoip2_module-${GEOIP2_MODULE_PV}" + +# njs-module (https://github.com/nginx/njs, as-is) +NJS_MODULE_PV="0.5.2" +NJS_MODULE_P="njs-${NJS_MODULE_PV}" +NJS_MODULE_URI="https://github.com/nginx/njs/archive/${NJS_MODULE_PV}.tar.gz" +NJS_MODULE_WD="${WORKDIR}/njs-${NJS_MODULE_PV}" + +# We handle deps below ourselves +SSL_DEPS_SKIP=1 +AUTOTOOLS_AUTO_DEPEND="no" + +inherit autotools lua-single ssl-cert toolchain-funcs perl-module flag-o-matic user systemd multilib pax-utils + +DESCRIPTION="Robust, small and high performance http and reverse proxy server" +HOMEPAGE="https://nginx.org" +SRC_URI="https://nginx.org/download/${P}.tar.gz + ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz + nginx_modules_http_auth_ldap? ( ${HTTP_LDAP_MODULE_URI} -> ${HTTP_LDAP_MODULE_P}.tar.gz ) + nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz ) + nginx_modules_http_brotli? ( ${HTTP_BROTLI_MODULE_URI} -> ${HTTP_BROTLI_MODULE_P}.tar.gz ) + nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_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_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz ) + nginx_modules_http_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) + nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz ) + nginx_modules_http_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) + nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz ) + nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz ) + nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz ) + nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz ) + nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz ) + nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz ) + nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz ) + nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz ) + nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 ) + nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz ) + nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz ) + nginx_modules_http_vhost_traffic_status? ( ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_URI} -> ${HTTP_VHOST_TRAFFIC_STATUS_MODULE_P}.tar.gz ) + nginx_modules_stream_geoip2? ( ${GEOIP2_MODULE_URI} -> ${GEOIP2_MODULE_P}.tar.gz ) + nginx_modules_stream_javascript? ( ${NJS_MODULE_URI} -> ${NJS_MODULE_P}.tar.gz ) + rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_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 ~ppc64 ~x86 ~amd64-linux ~x86-linux" + +# Package doesn't provide a real test suite +RESTRICT="test" + +NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif + fastcgi geo grpc gzip limit_req limit_conn map memcached mirror + proxy referer rewrite scgi ssi split_clients upstream_hash + upstream_ip_hash upstream_keepalive upstream_least_conn + upstream_zone 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 xslt" +NGINX_MODULES_STREAM_STD="access geo limit_conn map return split_clients + upstream_hash upstream_least_conn upstream_zone" +NGINX_MODULES_STREAM_OPT="geoip realip ssl_preread" +NGINX_MODULES_MAIL="imap pop3 smtp" +NGINX_MODULES_3RD=" + http_auth_ldap + http_auth_pam + http_brotli + http_cache_purge + http_dav_ext + http_echo + http_fancyindex + http_geoip2 + http_headers_more + http_javascript + http_lua + http_memc + http_metrics + http_mogilefs + http_naxsi + http_push_stream + http_security + http_slowfs_cache + http_sticky + http_upload_progress + http_upstream_check + http_vhost_traffic_status + stream_geoip2 + stream_javascript +" + +IUSE="aio debug +http +http2 +http-cache +ipv6 libatomic libressl +pcre + pcre-jit rtmp selinux ssl threads userland_GNU vim-syntax" + +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_STD; do + IUSE="${IUSE} nginx_modules_stream_${mod}" +done + +for mod in $NGINX_MODULES_STREAM_OPT; 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:= ) + pcre-jit? ( dev-libs/libpcre:=[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_brotli? ( app-arch/brotli:= ) + nginx_modules_http_geoip? ( dev-libs/geoip ) + nginx_modules_http_geoip2? ( dev-libs/libmaxminddb:= ) + 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:= ) + nginx_modules_http_secure_link? ( + userland_GNU? ( + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:= ) + ) + ) + nginx_modules_http_xslt? ( dev-libs/libxml2:= dev-libs/libxslt ) + nginx_modules_http_lua? ( ${LUA_DEPS} ) + nginx_modules_http_auth_pam? ( sys-libs/pam ) + nginx_modules_http_metrics? ( dev-libs/yajl:= ) + nginx_modules_http_dav_ext? ( dev-libs/libxml2 ) + nginx_modules_http_security? ( + dev-libs/apr:= + dev-libs/apr-util:= + dev-libs/libxml2:= + net-misc/curl + www-servers/apache + ) + nginx_modules_http_auth_ldap? ( net-nds/openldap[ssl?] ) + nginx_modules_stream_geoip? ( dev-libs/geoip ) + nginx_modules_stream_geoip2? ( dev-libs/libmaxminddb:= )" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-nginx ) + !www-servers/nginx:0" +DEPEND="${CDEPEND} + arm? ( dev-libs/libatomic_ops ) + libatomic? ( dev-libs/libatomic_ops )" +BDEPEND="nginx_modules_http_brotli? ( virtual/pkgconfig ) + nginx_modules_http_security? ( ${AUTOTOOLS_DEPEND} )" +PDEPEND="vim-syntax? ( app-vim/nginx-syntax )" + +REQUIRED_USE="pcre-jit? ( pcre ) + nginx_modules_http_fancyindex? ( nginx_modules_http_addition ) + nginx_modules_http_grpc? ( http2 ) + nginx_modules_http_lua? ( + ${LUA_REQUIRED_USE} + nginx_modules_http_rewrite + ) + nginx_modules_http_naxsi? ( pcre ) + nginx_modules_http_dav_ext? ( nginx_modules_http_dav nginx_modules_http_xslt ) + nginx_modules_http_metrics? ( nginx_modules_http_stub_status ) + nginx_modules_http_security? ( pcre ) + nginx_modules_http_push_stream? ( ssl )" + +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_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 + + use nginx_modules_http_lua && lua-single_pkg_setup +} + +src_prepare() { + eapply "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch" + eapply "${FILESDIR}/${PN}-httpoxy-mitigation-r1.patch" + + if use nginx_modules_http_brotli; then + cd "${HTTP_BROTLI_MODULE_WD}" || die + eapply "${FILESDIR}"/http_brotli-detect-brotli-r3.patch + cd "${S}" || die + fi + + if use nginx_modules_http_upstream_check; then + eapply -p0 "${FILESDIR}"/http_upstream_check-nginx-1.11.5+.patch + fi + + if use nginx_modules_http_cache_purge; then + cd "${HTTP_CACHE_PURGE_MODULE_WD}" || die + eapply "${FILESDIR}"/http_cache_purge-1.11.6+.patch + cd "${S}" || die + fi + + if use nginx_modules_http_security; then + cd "${HTTP_SECURITY_MODULE_WD}" || die + + eautoreconf + + if use nginx_modules_http_lua; then + sed -i \ + -e "s|^\(LUA_PKGNAMES\)=.*|\1=\"${ELUA}\"|" \ + configure || die + fi + + cd "${S}" || die + fi + + if use nginx_modules_http_upload_progress; then + cd "${HTTP_UPLOAD_PROGRESS_MODULE_WD}" || die + eapply "${FILESDIR}"/http_uploadprogress-issue_50-r1.patch + cd "${S}" || 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 + + 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}" || die + + ./configure \ + --enable-standalone-module \ + --disable-mlogc \ + --with-ssdeep=no \ + $(use_enable pcre-jit) \ + $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security" + + cd "${S}" || die + fi + + 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 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 + export LUAJIT_LIB=$(dirname $(lua_get_shared_lib)) + export LUAJIT_INC=$(lua_get_include_dir) + 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_vhost_traffic_status; then + http_enabled=1 + myconf+=( --add-module=${HTTP_VHOST_TRAFFIC_STATUS_MODULE_WD} ) + fi + + if use nginx_modules_http_geoip2 || use nginx_modules_stream_geoip2; then + myconf+=( --add-module=${GEOIP2_MODULE_WD} ) + fi + + if use nginx_modules_http_javascript || use nginx_modules_stream_javascript; then + myconf+=( --add-module="${NJS_MODULE_WD}/nginx" ) + fi + + if use nginx_modules_http_brotli; then + http_enabled=1 + myconf+=( --add-module=${HTTP_BROTLI_MODULE_WD} ) + fi + + if use http || use http-cache || use http2 || use nginx_modules_http_javascript; 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_STD; do + if use nginx_modules_stream_${mod}; then + stream_enabled=1 + else + myconf+=( --without-stream_${mod}_module ) + fi + done + + for mod in $NGINX_MODULES_STREAM_OPT; do + if use nginx_modules_stream_${mod}; then + stream_enabled=1 + myconf+=( --with-stream_${mod}_module ) + fi + done + + if use nginx_modules_stream_geoip2 || use nginx_modules_stream_javascript; then + stream_enabled=1 + fi + + 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 AR CC + + if ! use prefix; then + myconf+=( --user=${PN} ) + myconf+=( --group=${PN} ) + fi + + local WITHOUT_IPV6= + if ! use ipv6; then + WITHOUT_IPV6=" -DNGX_HAVE_INET6=0" + fi + + if [[ -n "${EXTRA_ECONF}" ]]; then + myconf+=( ${EXTRA_ECONF} ) + ewarn "EXTRA_ECONF applied. Now you are on your own, good luck!" + 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${WITHOUT_IPV6}" \ + --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 \ + --with-compat \ + "${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-r4 nginx + newconfd "${FILESDIR}"/nginx.confd 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 "${ED}"/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 ${keepdir_list} + fowners ${PN}:${PN} ${keepdir_list} + + fperms 0710 /var/log/nginx + fowners 0:${PN} /var/log/nginx + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate-r1 nginx + + # Don't create /run + rm -rf "${ED}"/run || die + + if use lua_single_target_luajit; then + pax-mark m "${ED}/usr/sbin/nginx" + fi + + if use nginx_modules_http_perl; then + cd "${S}"/objs/src/http/modules/perl/ || die + emake DESTDIR="${D}" INSTALLDIRS=vendor + perl_delete_localpod + cd "${S}" || die + 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}"/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.rst + fi + + if use nginx_modules_http_echo; then + docinto ${HTTP_ECHO_MODULE_P} + dodoc "${HTTP_ECHO_MODULE_WD}"/README.markdown + fi + + if use nginx_modules_http_security; then + docinto ${HTTP_SECURITY_MODULE_P} + dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.md,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 "" + 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; then + ewarn "" + ewarn "While you can build lua 3rd party module against ${P}" + ewarn "the author warns that >=${PN}-1.11.11 is still not an" + ewarn "officially supported target yet. You are on your own." + ewarn "Expect runtime failures, memory leaks and other problems!" + fi + + if use nginx_modules_http_lua && use http2; then + ewarn "" + ewarn "Lua 3rd party module author warns against using ${P} with" + ewarn "NGINX_MODULES_HTTP=\"lua http2\". For more info, see https://git.io/OldLsg" + fi + + local _n_permission_layout_checks=0 + local _has_to_adjust_permissions=0 + local _has_to_show_permission_warning=0 + + # Defaults to 1 to inform people doing a fresh installation + # that we ship modified {scgi,uwsgi,fastcgi}_params files + local _has_to_show_httpoxy_mitigation_notice=1 + + local _replacing_version= + for _replacing_version in ${REPLACING_VERSIONS}; do + _n_permission_layout_checks=$((${_n_permission_layout_checks}+1)) + + if [[ ${_n_permission_layout_checks} -gt 1 ]]; then + # Should never happen: + # Package is abusing slots but doesn't allow multiple parallel installations. + # If we run into this situation it is unsafe to automatically adjust any + # permission... + _has_to_show_permission_warning=1 + + ewarn "Replacing multiple ${PN}' versions is unsupported! " \ + "You will have to adjust permissions on your own." + + break + fi + + local _replacing_version_branch=$(ver_cut 1-2 "${_replacing_version}") + debug-print "Updating an existing installation (v${_replacing_version}; branch '${_replacing_version_branch}') ..." + + # Do we need to adjust permissions to fix CVE-2013-0337 (bug #458726, #469094)? + # This was before we introduced multiple nginx versions so we + # do not need to distinguish between stable and mainline + local _need_to_fix_CVE2013_0337=1 + + if ver_test ${_replacing_version} -ge 1.4.1-r2; then + # We are updating an installation which should already be fixed + _need_to_fix_CVE2013_0337=0 + debug-print "Skipping CVE-2013-0337 ... existing installation should not be affected!" + else + _has_to_adjust_permissions=1 + debug-print "Need to adjust permissions to fix CVE-2013-0337!" + fi + + # Do we need to inform about HTTPoxy mitigation? + # In repository since commit 8be44f76d4ac02cebcd1e0e6e6284bb72d054b0f + if ver_test ${_replacing_version_branch} -lt 1.10; then + # Updating from <1.10 + _has_to_show_httpoxy_mitigation_notice=1 + debug-print "Need to inform about HTTPoxy mitigation!" + else + # Updating from >=1.10 + local _fixed_in_pvr= + case "${_replacing_version_branch}" in + "1.10") + _fixed_in_pvr="1.10.1-r2" + ;; + "1.11") + _fixed_in_pvr="1.11.3-r1" + ;; + *) + # This should be any future branch. + # If we run this code it is safe to assume that the user has + # already seen the HTTPoxy mitigation notice because he/she is doing + # an update from previous version where we have already shown + # the warning. Otherwise, we wouldn't hit this code path ... + _fixed_in_pvr= + esac + + if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then + # We are updating an installation where we already informed + # that we are mitigating HTTPoxy per default + _has_to_show_httpoxy_mitigation_notice=0 + debug-print "No need to inform about HTTPoxy mitigation ... information was already shown for existing installation!" + else + _has_to_show_httpoxy_mitigation_notice=1 + debug-print "Need to inform about HTTPoxy mitigation!" + fi + fi + + # Do we need to adjust permissions to fix CVE-2016-1247 (bug #605008)? + # All branches up to 1.11 are affected + local _need_to_fix_CVE2016_1247=1 + + if ver_test ${_replacing_version_branch} -lt 1.10; then + # Updating from <1.10 + _has_to_adjust_permissions=1 + debug-print "Need to adjust permissions to fix CVE-2016-1247!" + else + # Updating from >=1.10 + local _fixed_in_pvr= + case "${_replacing_version_branch}" in + "1.10") + _fixed_in_pvr="1.10.2-r3" + ;; + "1.11") + _fixed_in_pvr="1.11.6-r1" + ;; + *) + # This should be any future branch. + # If we run this code it is safe to assume that we have already + # adjusted permissions or were never affected because user is + # doing an update from previous version which was safe or did + # the adjustments. Otherwise, we wouldn't hit this code path ... + _fixed_in_pvr= + esac + + if [[ -z "${_fixed_in_pvr}" ]] || ver_test ${_replacing_version} -ge ${_fixed_in_pvr}; then + # We are updating an installation which should already be adjusted + # or which was never affected + _need_to_fix_CVE2016_1247=0 + debug-print "Skipping CVE-2016-1247 ... existing installation should not be affected!" + else + _has_to_adjust_permissions=1 + debug-print "Need to adjust permissions to fix CVE-2016-1247!" + fi + fi + done + + if [[ ${_has_to_adjust_permissions} -eq 1 ]]; then + # We do not DIE when chmod/chown commands are failing because + # package is already merged on user's system at this stage + # and we cannot retry without losing the information that + # the existing installation needs to adjust permissions. + # Instead we are going to a show a big warning ... + + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2013_0337} -eq 1 ]]; then + ewarn "" + ewarn "The world-readable bit (if set) has been removed from the" + ewarn "following directories to mitigate a security bug" + ewarn "(CVE-2013-0337, bug #458726):" + ewarn "" + ewarn " ${EPREFIX}/var/log/nginx" + ewarn " ${EPREFIX}${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi}" + ewarn "" + 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 '${EPREFIX}${NGINX_HOME_TMP}'" + chmod o-rwx \ + "${EPREFIX}"/var/log/nginx \ + "${EPREFIX}"${NGINX_HOME_TMP}/{,client,proxy,fastcgi,scgi,uwsgi} || \ + _has_to_show_permission_warning=1 + fi + + if [[ ${_has_to_show_permission_warning} -eq 0 ]] && [[ ${_need_to_fix_CVE2016_1247} -eq 1 ]]; then + ewarn "" + ewarn "The permissions on the following directory have been reset in" + ewarn "order to mitigate a security bug (CVE-2016-1247, bug #605008):" + ewarn "" + ewarn " ${EPREFIX}/var/log/nginx" + ewarn "" + ewarn "Check if this is correct for your setup before restarting nginx!" + ewarn "Also ensure that no other log directory used by any of your" + ewarn "vhost(s) is not writeable for nginx user. Any of your log files" + ewarn "used by nginx can be abused to escalate privileges!" + ewarn "This is a one-time change and will not happen on subsequent updates." + chown 0:nginx "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 + chmod 710 "${EPREFIX}"/var/log/nginx || _has_to_show_permission_warning=1 + fi + + if [[ ${_has_to_show_permission_warning} -eq 1 ]]; then + # Should never happen ... + ewarn "" + ewarn "*************************************************************" + ewarn "*************** W A R N I N G ***************" + ewarn "*************************************************************" + ewarn "The one-time only attempt to adjust permissions of the" + ewarn "existing nginx installation failed. Be aware that we will not" + ewarn "try to adjust the same permissions again because now you are" + ewarn "using a nginx version where we expect that the permissions" + ewarn "are already adjusted or that you know what you are doing and" + ewarn "want to keep custom permissions." + ewarn "" + fi + fi + + # Sanity check for CVE-2016-1247 + # Required to warn users who received the warning above and thought + # they could fix it by unmerging and re-merging the package or have + # unmerged a affected installation on purpose in the past leaving + # /var/log/nginx on their system due to keepdir/non-empty folder + # and are now installing the package again. + local _sanity_check_testfile=$(mktemp --dry-run "${EPREFIX}"/var/log/nginx/.CVE-2016-1247.XXXXXXXXX) + su -s /bin/sh -c "touch ${_sanity_check_testfile}" nginx >&/dev/null + if [ $? -eq 0 ] ; then + # Cleanup -- no reason to die here! + rm -f "${_sanity_check_testfile}" + + ewarn "" + ewarn "*************************************************************" + ewarn "*************** W A R N I N G ***************" + ewarn "*************************************************************" + ewarn "Looks like your installation is vulnerable to CVE-2016-1247" + ewarn "(bug #605008) because nginx user is able to create files in" + ewarn "" + ewarn " ${EPREFIX}/var/log/nginx" + ewarn "" + ewarn "Also ensure that no other log directory used by any of your" + ewarn "vhost(s) is not writeable for nginx user. Any of your log files" + ewarn "used by nginx can be abused to escalate privileges!" + fi + + if [[ ${_has_to_show_httpoxy_mitigation_notice} -eq 1 ]]; then + # HTTPoxy mitigation + ewarn "" + ewarn "This nginx installation comes with a mitigation for the HTTPoxy" + ewarn "vulnerability for FastCGI, SCGI and uWSGI applications by setting" + ewarn "the HTTP_PROXY parameter to an empty string per default when you" + ewarn "are sourcing one of the default" + ewarn "" + ewarn " - 'fastcgi_params' or 'fastcgi.conf'" + ewarn " - 'scgi_params'" + ewarn " - 'uwsgi_params'" + ewarn "" + ewarn "files in your server block(s)." + ewarn "" + ewarn "If this is causing any problems for you make sure that you are sourcing the" + ewarn "default parameters _before_ you set your own values." + ewarn "If you are relying on user-supplied proxy values you have to remove the" + ewarn "correlating lines from the file(s) mentioned above." + ewarn "" + fi +} diff --git a/www-servers/puma/Manifest b/www-servers/puma/Manifest index 93ecb5f7f652..7c6de707f556 100644 --- a/www-servers/puma/Manifest +++ b/www-servers/puma/Manifest @@ -1,6 +1,5 @@ AUX puma-3.12.1-ruby26-waitpid.patch 1722 BLAKE2B cee9b9e89cf098a387481d754732f54274ce0f9580568e62496513d58d46578f81c13df2aa98d2da218bf9d8ad581e8728ff60be488905493e9acc6b88012a88 SHA512 86f826d7f9ac8a50d62f8cf2b87b0df5f7ce55c1a5e4ac7b928b756ece809e30750bb2a7c3c50dc95f9edcb463e9c453b5d3eb84ffe44952904200b5337351ad AUX puma-3.12.5-cve-2020-11077.patch 3490 BLAKE2B 08f103ed5a5cf9878404f04c139476c730f7a663681aa6cc0107c033317826ed803b72b384034b08b361ed7c99683fe3d90d51c5f97708647750db9edf59e15c SHA512 25f26889e74c98e5ee45dbdb2dad356099d15c70027f32fa2500e0f5b40d742d376b7f29560dde985c3652064f6bdec8dd411154301f6c89b1ef356632570c29 -AUX puma-4.3.4-cve-2020-11077.patch 3578 BLAKE2B 34ed185950223fe952f29c98aa80211f8b066ec9d89a04ce4900b6fa654521ac4abb3ae4fd6ae9f56c3143649b0d07bb1a1b66691522c1a9d0ee4d574fe9c58b SHA512 1df326102f6efd0b0aec4918ddda8beba467a76fb863cb0f117d9f073cd6adfdc4dbcb5b698cff8a43404794aa0171e5c124bdf9e0b8ab4161475c6ab3bbd95e DIST puma-3.12.5.tar.gz 219175 BLAKE2B 55e80fba8fd84004090cb8d30b6fd01652f1beb1d1216c5d41ce46c616677504fa867f9701ed2631f4edc956c9377d72c6fd4a1b61e99fdbb50ea371b170a0c0 SHA512 1e6721844cbabab0cfb8b1707625723061821dae3ee06a3330075f787ae580e6836d9cbe436e63dc4602253ad1da3b56135316c923c03bbbae454d9457a44aec DIST puma-5.1.1.tar.gz 284807 BLAKE2B 59ba17129e55e79aa2f8092d60a5643840bd996b7832d421cb72538fc48b0fb302353bedef56cc9b115bdfb15b33b0f453bfbf759b2e9552a9490a8b0cef3090 SHA512 8653c622c21dca2116219702e801d7aa3272f0771fd5c2d5149927edbd504a9838fb0d442bfc5dc523035a94dad25946738a5dda954fdaa74a9a00c85ed9f86e DIST puma-5.2.0.tar.gz 292173 BLAKE2B e09e524ef651a674373e0c5281832fef2e016f58e9623968e11c47135f7bcddb72c6458e74e85f4264c40f49222161d9749c3c29295d5470e47e7b0382e96bab SHA512 3e97f17be3926ff23b03def55dd1c9f015750a5aec74f0fa1551d20c9f386e0ec1a9e676dc0df49ae12129be6768a7d2f7df7a944dd2ec3d44f8243098dc7950 diff --git a/www-servers/puma/files/puma-4.3.4-cve-2020-11077.patch b/www-servers/puma/files/puma-4.3.4-cve-2020-11077.patch deleted file mode 100644 index 673641a91627..000000000000 --- a/www-servers/puma/files/puma-4.3.4-cve-2020-11077.patch +++ /dev/null @@ -1,115 +0,0 @@ -From f3b409c565d67557c04ad37c10a42dd8cad0b655 Mon Sep 17 00:00:00 2001 -From: Evan Phoenix -Date: Tue, 19 May 2020 15:20:10 -0700 -Subject: [PATCH] Reduce ambiguity of headers - ---- - ext/puma_http11/http11_parser.c | 4 +++- - ext/puma_http11/http11_parser.rl | 4 +++- - lib/puma/server.rb | 31 +++++++++++++++++++++++++++++++ - 3 files changed, 37 insertions(+), 2 deletions(-) - -diff --git a/ext/puma_http11/http11_parser.c b/ext/puma_http11/http11_parser.c -index 0b5fdabc3..bf1dd89ab 100644 ---- a/ext/puma_http11/http11_parser.c -+++ b/ext/puma_http11/http11_parser.c -@@ -14,12 +14,14 @@ - - /* - * capitalizes all lower-case ASCII characters, -- * converts dashes to underscores. -+ * converts dashes to underscores, and underscores to commas. - */ - static void snake_upcase_char(char *c) - { - if (*c >= 'a' && *c <= 'z') - *c &= ~0x20; -+ else if (*c == '_') -+ *c = ','; - else if (*c == '-') - *c = '_'; - } -diff --git a/ext/puma_http11/http11_parser.rl b/ext/puma_http11/http11_parser.rl -index 880c1d40b..62452ba7c 100644 ---- a/ext/puma_http11/http11_parser.rl -+++ b/ext/puma_http11/http11_parser.rl -@@ -12,12 +12,14 @@ - - /* - * capitalizes all lower-case ASCII characters, -- * converts dashes to underscores. -+ * converts dashes to underscores, and underscores to commas. - */ - static void snake_upcase_char(char *c) - { - if (*c >= 'a' && *c <= 'z') - *c &= ~0x20; -+ else if (*c == '_') -+ *c = ','; - else if (*c == '-') - *c = '_'; - } -diff --git a/lib/puma/server.rb b/lib/puma/server.rb -index b8e8a7b48..0e123687c 100644 ---- a/lib/puma/server.rb -+++ b/lib/puma/server.rb -@@ -672,6 +672,37 @@ def handle_request(req, lines) - } - end - -+ # Fixup any headers with , in the name to have _ now. We emit -+ # headers with , in them during the parse phase to avoid ambiguity -+ # with the - to _ conversion for critical headers. But here for -+ # compatibility, we'll convert them back. This code is written to -+ # avoid allocation in the common case (ie there are no headers -+ # with , in their names), that's why it has the extra conditionals. -+ -+ to_delete = nil -+ to_add = nil -+ -+ env.each do |k,v| -+ if k.start_with?("HTTP_") and k.include?(",") and k != "HTTP_TRANSFER,ENCODING" -+ if to_delete -+ to_delete << k -+ else -+ to_delete = [k] -+ end -+ -+ unless to_add -+ to_add = {} -+ end -+ -+ to_add[k.gsub(",", "_")] = v -+ end -+ end -+ -+ if to_delete -+ to_delete.each { |k| env.delete(k) } -+ env.merge! to_add -+ end -+ - # A rack extension. If the app writes #call'ables to this - # array, we will invoke them when the request is done. - # -From 6d87ed2101dab40e6aaa85b0df01433cfb84df53 Mon Sep 17 00:00:00 2001 -From: Evan Phoenix -Date: Tue, 19 May 2020 15:34:06 -0700 -Subject: [PATCH] Adjust test to match real world value - ---- - test/test_puma_server.rb | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/test/test_puma_server.rb b/test/test_puma_server.rb -index 75fcc22e8..a10490a71 100644 ---- a/test/test_puma_server.rb -+++ b/test/test_puma_server.rb -@@ -151,7 +151,7 @@ def test_default_server_port_respects_x_forwarded_proto - - req = Net::HTTP::Get.new("/") - req['HOST'] = "example.com" -- req['X_FORWARDED_PROTO'] = "https,http" -+ req['X-FORWARDED-PROTO'] = "https,http" - - res = Net::HTTP.start @host, @server.connected_port do |http| - http.request(req) diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest index ecab87a4980b..fa83bf6f79ee 100644 --- a/www-servers/tomcat/Manifest +++ b/www-servers/tomcat/Manifest @@ -14,8 +14,10 @@ DIST apache-tomcat-7.0.107-src.tar.gz 5312698 BLAKE2B 1f2712ddce6aa604692aaf6a6c DIST apache-tomcat-7.0.108-src.tar.gz 5313375 BLAKE2B 200a1ccbc39a572ca7e4f7805bf3d27e0bd645156d8886b0fcbee5e64279a4d2f4e2ad847d67a70e1c65a8d88fa5bd4757a0066ceff367fe92914e22cc809aa5 SHA512 bdd957ca5b3b7dd152efa6406dbb6397ed62661ec44c83b6a8f6e9e3c33362c51ff5e0451a57d6aa3874cd745811f2afe78d08825ddaba8e29cb38ef922c48e2 DIST apache-tomcat-8.5.61-src.tar.gz 5840559 BLAKE2B 18e1505b6b7d8e1a024d9f834d33ef105a16e6fc1f9e80abd3e6e88b2326597b9973e13c2ebc030a1db4a2d4dc5572d195b9f61db6cb7bf51e97cbfaa121678a SHA512 fd6bb5926b5e7cf44f359c93dadc4edd87fa5f2e26fb0fb3a9bc0a5c89ae4d844d66872055e1b441392cf03d7690aca3429b66afd8334319784f089f821d8c22 DIST apache-tomcat-8.5.63-src.tar.gz 5853051 BLAKE2B d007d9922d54578bdebcbbaec3e7c0ffcafdce913e52fdd93d5c174c9d1304980b5eb7f126e957c5975a59dfb126857dcc87ef3ca5e479e44cd7910b6183e469 SHA512 d78a140117844675239e834a0890641c0ef0d6fc3c89eb4512536fece2c128f088edfdea15f79ba7a31e0478431f155230f8f60a57bfea0aed191298a95310c4 +DIST apache-tomcat-8.5.64-src.tar.gz 5863485 BLAKE2B c297c0803c74a969e96b99c379bcd050d6e08cb1036d69b5c49c64311d6f17695754631738130a76def849da6c2de70a49d4452b24ee34c5720d9474f8d4d41b SHA512 ffcc8e97b56730e7e15daa8c4ce628547afcf0bb008bb8d8142ae684c963ed6a366c1dfdbaaca9080201c3c1bcda60c759b76447dd72493f0ec922a034b75f08 DIST apache-tomcat-9.0.41-src.tar.gz 6022059 BLAKE2B 6e97390aec956c16f271e57a2fa8805b6f49f593434f0dff8d82e14bc9abc199b00a7523dbb8da335a7ffa9dfee6790430c30f8b0ee90bcd133694c8da42197f SHA512 094e7cbd2519a4b812a2ca865f92802ece3385a20826c5e29b5f7cda8b9265d01ede6f598999f8aa2f1b04bcaca2e67e3f0132781b3f22007356df49ab6b1838 DIST apache-tomcat-9.0.43-src.tar.gz 6042010 BLAKE2B 78c0e7d711dd826ba93b12db6a96929ddeeb0df189a12e907c51f02baa08d84757915b8744b5ebd027892ff2823b955d7b1c3c749ab54b588686dfd8d3157640 SHA512 8c23f8a371b3ffbc1ab4d5f24be08ecf2c9e6ba466ef36ef97e075bd0f12b1ffc93f63b9ff1def9953b3f791319c7c355a76e7a54061a21d25be37a5dc22da26 +DIST apache-tomcat-9.0.44-src.tar.gz 6047722 BLAKE2B fda3081d66c9018a49e5a07bfb5d54b133fe51dff69b692480065d8d9a4877ce5b5b152e33f6d4cfaf28940ec6b556c9a2455c8fda56ea0552e4d1f83f0f9cbe SHA512 68f6a6edecc0469e21cf062cd4b5aacd2df4903fe98aea052acfc9f725268490d5a6917ac1565f26e15a513afa09814014aed267dc1b5aa92733a51ef52b305f DIST biz.aQute.bnd-5.1.1.jar 16088761 BLAKE2B 59906cc39ea27ef20cbf82de1ba78096f34dc417da6dc5c28e21f6e92c0625efecf14cec6c5faf0ab17551c31a6c87a24614c2ac75ac902cfea30199ecc0d39f SHA512 8092b083e7b86e75bf27233964763b88bee74d8ae141c85e387c1cc8bd0cbf3a54be27afea29931fb3ae950700a515fd4a28cfe8e7f26cbaaec506aa06357a37 DIST biz.aQute.bndlib-5.1.1.jar 3652944 BLAKE2B dad9f9835fb407a36e0eae4b65fa2fda147e06ab3f3211a2ed2f1631aeccd6d14d198c325793cb1ce9a57b719a836db230d0452715744ba5a4a6c2983c17916b SHA512 d7da056ba541ae0862159bf5e38e1a5351b2ab5388c88733b46601c2d7dab8970f16af00df186a6cb67fbe81ef53f2c8402db9d28a8c6819dadf60a1df40879b EBUILD tomcat-10.0.2.ebuild 5902 BLAKE2B 45d8f8191815f6e668bf9c2d927d2490c3ab486455144364e188eb97196990f85b176394a95020dd7eb6dfc4828278ac9f282e9615080dbd49bff946d7c11845 SHA512 a756ac610ca78012ae828b5843b447753196eaba9e8f7a54726e2a78758d16989d6a1c5e84df71d2e35ad9d722b67ebc1da0abf256de31483facb98ed13a8465 @@ -23,6 +25,8 @@ EBUILD tomcat-7.0.107.ebuild 4154 BLAKE2B 2020b3a15d3e33f4638f74511f6beb8d82db9f EBUILD tomcat-7.0.108.ebuild 4155 BLAKE2B e55024bdd35be24b2807229d4a659e3ced6a4211d3e6c586d045955b84aa38e066e208f5c3bfbeb2d9d87944a782adb1f36e65c237edffc32373897a48c9ef42 SHA512 5f9db59d6fb0e575a566c45aa84be258bd6838db909ab263180f288a57a047c75a74bba2103e05e6fc9090d6aef64215d7c011814f73cb408501b7541d9df4db EBUILD tomcat-8.5.61.ebuild 4734 BLAKE2B b790306d322cf975ada21309e946c6b95225e2f20d768f851f3954bee11a71a817b6a54ac43bfd4830fc4d5cdbdef54c07241ed90d52ea54c5b46d0d16d65295 SHA512 1e1fae7207883a473d6f37d0f80ee3bc108a295c95d93d136e3179cedf893c9709c488a43c649fef74c757b1c064589c677c5bbbc56b201c8ca71a12feeb869c EBUILD tomcat-8.5.63.ebuild 4735 BLAKE2B 6539f7954d5855fecd19875b513a511379efd91543d067e1b1c1404601fe9be81e72f51655c4cba9312c4a7d9b0d0a367bcf4fcb9fa8784b9cad79183536f458 SHA512 1765a85b925f95a2465e6c680ac1bc6a801cf625be7ca312e01e58fa6172d460050f0829a3732197dd9f54b95aa1bb5f7e8f9ba30427dd5e60f4471f69fb717f +EBUILD tomcat-8.5.64.ebuild 4735 BLAKE2B 6539f7954d5855fecd19875b513a511379efd91543d067e1b1c1404601fe9be81e72f51655c4cba9312c4a7d9b0d0a367bcf4fcb9fa8784b9cad79183536f458 SHA512 1765a85b925f95a2465e6c680ac1bc6a801cf625be7ca312e01e58fa6172d460050f0829a3732197dd9f54b95aa1bb5f7e8f9ba30427dd5e60f4471f69fb717f EBUILD tomcat-9.0.41.ebuild 5630 BLAKE2B c219a31f70d97b85b928550b9545979caa3e165a0154fd1a1624847fe5bdd9a70772052495e0c30929542bcad1856fdd6143791da4931ebb2d0bab4af1366f36 SHA512 baca0dfa996031d7be20f7a15127554301efcece3f2469296edaf0dd2bfc7bab38e0a334b6e497593acd55532f1054d31209bd34521a0099c7d305e24f2fbd15 EBUILD tomcat-9.0.43.ebuild 5622 BLAKE2B fc21ca59e1060940465a287bdad5a503454afa961796234f85c13a9c3eb97ad4c5914c518d74b37711a2830eb9d4e7458fadb4437dc0aa8b43bca513be243ad8 SHA512 247436d948df70533f61ddc2c5a1f2c97eaa729876f5b226437da21e717bcf2ae1e15193df92666c4020740eb92ef299a86debc8709c20e8ac434a6444524207 +EBUILD tomcat-9.0.44.ebuild 5630 BLAKE2B 279087af977cf4bb6bbd80487401004cc396e98c4601ee5981f750a2ca5e54d288dd2f40c56ec54dff71663f4feb9703b9bd9d043f658c16cc39ffe8d92237f7 SHA512 172bbbb739e8f39100eb6518a49ebe16bf2da7b9e79a38435a22a4393b0babc918d955798f86c3cadee2d6ccc9421a50eb1dfb0c6f30151d3d993f5b3f77ba12 MISC metadata.xml 712 BLAKE2B 3e0a9b1bd07334015006678c0e1d933dc3d7b65291425754f7bcaec673f2316ba85b2e7df2c79a90f0d53dfbc443329cbea8ddfde7d4c93a1635b6140a3b18b6 SHA512 bc7c894d5f945a732078cc4d9a7fa9d0374ebb6aec449487f8968b22aed07bc5e20094448fda9be7516206121d0dfec8c6d6e48ee818786999703ea778a82109 diff --git a/www-servers/tomcat/tomcat-8.5.64.ebuild b/www-servers/tomcat/tomcat-8.5.64.ebuild new file mode 100644 index 000000000000..9a48d1d98961 --- /dev/null +++ b/www-servers/tomcat/tomcat-8.5.64.ebuild @@ -0,0 +1,159 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +JAVA_PKG_IUSE="doc source test" + +inherit eutils java-pkg-2 java-ant-2 prefix + +MY_P="apache-${P}-src" + +DESCRIPTION="Tomcat Servlet-3.1/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container" +HOMEPAGE="https://tomcat.apache.org/" +SRC_URI="mirror://apache/${PN}/tomcat-8/v${PV}/src/${MY_P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="8.5" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris" +IUSE="extra-webapps" + +RESTRICT="test" # can we run them on a production system? + +ECJ_SLOT="4.5" +SAPI_SLOT="3.1" + +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT} + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT}" +RDEPEND="${COMMON_DEP} + acct-group/tomcat + acct-user/tomcat + virtual/jre" +DEPEND="${COMMON_DEP} + app-admin/pwgen + dev-java/ant-core + virtual/jdk:1.8 + doc? ( + dev-java/glassfish-xmlrpc-api:0 + dev-java/wsdl4j:0 + ) + test? ( + >=dev-java/ant-junit-1.9:0 + dev-java/easymock:3.2 + )" + +S=${WORKDIR}/${MY_P} + +src_prepare() { + default + + find -name '*.jar' -type f -delete -print || die + + # Remove bundled servlet-api + rm -rv java/javax/{el,servlet} || die + + eapply "${FILESDIR}/${PN}-8.5.57-build.xml.patch" + + # For use of catalina.sh in netbeans + sed -i -e "/^# ----- Execute The Requested Command/ a\ + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \ + bin/catalina.sh || die + + java-pkg-2_src_prepare +} + +JAVA_ANT_REWRITE_CLASSPATH="true" + +EANT_BUILD_TARGET="deploy" +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT}" +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2" +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes" +EANT_NEEDS_TOOLS="true" +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dexecute.validate=false" + +# revisions of the scripts +IM_REV="-r2" +INIT_REV="-r1" + +src_compile() { + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)" + use doc && EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only glassfish-xmlrpc-api glassfish-xmlrpc-api.jar):$(java-pkg_getjar --build-only wsdl4j wsdl4j.jar)" + java-pkg-2_src_compile +} + +src_test() { + java-pkg-2_src_test +} + +src_install() { + local dest="/usr/share/${PN}-${SLOT}" + + java-pkg_jarinto "${dest}"/bin + java-pkg_dojar output/build/bin/*.jar + exeinto "${dest}"/bin + doexe output/build/bin/*.sh + + java-pkg_jarinto "${dest}"/lib + java-pkg_dojar output/build/lib/*.jar + + dodoc RELEASE-NOTES RUNNING.txt + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api + use source && java-pkg_dosrc java/* + + ### Webapps ### + + # add missing docBase + local apps="host-manager manager" + for app in ${apps}; do + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \ + output/build/webapps/${app}/META-INF/context.xml || die + done + + insinto "${dest}"/webapps + doins -r output/build/webapps/{host-manager,manager,ROOT} + use extra-webapps && doins -r output/build/webapps/{docs,examples} + + ### Config ### + + # create "logs" directory in $CATALINA_BASE + # and set correct perms, see #458890 + dodir "${dest}"/logs + fperms 0750 "${dest}"/logs + + # replace the default pw with a random one, see #92281 + local randpw="$(pwgen -s -B 15 1)" + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die + + # prepend gentoo.classpath to common.loader, see #453212 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die + + insinto "${dest}" + doins -r output/build/conf + + ### rc ### + + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die + + insinto "${dest}"/gentoo + doins "${T}"/tomcat.conf + exeinto "${dest}"/gentoo + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash +} + +pkg_postinst() { + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version" + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat." + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat" + + elog "To manage Tomcat instances, run:" + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help" + + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar" + ewarn "from upstream binary if you need it. Gentoo Bug # 144276" + + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and" + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information." +} diff --git a/www-servers/tomcat/tomcat-9.0.44.ebuild b/www-servers/tomcat/tomcat-9.0.44.ebuild new file mode 100644 index 000000000000..f12d2f96fa30 --- /dev/null +++ b/www-servers/tomcat/tomcat-9.0.44.ebuild @@ -0,0 +1,187 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +JAVA_PKG_IUSE="doc source test" + +inherit eutils java-pkg-2 java-ant-2 prefix + +MY_P="apache-${PN}-${PV}-src" + +# Currently we bundle binary versions of bnd.jar and bndlib.jar +# See bugs #203080 and #676116 +BND_VERSION="5.1.1" +BND="biz.aQute.bnd-${BND_VERSION}.jar" +BNDLIB="biz.aQute.bndlib-${BND_VERSION}.jar" + +DESCRIPTION="Tomcat Servlet-4.0/JSP-2.3/EL-3.0/WebSocket-1.1/JASPIC-1.1 Container" +HOMEPAGE="https://tomcat.apache.org/" +SRC_URI="mirror://apache/${PN}/tomcat-9/v${PV}/src/${MY_P}.tar.gz + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd/${BND_VERSION}/${BND} + https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/${BND_VERSION}/${BNDLIB}" + +LICENSE="Apache-2.0" +SLOT="9" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris" +IUSE="extra-webapps" + +RESTRICT="test" # can we run them on a production system? + +ECJ_SLOT="4.15" +SAPI_SLOT="4.0" + +COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT} + dev-java/glassfish-xmlrpc-api:0 + ~dev-java/tomcat-servlet-api-${PV}:${SAPI_SLOT} + dev-java/wsdl4j:0" +RDEPEND="${COMMON_DEP} + acct-group/tomcat + acct-user/tomcat + virtual/jre" +DEPEND="${COMMON_DEP} + app-admin/pwgen + >=dev-java/ant-core-1.9.13 + virtual/jdk:1.8 + test? ( + >=dev-java/ant-junit-1.9:0 + dev-java/easymock:3.2 + )" + +S=${WORKDIR}/${MY_P} + +PATCHES=( + "${FILESDIR}/${PN}-9.0.43-insufficient-ecj.patch" +) + +BND_HOME="${S}/tomcat-build-libs/bnd" +BNDLIB_HOME="${S}/tomcat-build-libs/bndlib" +BND_JAR="${BND_HOME}/${BND}" +BNDLIB_JAR="${BNDLIB_HOME}/${BND_LIB}" + +src_unpack() { + unpack ${MY_P}.tar.gz + + mkdir -p "${BND_HOME}" "${BNDLIB_HOME}" || die "Failed to create dir" + ln -s "${DISTDIR}/${BND}" "${BND_HOME}/" || die "Failed to symlink bnd-*.jar" + ln -s "${DISTDIR}/${BND}" "${BNDLIB_HOME}/" || die "Failed to symlink bndlib-*.jar" +} + +src_prepare() { + default + + find -name '*.jar' -type f -delete -print || die + + # Remove bundled servlet-api + rm -rv java/javax/{el,servlet} || die + + eapply "${FILESDIR}/${PN}-9.0.40-build.xml.patch" + + # For use of catalina.sh in netbeans + sed -i -e "/^# ----- Execute The Requested Command/ a\ + CLASSPATH=\`java-config --with-dependencies --classpath ${PN}-${SLOT}\`" \ + bin/catalina.sh || die + + java-pkg-2_src_prepare +} + +JAVA_ANT_REWRITE_CLASSPATH="true" + +EANT_BUILD_TARGET="deploy" +EANT_GENTOO_CLASSPATH="eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT},wsdl4j" +EANT_TEST_GENTOO_CLASSPATH="easymock-3.2" +EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes" +EANT_NEEDS_TOOLS="true" +EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false -Dbnd.jar=${BND_JAR} -Dbndlib.jar=${BNDLIB_JAR}" + +# revisions of the scripts +IM_REV="-r2" +INIT_REV="-r1" + +src_configure() { + java-ant-2_src_configure + + eapply "${FILESDIR}/${PN}-9.0.37-fix-build-rewrite.patch" +} + +src_compile() { + EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar):$(java-pkg_getjars --build-only glassfish-xmlrpc-api)" + java-pkg-2_src_compile +} + +src_test() { + java-pkg-2_src_test +} + +src_install() { + local dest="/usr/share/${PN}-${SLOT}" + + java-pkg_jarinto "${dest}"/bin + java-pkg_dojar output/build/bin/*.jar + exeinto "${dest}"/bin + doexe output/build/bin/*.sh + + java-pkg_jarinto "${dest}"/lib + java-pkg_dojar output/build/lib/*.jar + + dodoc RELEASE-NOTES RUNNING.txt + use doc && java-pkg_dojavadoc output/dist/webapps/docs/api + use source && java-pkg_dosrc java/* + + ### Webapps ### + + # add missing docBase + local apps="host-manager manager" + for app in ${apps}; do + sed -i -e "s|=\"true\" >|=\"true\" docBase=\"\$\{catalina.home\}/webapps/${app}\" >|" \ + output/build/webapps/${app}/META-INF/context.xml || die + done + + insinto "${dest}"/webapps + doins -r output/build/webapps/{host-manager,manager,ROOT} + use extra-webapps && doins -r output/build/webapps/{docs,examples} + + ### Config ### + + # create "logs" directory in $CATALINA_BASE + # and set correct perms, see #458890 + dodir "${dest}"/logs + fperms 0750 "${dest}"/logs + + # replace the default pw with a random one, see #92281 + local randpw="$(pwgen -s -B 15 1)" + sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die + + # prepend gentoo.classpath to common.loader, see #453212 + sed -i -e 's/^common\.loader=/\0${gentoo.classpath},/' output/build/conf/catalina.properties || die + + insinto "${dest}" + doins -r output/build/conf + + ### rc ### + + cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die + eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} + sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die + + insinto "${dest}"/gentoo + doins "${T}"/tomcat.conf + exeinto "${dest}"/gentoo + newexe "${T}"/tomcat${INIT_REV}.init tomcat.init + newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash +} + +pkg_postinst() { + elog "New ebuilds of Tomcat support running multiple instances. If you used prior version" + elog "of Tomcat (<7.0.32), you have to migrate your existing instance to work with new Tomcat." + elog "You can find more information at https://wiki.gentoo.org/wiki/Apache_Tomcat" + + elog "To manage Tomcat instances, run:" + elog " ${EPREFIX}/usr/share/${PN}-${SLOT}/gentoo/tomcat-instance-manager.bash --help" + + ewarn "tomcat-dbcp.jar is not built at this time. Please fetch jar" + ewarn "from upstream binary if you need it. Gentoo Bug # 144276" + + einfo "Please read https://wiki.gentoo.org/wiki/Apache_Tomcat and" + einfo "https://wiki.gentoo.org/wiki/Project:Java/Tomcat_6_Guide for more information." +} -- cgit v1.2.3