merge & remove of nginx

This commit is contained in:
Micha Glave 2014-05-27 15:58:57 +02:00
commit 72dfc84ddd
8 changed files with 0 additions and 700 deletions

View File

@ -1,15 +0,0 @@
AUX nginx-r1 1654 SHA256 6e4e954e53a8dad52fce661faca17acb4c3fc536f3708199b67f2d203b40f596 SHA512 21a57d0cb42d90584c207747d2adc3543eb01bdafe6e2129886984f8c42fa435ef6bcd4982b31bbe390519668ecf9cb6c4b543b73669db8fe77c897dc276bbd1 WHIRLPOOL b5835f6b55b766adf614eb7b4aa0b5776356e56cbf0921659aadbb5ceb7b9b99bf36bef59323e4a3bb5de6c1ee5c38188d795a4d559a249feb2adcebf9dfcf20
AUX nginx-secure-link-timeout.patch 3103 SHA256 ff89688109e695c7e3c8dfd39fa7e1310984d790e59bbbf40f29987d3edfd0a5 SHA512 92bfdd5c087b7841b3e2574e923799dc4bfd0cc84cc300029f63c50919661b70204a7dd40e1e5ab4b90e27114c7723fd8a91847b4ff76dfa4bd77b592a505167 WHIRLPOOL 5d7cc6e8feec1fd5c187b284e01150ae9f22fc3886710309e6bfb2853b870d3da12d5f83f618d0538071c54bcb0112c325b7a6ed8ff35ef19cdf8192cd60a994
AUX nginx.conf 878 SHA256 c827c2d28959f14ee7ebb1ba9e88071ff8203228df6b24da9ee94ee4ec669fcc SHA512 29e936bb71d5c46adc5973f93abf3424330d348d87c22166a87e7be1873ad7942c24c7498988b30ef90be3fc878b584804a37f16449c94b967afbf3bd94b15ee WHIRLPOOL 78d02aafc9e0e8742064e34b7b2146dfb7b5900635653f8bfc6274771da0c1f8d6cbf031a252d559e0b4a2a0ad0e455cfdf214680d19afcd91fb9663c9016d2d
AUX nginx.initd 994 SHA256 17a32f38e066ecc91ad91496e0ab8f0885e5550d42bf62dbecfdf2747a0fb1cd SHA512 a0e43823594a7afc29aba6b16f21f5783224f29eb484bd70d9a378e82fdf1d7d2869d3c41395c2aeb5f46161e38f751ceca9b39b39e86ec9177ab6bf7327f116 WHIRLPOOL ac0d582d51edab1ec1fc42165412bed5e7c0ef44c97ca973b948cc437baf2876354f9f4e58cfdfb3a7ed53b1f4bbc3982cfbf767fd9a40cab3a51d49d7bc3d88
AUX nginx.logrotate 195 SHA256 16fcd09e7c62b5693a4eed0924494c9794cd2e86d0e0f4d2d77519b75bf69bb6 SHA512 08d7cc29f325633c560782ef8ddbeea6c4817c58bd74d138c0f6665777047e69885a6bf0782cfd24595a7d60f3bafd4b7a9605f75ec4fd38a208973d6af51d53 WHIRLPOOL e72cc4e15955a1c01239c7cfb7602da0ad7a0df9be70b8958149ccd99705b328a866007f550394397048e9b497b18c75a399323a16aa6321bcddbb09a4d88463
DIST nginx-1.2.9.tar.gz 725829 SHA256 71486674b757f6aa93a4f7ec6e68ef82557d4944deeb08f3ad3de00079d22b1c SHA512 ee66bdde5e01779ff4889bb1f97ade48a5bb8b56e3197f3d7563806ccf510afd9523f20ee1dcd4104d4051f8e50baa431d1e50096fb2b57520497248b8abf2d3 WHIRLPOOL 0259d17bdda4af38b6637d8cf20ef1c47797c7f9872b34a6ecbdcf0c7a63fd00fd40aecd49020ac505c002eabf127c4e8c5841c05e6eab414a275b706379c713
DIST nginx_http_push_module-0.692.tar.gz 29119 SHA256 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe
DIST nginx_upload_module-2.2.0.tar.gz 25796 SHA256 b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805 SHA512 8192cedb2ac6911e8529e1dc63f02ac781cd54a293ab87571866bed11520b01ed5786be6daf79b4a1c34792926548b2fa8404daa0bf31d9fd17c59a64e90b3fe WHIRLPOOL db3ad2790c4beb735d51422d2a8d556385576c4f769addeaa1dd00cae55ee2ab97be9efe420743c87b2f794f816eae7f001e7622648b4f63fbbc60898840f9e8
DIST ngx-fancyindex-0.3.1.tar.gz 13148 SHA256 49328a175548a456e2e2b78d0be87df7aade60345e07be57f2337c83058da115
DIST ngx_cache_purge-1.5.tar.gz 7149 SHA256 4b9cf48c0cf8f13150dfc329a889c221f6206a44aa9dcf8fa2f347abce55995c
DIST ngx_http_headers_more-0.17rc1.tar.gz 24707 SHA256 826b62c13605281f843ad4a612a00b38d71599a673c3112480bff9bdbbcd36cd
DIST ngx_slowfs_cache-1.8.tar.gz 11408 SHA256 3ab8aa47912a3f7a07cda0a4fbf6d2e870b9c9cbf5477014ac109001cdcb3644
DIST ngx_upload_progress-0.9.0.tar.gz 17020 SHA256 3fb903dab595cf6656fa0fc5743a48daffbba2f6b5c554836be630800eaad4e2 SHA512 8b585609983b34a9f3fa39aa18b744be7109beee2e1892ec723deae0353fb366f700e58e120569b7ff364841d271d04b32a9022a0165e9f33e07a21437e1c0ca WHIRLPOOL 42aefc25e98cd0a8f48705638462927494a3b0bcbed1fb0ea7b33a6027a848950347d20d1b055211890ccf4be4f31c7e417614948adeec1272ea01c2e5f0d29a
EBUILD nginx-1.2.9.ebuild 12477 SHA256 0327960497918025c8b35b0dc03864f6e6c6fe888dcaba3ef53e9a3b6e7ab487 SHA512 aa87a3303fa2e7254f427badd1a3cd4142fd42cde2d744ca172b4155eed11ad55e1148fc8e806ec1508743ef87fb326f12331e213d26a50a9399dd988c89891d WHIRLPOOL 25e43b16571be2375f8ae80b51181dda05d3a6d6866cd7ecdd171163b149410a822b49ee6558ceaab500eea73219864e6b88b916aea1ef9f05a3825436533539
MISC metadata.xml 711 SHA256 d3b05c228dd62148c8bc7e46abad586eb9a9f3061ef510e1ed0a4baa77595a99 SHA512 c0219177893ec25ebc819d3b4dc12e8f49bad60faa600d90f572f2eb9058d40b1fc67e48dee71707bd8d0df7721532a08c54da7667c6402f8cd5954e1ca1bab3 WHIRLPOOL 6ec488b91ad22ba103f4a3d64cd5381643d08a36814330c70663c70a5c0f98b3491a24c569c532de6c860581a65083be3df74db0721332aaa77898ac1b6aa6e5

