From e9e622d4501fc9bd4d913ec77308edbf5ade639d Mon Sep 17 00:00:00 2001 From: Yuriy Ustushenko Date: Wed, 15 May 2013 12:07:52 +0300 Subject: new version --- www-servers/nginx/Manifest | 2 + www-servers/nginx/nginx-1.4.1-r104.ebuild | 519 ++++++++++++++++++++++++++++++ 2 files changed, 521 insertions(+) create mode 100644 www-servers/nginx/nginx-1.4.1-r104.ebuild diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest index 746d0d2..b0987d0 100644 --- a/www-servers/nginx/Manifest +++ b/www-servers/nginx/Manifest @@ -11,6 +11,7 @@ DIST ngx_http_cache_purge-2.1.tar.gz 10535 SHA256 424005af0c04e59ffa65a65e446081 DIST ngx_http_fancyindex-0.3.1.1.tar.gz 13146 SHA256 227896f7d69866f7432c1b19a03dd47ae3463fc4afda117951da7a497a97cfd0 SHA512 25bf420964bf9489face93ac415d531e0b52f281b8f993b85eca75b159099f269af183a63b895ea0ba855bb08f23d4b5e5dd6aefd96b63b4e7e478bba0d2e145 WHIRLPOOL 971c9e9899ac4552c0d7ef0068f740fec431e89be3b666a4e01db882dc36b6d55ee2eb3459c9e8e5173bc303bc24c4ec99569949bde557506f2b63959959568d DIST ngx_http_headers_more-0.20-r1.tar.gz 26769 SHA256 0e7c5e9dc9daade8b508a9f0cd0cd887329d1ae19d80294bc588939afed9e9d9 SHA512 c31be114943f5831ad9cbac8ac0c9c1995c513205e7d3d87761788e7fdd9ea7d60992dbd51cccf26777e96658091ef091e98c2e384b1041f9bce0dacdfa81c3e WHIRLPOOL 94ae99aa9c682c6406db39f4552fd6e33c735644c930f30617b6b32efd116962b630fb1a36ff37671d1c5c8de480045e426e3779e6b9c5991cbd7d93568d6d2d DIST ngx_http_lua-0.8.1.tar.gz 478976 SHA256 1b4fbdcf55765fa7214d00d3d70f9c02d6922970b005649622612476e65e994f SHA512 a0eb7f839bc332ff658fd2885072591c0719bba93e7490420821daee23b6b6d26b6395222635c0841d3a322a9b77aa76411a52f137b7da356c90ed64b8f9602a WHIRLPOOL 3d5262fd97fef6d2e6ad090c9c105ac5a9659fd58eed16a2a555273dbce66d67dd0143531571897e013d45a595a3cc806bcaf7a445f56ad42f0cde8f82e8b01b +DIST ngx_http_naxsi-0.50.tar.gz 49809 SHA256 7cece5f9d9c5df9e09af1e1023bc8e04bbbbe953e67461b893b8240e82ca52ef SHA512 cc641683211ba379b7e4d02417b9b78cc3c25b80ec2eb072b90b1515e08a40ada9ce320f618db6e60bf0eb3ae27961a1c5ad90c735cc21244bd54c1ddb50e74e WHIRLPOOL a000dc2b7b628e685885463823e202cfbaaaffe62daaa50c93a65b79560718600cf9319ccf0ea861a1207c660415818f7085e090dcea49308cadbe4379b476fe DIST ngx_http_push-0.692.tar.gz 29119 SHA256 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe SHA512 79821cacf5db4b1309e3f1c8d6980f83b1093dd3f291db5298bfdeb0d889fc0629625dcf3135d1cf7554b43308ef7172a4f40596928ab3069426801177ed3c1c WHIRLPOOL f1c846a4aa2d4491ee3063266d27b9854d860bbba44ef6e2ea33ebe1f570177e836c593a84cc2c7e22357bd43411f9d5b55852ee96a98dccdc18e7edf6768c95 DIST ngx_http_slowfs_cache-1.10.tar.gz 11809 SHA256 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1 SHA512 fbc9609a8d6913aeefe535f206b9e53477503f131934ead2ae5a6169e395af2f5fb54778704824d5eeb22a4ef40a11ebbcde580db62a631f70edcc2cfc06b15d WHIRLPOOL a02ed77422c47d9e476f8746186d19d632ddb953635d8d9dd51ff076225a78044286ee7e114478bc02e4b2a422e4fdc207154fc287629dd2cd7c3f9a634dad18 DIST ngx_http_upload_progress-0.9.0-r1.tar.gz 16990 SHA256 93e29b9b437a2e34713de54c2861ea51151624aca09f73f9f44d1caaff01a6b1 SHA512 a602b797f1a928c72752edf44629e48d5b8ab3c979ea0996645a978ba898b2a11c8b12bf09bd2282c4b1503bb8caaba4e4fbf357d644fbc5744c9e7264d07519 WHIRLPOOL 6b3f9feb1a7d2a4bd2f80dd20748ee5918e187e7b026c53ed9bc189696b90521bb5beabce9e00936c5bbf625cc73ccf131d8a9c219d4f399d8ae2c44ba378ebc @@ -20,5 +21,6 @@ DIST ngx_syslog-0.25.tar.gz 91070 SHA256 8bafa901d2f9af0b54f1a014fdfaa07140bd458 DIST ngx_xsltproc-0.14.tar.gz 532723 SHA256 dc9b29fb7a1ad75486404677c0d8df792475eb469f96824486f19198fadbf96c SHA512 88f4df26438bd2f525b9554a2b94fa61c212f46bf476754ddfa30ebe70187fda59a1017a69f82c1542568454d5e9f122068bd616b9bc7b26b408aaf0a7de0ca9 WHIRLPOOL 6cfb8bddacd2a0e3ae05b88a435a216d52ce5205bcc4797b08b8c0712038eea9699859e11a5663cd6761255162a8e305ba6565f60095990611683777063a02b4 EBUILD nginx-1.4.1-r102.ebuild 18213 SHA256 00f9ac7eba8de3b5ae2442a20a13f65ea9841b372e0c9a353f0df65033d1e305 SHA512 367f9dd866753a42e45d20cdba3b8b77c55ca946ba880dfa6127800cae62aa474dbaf3ae029758a258e60b99359ec02070ba02e5701dc151ad2c4c9fb0c67a24 WHIRLPOOL a441b944dff94113fb1078c0f5f6517c3e3d44680653fb725f151b65273cae300f4cbf865b651ae156d179fb7c7371f8e6ea281311d77def4e3ef897ead11e5a EBUILD nginx-1.4.1-r103.ebuild 18238 SHA256 d5437adc2458888b738282c88023a52df535de7050edf4d27d602261ffdda864 SHA512 71f959adc3af98911069891859be20aec90c208c2dacd67b7170570c9915f989a75dfab263615ca6a89616bd44f2c2ad1abf4733c2ded48bef076c22ec3c405d WHIRLPOOL 16b17532a6123ed1e63c4cac1e8bb3bc9fc01d666788dc7e5f9a1e9a33996fafd0c7232684396ef0baa5e9c661dcace88aab96c29d70f32738c096dc229f1dae +EBUILD nginx-1.4.1-r104.ebuild 19076 SHA256 ad8a87dcda5cf5aff9f7e7869177bd8c3b1e2ea0af9284d2969442047ad2a9c6 SHA512 dabca87ffad5ec384f3d8d52ae68949d862cc12472957ed9ad83bcc33ded997733f0e93ba5a9d80417982ce6d0413a345eff8d79689cfd92947000ae0944b802 WHIRLPOOL 042bc074f671af67e35bf66b001507bccc527890fb3cc6ba07dfdc578bd5fae9634f083d657ab74947142cc57c676af67e665590a80216ba78bab845cec16b81 MISC ChangeLog 59078 SHA256 ae4ff04df88ef04099afa60032007583dd595e23515e3f93293b1866a818f1cb SHA512 24746d1660858e8dfa8513c5cb4fc752d5f2934bfdcff5e48427f48e6e6ec276aeb895be7e958afe3ddc8efdacad7984f512ab5923081f3b271d4e4554ec205f WHIRLPOOL 8050f4980104e84ba9389a910c30306f5e01fa06c8da706c338298002ece9680ab4769f37ab1389131b3e4f755e9e6c8f206833e033fe6a3f0a42b9acc312210 MISC metadata.xml 827 SHA256 750fe1d3ad8a43f2772ba296a0bfd35259d32a1746847dfe4119a18d49c01397 SHA512 5248aaf2524123b68d6fd6b82bc58426d419801763d8dcb87b5a5b15475936daf0160f9e878db06307ede0ab215ba0b571a9ff39873f7a77c18780f31c92b0d0 WHIRLPOOL 70c74c2b920dc049b01038e89d7046d188cad9a8a60cbd52dd11db32fe34ca9b55e62ec0bf3ad32c7fb8b26e519a97dc38175f1be3ef5e24c3d55d76f6ed8d10 diff --git a/www-servers/nginx/nginx-1.4.1-r104.ebuild b/www-servers/nginx/nginx-1.4.1-r104.ebuild new file mode 100644 index 0000000..832a768 --- /dev/null +++ b/www-servers/nginx/nginx-1.4.1-r104.ebuild @@ -0,0 +1,519 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.4.1-r4.ebuild,v 1.2 2013/05/14 21:47:27 dev-zero Exp $ + +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" + +# syslog +SYSLOG_MODULE_PV="0.25" +SYSLOG_MODULE_NGINX_PV="1.3.14" +SYSLOG_MODULE_P="ngx_syslog-${SYSLOG_MODULE_PV}" +SYSLOG_MODULE_URI="https://github.com/yaoweibin/nginx_syslog_patch/archive/v${SYSLOG_MODULE_PV}.tar.gz" +SYSLOG_MODULE_WD="${WORKDIR}/nginx_syslog_patch-${SYSLOG_MODULE_PV}" + +# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license) +DEVEL_KIT_MODULE_PV="0.2.18" +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.0" +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 (http://github.com/agentzh/headers-more-nginx-module, BSD license) +HTTP_HEADERS_MORE_MODULE_PV="0.20" +HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}-r1" +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_push (http://pushmodule.slact.net/, MIT license) +HTTP_PUSH_MODULE_PV="0.692" +HTTP_PUSH_MODULE_P="ngx_http_push-${HTTP_PUSH_MODULE_PV}" +HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/nginx_http_push_module-${HTTP_PUSH_MODULE_PV}.tar.gz" +HTTP_PUSH_MODULE_WD="${WORKDIR}/nginx_http_push_module-${HTTP_PUSH_MODULE_PV}" + +# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license) +HTTP_CACHE_PURGE_MODULE_PV="2.1" +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 (http://wiki.nginx.org/NgxFancyIndex, BSD license) +HTTP_FANCYINDEX_MODULE_PV="0.3.1.1" +HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}" +HTTP_FANCYINDEX_MODULE_URI="http://gitorious.org/ngx-fancyindex/ngx-fancyindex/archive-tarball/2034d0ad" +HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-ngx-fancyindex" + +# http_lua (https://github.com/chaoslawful/lua-nginx-module, BSD license) +HTTP_LUA_MODULE_PV="0.8.1" +HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}" +HTTP_LUA_MODULE_URI="https://github.com/chaoslawful/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 (http://web.iti.upv.es/~sto/nginx/, unknown license) +HTTP_AUTH_PAM_MODULE_PV="1.2" +HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}" +HTTP_AUTH_PAM_MODULE_URI="http://web.iti.upv.es/~sto/nginx/ngx_http_auth_pam_module-${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="99f39394f387211641a1668d61faf2d5186ea1f5" +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/madvertise/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://code.google.com/p/naxsi/, GPLv2+) +HTTP_NAXSI_MODULE_PV="0.50" +HTTP_NAXSI_MODULE_P="ngx_http_naxsi-${HTTP_NAXSI_MODULE_PV}" +HTTP_NAXSI_MODULE_URI="https://naxsi.googlecode.com/files/naxsi-core-${HTTP_NAXSI_MODULE_PV}.tgz" +HTTP_NAXSI_MODULE_WD="${WORKDIR}/naxsi-core-${HTTP_NAXSI_MODULE_PV}/naxsi_src" + +# http_xsltproc (http://github.com/yoreek/nginx-xsltproc-module/, BSD license) +HTTP_XSLTPROC_MODULE_PV="0.14" +HTTP_XSLTPROC_MODULE_P="ngx_xsltproc-${HTTP_XSLTPROC_MODULE_PV}" +HTTP_XSLTPROC_MODULE_SHA1="9bb572d" +HTTP_XSLTPROC_MODULE_URI="https://github.com/yoreek/nginx-xsltproc-module/tarball/v${HTTP_XSLTPROC_MODULE_PV}" + +inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator + +DESCRIPTION="Robust, small and high performance http and reverse proxy server" +HOMEPAGE="http://nginx.org" +SRC_URI="http://nginx.org/download/${P}.tar.gz + syslog? ( ${SYSLOG_MODULE_URI} -> ${SYSLOG_MODULE_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_push? ( ${HTTP_PUSH_MODULE_URI} -> ${HTTP_PUSH_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 ) + nginx_modules_http_xsltproc? ( ${HTTP_XSLTPROC_MODULE_URI} -> ${HTTP_XSLTPROC_MODULE_P}.tar.gz )" + +LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~ppc ~x86 ~amd64-fbsd ~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 dav degradation flv geoip gunzip gzip_static image_filter +mp4 perl random_index realip secure_link spdy stub_status sub" +NGINX_MODULES_MAIL="imap pop3 smtp" +NGINX_MODULES_3RD=" + http_upload_progress + http_headers_more + http_push + http_cache_purge + http_slowfs_cache + http_fancyindex + http_lua + http_auth_pam + http_upstream_check + http_metrics + http_naxsi + http_xsltproc" + +IUSE="aio debug +http +http-cache ipv6 libatomic +pcre pcre-jit selinux ssl +syslog userland_GNU vim-syntax +nginx_modules_http_xsltproc" + +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 + +CDEPEND=" + pcre? ( >=dev-libs/libpcre-4.2 ) + pcre-jit? ( >=dev-libs/libpcre-8.20[jit] ) + selinux? ( sec-policy/selinux-nginx ) + ssl? ( dev-libs/openssl ) + http-cache? ( userland_GNU? ( dev-libs/openssl ) ) + nginx_modules_http_geo? ( 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 ) ) + nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c ) + nginx_modules_http_xsltproc? ( dev-libs/libxml2 dev-libs/libxslt dev-libs/icu dev-libs/libmemcached ) + nginx_modules_http_lua? ( || ( dev-lang/lua dev-lang/luajit ) ) + nginx_modules_http_auth_pam? ( virtual/pam ) + nginx_modules_http_metrics? ( dev-libs/yajl )" +RDEPEND="${CDEPEND}" +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 )" + +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 +} + +src_prepare() { + epatch "${FILESDIR}/${P}-fix-perl-install-path.patch" + + if use syslog; then + epatch "${SYSLOG_MODULE_WD}"/syslog_${SYSLOG_MODULE_NGINX_PV}.patch + fi + + if use nginx_modules_http_upstream_check; then + epatch "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/check_1.2.6+.patch + 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 + + epatch_user +} + +src_configure() { + local myconf= http_enabled= mail_enabled= + + use aio && myconf+=" --with-file-aio --with-aio_module" + use debug && myconf+=" --with-debug" + use ipv6 && myconf+=" --with-ipv6" + use libatomic && myconf+=" --with-libatomic" + use pcre && myconf+=" --with-pcre" + use pcre-jit && myconf+=" --with-pcre-jit" + + # syslog support + if use syslog; then + myconf+=" --add-module=${SYSLOG_MODULE_WD}" + fi + + # 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_push; then + http_enabled=1 + myconf+=" --add-module=${HTTP_PUSH_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 + 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 nginx_modules_http_xsltproc; then + http_enabled=1 + myconf+=" --add-module=${WORKDIR}/yoreek-nginx-xsltproc-module-${HTTP_XSLTPROC_MODULE_SHA1}" + fi + + if use http || use http-cache; 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/lib" \ + --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" +} + +src_compile() { + # 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 + + keepdir /var/log/nginx "${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + fperms 0700 /var/log/nginx "${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + fowners ${PN}:${PN} /var/log/nginx "${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + + # logrotate + insinto /etc/logrotate.d + newins "${FILESDIR}"/nginx.logrotate nginx + + if use nginx_modules_http_perl; then + cd "${S}"/objs/src/http/modules/perl/ + einstall DESTDIR="${D}" INSTALLDIRS=vendor + fixlocalpod + fi + + if use syslog; then + docinto ${SYSLOG_MODULE_P} + dodoc "${SYSLOG_MODULE_WD}"/README + fi + + if use nginx_modules_http_push; then + docinto ${HTTP_PUSH_MODULE_P} + dodoc "${HTTP_PUSH_MODULE_WD}"/{changelog.txt,protocol.txt,README} + 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,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_metrics; then + docinto ${HTTP_METRICS_MODULE_P} + dodoc "${HTTP_METRICS_MODULE_WD}"/README.md + fi + + if use nginx_modules_http_naxsi; then + insinto /etc/nginx + doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules + + docinto ${HTTP_NAXSI_MODULE_P} + newdoc "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/default_location_config.example nbs.rules + 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_lua && use nginx_modules_http_spdy; then + ewarn "Lua 3rd party module author warns against using ${P} with" + ewarn "NGINX_MODULES_HTTP=\"lua spdy\". 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 o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}/${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi} + fi +} -- cgit v1.2.3-65-gdbad