Nginx passenger is not longer needed thanks to Gitorious patch

which replaces X-Sendfile with X-Accel-Redirect.
3385bf5769
This commit is contained in:
Kolan Sh 2012-06-15 15:03:34 +04:00
parent 0ff1d001bb
commit 05b5a210cd
10 changed files with 0 additions and 782 deletions

View File

@ -1,18 +0,0 @@
AUX nginx-1.1.5-zero_filesize_check.patch 2680 RMD160 27e1d8dd6480ff900533f5d372878e7bcc626151 SHA1 9551a082b4cab4dc44822aa1b5ffac5e98550c96 SHA256 84cd09e431d159ff58eb369abf7fe0a82c3968ad7ba72105e27378d27bd53ced
AUX nginx-r1 1645 RMD160 d032feec43e4ba31ac5b6fffec478ebbeb49db60 SHA1 49f0db3efaccd3cef545b8c68cfa557ca829352f SHA256 b263a663399d2897dfdf53226d45fc3707bc9230bd687b8003d075a48f60ecaf
AUX nginx.conf-r4 1410 RMD160 4b188bb03b12de3b38a82e13b1a2bb93848e8948 SHA1 e836c85e98e3b2c633818c286992d32a68c0b5ff SHA256 74d984512901fc9cfd13cac60df06cd468566aae367c35a3205e6daf7e7c32b6
AUX nginx.init-r2 1657 RMD160 a42538ae12cccfad1108fe2fca387ec666f4fd85 SHA1 7a0706894bed322d8b5814de98bca56d48c458d0 SHA256 9fceee69794de55b6da24ff2d11c72f6bc86339e7088c644b165dc35a9d5afa1
AUX nginx.logrotate 364 RMD160 9fdfd2ea2f49b8dba20a030d893e34779bb32364 SHA1 4ab07992fa5c64f753e3643e1b51fcab4dec6ccf SHA256 9e3e090dfd10861d5f9b279e19113ce8d05caf9f33d488f6aabf9f19ac0cf925
AUX passenger-3.0.1-cflags.patch 1005 RMD160 b48c9a96997277059566f1fd88187006fe8a161f SHA1 2e9eea3bc2c5c55475c59cd884507e3af3c65b42 SHA256 138280e03bfc3314bf50d43dfaa697aa09027d108fc39c8572f06d786dc7f202
AUX passenger-3.0.1-missing-include.patch 340 RMD160 5e314c6ec809a37c898eed9166a1d0c7e71af41b SHA1 c43aff0bce51143c84f0b24857c4bdec2df161f0 SHA256 a41a53f893ac7737b520d1fec0f2490986aae09afe38d79ab540c141322da7eb
AUX passenger-CFLAGS.patch 646 RMD160 12f1e5f80fd2694fed612226561670f9a0f7f556 SHA1 1f9e2df74069a8d863e850a0e7e13bd0e8fc8fcb SHA256 42b5221b418df055cd51d03057d92fb93c4f1bbca56a1ea35cc6f5c5d9e1953d
DIST nginx-1.1.12.tar.gz 707120 RMD160 1d09c3b17ee27774657c5be32f7fdcc20252c0b0 SHA1 78e8de01206fa5a150c3494ed313ea1d6b74353a SHA256 0d00f0f928bc8637f200de7bc405ebb95730c923df208624ea56529be44c08f9
DIST nginx_http_push_module-0.692.tar.gz 29119 RMD160 9d2be16074cf28115af0f1d8f3646937cda649ad SHA1 72103084cad8f4d3d9a49a6b04cf780e4541605d SHA256 64868708071aa21dbc4c7a07d149dd6ec9108fb7eaf2aad5ad069406151f17fe
DIST nginx_upload_module-2.2.0.tar.gz 25796 RMD160 5734af837be3fe8ec444a7e5e7f6707118594098 SHA1 93d6e83e613a0ce2ed057a434b344fa1b6609b47 SHA256 b1c26abe0427180602e257627b4ed21848c93cc20cefc33af084983767d65805
DIST ngx-http-headers-more-0.16rc4.tar.gz 23578 RMD160 a0e0f99aa8fff61631f9cf77ee7ca6e147167f68 SHA1 12fc6a81e029eedfdcf32100ffe47a9b6d837a7d SHA256 e32c1e4eec68352e58184895eb96b7d0705ec0d8df75a1bcbe11fd2f46d5e065
DIST ngx_cache_purge-1.5.tar.gz 7149 RMD160 7b7d351ea91ff3d4161296625a5a4992eee8b7d4 SHA1 f5717a2aee2cc174180627f9bf74a7c2f906047d SHA256 4b9cf48c0cf8f13150dfc329a889c221f6206a44aa9dcf8fa2f347abce55995c
DIST ngx_http_redis-0.3.5.tar.gz 11373 RMD160 1f8b074b9a6359fda25aa895151f19b4606bd9fc SHA1 6cae6c986b306b6fedac3e0abedd80da5ea418fd SHA256 5398805bbc790b8ae5ddb5079cf726df63c8c206bbf9a3a4b035412194aac82e
DIST ngx_slowfs_cache-1.6.tar.gz 10972 RMD160 e1d10851db4a55fc465665caa3f6989d142af2d3 SHA1 072d06b7547629b244bebeef7df7425567f264c9 SHA256 cc0505dbba30153691ff7b3a7353804d5ceb9a519a407b938cae49e9913a7bcc
DIST ngx_upload_progress-0.8.3.tar.gz 16694 RMD160 b3c8835a270cda2224f5be35f1afb818821609b3 SHA1 0edae535d1efd50524d9947acaebe3979b06fcfb SHA256 f391da7fd1a89bd65e852182b6cbc746289cd10c83b211be18e703ff3e3986ae
DIST passenger-3.0.11.tar.gz 2378398 RMD160 4e66832d825cb1f5bf06d117d4285c0b0ab54c12 SHA1 6406ecd47b4f100eb98a2cac611793aab15cd31e SHA256 7bbabfafb9d7f4e1beb6a231dea1fe68d540910ceafec6469f51187a43d8ee4e
EBUILD nginx-1.1.12.ebuild 12843 RMD160 795b44cdcc4157fc6a5cb005561f8eb01e71005f SHA1 c4c780c11a67966298fdf91dbde29579b073d673 SHA256 82a29a23c033945813f7a9a436fea5792caa7f41eb719a7526a012cbc3596650