View File

@ -1,71 +0,0 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx-r1,v 1.1 2006/07/04 16:58:38 voxus Exp $
opts="${opts} upgrade reload configtest"
depend() {
need net
use dns logger netmount
}
start() {
configtest || return 1
ebegin "Starting nginx"
start-stop-daemon --start --pidfile /var/run/nginx.pid \
--exec /usr/sbin/nginx -- -c /etc/nginx/nginx.conf
eend $? "Failed to start nginx"
}
stop() {
configtest || return 1
ebegin "Stopping nginx"
start-stop-daemon --stop --pidfile /var/run/nginx.pid
eend $? "Failed to stop nginx"
rm -f /var/run/nginx.pid
}
reload() {
configtest || return 1
ebegin "Refreshing nginx' configuration"
kill -HUP `cat /var/run/nginx.pid` &>/dev/null
eend $? "Failed to reload nginx"
}
upgrade() {
configtest || return 1
ebegin "Upgrading nginx"
einfo "Sending USR2 to old binary"
kill -USR2 `cat /var/run/nginx.pid` &>/dev/null
einfo "Sleeping 3 seconds before pid-files checking"
sleep 3
if [ ! -f /var/run/nginx.pid.oldbin ]; then
eerror "File with old pid not found"
return 1
fi
if [ ! -f /var/run/nginx.pid ]; then
eerror "New binary failed to start"
return 1
fi
einfo "Sleeping 3 seconds before WINCH"
sleep 3 ; kill -WINCH `cat /var/run/nginx.pid.oldbin`
einfo "Sending QUIT to old binary"
kill -QUIT `cat /var/run/nginx.pid.oldbin`
einfo "Upgrade completed"
eend $? "Upgrade failed"
}
configtest() {
ebegin "Checking nginx' configuration"
/usr/sbin/nginx -c /etc/nginx/nginx.conf -t
eend $? "failed, please correct errors above"
}

View File

@ -1,131 +0,0 @@
diff -Naur nginx-0.8.4.orig/src/http/modules/ngx_http_secure_link_module.c nginx-0.8.4/src/http/modules/ngx_http_secure_link_module.c
--- nginx-0.8.4.orig/src/http/modules/ngx_http_secure_link_module.c 2009-05-13 14:44:15.000000000 +0200
+++ nginx-0.8.4/src/http/modules/ngx_http_secure_link_module.c 2009-05-13 15:00:49.000000000 +0200
@@ -12,6 +12,7 @@
typedef struct {
ngx_str_t secret;
+ time_t timeout;
} ngx_http_secure_link_conf_t;
@@ -30,6 +31,12 @@
offsetof(ngx_http_secure_link_conf_t, secret),
NULL },
+ { ngx_string("secure_link_timeout"),
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_sec_slot,
+ NGX_HTTP_LOC_CONF_OFFSET,
+ offsetof(ngx_http_secure_link_conf_t, timeout),
+ NULL },
ngx_null_command
};
@@ -67,22 +74,36 @@
static ngx_str_t ngx_http_secure_link = ngx_string("secure_link");
+static u_char
+ngx_hex2int(u_char hex)
+{
+ hex = hex - '0';
+ if (hex > 9) {
+ hex = (hex + '0' - 1) | 0x20;
+ hex = hex - 'a' + 11;
+ }
+ if (hex > 15)
+ hex = 0xFF;
+
+ return hex;
+}
static ngx_int_t
ngx_http_secure_link_variable(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
{
- u_char *p, *start, *end, *last;
- size_t len;
+ u_char *p, *start, *end, *last, *tss, *tse;
+ size_t len, tslen;
ngx_int_t n;
ngx_uint_t i;
ngx_md5_t md5;
+ time_t ts;
ngx_http_secure_link_conf_t *conf;
u_char hash[16];
conf = ngx_http_get_module_loc_conf(r, ngx_http_secure_link_module);
- if (conf->secret.len == 0) {
+ if (conf->secret.len == 0 || conf->timeout == 0) {
goto not_found;
}
@@ -103,22 +124,46 @@
while (p < last) {
if (*p++ == '/') {
end = p - 1;
- goto url_start;
+ goto tstamp_start;
}
}
goto not_found;
+ tstamp_start:
+
+ tss = p;
+
+ while (p < last) {
+ if (*p++ == '/') {
+ tse = p - 1;
+ goto url_start;
+ }
+ }
+
+ goto not_found;
+
url_start:
+ tslen = tse - tss;
len = last - p;
- if (end - start != 32 || len == 0) {
+ if (end - start != 32 || len == 0 || tslen != 8) {
goto not_found;
}
+ ts = 0;
+ for (i = 0; i < 8; i++) {
+ ts = (ts << 4) + ngx_hex2int(tss[i]);
+ }
+
+ if (ts < r->start_sec - conf->timeout) {
+ goto not_found;
+ }
+
ngx_md5_init(&md5);
ngx_md5_update(&md5, p, len);
+ ngx_md5_update(&md5, tss, tslen);
ngx_md5_update(&md5, conf->secret.data, conf->secret.len);
ngx_md5_final(hash, &md5);
@@ -160,7 +205,8 @@
*
* conf->secret = { 0, NULL }
*/
-
+
+ conf->timeout = NGX_CONF_UNSET;
return conf;
}
@@ -172,6 +218,7 @@
ngx_http_secure_link_conf_t *conf = child;
ngx_conf_merge_str_value(conf->secret, prev->secret, "");
+ ngx_conf_merge_sec_value(conf->timeout, prev->timeout, 3600);
return NGX_CONF_OK;
}

View File

@ -1,49 +0,0 @@
user nginx nginx;
worker_processes 1;
error_log /var/log/nginx/error_log info;
events {
worker_connections 1024;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main
'$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
client_header_timeout 10m;
client_body_timeout 10m;
send_timeout 10m;
connection_pool_size 256;
client_header_buffer_size 1k;
large_client_header_buffers 4 2k;
request_pool_size 4k;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;
output_buffers 1 32k;
postpone_output 1460;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 75 20;
ignore_invalid_headers on;
index index.html;
include /etc/nginx/vhosts.d/*.conf;
}

View File

@ -1,40 +0,0 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx,v 1.3 2005/05/29 14:30:28 voxus Exp $
opts="${opts} reload configtest"
depend() {
need net
use dns logger
}
start() {
configtest || return 1
ebegin "Starting nginx"
start-stop-daemon --start --pidfile /var/run/nginx.pid \
--exec /usr/sbin/nginx -- -c /etc/nginx/nginx.conf
eend $? "Failed to start nginx"
}
stop() {
configtest || return 1
ebegin "Stopping nginx"
start-stop-daemon --stop --pidfile /var/run/nginx.pid
eend $? "Failed to stop nginx"
rm -f /var/run/nginx.pid
}
reload() {
configtest || return 1
ebegin "Refreshing nginx' configuration"
kill -HUP `cat /var/run/nginx.pid` &>/dev/null
eend $? "Failed to reload nginx"
}
configtest() {
ebegin "Checking nginx' configuration"
/usr/sbin/nginx -c /etc/nginx/nginx.conf -t
eend $? "failed, please correct errors above"
}

View File

@ -1,11 +0,0 @@
# nginx logrotate snipet for Gentoo Linux
/var/log/nginx/*.log {
rotate 52
weekly
notifempty
sharedscripts
postrotate
/etc/init.d/nginx reload > /dev/null 2>&1 || true
endscript
}

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>no-herd</herd>
<maintainer>
<email>voxus@gentoo.org</email>
</maintainer>
<use>
<flag name='addition'>Enables HTTP addition filter module</flag>
<flag name='flv'>Enables special processing module for flv files</flag>
<flag name='pamauth'>Enable pam auth support</flag>
<flag name='random-index'>Enables HTTP random index module</flag>
<flag name='securelink'>Enable HTTP secure link module</flag>
<flag name='status'>Enables stub_status module</flag>
<flag name='sub'>Enables sub_filter module</flag>
<flag name='webdav'>Enable webdav support</flag>
</use>
</pkgmetadata>

View File

@ -1,365 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-1.3.1.ebuild,v 1.1 2012/06/06 08:47:00 patrick Exp $
EAPI="4"
# 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"
# 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_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
HTTP_UPLOAD_PROGRESS_MODULE_SHA1="a788dea"
HTTP_UPLOAD_PROGRESS_MODULE_URI="http://github.com/masterzen/nginx-upload-progress-module/tarball/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
HTTP_HEADERS_MORE_MODULE_PV="0.17rc1"
HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
HTTP_HEADERS_MORE_MODULE_SHA1="3580526"
HTTP_HEADERS_MORE_MODULE_URI="http://github.com/agentzh/headers-more-nginx-module/tarball/v${HTTP_HEADERS_MORE_MODULE_PV}"
# http_push (http://pushmodule.slact.net/, MIT license)
HTTP_PUSH_MODULE_PV="0.692"
HTTP_PUSH_MODULE_P="nginx_http_push_module-${HTTP_PUSH_MODULE_PV}"
HTTP_PUSH_MODULE_URI="http://pushmodule.slact.net/downloads/${HTTP_PUSH_MODULE_P}.tar.gz"
# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
HTTP_CACHE_PURGE_MODULE_PV="1.5"
HTTP_CACHE_PURGE_MODULE_P="ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/${HTTP_CACHE_PURGE_MODULE_P}.tar.gz"
# HTTP Upload module from Valery Kholodkov
# (http://www.grid.net.ru/nginx/upload.en.html, BSD license)
HTTP_UPLOAD_MODULE_PV="2.2.0"
HTTP_UPLOAD_MODULE_P="nginx_upload_module-${HTTP_UPLOAD_MODULE_PV}"
HTTP_UPLOAD_MODULE_URI="http://www.grid.net.ru/nginx/download/${HTTP_UPLOAD_MODULE_P}.tar.gz"
# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
HTTP_SLOWFS_CACHE_MODULE_PV="1.8"
HTTP_SLOWFS_CACHE_MODULE_P="ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz"
# http_fancyindex_module (http://wiki.nginx.org/NgxFancyIndex, BSD license)
HTTP_FANCYINDEX_MODULE_PV="0.3.1"
HTTP_FANCYINDEX_MODULE_PN="ngx-fancyindex"
# gitorious names the tarbell oddly, hence PNPN
HTTP_FANCYINDEX_MODULE_PNPN="ngx-fancyindex-ngx-fancyindex"
HTTP_FANCYINDEX_MODULE_P="${HTTP_FANCYINDEX_MODULE_PN}-${HTTP_FANCYINDEX_MODULE_PV}"
HTTP_FANCYINDEX_MODULE_URI="http://gitorious.org/${HTTP_FANCYINDEX_MODULE_PN}/${HTTP_FANCYINDEX_MODULE_PN}/archive-tarball/v${HTTP_FANCYINDEX_MODULE_PV}"
inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user
DESCRIPTION="Robust, small and high performance http and reverse proxy server"
HOMEPAGE="http://nginx.org"
SRC_URI="http://nginx.org/download/${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} )
nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} )
nginx_modules_http_upload? ( ${HTTP_UPLOAD_MODULE_URI} )
nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} )
nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )"
LICENSE="as-is BSD BSD-2 GPL-2 MIT"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
geo gzip limit_req limit_zone map memcached proxy referer rewrite scgi ssi
split_clients upstream_ip_hash userid uwsgi"
NGINX_MODULES_OPT="addition dav degradation flv geoip gzip_static image_filter
mp4 perl random_index realip secure_link stub_status sub xslt"
NGINX_MODULES_MAIL="imap pop3 smtp"
NGINX_MODULES_3RD="
http_upload_progress
http_headers_more
http_passenger
http_push
http_cache_purge
http_upload
http_slowfs_cache
http_fancyindex"
IUSE="aio debug +http +http-cache ipv6 libatomic +pcre pcre-jit selinux ssl 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_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 )
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_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_xslt? ( dev-libs/libxml2 dev-libs/libxslt )"
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 )"
pkg_setup() {
if use nginx_modules_http_passenger; then
einfo
einfo "Passenger support has been removed from the nginx ebuild to"
einfo "get rid of file collisions, its broken build system and"
einfo "incompatibilities between passenger 2 and 3."
einfo
einfo "Please switch to passenger-3 standalone or use the"
einfo "unicorn gem which provides a sane nginx-like architecture"
einfo "out of the box."
einfo
einfo "For more information on sane ruby deployments with"
einfo "passenger-3/unicorn go to:"
einfo
einfo "https://rvm.beginrescueend.com"
einfo
die "nginx_modules_http_passenger still in IUSE"
fi
ebegin "Creating nginx user and group"
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${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() {
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
}
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"
# 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=${WORKDIR}/masterzen-nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_SHA1}"
fi
if use nginx_modules_http_headers_more; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/agentzh-headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_SHA1}"
fi
if use nginx_modules_http_push; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_PUSH_MODULE_P}"
fi
if use nginx_modules_http_cache_purge; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_CACHE_PURGE_MODULE_P}"
fi
if use nginx_modules_http_upload; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_UPLOAD_MODULE_P}"
fi
if use nginx_modules_http_slowfs_cache; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_SLOWFS_CACHE_MODULE_P}"
fi
if use nginx_modules_http_fancyindex; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_FANCYINDEX_MODULE_PNPN}"
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}"/var/run/${PN}.pid \
--lock-path="${EPREFIX}"/var/lock/nginx.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}"/var/tmp/${PN}/client \
--http-proxy-temp-path="${EPREFIX}"/var/tmp/${PN}/proxy \
--http-fastcgi-temp-path="${EPREFIX}"/var/tmp/${PN}/fastcgi \
--http-scgi-temp-path="${EPREFIX}"/var/tmp/${PN}/scgi \
--http-uwsgi-temp-path="${EPREFIX}"/var/tmp/${PN}/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 nginx
doman man/nginx.8
dodoc CHANGES* README
# Keepdir because these are hardcoded above
keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi}
keepdir /var/www/localhost/htdocs
mv "${ED}"/usr/html "${ED}"/var/www/localhost/htdocs || die
# 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 nginx_modules_http_push; then
docinto ${HTTP_PUSH_MODULE_P}
dodoc "${WORKDIR}"/${HTTP_PUSH_MODULE_P}/{changelog.txt,protocol.txt,README}
fi
if use nginx_modules_http_cache_purge; then
docinto ${HTTP_CACHE_PURGE_MODULE_P}
dodoc "${WORKDIR}"/${HTTP_CACHE_PURGE_MODULE_P}/{CHANGES,README.md,TODO.md}
fi
if use nginx_modules_http_upload; then
docinto ${HTTP_UPLOAD_MODULE_P}
dodoc "${WORKDIR}"/${HTTP_UPLOAD_MODULE_P}/{Changelog,README}
fi
if use nginx_modules_http_slowfs_cache; then
docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
dodoc "${WORKDIR}"/${HTTP_SLOWFS_CACHE_MODULE_P}/{CHANGES,README.md}
fi
if use nginx_modules_http_fancyindex; then
docinto ${HTTP_FANCYINDEX_MODULE_P}
dodoc "${WORKDIR}"/${HTTP_FANCYINDEX_MODULE_PNPN}/README.rst
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
}