View File

@ -1,81 +0,0 @@
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c
index 5164734..6daf4b7 100644
--- a/src/http/modules/ngx_http_rewrite_module.c
+++ b/src/http/modules/ngx_http_rewrite_module.c
@@ -813,6 +813,11 @@ ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf)
return NGX_CONF_OK;
}
+ if (p[1] == 'z') {
+ fop->op = ngx_http_script_file_empty;
+ return NGX_CONF_OK;
+ }
+
if (p[0] == '!') {
if (p[2] == 'f') {
fop->op = ngx_http_script_file_not_plain;
@@ -833,6 +838,11 @@ ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf)
fop->op = ngx_http_script_file_not_exec;
return NGX_CONF_OK;
}
+
+ if (p[2] == 'z') {
+ fop->op = ngx_http_script_file_not_empty;
+ return NGX_CONF_OK;
+ }
}
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index a703f08..4a82b6d 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -1520,12 +1520,14 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e)
case ngx_http_script_file_dir:
case ngx_http_script_file_exists:
case ngx_http_script_file_exec:
+ case ngx_http_script_file_not_empty:
goto false_value;
case ngx_http_script_file_not_plain:
case ngx_http_script_file_not_dir:
case ngx_http_script_file_not_exists:
case ngx_http_script_file_not_exec:
+ case ngx_http_script_file_empty:
goto true_value;
}
@@ -1580,6 +1582,18 @@ ngx_http_script_file_code(ngx_http_script_engine_t *e)
goto false_value;
}
goto true_value;
+
+ case ngx_http_script_file_empty:
+ if (of.size == 0) {
+ goto true_value;
+ }
+ goto false_value;
+
+ case ngx_http_script_file_not_empty:
+ if (of.size > 0) {
+ goto false_value;
+ }
+ goto true_value;
}
false_value:
diff --git a/src/http/ngx_http_script.h b/src/http/ngx_http_script.h
index c5b1e40..7790b53 100644
--- a/src/http/ngx_http_script.h
+++ b/src/http/ngx_http_script.h
@@ -171,7 +171,9 @@ typedef enum {
ngx_http_script_file_exists,
ngx_http_script_file_not_exists,
ngx_http_script_file_exec,
- ngx_http_script_file_not_exec
+ ngx_http_script_file_not_exec,
+ ngx_http_script_file_empty,
+ ngx_http_script_file_not_empty
} ngx_http_script_file_op_e;

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
}
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,72 +0,0 @@
user nginx nginx;
worker_processes 1;
error_log /var/log/nginx/error_log info;
events {
worker_connections 8192;
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;
server {
listen 127.0.0.1;
server_name localhost;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
root /var/www/localhost/htdocs;
}
##ssl portion
# server {
# listen 127.0.0.1:443;
# server_name localhost;
#
# ssl on;
# ssl_certificate /etc/ssl/nginx/nginx.pem;
# ssl_certificate_key /etc/ssl/nginx/nginx.key;
#
# access_log /var/log/nginx/localhost.ssl_access_log main;
# error_log /var/log/nginx/localhost.ssl_error_log info;
#
# root /var/www/localhost/htdocs;
# }
}

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.init-r2,v 1.1 2010/01/03 19:51:41 djc 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,11 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/files/nginx.logrotate,v 1.2 2011/04/08 08:32:20 hollow Exp $
/var/log/nginx/*_log {
missingok
sharedscripts
postrotate
test -r /var/run/nginx.pid && kill -USR1 `cat /var/run/nginx.pid`
endscript
}

View File

@ -1,24 +0,0 @@
diff --git a/build/config.rb b/build/config.rb
index 8905bd8..64199fb 100644
--- a/build/config.rb
+++ b/build/config.rb
@@ -24,11 +24,7 @@
OPTIMIZE = boolean_option("OPTIMIZE")
CC = string_option("CC", "gcc")
CXX = string_option("CXX", "g++")
-if OPTIMIZE
- OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -O2 -DBOOST_DISABLE_ASSERTS".strip
-else
- OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS".strip
-end
+OPTIMIZATION_FLAGS = "#{ENV['CXXFLAGS']} -DNDEBUG -DBOOST_DISABLE_ASSERTS".strip
# Extra compiler flags that should always be passed to the C/C++ compiler.
# Should be included last in the command string, even after PlatformInfo.portability_cflags.
@@ -39,4 +35,4 @@ EXTRA_CXXFLAGS = "-Wall #{OPTIMIZATION_FLAGS}".strip
EXTRA_LDFLAGS = ""
# Whether to use the vendored libev or the system one.
-USE_VENDORED_LIBEV = boolean_option("USE_VENDORED_LIBEV", true)
\ No newline at end of file
+USE_VENDORED_LIBEV = false

View File

@ -1,12 +0,0 @@
diff --git a/ext/common/RandomGenerator.h b/ext/common/RandomGenerator.h
index 4a72a5e..836bf66 100644
--- a/ext/common/RandomGenerator.h
+++ b/ext/common/RandomGenerator.h
@@ -26,6 +26,7 @@
#define _PASSENGER_RANDOM_GENERATOR_H_
#include <string>
+#include <cerrno>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>

View File

@ -1,15 +0,0 @@
--- Rakefile.org 2009-10-15 18:45:30.000000000 +0100
+++ Rakefile 2009-10-16 12:17:25.000000000 +0100
@@ -39,11 +39,7 @@
CC = "gcc"
CXX = "g++"
LIBEXT = PlatformInfo.library_extension
-if OPTIMIZE
- OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -O2 -DBOOST_DISABLE_ASSERTS"
-else
- OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS"
-end
+OPTIMIZATION_FLAGS = "#{ENV['CXXFLAGS']} -DNDEBUG -DBOOST_DISABLE_ASSERTS"
# Extra compiler flags that should always be passed to the C/C++ compiler.
# Should be included last in the command string, even after PlatformInfo.portability_cflags.

View File

@ -1,407 +0,0 @@
# Copyright 2011-2012 W-Mark Kubacki
# Distributed under the terms of the OSI Reciprocal Public License
# $Header: $
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
# - 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.8.3"
HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
HTTP_UPLOAD_PROGRESS_MODULE_SHA1="c7c663f"
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.16rc4"
HTTP_HEADERS_MORE_MODULE_P="ngx-http-headers-more-${HTTP_HEADERS_MORE_MODULE_PV}"
HTTP_HEADERS_MORE_MODULE_SHA1="6cd7ae8"
HTTP_HEADERS_MORE_MODULE_URI="http://github.com/agentzh/headers-more-nginx-module/tarball/v${HTTP_HEADERS_MORE_MODULE_PV}"
# http_passenger (http://www.modrails.com/, MIT license)
# TODO: currently builds some stuff in src_configure
PASSENGER_PV="3.0.11"
USE_RUBY="ruby18"
RUBY_OPTIONAL="yes"
# http_redis (http://wiki.nginx.org/HttpRedis)
HTTP_REDIS_MODULE_P="ngx_http_redis-0.3.5"
# 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.6"
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"
inherit eutils ssl-cert toolchain-funcs perl-module ruby-ng flag-o-matic
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_passenger? ( mirror://rubyforge/passenger/passenger-${PASSENGER_PV}.tar.gz )
nginx_modules_http_redis? ( http://people.freebsd.org/~osa/${HTTP_REDIS_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} )
"
RESTRICT="primaryuri"
LICENSE="as-is BSD BSD-2 GPL-2 MIT"
SLOT="0"
KEYWORDS="amd64 ~ppc ~sparc x86 arm ~x86-fbsd"
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_redis
http_push
http_cache_purge
http_upload
http_slowfs_cache
"
IUSE="aio debug +http +http-cache ipv6 libatomic +pcre 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 )
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 )
nginx_modules_http_passenger? (
$(ruby_implementation_depend ruby18)
>=dev-ruby/rubygems-0.9.0
>=dev-ruby/rake-0.8.1
>=dev-ruby/fastthread-1.0.1
>=dev-ruby/rack-1.0.0
dev-libs/libev
)"
RDEPEND="${CDEPEND}"
DEPEND="${CDEPEND}
arm? ( dev-libs/libatomic_ops )
ppc? ( dev-libs/libatomic_ops )
libatomic? ( dev-libs/libatomic_ops )"
PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
S="${WORKDIR}/${P}"
pkg_setup() {
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
if use nginx_modules_http_passenger; then
ruby-ng_pkg_setup
use debug && append-flags -DPASSENGER_DEBUG
fi
}
src_unpack() {
# prevent ruby-ng.eclass from messing with src_unpack
default
}
src_prepare() {
epatch "${FILESDIR}/nginx-1.1.5-zero_filesize_check.patch"
sed -i 's/ make/ \\$(MAKE)/' "${S}"/auto/lib/perl/make
sed -i 's/1001011/1001012/' "${S}"/src/core/nginx.h
if use nginx_modules_http_passenger; then
cd "${WORKDIR}"/passenger-${PASSENGER_PV}
epatch \
"${FILESDIR}/passenger-3.0.1-missing-include.patch"
sed -i \
-e 's|/usr/lib/phusion-passenger/agents|/usr/libexec/passenger/agents|' \
-e 's|/usr/share/phusion-passenger/helper-scripts|/usr/libexec/passenger/bin|' \
-e "s|/usr/share/doc/phusion-passenger|/usr/share/doc/${PF}|" \
lib/phusion_passenger.rb ext/common/ResourceLocator.h || die "sed failed"
fi
}
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 --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_passenger; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/passenger-${PASSENGER_PV}/ext/nginx"
fi
if use nginx_modules_http_redis; then
http_enabled=1
myconf+=" --add-module=${WORKDIR}/${HTTP_REDIS_MODULE_P}"
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 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
./configure \
--prefix=/usr \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/${PN}/${PN}.conf \
--error-log-path=/var/log/${PN}/error_log \
--pid-path=/var/run/${PN}.pid \
--lock-path=/var/lock/nginx.lock \
--user=${PN} --group=${PN} \
--with-cc-opt="-I${ROOT}usr/include" \
--with-ld-opt="-L${ROOT}usr/lib" \
--http-log-path=/var/log/${PN}/access_log \
--http-client-body-temp-path=/var/tmp/${PN}/client \
--http-proxy-temp-path=/var/tmp/${PN}/proxy \
--http-fastcgi-temp-path=/var/tmp/${PN}/fastcgi \
--http-scgi-temp-path=/var/tmp/${PN}/scgi \
--http-uwsgi-temp-path=/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}" || die "emake failed"
}
src_install() {
keepdir /var/log/${PN} /var/tmp/${PN}/{client,proxy,fastcgi,scgi,uwsgi}
keepdir /var/www/localhost/htdocs
dosbin objs/nginx
newinitd "${FILESDIR}"/nginx.init-r2 nginx
cp "${FILESDIR}"/nginx.conf-r4 conf/nginx.conf
rm conf/win-utf conf/koi-win conf/koi-utf
dodir /etc/${PN}
insinto /etc/${PN}
doins conf/*
doman man/nginx.8
dodoc CHANGES* README
# 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 || die "failed to install perl stuff"
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}
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}
fi
if use nginx_modules_http_passenger; then
# passengers Rakefile is so horribly broken that we have to do it
# manually
cd "${WORKDIR}"/passenger-${PASSENGER_PV}
export RUBY="ruby18"
insinto $(${RUBY} -rrbconfig -e 'print Config::CONFIG["archdir"]')
insopts -m 0755
doins ext/ruby/*/passenger_native_support.so
doruby -r lib/phusion_passenger lib/phusion_passenger.rb
exeinto /usr/bin
doexe bin/passenger-memory-stats bin/passenger-status
exeinto /usr/libexec/passenger/bin
doexe helper-scripts/passenger-spawn-server
exeinto /usr/libexec/passenger/agents
doexe agents/Passenger{LoggingAgent,Watchdog}
exeinto /usr/libexec/passenger/agents/nginx
doexe agents/nginx/PassengerHelperAgent
fi
}
pkg_postinst() {
if use ssl; then
if [ ! -f "${ROOT}"/etc/ssl/${PN}/${PN}.key ]; then
install_cert /etc/ssl/${PN}/${PN}
chown ${PN}:${PN} "${ROOT}"/etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
fi
fi
}