summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/apache/Manifest6
-rw-r--r--www-servers/apache/apache-2.2.29.ebuild115
-rw-r--r--www-servers/apache/apache-2.2.31.ebuild115
-rw-r--r--www-servers/apache/apache-2.4.12-r1.ebuild236
-rw-r--r--www-servers/apache/apache-2.4.16.ebuild236
-rw-r--r--www-servers/apache/files/apache-2.4.12-alpn.patch476
-rw-r--r--www-servers/apache/files/apache.conf2
-rw-r--r--www-servers/apache/files/apache2.2.service19
-rw-r--r--www-servers/apache/metadata.xml36
-rw-r--r--www-servers/axis/Manifest1
-rw-r--r--www-servers/axis/axis-1.4-r2.ebuild139
-rw-r--r--www-servers/axis/files/axis-1.4-JSSESocketFactory.java.patch342
-rw-r--r--www-servers/axis/files/axis-1.4-build.xml.patch15
-rw-r--r--www-servers/axis/files/axis-1.4-java6.patch16
-rw-r--r--www-servers/axis/files/axis-1.4-path_refs.xml.patch20
-rw-r--r--www-servers/axis/files/axis-1.4-targets.xml.patch86
-rw-r--r--www-servers/axis/files/axis-1.4-tools-build.xml.patch26
-rw-r--r--www-servers/axis/files/build.properties15
-rw-r--r--www-servers/axis/metadata.xml13
-rw-r--r--www-servers/boa/Manifest1
-rw-r--r--www-servers/boa/boa-0.94.14_rc21-r1.ebuild63
-rw-r--r--www-servers/boa/files/boa-0.94.14_rc21-ENOSYS.patch17
-rw-r--r--www-servers/boa/files/boa-0.94.14_rc21-texi.patch14
-rw-r--r--www-servers/boa/files/boa.conf187
-rw-r--r--www-servers/boa/files/boa.conf.d4
-rw-r--r--www-servers/boa/files/boa.rc638
-rw-r--r--www-servers/boa/files/boa.service9
-rw-r--r--www-servers/boa/files/mime.types205
-rw-r--r--www-servers/boa/metadata.xml8
-rw-r--r--www-servers/bozohttpd/Manifest1
-rw-r--r--www-servers/bozohttpd/bozohttpd-20140708.ebuild35
-rw-r--r--www-servers/bozohttpd/files/bozohttpd.conffile11
-rw-r--r--www-servers/bozohttpd/files/bozohttpd.initscript38
-rw-r--r--www-servers/bozohttpd/metadata.xml11
-rw-r--r--www-servers/cherokee/Manifest3
-rw-r--r--www-servers/cherokee/cherokee-1.2.103-r2.ebuild194
-rw-r--r--www-servers/cherokee/cherokee-1.2.104.ebuild190
-rw-r--r--www-servers/cherokee/files/cherokee-1.2.103-linux3.patch36
-rw-r--r--www-servers/cherokee/files/cherokee-1.2.99-gentoo.patch38
-rw-r--r--www-servers/cherokee/files/cherokee-confd-1.2.984
-rw-r--r--www-servers/cherokee/files/cherokee-initd-1.2.9967
-rw-r--r--www-servers/cherokee/files/cherokee.logrotate-r111
-rw-r--r--www-servers/cherokee/files/cherokee.service10
-rw-r--r--www-servers/cherokee/metadata.xml15
-rw-r--r--www-servers/fnord/Manifest2
-rw-r--r--www-servers/fnord/files/fnord-1.10-gentoo.diff99
-rw-r--r--www-servers/fnord/files/fnord-1.9-gentoo.diff96
-rw-r--r--www-servers/fnord/fnord-1.10-r2.ebuild47
-rw-r--r--www-servers/fnord/fnord-1.11.ebuild47
-rw-r--r--www-servers/fnord/metadata.xml10
-rw-r--r--www-servers/gatling/Manifest2
-rw-r--r--www-servers/gatling/files/gatling-0.12-FLAGS.patch40
-rw-r--r--www-servers/gatling/files/gatling-0.12-compile.patch20
-rw-r--r--www-servers/gatling/files/gatling-0.13-compile.patch11
-rw-r--r--www-servers/gatling/files/gatling.confd49
-rw-r--r--www-servers/gatling/files/gatling.initd64
-rw-r--r--www-servers/gatling/files/gatling.initd-263
-rw-r--r--www-servers/gatling/gatling-0.12-r2.ebuild61
-rw-r--r--www-servers/gatling/gatling-0.13.ebuild61
-rw-r--r--www-servers/gatling/metadata.xml19
-rw-r--r--www-servers/gunicorn/Manifest3
-rw-r--r--www-servers/gunicorn/files/gunicorn-0.14.0-noegg.patch64
-rw-r--r--www-servers/gunicorn/files/gunicorn-19.0.0-gaiohttp.patch59
-rw-r--r--www-servers/gunicorn/gunicorn-0.17.4.ebuild47
-rw-r--r--www-servers/gunicorn/gunicorn-19.0.0.ebuild54
-rw-r--r--www-servers/gunicorn/gunicorn-19.1.1.ebuild52
-rw-r--r--www-servers/gunicorn/metadata.xml20
-rw-r--r--www-servers/hiawatha/Manifest1
-rw-r--r--www-servers/hiawatha/files/hiawatha-9.5-cflags.patch17
-rw-r--r--www-servers/hiawatha/files/hiawatha.initd26
-rw-r--r--www-servers/hiawatha/files/hiawatha.service9
-rw-r--r--www-servers/hiawatha/hiawatha-9.8.ebuild90
-rw-r--r--www-servers/hiawatha/metadata.xml18
-rw-r--r--www-servers/lighttpd/Manifest1
-rw-r--r--www-servers/lighttpd/files/conf/lighttpd.conf330
-rw-r--r--www-servers/lighttpd/files/conf/mime-types.conf79
-rw-r--r--www-servers/lighttpd/files/conf/mod_cgi.conf33
-rw-r--r--www-servers/lighttpd/files/conf/mod_fastcgi.conf17
-rw-r--r--www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r217
-rw-r--r--www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch738
-rw-r--r--www-servers/lighttpd/files/lighttpd-1.4.31-automake-1.12.patch21
-rw-r--r--www-servers/lighttpd/files/lighttpd-1.4.33-fix-ipv6-build.patch21
-rw-r--r--www-servers/lighttpd/files/lighttpd.confd12
-rw-r--r--www-servers/lighttpd/files/lighttpd.initd73
-rw-r--r--www-servers/lighttpd/files/lighttpd.logrotate17
-rw-r--r--www-servers/lighttpd/files/lighttpd.logrotate-r116
-rw-r--r--www-servers/lighttpd/files/lighttpd.service10
-rw-r--r--www-servers/lighttpd/files/lighttpd.tmpfiles.conf1
-rw-r--r--www-servers/lighttpd/lighttpd-1.4.35-r1.ebuild227
-rw-r--r--www-servers/lighttpd/lighttpd-1.4.35-r2.ebuild227
-rw-r--r--www-servers/lighttpd/lighttpd-1.4.35.ebuild227
-rw-r--r--www-servers/lighttpd/metadata.xml30
-rw-r--r--www-servers/metadata.xml32
-rw-r--r--www-servers/mongoose/Manifest1
-rw-r--r--www-servers/mongoose/metadata.xml10
-rw-r--r--www-servers/mongoose/mongoose-5.3.ebuild47
-rw-r--r--www-servers/monkeyd/Manifest3
-rw-r--r--www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch17
-rw-r--r--www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch157
-rw-r--r--www-servers/monkeyd/files/monkeyd.confd6
-rw-r--r--www-servers/monkeyd/files/monkeyd.initd26
-rw-r--r--www-servers/monkeyd/metadata.xml13
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.3.ebuild144
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.5.ebuild144
-rw-r--r--www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild147
-rw-r--r--www-servers/nginx/Manifest38
-rw-r--r--www-servers/nginx/files/AJP-nginx-1.7.9+.patch184
-rw-r--r--www-servers/nginx/files/check-1.9.2.patch242
-rw-r--r--www-servers/nginx/files/check_1.7.2+.patch201
-rw-r--r--www-servers/nginx/files/lua-nginx-1.7.6.patch39
-rw-r--r--www-servers/nginx/files/nginx-1.4.1-fix-perl-install-path.patch13
-rw-r--r--www-servers/nginx/files/nginx.conf72
-rw-r--r--www-servers/nginx/files/nginx.initd-r289
-rw-r--r--www-servers/nginx/files/nginx.logrotate-r112
-rw-r--r--www-servers/nginx/files/nginx.service-r114
-rw-r--r--www-servers/nginx/files/rtmp-nginx-1.7.6.patch89
-rw-r--r--www-servers/nginx/metadata.xml28
-rw-r--r--www-servers/nginx/nginx-1.7.12.ebuild683
-rw-r--r--www-servers/nginx/nginx-1.7.6.ebuild681
-rw-r--r--www-servers/nginx/nginx-1.8.0.ebuild667
-rw-r--r--www-servers/nginx/nginx-1.9.2.ebuild686
-rw-r--r--www-servers/nginx/nginx-1.9.3.ebuild686
-rw-r--r--www-servers/ocsigenserver/Manifest2
-rw-r--r--www-servers/ocsigenserver/files/lwt.patch19
-rw-r--r--www-servers/ocsigenserver/files/lwt2.patch19
-rw-r--r--www-servers/ocsigenserver/files/lwt3.patch86
-rw-r--r--www-servers/ocsigenserver/files/ocsigenserver.confd25
-rw-r--r--www-servers/ocsigenserver/files/ocsigenserver.initd59
-rw-r--r--www-servers/ocsigenserver/metadata.xml8
-rw-r--r--www-servers/ocsigenserver/ocsigenserver-2.5-r2.ebuild91
-rw-r--r--www-servers/ocsigenserver/ocsigenserver-2.6.ebuild85
-rw-r--r--www-servers/pathod/Manifest3
-rw-r--r--www-servers/pathod/metadata.xml11
-rw-r--r--www-servers/pathod/pathod-0.10.ebuild27
-rw-r--r--www-servers/pathod/pathod-0.11.1.ebuild37
-rw-r--r--www-servers/pathod/pathod-0.12.0.ebuild35
-rw-r--r--www-servers/pound/Manifest3
-rw-r--r--www-servers/pound/files/pound-2.2.cfg54
-rw-r--r--www-servers/pound/files/pound-2.5-openssl-1.patch289
-rw-r--r--www-servers/pound/files/pound.init-1.923
-rw-r--r--www-servers/pound/metadata.xml18
-rw-r--r--www-servers/pound/pound-2.6.ebuild56
-rw-r--r--www-servers/pound/pound-2.7d.ebuild51
-rw-r--r--www-servers/pound/pound-2.7f.ebuild51
-rw-r--r--www-servers/pshs/Manifest6
-rw-r--r--www-servers/pshs/metadata.xml23
-rw-r--r--www-servers/pshs/pshs-0.2.1.ebuild34
-rw-r--r--www-servers/pshs/pshs-0.2.3.ebuild36
-rw-r--r--www-servers/pshs/pshs-0.2.4.ebuild36
-rw-r--r--www-servers/pshs/pshs-0.2.5.ebuild39
-rw-r--r--www-servers/pshs/pshs-0.2.6.ebuild39
-rw-r--r--www-servers/pshs/pshs-0.2.ebuild33
-rw-r--r--www-servers/pshs/pshs-9999.ebuild51
-rw-r--r--www-servers/resin/Manifest6
-rw-r--r--www-servers/resin/files/4.0.13/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.13/resin.init37
-rw-r--r--www-servers/resin/files/4.0.14/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.14/resin.init37
-rw-r--r--www-servers/resin/files/4.0.15/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.15/resin.init37
-rw-r--r--www-servers/resin/files/4.0.22/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.22/resin.init37
-rw-r--r--www-servers/resin/files/4.0.25/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.25/resin.init37
-rw-r--r--www-servers/resin/files/4.0.26/resin.conf16
-rw-r--r--www-servers/resin/files/4.0.26/resin.init37
-rw-r--r--www-servers/resin/metadata.xml8
-rw-r--r--www-servers/resin/resin-4.0.22.ebuild186
-rw-r--r--www-servers/resin/resin-4.0.25.ebuild186
-rw-r--r--www-servers/resin/resin-4.0.26.ebuild182
-rw-r--r--www-servers/servefile/Manifest2
-rw-r--r--www-servers/servefile/metadata.xml8
-rw-r--r--www-servers/servefile/servefile-0.4.2.ebuild32
-rw-r--r--www-servers/servefile/servefile-0.4.3.ebuild32
-rw-r--r--www-servers/skunkweb/Manifest1
-rw-r--r--www-servers/skunkweb/files/100_mod_skunkweb.conf50
-rwxr-xr-xwww-servers/skunkweb/files/skunkweb-cron-cache_cleaner4
-rwxr-xr-xwww-servers/skunkweb/files/skunkweb-init21
-rw-r--r--www-servers/skunkweb/metadata.xml14
-rw-r--r--www-servers/skunkweb/skunkweb-3.4.4.ebuild80
-rw-r--r--www-servers/spawn-fcgi/Manifest2
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.confd74
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1117
-rw-r--r--www-servers/spawn-fcgi/files/spawn-fcgi.initd-r2117
-rw-r--r--www-servers/spawn-fcgi/metadata.xml17
-rw-r--r--www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild33
-rw-r--r--www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r2.ebuild33
-rw-r--r--www-servers/spawn-fcgi/spawn-fcgi-1.6.4.ebuild33
-rw-r--r--www-servers/thin/Manifest1
-rw-r--r--www-servers/thin/files/thin.confd20
-rw-r--r--www-servers/thin/files/thin.confd-132
-rw-r--r--www-servers/thin/files/thin.confd-239
-rw-r--r--www-servers/thin/files/thin.initd63
-rw-r--r--www-servers/thin/files/thin.initd-170
-rw-r--r--www-servers/thin/files/thin.initd-283
-rw-r--r--www-servers/thin/files/thin.initd-388
-rw-r--r--www-servers/thin/metadata.xml13
-rw-r--r--www-servers/thin/thin-1.6.3-r1.ebuild84
-rw-r--r--www-servers/thin/thin-1.6.3.ebuild84
-rw-r--r--www-servers/thttpd/Manifest2
-rw-r--r--www-servers/thttpd/files/thttpd-fix-world-readable-log.patch59
-rw-r--r--www-servers/thttpd/files/thttpd-renamed-htpasswd.patch108
-rw-r--r--www-servers/thttpd/files/thttpd.conf.sample38
-rw-r--r--www-servers/thttpd/files/thttpd.confd.135
-rw-r--r--www-servers/thttpd/files/thttpd.init.134
-rw-r--r--www-servers/thttpd/files/thttpd.logrotate12
-rw-r--r--www-servers/thttpd/files/thttpd.service12
-rw-r--r--www-servers/thttpd/metadata.xml8
-rw-r--r--www-servers/thttpd/thttpd-2.26.4-r3.ebuild74
-rw-r--r--www-servers/thttpd/thttpd-2.27.0.ebuild81
-rw-r--r--www-servers/thttpd/thttpd-9999.ebuild81
-rw-r--r--www-servers/tomcat/Manifest3
-rw-r--r--www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch31
-rw-r--r--www-servers/tomcat/files/tomcat-7.0.59-build.xml.patch107
-rw-r--r--www-servers/tomcat/files/tomcat-8.0.22-build.xml.patch230
-rw-r--r--www-servers/tomcat/files/tomcat-8.0.23-build.xml.patch230
-rw-r--r--www-servers/tomcat/files/tomcat-instance-manager-r1.bash240
-rw-r--r--www-servers/tomcat/files/tomcat-instance-manager.bash240
-rw-r--r--www-servers/tomcat/files/tomcat.conf49
-rw-r--r--www-servers/tomcat/files/tomcat.init105
-rw-r--r--www-servers/tomcat/metadata.xml15
-rw-r--r--www-servers/tomcat/tomcat-6.0.44-r0.ebuild144
-rw-r--r--www-servers/tomcat/tomcat-7.0.59-r2.ebuild147
-rw-r--r--www-servers/tomcat/tomcat-8.0.23-r2.ebuild145
-rw-r--r--www-servers/tornado/Manifest7
-rw-r--r--www-servers/tornado/files/4.1.0-drop-intersphinx.patch36
-rw-r--r--www-servers/tornado/files/drop-intersphinx.patch36
-rw-r--r--www-servers/tornado/files/tornado-3.1.1-py2_6-tests-fix.patch31
-rw-r--r--www-servers/tornado/files/unittest2-import-issue-1005.patch41
-rw-r--r--www-servers/tornado/metadata.xml12
-rw-r--r--www-servers/tornado/tornado-3.1.1-r1.ebuild48
-rw-r--r--www-servers/tornado/tornado-3.1.1.ebuild38
-rw-r--r--www-servers/tornado/tornado-4.0.1.ebuild32
-rw-r--r--www-servers/tornado/tornado-4.0.2.ebuild32
-rw-r--r--www-servers/tornado/tornado-4.1.0-r1.ebuild63
-rw-r--r--www-servers/tornado/tornado-4.1.0.ebuild61
-rw-r--r--www-servers/tornado/tornado-4.2.0_beta1.ebuild67
-rw-r--r--www-servers/tornado/tornado-4.2.1.ebuild65
-rw-r--r--www-servers/tornado/tornado-4.2.ebuild67
-rw-r--r--www-servers/uwsgi/Manifest2
-rw-r--r--www-servers/uwsgi/files/1.1.2-threaded-php.patch40
-rw-r--r--www-servers/uwsgi/files/1.2.3-pyerl.patch31
-rw-r--r--www-servers/uwsgi/files/42_mod_uwsgi-r1.conf9
-rw-r--r--www-servers/uwsgi/files/42_mod_uwsgi-r2.conf9
-rw-r--r--www-servers/uwsgi/files/42_mod_uwsgi.conf7
-rw-r--r--www-servers/uwsgi/files/gentoo.buildconf30
-rw-r--r--www-servers/uwsgi/files/uwsgi.confd-r153
-rw-r--r--www-servers/uwsgi/files/uwsgi.confd-r363
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r1138
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r2142
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r3144
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r4144
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r5144
-rw-r--r--www-servers/uwsgi/files/uwsgi.initd-r6144
-rw-r--r--www-servers/uwsgi/metadata.xml22
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.11.1.ebuild376
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.9.ebuild376
-rw-r--r--www-servers/varnish/Manifest7
-rw-r--r--www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch35
-rw-r--r--www-servers/varnish/files/varnish-3.0.4-automagic.patch94
-rw-r--r--www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch12
-rw-r--r--www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch9
-rw-r--r--www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch12
-rw-r--r--www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch14
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch14
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch19
-rw-r--r--www-servers/varnish/files/varnish-4.0.1-fix-warning.patch12
-rw-r--r--www-servers/varnish/files/varnishd.confd-r122
-rw-r--r--www-servers/varnish/files/varnishd.confd-r226
-rw-r--r--www-servers/varnish/files/varnishd.confd-r322
-rwxr-xr-xwww-servers/varnish/files/varnishd.initd-r187
-rwxr-xr-xwww-servers/varnish/files/varnishd.initd-r294
-rw-r--r--www-servers/varnish/files/varnishd.initd-r378
-rw-r--r--www-servers/varnish/files/varnishd.logrotate9
-rw-r--r--www-servers/varnish/files/varnishd.logrotate-r231
-rw-r--r--www-servers/varnish/files/varnishd.service16
-rw-r--r--www-servers/varnish/files/varnishlog.confd3
-rw-r--r--www-servers/varnish/files/varnishlog.initd32
-rw-r--r--www-servers/varnish/files/varnishncsa.confd3
-rw-r--r--www-servers/varnish/files/varnishncsa.initd32
-rw-r--r--www-servers/varnish/files/varnishncsa.initd-r145
-rw-r--r--www-servers/varnish/metadata.xml31
-rw-r--r--www-servers/varnish/varnish-3.0.5-r3.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.5-r4.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.5.ebuild83
-rw-r--r--www-servers/varnish/varnish-3.0.6.ebuild100
-rw-r--r--www-servers/varnish/varnish-3.0.7.ebuild100
-rw-r--r--www-servers/varnish/varnish-4.0.0-r1.ebuild108
-rw-r--r--www-servers/varnish/varnish-4.0.1-r1.ebuild111
-rw-r--r--www-servers/varnish/varnish-4.0.2.ebuild111
-rw-r--r--www-servers/varnish/varnish-4.0.3.ebuild105
-rw-r--r--www-servers/webfs/Manifest1
-rw-r--r--www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch15
-rw-r--r--www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch12
-rw-r--r--www-servers/webfs/files/webfs.confd27
-rw-r--r--www-servers/webfs/files/webfs.initd-r130
-rw-r--r--www-servers/webfs/metadata.xml7
-rw-r--r--www-servers/webfs/webfs-1.21-r3.ebuild49
298 files changed, 21583 insertions, 0 deletions
diff --git a/www-servers/apache/Manifest b/www-servers/apache/Manifest
new file mode 100644
index 000000000000..ffc86fc2a702
--- /dev/null
+++ b/www-servers/apache/Manifest
@@ -0,0 +1,6 @@
+DIST gentoo-apache-2.2.29-20140922.tar.bz2 64135 SHA256 8c69c36c2f40fb81ee905b4dd72ab74aab4563c75149d302f372a451498e2678 SHA512 1d9aa12aa3ab79b5f80ee3fda020b33ff6798e5b1abbcbc138acea06a1ab9968ad240d2bdf9c5dbb9640fa9fb6718eec7175df7cc0fb8574cc4d7d5cdfb5bcc4 WHIRLPOOL f655300f0dcd2f4503cbdb25983fed902e4b717ff57e06f66486bebd0ed7cb8df56387be74b4259bfffad949bb446c5ec28f89065b6d5239585324b610be7b88
+DIST gentoo-apache-2.4.10-r1-20140731.tar.bz2 24531 SHA256 8e093a18582c3a20283ed1c09de9acc6832a80b1d5a02962599db0535d38af19 SHA512 c54239df36d7ab30bd14a41241d94b4b49b92c5e50e64857da3e7cde7575d5c0a634d51710bdf75807a57932bf9447906407ae4ef6cb333d7197e82ba5052cd9 WHIRLPOOL 0d184763a033209eaa3c91f7050b24c2a2da24d930ed280a8aa99e32461ac31402e6fd8f57e2122a96e45a8308c4a332144ede7b511ceee352be2f38a6ef7839
+DIST httpd-2.2.29.tar.bz2 5625498 SHA256 574b4f994b99178dfd5160bcb14025402e2ce381be9889b83e4be0ffbf5839a4 SHA512 0b953c97d79dfaaedaee72c6260e7a8e2e1711d47b19f9ace961b33f1226eeb58e37e04694a3e1207e0cf151a9ffbebf379d2bb81306bbf5111ec6db621a68b8 WHIRLPOOL d161104824c5bd6a42675489facf528a8ac2e727a8d2a295111b182e73bb17e7e8a52b720e74a37371e8bd3ddf5745afea32b32171831d95870daa440e7ac2a7
+DIST httpd-2.2.31.tar.bz2 5610489 SHA256 f32f9d19f535dac63b06cb55dfc023b40dcd28196b785f79f9346779e22f26ac SHA512 5aa47d4b76f692bbd8b309135ff99152df98cf69b505b9daf3f13f7f2a31443eaf4995161adfbc47a133b4d0e091fda2d95fc6b87a956f0ada18d7466ee28e74 WHIRLPOOL a2e3e53c51719cb6f7e641b41788cd89ce7b4d2ea105b403bfa3b3d4479b69c5604228269062f66722594e105e91121d05b1c9f27ca7dc4ecfcf339da8b8375c
+DIST httpd-2.4.12.tar.bz2 5054838 SHA256 ad6d39edfe4621d8cc9a2791f6f8d6876943a9da41ac8533d77407a2e630eae4 SHA512 f69db14b421f0e1e4861fe4d8b652688d50ca9eb41c622242d11ae55687eb6c2142a8505a8c3fb6f2bd53167be535bc0a77ca1af97e0720930fc7f20f4c1f8e8 WHIRLPOOL 56512066e8978c4a3d47d0cc2bb92093fd468a9b2f46b8b07fe4db366f55fa5e74ae58bbebe2377cbe0c66f1585759115c786f62f18ac1abc534fb257689d250
+DIST httpd-2.4.16.tar.bz2 5101005 SHA256 ac660b47aaa7887779a6430404dcb40c0b04f90ea69e7bd49a40552e9ff13743 SHA512 039750ff962c08a7261896acc8272e59874d066f7d52721aaf967ddb737fc5716acc47e1effaf7c4d156ba61bc393e0738f64f8e89cc277ba2651e0f61d56628 WHIRLPOOL f67a4449409cd1a50fcdf4d192a3a0c90e6e3483269d19e9f0454557cbfbda7fb3535063e1738de60d6f524e22eac7fc159d2abe5a60952219c1b01ee143ae05
diff --git a/www-servers/apache/apache-2.2.29.ebuild b/www-servers/apache/apache-2.2.29.ebuild
new file mode 100644
index 000000000000..414698f3de2f
--- /dev/null
+++ b/www-servers/apache/apache-2.2.29.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# latest gentoo apache files
+GENTOO_PATCHSTAMP="20140922"
+GENTOO_DEVELOPER="polynomial-c"
+GENTOO_PATCHNAME="gentoo-apache-2.2.29"
+
+# IUSE/USE_EXPAND magic
+IUSE_MPMS_FORK="itk peruser prefork"
+IUSE_MPMS_THREAD="event worker"
+
+IUSE_MODULES="actions alias asis auth_basic auth_digest authn_alias authn_anon
+authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default
+authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta
+charset_lite cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache dumpio
+env expires ext_filter file_cache filter headers ident imagemap include info
+log_config log_forensic logio mem_cache mime mime_magic negotiation proxy
+proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi rewrite
+reqtimeout setenvif speling status substitute unique_id userdir usertrack
+version vhost_alias"
+# The following are also in the source as of this version, but are not available
+# for user selection:
+# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
+# optional_fn_import optional_hook_export optional_hook_import
+
+# inter-module dependencies
+# TODO: this may still be incomplete
+MODULE_DEPENDS="
+ dav_fs:dav
+ dav_lock:dav
+ deflate:filter
+ disk_cache:cache
+ ext_filter:filter
+ file_cache:cache
+ log_forensic:log_config
+ logio:log_config
+ mem_cache:cache
+ mime_magic:mime
+ proxy_ajp:proxy
+ proxy_balancer:proxy
+ proxy_connect:proxy
+ proxy_ftp:proxy
+ proxy_http:proxy
+ proxy_scgi:proxy
+ substitute:filter
+"
+
+# module<->define mappings
+MODULE_DEFINES="
+ auth_digest:AUTH_DIGEST
+ authnz_ldap:AUTHNZ_LDAP
+ cache:CACHE
+ dav:DAV
+ dav_fs:DAV
+ dav_lock:DAV
+ disk_cache:CACHE
+ file_cache:CACHE
+ info:INFO
+ ldap:LDAP
+ mem_cache:CACHE
+ proxy:PROXY
+ proxy_ajp:PROXY
+ proxy_balancer:PROXY
+ proxy_connect:PROXY
+ proxy_ftp:PROXY
+ proxy_http:PROXY
+ ssl:SSL
+ status:STATUS
+ suexec:SUEXEC
+ userdir:USERDIR
+"
+
+# critical modules for the default config
+MODULE_CRITICAL="
+ authz_host
+ dir
+ mime
+"
+
+inherit apache-2 systemd toolchain-funcs
+
+DESCRIPTION="The Apache Web Server"
+HOMEPAGE="http://httpd.apache.org/"
+
+# some helper scripts are Apache-1.1, thus both are here
+LICENSE="Apache-2.0 Apache-1.1"
+SLOT="2"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+src_configure() {
+ # Brain dead check.
+ tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
+
+ apache-2_src_configure
+}
+
+src_install() {
+ apache-2_src_install
+
+ # install apxs in /usr/bin (bug #502384) and put a symlink into the
+ # old location until all ebuilds and eclasses have been modified to
+ # use the new location.
+ local apxs_dir="/usr/bin"
+ dodir ${apxs_dir}
+ mv "${D}"/usr/sbin/apxs "${D}"${apxs_dir} || die
+ ln -s ../bin/apxs "${D}"/usr/sbin/apxs || die
+
+ systemd_newunit "${FILESDIR}/apache2.2.service" "apache2.service"
+ systemd_dotmpfilesd "${FILESDIR}/apache.conf"
+}
diff --git a/www-servers/apache/apache-2.2.31.ebuild b/www-servers/apache/apache-2.2.31.ebuild
new file mode 100644
index 000000000000..5aa2b070a985
--- /dev/null
+++ b/www-servers/apache/apache-2.2.31.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# latest gentoo apache files
+GENTOO_PATCHSTAMP="20140922"
+GENTOO_DEVELOPER="polynomial-c"
+GENTOO_PATCHNAME="gentoo-apache-2.2.29"
+
+# IUSE/USE_EXPAND magic
+IUSE_MPMS_FORK="itk peruser prefork"
+IUSE_MPMS_THREAD="event worker"
+
+IUSE_MODULES="actions alias asis auth_basic auth_digest authn_alias authn_anon
+authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default
+authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta
+charset_lite cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache dumpio
+env expires ext_filter file_cache filter headers ident imagemap include info
+log_config log_forensic logio mem_cache mime mime_magic negotiation proxy
+proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi rewrite
+reqtimeout setenvif speling status substitute unique_id userdir usertrack
+version vhost_alias"
+# The following are also in the source as of this version, but are not available
+# for user selection:
+# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
+# optional_fn_import optional_hook_export optional_hook_import
+
+# inter-module dependencies
+# TODO: this may still be incomplete
+MODULE_DEPENDS="
+ dav_fs:dav
+ dav_lock:dav
+ deflate:filter
+ disk_cache:cache
+ ext_filter:filter
+ file_cache:cache
+ log_forensic:log_config
+ logio:log_config
+ mem_cache:cache
+ mime_magic:mime
+ proxy_ajp:proxy
+ proxy_balancer:proxy
+ proxy_connect:proxy
+ proxy_ftp:proxy
+ proxy_http:proxy
+ proxy_scgi:proxy
+ substitute:filter
+"
+
+# module<->define mappings
+MODULE_DEFINES="
+ auth_digest:AUTH_DIGEST
+ authnz_ldap:AUTHNZ_LDAP
+ cache:CACHE
+ dav:DAV
+ dav_fs:DAV
+ dav_lock:DAV
+ disk_cache:CACHE
+ file_cache:CACHE
+ info:INFO
+ ldap:LDAP
+ mem_cache:CACHE
+ proxy:PROXY
+ proxy_ajp:PROXY
+ proxy_balancer:PROXY
+ proxy_connect:PROXY
+ proxy_ftp:PROXY
+ proxy_http:PROXY
+ ssl:SSL
+ status:STATUS
+ suexec:SUEXEC
+ userdir:USERDIR
+"
+
+# critical modules for the default config
+MODULE_CRITICAL="
+ authz_host
+ dir
+ mime
+"
+
+inherit apache-2 systemd toolchain-funcs
+
+DESCRIPTION="The Apache Web Server"
+HOMEPAGE="http://httpd.apache.org/"
+
+# some helper scripts are Apache-1.1, thus both are here
+LICENSE="Apache-2.0 Apache-1.1"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+src_configure() {
+ # Brain dead check.
+ tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
+
+ apache-2_src_configure
+}
+
+src_install() {
+ apache-2_src_install
+
+ # install apxs in /usr/bin (bug #502384) and put a symlink into the
+ # old location until all ebuilds and eclasses have been modified to
+ # use the new location.
+ local apxs_dir="/usr/bin"
+ dodir ${apxs_dir}
+ mv "${D}"/usr/sbin/apxs "${D}"${apxs_dir} || die
+ ln -s ../bin/apxs "${D}"/usr/sbin/apxs || die
+
+ systemd_newunit "${FILESDIR}/apache2.2.service" "apache2.service"
+ systemd_dotmpfilesd "${FILESDIR}/apache.conf"
+}
diff --git a/www-servers/apache/apache-2.4.12-r1.ebuild b/www-servers/apache/apache-2.4.12-r1.ebuild
new file mode 100644
index 000000000000..8307f4827555
--- /dev/null
+++ b/www-servers/apache/apache-2.4.12-r1.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# latest gentoo apache files
+GENTOO_PATCHSTAMP="20140731"
+GENTOO_DEVELOPER="polynomial-c"
+GENTOO_PATCHNAME="gentoo-apache-2.4.10-r1"
+
+# IUSE/USE_EXPAND magic
+IUSE_MPMS_FORK="peruser prefork"
+IUSE_MPMS_THREAD="event worker"
+
+# << obsolete modules:
+# authn_default authz_default mem_cache
+# mem_cache is replaced by cache_disk
+# ?? buggy modules
+# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
+# >> added modules for reason:
+# compat: compatibility with 2.2 access control
+# authz_host: new module for access control
+# authn_core: functionality provided by authn_alias in previous versions
+# authz_core: new module, provides core authorization capabilities
+# cache_disk: replacement for mem_cache
+# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
+# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
+# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
+# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
+# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
+# socache_shmcb: shared object cache provider. Default config with ssl needs it
+# unixd: fixes startup error: Invalid command 'User'
+IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest
+authn_alias authn_anon authn_core authn_dbd authn_dbm authn_file authz_core
+authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
+cache cache_disk cern_meta charset_lite cgi cgid dav dav_fs dav_lock dbd deflate
+dir dumpio env expires ext_filter file_cache filter headers ident imagemap
+include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
+lbmethod_heartbeat log_config log_forensic logio macro mime mime_magic negotiation
+proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi
+proxy_fcgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout setenvif
+slotmem_shm speling socache_shmcb status substitute unique_id userdir usertrack
+unixd version vhost_alias"
+# The following are also in the source as of this version, but are not available
+# for user selection:
+# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
+# optional_fn_import optional_hook_export optional_hook_import
+
+# inter-module dependencies
+# TODO: this may still be incomplete
+MODULE_DEPENDS="
+ dav_fs:dav
+ dav_lock:dav
+ deflate:filter
+ cache_disk:cache
+ ext_filter:filter
+ file_cache:cache
+ lbmethod_byrequests:proxy_balancer
+ lbmethod_byrequests:slotmem_shm
+ lbmethod_bytraffic:proxy_balancer
+ lbmethod_bybusyness:proxy_balancer
+ lbmethod_heartbeat:proxy_balancer
+ log_forensic:log_config
+ logio:log_config
+ cache_disk:cache
+ mime_magic:mime
+ proxy_ajp:proxy
+ proxy_balancer:proxy
+ proxy_balancer:slotmem_shm
+ proxy_connect:proxy
+ proxy_ftp:proxy
+ proxy_http:proxy
+ proxy_scgi:proxy
+ proxy_fcgi:proxy
+ proxy_wstunnel:proxy
+ substitute:filter
+"
+
+# module<->define mappings
+MODULE_DEFINES="
+ auth_digest:AUTH_DIGEST
+ authnz_ldap:AUTHNZ_LDAP
+ cache:CACHE
+ cache_disk:CACHE
+ dav:DAV
+ dav_fs:DAV
+ dav_lock:DAV
+ file_cache:CACHE
+ info:INFO
+ ldap:LDAP
+ proxy:PROXY
+ proxy_ajp:PROXY
+ proxy_balancer:PROXY
+ proxy_connect:PROXY
+ proxy_ftp:PROXY
+ proxy_http:PROXY
+ proxy_fcgi:PROXY
+ proxy_scgi:PROXY
+ proxy_wstunnel:PROXY
+ socache_shmcb:SSL
+ ssl:SSL
+ status:STATUS
+ suexec:SUEXEC
+ userdir:USERDIR
+"
+
+# critical modules for the default config
+MODULE_CRITICAL="
+ authn_core
+ authz_core
+ authz_host
+ dir
+ mime
+ unixd
+"
+inherit eutils apache-2 systemd toolchain-funcs
+
+DESCRIPTION="The Apache Web Server"
+HOMEPAGE="http://httpd.apache.org/"
+
+# some helper scripts are Apache-1.1, thus both are here
+LICENSE="Apache-2.0 Apache-1.1"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
+IUSE="alpn"
+REQUIRED_USE="alpn? ( ssl )"
+
+DEPEND+="alpn? ( >=dev-libs/openssl-1.0.2:0= )"
+RDEPEND+="alpn? ( >=dev-libs/openssl-1.0.2:0= )"
+
+pkg_setup() {
+ # dependend critical modules which are not allowed in global scope due
+ # to USE flag conditionals (bug #499260)
+ use ssl && MODULE_CRITICAL+=" socache_shmcb"
+ use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
+ apache-2_pkg_setup
+}
+
+src_prepare() {
+ use alpn && epatch "${FILESDIR}"/${PN}-2.4.12-alpn.patch #471512
+ apache-2_src_prepare
+}
+
+src_configure() {
+ # Brain dead check.
+ tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
+
+ apache-2_src_configure
+}
+
+src_compile() {
+ if tc-is-cross-compiler; then
+ # This header is the same across targets, so use the build compiler.
+ pushd server >/dev/null
+ emake gen_test_char
+ tc-export_build_env BUILD_CC
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
+ gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
+ popd >/dev/null
+ fi
+
+ default
+}
+
+src_install() {
+ apache-2_src_install
+ for i in /usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/share/man/man8/{rotatelogs.8,htcacheclean.8}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}; do
+ rm "${ED}/"$i || die "Failed to prune apache-tools bits"
+ done
+
+ # install apxs in /usr/bin (bug #502384) and put a symlink into the
+ # old location until all ebuilds and eclasses have been modified to
+ # use the new location.
+ local apxs="/usr/bin/apxs"
+ cp "${S}"/support/apxs "${ED}"${apxs} || die "Failed to install apxs"
+ ln -s ../bin/apxs "${ED}"/usr/sbin/apxs || die
+ chmod 0755 "${ED}"${apxs} || die
+
+ # Note: wait for mod_systemd to be included in the next release,
+ # then apache2.4.service can be used and systemd support controlled
+ # through --enable-systemd
+ systemd_newunit "${FILESDIR}/apache2.2.service" "apache2.service"
+ systemd_dotmpfilesd "${FILESDIR}/apache.conf"
+ #insinto /etc/apache2/modules.d
+ #doins "${FILESDIR}/00_systemd.conf"
+}
+
+pkg_postinst()
+{
+ apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
+ # warnings that default config might not work out of the box
+ for mod in $MODULE_CRITICAL; do
+ if ! use "apache2_modules_${mod}"; then
+ echo
+ ewarn "Warning: Critical module not installed!"
+ ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
+ ewarn "are highly recomended but might not be in the base profile yet."
+ ewarn "Default config for ssl needs module 'socache_shmcb'."
+ ewarn "Enabling the following flags is highly recommended:"
+ for cmod in $MODULE_CRITICAL; do
+ use "apache2_modules_${cmod}" || \
+ ewarn "+ apache2_modules_${cmod}"
+ done
+ echo
+ break
+ fi
+ done
+ # warning for proxy_balancer and missing load balancing scheduler
+ if use apache2_modules_proxy_balancer; then
+ local lbset=
+ for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
+ if use "apache2_modules_${mod}"; then
+ lbset=1 && break
+ fi
+ done
+ if [ ! $lbset ]; then
+ echo
+ ewarn "Info: Missing load balancing scheduler algorithm module"
+ ewarn "(They were split off from proxy_balancer in 2.3)"
+ ewarn "In order to get the ability of load balancing, at least"
+ ewarn "one of these modules has to be present:"
+ ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
+ echo
+ fi
+ fi
+}
diff --git a/www-servers/apache/apache-2.4.16.ebuild b/www-servers/apache/apache-2.4.16.ebuild
new file mode 100644
index 000000000000..8307f4827555
--- /dev/null
+++ b/www-servers/apache/apache-2.4.16.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# latest gentoo apache files
+GENTOO_PATCHSTAMP="20140731"
+GENTOO_DEVELOPER="polynomial-c"
+GENTOO_PATCHNAME="gentoo-apache-2.4.10-r1"
+
+# IUSE/USE_EXPAND magic
+IUSE_MPMS_FORK="peruser prefork"
+IUSE_MPMS_THREAD="event worker"
+
+# << obsolete modules:
+# authn_default authz_default mem_cache
+# mem_cache is replaced by cache_disk
+# ?? buggy modules
+# proxy_scgi: startup error: undefined symbol "ap_proxy_release_connection", no fix found
+# >> added modules for reason:
+# compat: compatibility with 2.2 access control
+# authz_host: new module for access control
+# authn_core: functionality provided by authn_alias in previous versions
+# authz_core: new module, provides core authorization capabilities
+# cache_disk: replacement for mem_cache
+# lbmethod_byrequests: Split off from mod_proxy_balancer in 2.3
+# lbmethod_bytraffic: Split off from mod_proxy_balancer in 2.3
+# lbmethod_bybusyness: Split off from mod_proxy_balancer in 2.3
+# lbmethod_heartbeat: Split off from mod_proxy_balancer in 2.3
+# slotmem_shm: Slot-based shared memory provider (for lbmethod_byrequests).
+# socache_shmcb: shared object cache provider. Default config with ssl needs it
+# unixd: fixes startup error: Invalid command 'User'
+IUSE_MODULES="access_compat actions alias asis auth_basic auth_digest
+authn_alias authn_anon authn_core authn_dbd authn_dbm authn_file authz_core
+authz_dbd authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex
+cache cache_disk cern_meta charset_lite cgi cgid dav dav_fs dav_lock dbd deflate
+dir dumpio env expires ext_filter file_cache filter headers ident imagemap
+include info lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness
+lbmethod_heartbeat log_config log_forensic logio macro mime mime_magic negotiation
+proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy_scgi
+proxy_fcgi proxy_wstunnel rewrite ratelimit remoteip reqtimeout setenvif
+slotmem_shm speling socache_shmcb status substitute unique_id userdir usertrack
+unixd version vhost_alias"
+# The following are also in the source as of this version, but are not available
+# for user selection:
+# bucketeer case_filter case_filter_in echo http isapi optional_fn_export
+# optional_fn_import optional_hook_export optional_hook_import
+
+# inter-module dependencies
+# TODO: this may still be incomplete
+MODULE_DEPENDS="
+ dav_fs:dav
+ dav_lock:dav
+ deflate:filter
+ cache_disk:cache
+ ext_filter:filter
+ file_cache:cache
+ lbmethod_byrequests:proxy_balancer
+ lbmethod_byrequests:slotmem_shm
+ lbmethod_bytraffic:proxy_balancer
+ lbmethod_bybusyness:proxy_balancer
+ lbmethod_heartbeat:proxy_balancer
+ log_forensic:log_config
+ logio:log_config
+ cache_disk:cache
+ mime_magic:mime
+ proxy_ajp:proxy
+ proxy_balancer:proxy
+ proxy_balancer:slotmem_shm
+ proxy_connect:proxy
+ proxy_ftp:proxy
+ proxy_http:proxy
+ proxy_scgi:proxy
+ proxy_fcgi:proxy
+ proxy_wstunnel:proxy
+ substitute:filter
+"
+
+# module<->define mappings
+MODULE_DEFINES="
+ auth_digest:AUTH_DIGEST
+ authnz_ldap:AUTHNZ_LDAP
+ cache:CACHE
+ cache_disk:CACHE
+ dav:DAV
+ dav_fs:DAV
+ dav_lock:DAV
+ file_cache:CACHE
+ info:INFO
+ ldap:LDAP
+ proxy:PROXY
+ proxy_ajp:PROXY
+ proxy_balancer:PROXY
+ proxy_connect:PROXY
+ proxy_ftp:PROXY
+ proxy_http:PROXY
+ proxy_fcgi:PROXY
+ proxy_scgi:PROXY
+ proxy_wstunnel:PROXY
+ socache_shmcb:SSL
+ ssl:SSL
+ status:STATUS
+ suexec:SUEXEC
+ userdir:USERDIR
+"
+
+# critical modules for the default config
+MODULE_CRITICAL="
+ authn_core
+ authz_core
+ authz_host
+ dir
+ mime
+ unixd
+"
+inherit eutils apache-2 systemd toolchain-funcs
+
+DESCRIPTION="The Apache Web Server"
+HOMEPAGE="http://httpd.apache.org/"
+
+# some helper scripts are Apache-1.1, thus both are here
+LICENSE="Apache-2.0 Apache-1.1"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x64-macos ~x86-macos ~m68k-mint ~sparc64-solaris ~x64-solaris"
+IUSE="alpn"
+REQUIRED_USE="alpn? ( ssl )"
+
+DEPEND+="alpn? ( >=dev-libs/openssl-1.0.2:0= )"
+RDEPEND+="alpn? ( >=dev-libs/openssl-1.0.2:0= )"
+
+pkg_setup() {
+ # dependend critical modules which are not allowed in global scope due
+ # to USE flag conditionals (bug #499260)
+ use ssl && MODULE_CRITICAL+=" socache_shmcb"
+ use doc && MODULE_CRITICAL+=" alias negotiation setenvif"
+ apache-2_pkg_setup
+}
+
+src_prepare() {
+ use alpn && epatch "${FILESDIR}"/${PN}-2.4.12-alpn.patch #471512
+ apache-2_src_prepare
+}
+
+src_configure() {
+ # Brain dead check.
+ tc-is-cross-compiler && export ap_cv_void_ptr_lt_long="no"
+
+ apache-2_src_configure
+}
+
+src_compile() {
+ if tc-is-cross-compiler; then
+ # This header is the same across targets, so use the build compiler.
+ pushd server >/dev/null
+ emake gen_test_char
+ tc-export_build_env BUILD_CC
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
+ gen_test_char.c -o gen_test_char $(apr-1-config --includes) || die
+ popd >/dev/null
+ fi
+
+ default
+}
+
+src_install() {
+ apache-2_src_install
+ for i in /usr/bin/{htdigest,logresolve,htpasswd,htdbm,ab,httxt2dbm}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/share/man/man8/{rotatelogs.8,htcacheclean.8}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/share/man/man1/{logresolve.1,htdbm.1,htdigest.1,htpasswd.1,dbmmanage.1,ab.1}; do
+ rm "${ED}"/$i || die "Failed to prune apache-tools bits"
+ done
+ for i in /usr/sbin/{checkgid,fcgistarter,htcacheclean,rotatelogs}; do
+ rm "${ED}/"$i || die "Failed to prune apache-tools bits"
+ done
+
+ # install apxs in /usr/bin (bug #502384) and put a symlink into the
+ # old location until all ebuilds and eclasses have been modified to
+ # use the new location.
+ local apxs="/usr/bin/apxs"
+ cp "${S}"/support/apxs "${ED}"${apxs} || die "Failed to install apxs"
+ ln -s ../bin/apxs "${ED}"/usr/sbin/apxs || die
+ chmod 0755 "${ED}"${apxs} || die
+
+ # Note: wait for mod_systemd to be included in the next release,
+ # then apache2.4.service can be used and systemd support controlled
+ # through --enable-systemd
+ systemd_newunit "${FILESDIR}/apache2.2.service" "apache2.service"
+ systemd_dotmpfilesd "${FILESDIR}/apache.conf"
+ #insinto /etc/apache2/modules.d
+ #doins "${FILESDIR}/00_systemd.conf"
+}
+
+pkg_postinst()
+{
+ apache-2_pkg_postinst || die "apache-2_pkg_postinst failed"
+ # warnings that default config might not work out of the box
+ for mod in $MODULE_CRITICAL; do
+ if ! use "apache2_modules_${mod}"; then
+ echo
+ ewarn "Warning: Critical module not installed!"
+ ewarn "Modules 'authn_core', 'authz_core' and 'unixd'"
+ ewarn "are highly recomended but might not be in the base profile yet."
+ ewarn "Default config for ssl needs module 'socache_shmcb'."
+ ewarn "Enabling the following flags is highly recommended:"
+ for cmod in $MODULE_CRITICAL; do
+ use "apache2_modules_${cmod}" || \
+ ewarn "+ apache2_modules_${cmod}"
+ done
+ echo
+ break
+ fi
+ done
+ # warning for proxy_balancer and missing load balancing scheduler
+ if use apache2_modules_proxy_balancer; then
+ local lbset=
+ for mod in lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat; do
+ if use "apache2_modules_${mod}"; then
+ lbset=1 && break
+ fi
+ done
+ if [ ! $lbset ]; then
+ echo
+ ewarn "Info: Missing load balancing scheduler algorithm module"
+ ewarn "(They were split off from proxy_balancer in 2.3)"
+ ewarn "In order to get the ability of load balancing, at least"
+ ewarn "one of these modules has to be present:"
+ ewarn "lbmethod_byrequests lbmethod_bytraffic lbmethod_bybusyness lbmethod_heartbeat"
+ echo
+ fi
+ fi
+}
diff --git a/www-servers/apache/files/apache-2.4.12-alpn.patch b/www-servers/apache/files/apache-2.4.12-alpn.patch
new file mode 100644
index 000000000000..25bb6e1b5145
--- /dev/null
+++ b/www-servers/apache/files/apache-2.4.12-alpn.patch
@@ -0,0 +1,476 @@
+https://bugs.gentoo.org/471512
+
+upstream apache has merged alpn into trunk:
+https://issues.apache.org/bugzilla/show_bug.cgi?id=52210
+note: the bug is closed INVALID due to the npn discussion; go to the bottom to
+see alpn merged into it trunk. unfortunately, it wasn't merged into the 2.4
+branch.
+
+the mod_h2 project has backported it to the 2.4 branch:
+https://github.com/icing/mod_h2/tree/master/sandbox/httpd/patches
+commit 73e4d0e9c813b58581a32a6948780fa948094cc1
+
+--- modules/ssl/mod_ssl.c
++++ modules/ssl/mod_ssl.c
+@@ -273,6 +273,12 @@
+ "OpenSSL configuration command")
+ #endif
+
++#ifdef HAVE_TLS_ALPN
++ SSL_CMD_SRV(ALPNPreference, ITERATE,
++ "Preference in Application-Layer Protocol Negotiation (ALPN), "
++ "protocols are chosen in the specified order")
++#endif
++
+ /* Deprecated directives. */
+ AP_INIT_RAW_ARGS("SSLLog", ap_set_deprecated, NULL, OR_ALL,
+ "SSLLog directive is no longer supported - use ErrorLog."),
+@@ -423,12 +448,44 @@
+ return 1;
+ }
+
++static int modssl_register_alpn(conn_rec *c,
++ ssl_alpn_propose_protos advertisefn,
++ ssl_alpn_proto_negotiated negotiatedfn)
++{
++#ifdef HAVE_TLS_ALPN
++ SSLConnRec *sslconn = myConnConfig(c);
++
++ if (!sslconn) {
++ return DECLINED;
++ }
++
++ if (!sslconn->alpn_proposefns) {
++ sslconn->alpn_proposefns =
++ apr_array_make(c->pool, 5, sizeof(ssl_alpn_propose_protos));
++ sslconn->alpn_negofns =
++ apr_array_make(c->pool, 5, sizeof(ssl_alpn_proto_negotiated));
++ }
++
++ if (advertisefn)
++ APR_ARRAY_PUSH(sslconn->alpn_proposefns, ssl_alpn_propose_protos) =
++ advertisefn;
++ if (negotiatedfn)
++ APR_ARRAY_PUSH(sslconn->alpn_negofns, ssl_alpn_proto_negotiated) =
++ negotiatedfn;
++
++ return OK;
++#else
++ return DECLINED;
++#endif
++}
++
+ int ssl_init_ssl_connection(conn_rec *c, request_rec *r)
+ {
+ SSLSrvConfigRec *sc;
+ SSL *ssl;
+ SSLConnRec *sslconn = myConnConfig(c);
+ char *vhost_md5;
++ int rc;
+ modssl_ctx_t *mctx;
+ server_rec *server;
+
+@@ -585,6 +647,7 @@
+
+ APR_REGISTER_OPTIONAL_FN(ssl_proxy_enable);
+ APR_REGISTER_OPTIONAL_FN(ssl_engine_disable);
++ APR_REGISTER_OPTIONAL_FN(modssl_register_alpn);
+
+ ap_register_auth_provider(p, AUTHZ_PROVIDER_GROUP, "ssl",
+ AUTHZ_PROVIDER_VERSION,
+--- modules/ssl/mod_ssl.h
++++ modules/ssl/mod_ssl.h
+@@ -63,5 +93,46 @@
+
+ APR_DECLARE_OPTIONAL_FN(int, ssl_engine_disable, (conn_rec *));
+
++/** The alpn_propose_proto callback allows other modules to propose
++ * the name of the protocol that will be chosen during the
++ * Application-Layer Protocol Negotiation (ALPN) portion of the SSL handshake.
++ * The callback is given the connection and a list of NULL-terminated
++ * protocol strings as supported by the client. If this client_protos is
++ * non-empty, it must pick its preferred protocol from that list. Otherwise
++ * it should add its supported protocols in order of precedence.
++ * The callback should not yet modify the connection or install any filters
++ * as its proposal(s) may be overridden by another callback or server
++ * configuration.
++ * It should return OK or, to prevent further processing of (other modules')
++ * callbacks, return DONE.
++ */
++typedef int (*ssl_alpn_propose_protos)(conn_rec *connection,
++ apr_array_header_t *client_protos,
++ apr_array_header_t *proposed_protos);
++
++/** The alpn_proto_negotiated callback allows other modules to discover
++ * the name of the protocol that was chosen during the Application-Layer
++ * Protocol Negotiation (ALPN) portion of the SSL handshake.
++ * The callback is given the connection, a
++ * non-NUL-terminated string containing the protocol name, and the
++ * length of the string; it should do something appropriate
++ * (i.e. insert or remove filters) and return OK. To prevent further
++ * processing of (other modules') callbacks, return DONE. */
++typedef int (*ssl_alpn_proto_negotiated)(conn_rec *connection,
++ const char *proto_name,
++ apr_size_t proto_name_len);
++
++/* An optional function which can be used to register a pair of callbacks
++ * for ALPN handling.
++ * This optional function should be invoked from a pre_connection hook
++ * which runs *after* mod_ssl.c's pre_connection hook. The function returns
++ * OK if the callbacks are registered, or DECLINED otherwise (for example if
++ * mod_ssl does not support ALPN).
++ */
++APR_DECLARE_OPTIONAL_FN(int, modssl_register_alpn,
++ (conn_rec *conn,
++ ssl_alpn_propose_protos proposefn,
++ ssl_alpn_proto_negotiated negotiatedfn));
++
+ #endif /* __MOD_SSL_H__ */
+ /** @} */
+--- modules/ssl/ssl_engine_config.c
++++ modules/ssl/ssl_engine_config.c
+@@ -159,6 +160,9 @@
+ SSL_CONF_CTX_set_flags(mctx->ssl_ctx_config, SSL_CONF_FLAG_CERTIFICATE);
+ mctx->ssl_ctx_param = apr_array_make(p, 5, sizeof(ssl_ctx_param_t));
+ #endif
++#ifdef HAVE_TLS_ALPN
++ mctx->ssl_alpn_pref = apr_array_make(p, 5, sizeof(const char *));
++#endif
+ }
+
+ static void modssl_ctx_init_proxy(SSLSrvConfigRec *sc,
+@@ -301,6 +307,9 @@
+ #ifdef HAVE_SSL_CONF_CMD
+ cfgMergeArray(ssl_ctx_param);
+ #endif
++#ifdef HAVE_TLS_ALPN
++ cfgMergeArray(ssl_alpn_pref);
++#endif
+ }
+
+ static void modssl_ctx_cfg_merge_proxy(apr_pool_t *p,
+@@ -1875,6 +1868,16 @@
+ }
+ #endif
+
++#ifdef HAVE_TLS_ALPN
++const char *ssl_cmd_SSLALPNPreference(cmd_parms *cmd, void *dcfg,
++ const char *protocol)
++{
++ SSLSrvConfigRec *sc = mySrvConfig(cmd->server);
++ APR_ARRAY_PUSH(sc->server->ssl_alpn_pref, const char *) = protocol;
++ return NULL;
++}
++#endif
++
+ #ifdef HAVE_SRP
+
+ const char *ssl_cmd_SSLSRPVerifierFile(cmd_parms *cmd, void *dcfg,
+--- modules/ssl/ssl_engine_init.c
++++ modules/ssl/ssl_engine_init.c
+@@ -623,6 +646,11 @@
+ SSL_CTX_set_tmp_dh_callback(ctx, ssl_callback_TmpDH);
+
+ SSL_CTX_set_info_callback(ctx, ssl_callback_Info);
++
++#ifdef HAVE_TLS_ALPN
++ SSL_CTX_set_alpn_select_cb(
++ ctx, ssl_callback_alpn_select, NULL);
++#endif
+ }
+
+ static apr_status_t ssl_init_ctx_verify(server_rec *s,
+--- modules/ssl/ssl_engine_io.c
++++ modules/ssl/ssl_engine_io.c
+@@ -28,6 +28,7 @@
+ core keeps dumping.''
+ -- Unknown */
+ #include "ssl_private.h"
++#include "mod_ssl.h"
+ #include "apr_date.h"
+
+ /* _________________________________________________________________
+@@ -297,6 +315,9 @@
+ apr_pool_t *pool;
+ char buffer[AP_IOBUFSIZE];
+ ssl_filter_ctx_t *filter_ctx;
++#ifdef HAVE_TLS_ALPN
++ int alpn_finished; /* 1 if ALPN has finished, 0 otherwise */
++#endif
+ } bio_filter_in_ctx_t;
+
+ /*
+@@ -1412,6 +1485,37 @@
+ APR_BRIGADE_INSERT_TAIL(bb, bucket);
+ }
+
++#ifdef HAVE_TLS_ALPN
++ /* By this point, Application-Layer Protocol Negotiation (ALPN) should be
++ * completed (if our version of OpenSSL supports it). If we haven't already,
++ * find out which protocol was decided upon and inform other modules
++ * by calling alpn_proto_negotiated_hook.
++ */
++ if (!inctx->alpn_finished) {
++ SSLConnRec *sslconn = myConnConfig(f->c);
++ const unsigned char *next_proto = NULL;
++ unsigned next_proto_len = 0;
++ int n;
++
++ if (sslconn->alpn_negofns) {
++ SSL_get0_alpn_selected(inctx->ssl, &next_proto, &next_proto_len);
++ ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, f->c,
++ APLOGNO(02836) "SSL negotiated protocol: '%s'",
++ (next_proto && next_proto_len)?
++ apr_pstrmemdup(f->c->pool, (const char *)next_proto,
++ next_proto_len) : "(null)");
++ for (n = 0; n < sslconn->alpn_negofns->nelts; n++) {
++ ssl_alpn_proto_negotiated fn =
++ APR_ARRAY_IDX(sslconn->alpn_negofns, n, ssl_alpn_proto_negotiated);
++
++ if (fn(f->c, (const char *)next_proto, next_proto_len) == DONE)
++ break;
++ }
++ }
++ inctx->alpn_finished = 1;
++ }
++#endif
++
+ return APR_SUCCESS;
+ }
+
+@@ -1893,6 +1996,9 @@
+ inctx->block = APR_BLOCK_READ;
+ inctx->pool = c->pool;
+ inctx->filter_ctx = filter_ctx;
++#ifdef HAVE_TLS_ALPN
++ inctx->alpn_finished = 0;
++#endif
+ }
+
+ /* The request_rec pointer is passed in here only to ensure that the
+--- modules/ssl/ssl_engine_kernel.c
++++ modules/ssl/ssl_engine_kernel.c
+@@ -29,6 +29,7 @@
+ time I was too famous.''
+ -- Unknown */
+ #include "ssl_private.h"
++#include "mod_ssl.h"
+ #include "util_md5.h"
+
+ static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn);
+@@ -2137,6 +2162,153 @@
+ }
+ #endif /* HAVE_TLS_SESSION_TICKETS */
+
++#ifdef HAVE_TLS_ALPN
++static int ssl_array_index(apr_array_header_t *array,
++ const char *s)
++{
++ int i;
++ for (i = 0; i < array->nelts; i++) {
++ const char *p = APR_ARRAY_IDX(array, i, const char*);
++ if (!strcmp(p, s)) {
++ return i;
++ }
++ }
++ return -1;
++}
++
++/*
++ * Compare two ALPN protocol proposal. Result is similar to strcmp():
++ * 0 gives same precedence, >0 means proto1 is prefered.
++ */
++static int ssl_cmp_alpn_protos(modssl_ctx_t *ctx,
++ const char *proto1,
++ const char *proto2)
++{
++ /* TODO: we should have a mod_ssl configuration parameter. */
++ if (ctx && ctx->ssl_alpn_pref) {
++ int index1 = ssl_array_index(ctx->ssl_alpn_pref, proto1);
++ int index2 = ssl_array_index(ctx->ssl_alpn_pref, proto2);
++ if (index2 > index1) {
++ return (index1 >= 0)? 1 : -1;
++ }
++ else if (index1 > index2) {
++ return (index2 >= 0)? -1 : 1;
++ }
++ }
++ /* both have the same index (mabye -1 or no pref configured) and we compare
++ * the names so that spdy3 gets precedence over spdy2. That makes
++ * the outcome at least deterministic. */
++ return strcmp((const char *)proto1, (const char *)proto2);
++}
++
++/*
++ * This callback function is executed when the TLS Application Layer
++ * Protocol Negotiate Extension (ALPN, RFC 7301) is triggered by the client
++ * hello, giving a list of desired protocol names (in descending preference)
++ * to the server.
++ * The callback has to select a protocol name or return an error if none of
++ * the clients preferences is supported.
++ * The selected protocol does not have to be on the client list, according
++ * to RFC 7301, so no checks are performed.
++ * The client protocol list is serialized as length byte followed by ascii
++ * characters (not null-terminated), followed by the next protocol name.
++ */
++int ssl_callback_alpn_select(SSL *ssl,
++ const unsigned char **out, unsigned char *outlen,
++ const unsigned char *in, unsigned int inlen, void *arg)
++{
++ conn_rec *c = (conn_rec*)SSL_get_app_data(ssl);
++ SSLConnRec *sslconn = myConnConfig(c);
++ server_rec *s = mySrvFromConn(c);
++ SSLSrvConfigRec *sc = mySrvConfig(s);
++ modssl_ctx_t *mctx = myCtxConfig(sslconn, sc);
++ const char *alpn_http1 = "http/1.1";
++ apr_array_header_t *client_protos;
++ apr_array_header_t *proposed_protos;
++ int i;
++ size_t len;
++
++ /* If the connection object is not available,
++ * then there's nothing for us to do. */
++ if (c == NULL) {
++ return SSL_TLSEXT_ERR_OK;
++ }
++
++ if (inlen == 0) {
++ // someone tries to trick us?
++ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02837)
++ "ALPN client protocol list empty");
++ return SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++
++ client_protos = apr_array_make(c->pool, 0, sizeof(char *));
++ for (i = 0; i < inlen; /**/) {
++ unsigned int plen = in[i++];
++ if (plen + i > inlen) {
++ // someone tries to trick us?
++ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02838)
++ "ALPN protocol identier too long");
++ return SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++ APR_ARRAY_PUSH(client_protos, char*) =
++ apr_pstrndup(c->pool, (const char *)in+i, plen);
++ i += plen;
++ }
++
++ proposed_protos = apr_array_make(c->pool, client_protos->nelts+1,
++ sizeof(char *));
++
++ if (sslconn->alpn_proposefns != NULL) {
++ /* Invoke our alpn_propos_proto hooks, giving other modules a chance to
++ * propose protocol names for selection. We might have several such
++ * hooks installed and if two make a proposal, we need to give
++ * preference to one.
++ */
++ for (i = 0; i < sslconn->alpn_proposefns->nelts; i++) {
++ ssl_alpn_propose_protos fn =
++ APR_ARRAY_IDX(sslconn->alpn_proposefns, i,
++ ssl_alpn_propose_protos);
++
++ if (fn(c, client_protos, proposed_protos) == DONE)
++ break;
++ }
++ }
++
++ if (proposed_protos->nelts <= 0) {
++ /* Regardless of installed hooks, the http/1.1 protocol is always
++ * supported by us. Choose it if none other matches. */
++ if (ssl_array_index(client_protos, alpn_http1) < 0) {
++ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02839)
++ "none of the client ALPN protocols are supported");
++ return SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++ *out = (const unsigned char*)alpn_http1;
++ *outlen = (unsigned char)strlen(alpn_http1);
++ return SSL_TLSEXT_ERR_OK;
++ }
++
++ /* Now select the most preferred protocol from the proposals. */
++ *out = APR_ARRAY_IDX(proposed_protos, 0, const unsigned char *);
++ for (i = 1; i < proposed_protos->nelts; ++i) {
++ const char *proto = APR_ARRAY_IDX(proposed_protos, i, const char*);
++ /* Do we prefer it over existing candidate? */
++ if (ssl_cmp_alpn_protos(mctx, (const char *)*out, proto) < 0) {
++ *out = (const unsigned char*)proto;
++ }
++ }
++
++ len = strlen((const char*)*out);
++ if (len > 255) {
++ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02840)
++ "ALPN negotiated protocol name too long");
++ return SSL_TLSEXT_ERR_ALERT_FATAL;
++ }
++ *outlen = (unsigned char)len;
++
++ return SSL_TLSEXT_ERR_OK;
++}
++#endif
++
+ #ifdef HAVE_SRP
+
+ int ssl_callback_SRPServerParams(SSL *ssl, int *ad, void *arg)
+--- modules/ssl/ssl_private.h
++++ modules/ssl/ssl_private.h
+@@ -182,6 +182,11 @@
+ #include <openssl/srp.h>
+ #endif
+
++/* ALPN Protocol Negotiation */
++#if defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
++#define HAVE_TLS_ALPN
++#endif
++
+ #endif /* !defined(OPENSSL_NO_TLSEXT) && defined(SSL_set_tlsext_host_name) */
+
+ /* mod_ssl headers */
+@@ -443,6 +438,12 @@
+ * connection */
+ } reneg_state;
+
++#ifdef HAVE_TLS_ALPN
++ /* Poor man's inter-module optional hooks for ALPN. */
++ apr_array_header_t *alpn_proposefns; /* list of ssl_alpn_propose_protos callbacks */
++ apr_array_header_t *alpn_negofns; /* list of ssl_alpn_proto_negotiated callbacks. */
++#endif
++
+ server_rec *server;
+ } SSLConnRec;
+
+@@ -633,6 +633,10 @@
+ SSL_CONF_CTX *ssl_ctx_config; /* Configuration context */
+ apr_array_header_t *ssl_ctx_param; /* parameters to pass to SSL_CTX */
+ #endif
++
++#ifdef HAVE_TLS_ALPN
++ apr_array_header_t *ssl_alpn_pref; /* protocol names in order of preference */
++#endif
+ } modssl_ctx_t;
+
+ struct SSLSrvConfigRec {
+@@ -763,6 +763,10 @@
+ const char *ssl_cmd_SSLOpenSSLConfCmd(cmd_parms *cmd, void *dcfg, const char *arg1, const char *arg2);
+ #endif
+
++#ifdef HAVE_TLS_ALPN
++const char *ssl_cmd_SSLALPNPreference(cmd_parms *cmd, void *dcfg, const char *protocol);
++#endif
++
+ #ifdef HAVE_SRP
+ const char *ssl_cmd_SSLSRPVerifierFile(cmd_parms *cmd, void *dcfg, const char *arg);
+ const char *ssl_cmd_SSLSRPUnknownUserSeed(cmd_parms *cmd, void *dcfg, const char *arg);
+@@ -815,6 +815,12 @@
+ EVP_CIPHER_CTX *, HMAC_CTX *, int);
+ #endif
+
++#ifdef HAVE_TLS_ALPN
++int ssl_callback_alpn_select(SSL *ssl, const unsigned char **out,
++ unsigned char *outlen, const unsigned char *in,
++ unsigned int inlen, void *arg);
++#endif
++
+ /** Session Cache Support */
+ apr_status_t ssl_scache_init(server_rec *, apr_pool_t *);
+ void ssl_scache_status_register(apr_pool_t *p);
diff --git a/www-servers/apache/files/apache.conf b/www-servers/apache/files/apache.conf
new file mode 100644
index 000000000000..56e23aefaf8e
--- /dev/null
+++ b/www-servers/apache/files/apache.conf
@@ -0,0 +1,2 @@
+d /run/apache2 710 root apache
+d /run/apache_ssl_mutex
diff --git a/www-servers/apache/files/apache2.2.service b/www-servers/apache/files/apache2.2.service
new file mode 100644
index 000000000000..76f783a423b9
--- /dev/null
+++ b/www-servers/apache/files/apache2.2.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=The Apache HTTP Server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+EnvironmentFile=/etc/conf.d/apache2
+ExecStart=/usr/sbin/apache2 $APACHE2_OPTS -DFOREGROUND
+ExecReload=/usr/sbin/apache2 $APACHE2_OPTS -k graceful
+ExecStop=/usr/sbin/apache2 $APACHE2_OPTS -k graceful-stop
+# We want systemd to give httpd some time to finish gracefully, but still want
+# it to kill httpd after TimeoutStopSec if something went wrong during the
+# graceful stop. Normally, Systemd sends SIGTERM signal right after the
+# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
+# httpd time to finish.
+KillSignal=SIGCONT
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/apache/metadata.xml b/www-servers/apache/metadata.xml
new file mode 100644
index 000000000000..bfa5a8542717
--- /dev/null
+++ b/www-servers/apache/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <longdescription>
+ The Apache HTTP Server Project is an effort to develop and maintain an
+ open-source HTTP server for modern operating systems. The goal of this
+ project is to provide a secure, efficient and extensible server that
+ provides HTTP services in sync with the current HTTP standards.
+ </longdescription>
+ <use>
+ <flag name='alpn'>Enable support for Application-Layer Protocol Negotiation (ALPN) in TLS. Needed by HTTP/2.0.</flag>
+ <flag name='suexec'>Install suexec with apache</flag>
+ <flag name='static'>Link in apache2 modules statically rather then plugins</flag>
+ <flag name='apache2_modules_access_compat'>Group authorizations based on host (name or IP address). Available as a compatibility module with previous versions.</flag>
+ <flag name='apache2_modules_authn_core'>Provides core authentication capabilities common to all authentication providers (functionality provided by authn_alias in previous versions).</flag>
+ <flag name='apache2_modules_authz_core'>Provides core authorization capabilities to various authorization/authorization modules, such as authn_file and authz_user.</flag>
+ <flag name='apache2_modules_authz_dbd'>Provides authorization capabilities via SQL database so that authenticated users can be allowed or denied access to portions of the web site by group membership.</flag>
+ <flag name='apache2_modules_cache_disk'>Disk based storage module for the HTTP caching filter (similar to mem_cache in previous versions).</flag>
+ <flag name='apache2_modules_lbmethod_byrequests'>Request counting load balancer scheduler algorithm for proxy_balancer.</flag>
+ <flag name='apache2_modules_lbmethod_bytraffic'>Weighted traffic counting load balancer scheduler algorithm for proxy_balancer.</flag>
+ <flag name='apache2_modules_lbmethod_bybusyness'>Pending request counting load balancer scheduler algorithm for proxy_balancer.</flag>
+ <flag name='apache2_modules_lbmethod_heartbeat'>Heartbeat traffic counting load balancer scheduler algorithm for proxy_balancer.</flag>
+ <flag name='apache2_modules_macro'>Macros for the Apache config file.</flag>
+ <flag name='apache2_modules_slotmem_shm'>Slot-based shared memory provider.</flag>
+ <flag name='apache2_modules_socache_shmcb'>A shared object cache provider using a high-performance cyclic buffer inside a shared memory segment.</flag>
+ <flag name='apache2_modules_unixd'>Basic (required) security for Unix-family platforms.</flag>
+ <flag name='apache2_modules_proxy_fcgi'>FCGI support module for mod_proxy.</flag>
+ <flag name='apache2_modules_proxy_wstunnel'>Provides support for the tunnelling of web socket connections to a backend websockets server.</flag>
+ <flag name='apache2_modules_ratelimit'>Ratelimit module for transfer rate management</flag>
+ <flag name='apache2_modules_remoteip'>Remotip module for logging</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/axis/Manifest b/www-servers/axis/Manifest
new file mode 100644
index 000000000000..a574a72dd1b8
--- /dev/null
+++ b/www-servers/axis/Manifest
@@ -0,0 +1 @@
+DIST axis-src-1_4.tar.gz 17041546 SHA256 911b4467f3d6cfe2e50fb7baea7a754e6aa717902d6ed91cef78f8f52bef8572 SHA512 7d08212b04702e76c960ad772a475f5765fef7f9ebe0aea3d4b949c6ba28a62500e8a76a43c7364b7caf36b7f27aee8592744256154670c7a24d29c5c1518258 WHIRLPOOL cf359caa9e645bdefb7c2ff012673dc64af9d4cc4bbe2a082cb64bcb0211d3a844ef797738ae1a3e9f978d0bbd8dc42bac9ecbdf4c734dd30ff52da18bdd7a91
diff --git a/www-servers/axis/axis-1.4-r2.ebuild b/www-servers/axis/axis-1.4-r2.ebuild
new file mode 100644
index 000000000000..a247f2beee12
--- /dev/null
+++ b/www-servers/axis/axis-1.4-r2.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+WANT_ANT_TASKS="ant-nodeps ant-trax"
+JAVA_PKG_IUSE="doc source examples"
+
+inherit eutils java-pkg-2 java-ant-2
+
+MY_PV="${PV//./_}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Apache's Axis1 implementation of the SOAP (Simple Object Access Protocol)"
+HOMEPAGE="http://ws.apache.org/axis/index.html"
+SRC_URI="mirror://apache/ws/${PN}/${MY_PV}/${PN}-src-${MY_PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="1"
+KEYWORDS="amd64 x86"
+IUSE="debug"
+
+CDEPEND="dev-java/commons-discovery:0
+ dev-java/wsdl4j:0
+ dev-java/sun-jaf:0
+ dev-java/commons-logging:0
+ java-virtuals/javamail:0
+ dev-java/ant-core:0
+ dev-java/bsf:2.3
+ dev-java/castor:1.0
+ dev-java/commons-httpclient:3
+ dev-java/commons-net:0
+ dev-java/sun-jimi:0
+ dev-java/servletapi:2.4
+ dev-java/saaj:0
+ dev-java/jax-rpc:0
+ dev-java/log4j:0
+ dev-java/xml-commons:0
+ dev-java/xml-xmlbeans:1"
+
+RDEPEND=">=virtual/jre-1.6
+ ${CDEPEND}"
+
+DEPEND=">=virtual/jdk-1.6
+ ${CDEPEND}"
+
+# uses enum as identifier
+JAVA_PKG_WANT_SOURCE="1.4"
+JAVA_PKG_WANT_TARGET="1.4"
+
+S="${WORKDIR}/${MY_P}"
+
+AXIS_NAME="${PN}-${SLOT}"
+
+# not declared mandatory but fails without it
+# mailapi.jar would be enough but that's only in -bin, mail.jar superseedes
+EANT_GENTOO_CLASSPATH="sun-jaf,javamail,log4j,xml-xmlbeans-1,servletapi-2.4,bsf-2.3,sun-jimi,commons-httpclient-3,castor-1.0,xml-commons,commons-net"
+EANT_EXTRA_ARGS="-Ddeprecation=false -Dbase.path=/opt
+-Dservlet.jar=servlet-api.jar -Dwsdl4j-1.5.1.jar=wsdl4j.jar
+-Dcommons-logging-1.0.4.jar=commons-logging.jar"
+EANT_BUILD_TARGET="compile"
+EANT_DOC_TARGET="javadocs"
+EANT_NEEDS_TOOLS="true"
+
+#TODO-tests require Atlassian clover, need to figure out which ones
+RESTRICT="test"
+
+java_prepare() {
+ # remove some <copy> actions
+ epatch "${FILESDIR}/${P}-build.xml.patch"
+ # remove exact lib paths and global java.classpath from classpath
+ epatch "${FILESDIR}/${P}-path_refs.xml.patch"
+ # add missing target to javac, xml rewriting would break entities
+ epatch "${FILESDIR}/${P}-tools-build.xml.patch"
+ # remove most of <available> checks
+ epatch "${FILESDIR}/${P}-targets.xml.patch"
+ # this clashes with java6 method
+ epatch "${FILESDIR}/${P}-java6.patch"
+
+ # fix CVE-2014-3596 and bug 520304
+ epatch "${FILESDIR}/${P}-JSSESocketFactory.java.patch"
+
+ # and replace them with predefined properties
+ cp "${FILESDIR}/build.properties" . \
+ || die "failed to copy build.properties from ${FILESDIR}"
+
+ rm -rf "${S}"/docs/apiDocs || die
+
+ #Remove test till they are working
+ rm -rf "${S}"/test || die
+ #cd "${S}"/test
+ #mv build_ant.xml build.xml
+ cd "${S}"/webapps/axis/WEB-INF/lib
+ rm -v *.jar || die
+
+ cd "${S}/lib"
+ mv saaj.jar endorsed/ || die
+ rm -v *.jar || die
+ java-pkg_jar-from --build-only ant-core
+ java-pkg_jar-from wsdl4j wsdl4j.jar
+ java-pkg_jar-from commons-logging commons-logging.jar
+ java-pkg_jar-from commons-discovery commons-discovery.jar
+
+ if use debug; then
+ EANT_EXTRA_ARGS+=" -Ddebug=on"
+ else
+ EANT_EXTRA_ARGS+=" -Ddebug=off"
+ fi
+
+ cd "${S}"
+ java-ant_rewrite-classpath
+ java-ant_rewrite-bootclasspath auto build.xml "lib/endorsed/xml-apis-2.6.2.jar:lib/endorsed/xercesImpl-2.6.2.jar:lib/endorsed/saaj.jar"
+ sed -i '/<bootclasspath refid="boot.classpath"/d' build.xml || die
+}
+
+src_install() {
+ dodir /usr/share/${AXIS_NAME}
+ mv build/lib/axis-ant.jar build/lib/ant-axis.jar || die
+ java-pkg_dojar build/lib/axis.jar
+ java-pkg_dojar build/lib/ant-axis.jar
+ java-pkg_dojar build/lib/jaxrpc.jar
+ java-pkg_register-ant-task
+ dodir /usr/share/${AXIS_NAME}/webapps
+
+ cp -pR "${S}"/webapps/axis "${D}"/usr/share/${AXIS_NAME}/webapps || die
+
+ dodoc NOTICE README
+ dohtml release-notes.html changelog.html
+
+ if use doc; then
+ java-pkg_dojavadoc build/javadocs/
+ dohtml -r docs/*
+ dodoc xmls/*
+ fi
+
+ use source && java-pkg_dosrc src
+ use examples && java-pkg_doexamples samples
+}
diff --git a/www-servers/axis/files/axis-1.4-JSSESocketFactory.java.patch b/www-servers/axis/files/axis-1.4-JSSESocketFactory.java.patch
new file mode 100644
index 000000000000..1309115295d1
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-JSSESocketFactory.java.patch
@@ -0,0 +1,342 @@
+--- src/org/apache/axis/components/net/JSSESocketFactory.java (revision 1618775)
++++ src/org/apache/axis/components/net/JSSESocketFactory.java (working copy)
+@@ -15,12 +15,6 @@
+ */
+ package org.apache.axis.components.net;
+
+-import org.apache.axis.utils.Messages;
+-import org.apache.axis.utils.XMLUtils;
+-import org.apache.axis.utils.StringUtils;
+-
+-import javax.net.ssl.SSLSocket;
+-import javax.net.ssl.SSLSocketFactory;
+ import java.io.BufferedWriter;
+ import java.io.IOException;
+ import java.io.InputStream;
+@@ -28,9 +22,35 @@
+ import java.io.OutputStreamWriter;
+ import java.io.PrintWriter;
+ import java.net.Socket;
++import java.security.cert.Certificate;
++import java.security.cert.CertificateParsingException;
++import java.security.cert.X509Certificate;
++import java.util.ArrayList;
++import java.util.Arrays;
++import java.util.Collection;
+ import java.util.Hashtable;
++import java.util.Iterator;
++import java.util.LinkedList;
++import java.util.List;
++import java.util.Locale;
++import java.util.regex.Pattern;
+
++import javax.naming.InvalidNameException;
++import javax.naming.NamingException;
++import javax.naming.directory.Attribute;
++import javax.naming.directory.Attributes;
++import javax.naming.ldap.LdapName;
++import javax.naming.ldap.Rdn;
++import javax.net.ssl.SSLException;
++import javax.net.ssl.SSLSession;
++import javax.net.ssl.SSLSocket;
++import javax.net.ssl.SSLSocketFactory;
+
++import org.apache.axis.utils.Messages;
++import org.apache.axis.utils.StringUtils;
++import org.apache.axis.utils.XMLUtils;
++
++
+ /**
+ * SSL socket factory. It _requires_ a valid RSA key and
+ * JSSE. (borrowed code from tomcat)
+@@ -41,6 +61,10 @@
+ */
+ public class JSSESocketFactory extends DefaultSocketFactory implements SecureSocketFactory {
+
++ // This is a a sorted list, if you insert new elements do it orderdered.
++ private final static String[] BAD_COUNTRY_2LDS =
++ {"ac", "co", "com", "ed", "edu", "go", "gouv", "gov", "info",
++ "lg", "ne", "net", "or", "org"};
+ /** Field sslFactory */
+ protected SSLSocketFactory sslFactory = null;
+
+@@ -187,6 +211,279 @@
+ if (log.isDebugEnabled()) {
+ log.debug(Messages.getMessage("createdSSL00"));
+ }
++ verifyHostName(host, (SSLSocket) sslSocket);
+ return sslSocket;
+ }
++ /**
++ * Verifies that the given hostname in certicifate is the hostname we are trying to connect to.
++ * This resolves CVE-2012-5784 and CVE-2014-3596
++ * @param host
++ * @param ssl
++ * @throws IOException
++ */
++
++ private static void verifyHostName(String host, SSLSocket ssl)
++ throws IOException {
++ if (host == null) {
++ throw new IllegalArgumentException("host to verify was null");
++ }
++
++ SSLSession session = ssl.getSession();
++ if (session == null) {
++ // In our experience this only happens under IBM 1.4.x when
++ // spurious (unrelated) certificates show up in the server's chain.
++ // Hopefully this will unearth the real problem:
++ InputStream in = ssl.getInputStream();
++ in.available();
++ /*
++ If you're looking at the 2 lines of code above because you're
++ running into a problem, you probably have two options:
++
++ #1. Clean up the certificate chain that your server
++ is presenting (e.g. edit "/etc/apache2/server.crt" or
++ wherever it is your server's certificate chain is
++ defined).
++
++ OR
++
++ #2. Upgrade to an IBM 1.5.x or greater JVM, or switch to a
++ non-IBM JVM.
++ */
++
++ // If ssl.getInputStream().available() didn't cause an exception,
++ // maybe at least now the session is available?
++ session = ssl.getSession();
++ if (session == null) {
++ // If it's still null, probably a startHandshake() will
++ // unearth the real problem.
++ ssl.startHandshake();
++
++ // Okay, if we still haven't managed to cause an exception,
++ // might as well go for the NPE. Or maybe we're okay now?
++ session = ssl.getSession();
++ }
++ }
++
++ Certificate[] certs = session.getPeerCertificates();
++ verifyHostName(host.trim().toLowerCase(Locale.US), (X509Certificate) certs[0]);
++ }
++ /**
++ * Extract the names from the certificate and tests host matches one of them
++ * @param host
++ * @param cert
++ * @throws SSLException
++ */
++
++ private static void verifyHostName(final String host, X509Certificate cert)
++ throws SSLException {
++ // I'm okay with being case-insensitive when comparing the host we used
++ // to establish the socket to the hostname in the certificate.
++ // Don't trim the CN, though.
++
++ String[] cns = getCNs(cert);
++ String[] subjectAlts = getDNSSubjectAlts(cert);
++ verifyHostName(host, cns, subjectAlts);
++
++ }
++
++ /**
++ * Extract all alternative names from a certificate.
++ * @param cert
++ * @return
++ */
++ private static String[] getDNSSubjectAlts(X509Certificate cert) {
++ LinkedList subjectAltList = new LinkedList();
++ Collection c = null;
++ try {
++ c = cert.getSubjectAlternativeNames();
++ } catch (CertificateParsingException cpe) {
++ // Should probably log.debug() this?
++ cpe.printStackTrace();
++ }
++ if (c != null) {
++ Iterator it = c.iterator();
++ while (it.hasNext()) {
++ List list = (List) it.next();
++ int type = ((Integer) list.get(0)).intValue();
++ // If type is 2, then we've got a dNSName
++ if (type == 2) {
++ String s = (String) list.get(1);
++ subjectAltList.add(s);
++ }
++ }
++ }
++ if (!subjectAltList.isEmpty()) {
++ String[] subjectAlts = new String[subjectAltList.size()];
++ subjectAltList.toArray(subjectAlts);
++ return subjectAlts;
++ } else {
++ return new String[0];
++ }
++
++ }
++ /**
++ * Verifies
++ * @param host
++ * @param cn
++ * @param subjectAlts
++ * @throws SSLException
++ */
++
++ private static void verifyHostName(final String host, String[] cns, String[] subjectAlts)throws SSLException{
++ StringBuffer cnTested = new StringBuffer();
++
++ for (int i = 0; i < subjectAlts.length; i++){
++ String name = subjectAlts[i];
++ if (name != null) {
++ name = name.toLowerCase(Locale.US);
++ if (verifyHostName(host, name)){
++ return;
++ }
++ cnTested.append("/").append(name);
++ }
++ }
++ for (int i = 0; i < cns.length; i++) {
++ String cn = cns[i];
++ if (cn != null) {
++ cn = cn.toLowerCase(Locale.US);
++ if (verifyHostName(host, cn)) {
++ return;
++ }
++ cnTested.append("/").append(cn);
++ }
++ }
++ throw new SSLException("hostname in certificate didn't match: <"
++ + host + "> != <" + cnTested + ">");
++ }
++
++ private static boolean verifyHostName(final String host, final String cn){
++ if (doWildCard(cn) && !isIPAddress(host)) {
++ return matchesWildCard(cn, host);
++ }
++ return host.equalsIgnoreCase(cn);
++ }
++ private static boolean doWildCard(String cn) {
++ // Contains a wildcard
++ // wildcard in the first block
++ // not an ipaddress (ip addres must explicitily be equal)
++ // not using 2nd level common tld : ex: not for *.co.uk
++ String parts[] = cn.split("\\.");
++ return parts.length >= 3 &&
++ parts[0].endsWith("*") &&
++ acceptableCountryWildcard(cn) &&
++ !isIPAddress(cn);
++ }
++
++ private static final Pattern IPV4_PATTERN =
++ Pattern.compile("^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$");
++
++ private static final Pattern IPV6_STD_PATTERN =
++ Pattern.compile("^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$");
++
++ private static final Pattern IPV6_HEX_COMPRESSED_PATTERN =
++ Pattern.compile("^((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)::((?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4})*)?)$");
++
++
++ private static boolean isIPAddress(final String hostname) {
++ return hostname != null
++ && (
++ IPV4_PATTERN.matcher(hostname).matches()
++ || IPV6_STD_PATTERN.matcher(hostname).matches()
++ || IPV6_HEX_COMPRESSED_PATTERN.matcher(hostname).matches()
++ );
++
++ }
++
++ private static boolean acceptableCountryWildcard(final String cn) {
++ // The CN better have at least two dots if it wants wildcard action,
++ // but can't be [*.co.uk] or [*.co.jp] or [*.org.uk], etc...
++ // The [*.co.uk] problem is an interesting one. Should we just
++ // hope that CA's would never foolishly allow such a
++ // certificate to happen?
++
++ String[] parts = cn.split("\\.");
++ // Only checks for 3 levels, with country code of 2 letters.
++ if (parts.length > 3 || parts[parts.length - 1].length() != 2) {
++ return true;
++ }
++ String countryCode = parts[parts.length - 2];
++ return Arrays.binarySearch(BAD_COUNTRY_2LDS, countryCode) < 0;
++ }
++
++ private static boolean matchesWildCard(final String cn,
++ final String hostName) {
++ String parts[] = cn.split("\\.");
++ boolean match = false;
++ String firstpart = parts[0];
++ if (firstpart.length() > 1) {
++ // server∗
++ // e.g. server
++ String prefix = firstpart.substring(0, firstpart.length() - 1);
++ // skipwildcard part from cn
++ String suffix = cn.substring(firstpart.length());
++ // skip wildcard part from host
++ String hostSuffix = hostName.substring(prefix.length());
++ match = hostName.startsWith(prefix) && hostSuffix.endsWith(suffix);
++ } else {
++ match = hostName.endsWith(cn.substring(1));
++ }
++ if (match) {
++ // I f we ’ r e i n s t r i c t mode ,
++ // [ ∗.foo.com] is not allowed to match [a.b.foo.com]
++ match = countDots(hostName) == countDots(cn);
++ }
++ return match;
++ }
++
++ private static int countDots(final String data) {
++ int dots = 0;
++ for (int i = 0; i < data.length(); i++) {
++ if (data.charAt(i) == '.') {
++ dots += 1;
++ }
++ }
++ return dots;
++ }
++
++
++ private static String[] getCNs(X509Certificate cert) {
++ // Note: toString() seems to do a better job than getName()
++ //
++ // For example, getName() gives me this:
++ // 1.2.840.113549.1.9.1=#16166a756c6975736461766965734063756362632e636f6d
++ //
++ // whereas toString() gives me this:
++ // EMAILADDRESS=juliusdavies@cucbc.com
++ String subjectPrincipal = cert.getSubjectX500Principal().toString();
++
++ return getCNs(subjectPrincipal);
++
++ }
++ private static String[] getCNs(String subjectPrincipal) {
++ if (subjectPrincipal == null) {
++ return null;
++ }
++ final List cns = new ArrayList();
++ try {
++ final LdapName subjectDN = new LdapName(subjectPrincipal);
++ final List rdns = subjectDN.getRdns();
++ for (int i = rdns.size() - 1; i >= 0; i--) {
++ final Rdn rds = (Rdn) rdns.get(i);
++ final Attributes attributes = rds.toAttributes();
++ final Attribute cn = attributes.get("cn");
++ if (cn != null) {
++ try {
++ final Object value = cn.get();
++ if (value != null) {
++ cns.add(value.toString());
++ }
++ }
++ catch (NamingException ignore) {}
++ }
++ }
++ }
++ catch (InvalidNameException ignore) { }
++ return cns.isEmpty() ? null : (String[]) cns.toArray(new String[ cns.size() ]);
++ }
++
+ }
diff --git a/www-servers/axis/files/axis-1.4-build.xml.patch b/www-servers/axis/files/axis-1.4-build.xml.patch
new file mode 100644
index 000000000000..92e5116934da
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-build.xml.patch
@@ -0,0 +1,15 @@
+--- build.xml.orig 2006-04-23 03:57:27.000000000 +0200
++++ build.xml 2006-10-01 21:18:20.000000000 +0200
+@@ -223,10 +223,12 @@
+ </section>
+ </manifest>
+ </jar>
++ <!--
+ <copy file="${wsdl4j.jar}" toDir="${build.lib}"/>
+ <copy file="${commons-logging.jar}" toDir="${build.lib}"/>
+ <copy file="${commons-discovery.jar}" toDir="${build.lib}"/>
+ <copy file="${log4j-core.jar}" toDir="${build.lib}"/>
++ -->
+ <copy file="${src.dir}/log4j.properties"
+ toDir="${build.lib}"/>
+
diff --git a/www-servers/axis/files/axis-1.4-java6.patch b/www-servers/axis/files/axis-1.4-java6.patch
new file mode 100644
index 000000000000..2e9bd4289900
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-java6.patch
@@ -0,0 +1,16 @@
+--- src/org/apache/axis/i18n/ProjectResourceBundle.java.orig 2006-04-23 03:57:27.000000000 +0200
++++ src/org/apache/axis/i18n/ProjectResourceBundle.java 2009-11-08 19:08:20.000000000 +0100
+@@ -357,13 +357,6 @@
+ return resourceName;
+ }
+
+- /**
+- * Clears the internal cache
+- */
+- public static void clearCache()
+- {
+- bundleCache.clear();
+- }
+
+ public String toString() {
+ return resourceName;
diff --git a/www-servers/axis/files/axis-1.4-path_refs.xml.patch b/www-servers/axis/files/axis-1.4-path_refs.xml.patch
new file mode 100644
index 000000000000..7c0ad2455bd4
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-path_refs.xml.patch
@@ -0,0 +1,20 @@
+--- xmls/path_refs.xml.orig 2006-04-23 03:56:52.000000000 +0200
++++ xmls/path_refs.xml 2006-10-01 15:31:34.000000000 +0200
+@@ -1,4 +1,5 @@
+ <path id="classpath">
++ <!--
+ <pathelement location="${xercesImpl.jar}"/>
+ <pathelement location="${xmlParserAPIs.jar}"/>
+ <pathelement location="${xalan.jar}"/>
+@@ -14,10 +15,10 @@
+ <pathelement location="${j2ee.jar}"/>
+ <pathelement location="${junit.jar}"/>
+ <pathelement location="${servlet.jar}"/>
++ -->
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar"/>
+ </fileset>
+- <pathelement path="${java.class.path}"/>
+ <pathelement location="${build.dest}" />
+ <pathelement location="${build.dir}/tools" />
+ <pathelement location="${build.lib}/axis-ant.jar" />
diff --git a/www-servers/axis/files/axis-1.4-targets.xml.patch b/www-servers/axis/files/axis-1.4-targets.xml.patch
new file mode 100644
index 000000000000..1f5f63ee1831
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-targets.xml.patch
@@ -0,0 +1,86 @@
+--- xmls/targets.xml.orig 2006-10-01 15:08:41.000000000 +0200
++++ xmls/targets.xml 2006-10-01 15:14:27.000000000 +0200
+@@ -84,6 +84,7 @@
+ <mkdir dir="${build.lib}"/>
+ <mkdir dir="${build.dir}/work"/>
+
++ <!--
+ <available property="servlet.present"
+ classname="javax.servlet.Servlet"
+ classpathref="classpath"/>
+@@ -135,18 +136,18 @@
+ <available property="httpunit.present"
+ classname="com.meterware.httpunit.GetMethodWebRequest"
+ classpathref="classpath"/>
+-
++ -->
+ <available property="jsse.present"
+ classname="javax.net.ssl.SSLSocketFactory"
+ classpathref="classpath"/>
+-
++ <!--
+ <condition property="jetty.present" >
+ <and>
+ <available classname="javax.servlet.Servlet" classpathref="classpath" />
+ <available classname="org.mortbay.http.HttpServer" classpathref="classpath" />
+ </and>
+ </condition>
+-
++ -->
+ <condition property="jdk14.jsse.present" >
+ <and>
+ <available classname="javax.net.ssl.X509TrustManager" classpathref="classpath" />
+@@ -185,7 +186,7 @@
+ <condition property="sun.codec.present" >
+ <available classname="sun.awt.image.codec.JPEGImageEncoderImpl" classpathref="classpath" />
+ </condition>
+-
++ <!--
+ <condition property="jimi.present" >
+ <available classname="com.sun.jimi.core.Jimi" classpathref="classpath" />
+ </condition>
+@@ -193,7 +194,7 @@
+ <condition property="merlinio.present" >
+ <available classname="javax.imageio.ImageIO" classpathref="classpath" />
+ </condition>
+-
++ -->
+ <condition property="axis-ant.present" >
+ <available classname="org.apache.axis.tools.ant.foreach.ForeachTask">
+ <classpath>
+@@ -201,7 +202,7 @@
+ </classpath>
+ </available>
+ </condition>
+-
++ <!--
+ <condition property="jimiAndAttachments.present">
+ <and>
+ <available classname="javax.activation.DataHandler" classpathref="classpath" />
+@@ -220,7 +221,7 @@
+ <available classname="progress.message.jclient.Message" classpathref="classpath" />
+ </and>
+ </condition>
+-
++ -->
+ <available property="post-compile.present" file="post-compile.xml" />
+
+ <property environment="env"/>
+@@ -229,7 +230,7 @@
+ <equals arg1="on" arg2="${env.debug}"/>
+ </and>
+ </condition>
+-
++ <!--
+ <condition property="castor.present" >
+ <available classname="org.exolab.castor.xml.MarshalException" classpathref="classpath" />
+ </condition>
+@@ -248,7 +249,7 @@
+ <condition property="combridge.present" >
+ <available classname="org.apache.axis.components.bridge.COMBridge" classpathref="classpath" />
+ </condition>
+-
++ -->
+ <!-- look for WSDL support on the platform -->
+ <condition property="wsdl.found">
+ <or>
diff --git a/www-servers/axis/files/axis-1.4-tools-build.xml.patch b/www-servers/axis/files/axis-1.4-tools-build.xml.patch
new file mode 100644
index 000000000000..ce9759264eda
--- /dev/null
+++ b/www-servers/axis/files/axis-1.4-tools-build.xml.patch
@@ -0,0 +1,26 @@
+--- tools/build.xml.orig 2006-10-02 10:18:43.000000000 +0200
++++ tools/build.xml 2006-10-02 10:21:34.000000000 +0200
+@@ -66,6 +66,7 @@
+ <javac srcdir="${tools.dir}"
+ debug="${debug}"
+ source="${source}"
++ target="${target}"
+ nowarn="${nowarn}"
+ destdir="${tools.build.dir}">
+ <classpath refid="classpath"/>
+@@ -77,6 +78,7 @@
+ <javac srcdir="${tools.dir}"
+ debug="${debug}"
+ source="${source}"
++ target="${target}"
+ nowarn="${nowarn}"
+ destdir="${tools.build.dir}">
+ <classpath refid="classpath"/>
+@@ -88,6 +90,7 @@
+ <javac srcdir="${tools.dir}"
+ debug="${debug}"
+ source="${source}"
++ target="${target}"
+ nowarn="${nowarn}"
+ destdir="${tools.build.dir}">
+ <classpath>
diff --git a/www-servers/axis/files/build.properties b/www-servers/axis/files/build.properties
new file mode 100644
index 000000000000..9387391ab441
--- /dev/null
+++ b/www-servers/axis/files/build.properties
@@ -0,0 +1,15 @@
+source=1.4
+target=1.4
+
+activation.present=true
+commons-discovery.present=true
+commons-logging.present=true
+wsdl4j.present=true
+mailapi.present=true
+
+bsf.present=true
+castor.present=true
+commons-httpclient.present=true
+commons-net.present=true
+jimi.present=true
+servlet.present=true
diff --git a/www-servers/axis/metadata.xml b/www-servers/axis/metadata.xml
new file mode 100644
index 000000000000..d75e8a6c1c56
--- /dev/null
+++ b/www-servers/axis/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>java</herd>
+
+<longdescription>
+Apache Axis is an implementation of the SOAP ("Simple Object Access Protocol") submission to W3C.
+
+From the draft W3C specification:
+
+SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. It is an XML based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined datatypes, and a convention for representing remote procedure calls and responses.
+</longdescription>
+</pkgmetadata>
diff --git a/www-servers/boa/Manifest b/www-servers/boa/Manifest
new file mode 100644
index 000000000000..b6ca09bc89b3
--- /dev/null
+++ b/www-servers/boa/Manifest
@@ -0,0 +1 @@
+DIST boa-0.94.14rc21.tar.gz 199950 SHA256 02c51bf25f29d56e641b662f0767759654c28d88ec31f55c5a73d57edfe13cf6 SHA512 ca8e5c2c29f0b6cd4fd2f7268682dc345c1d37f4de099319e22d63d822a72195659d707e148f2e2725edec88d90208fc40702f15ab2cacadc9957f1a0437d798 WHIRLPOOL 81e2175a79d8592a6c801ea07350743e2b606d928e63e11a1642b0be195752073c0fb7187e2875a80f849481794c435bf1a053d5f0465c912e6a59746cf267c7
diff --git a/www-servers/boa/boa-0.94.14_rc21-r1.ebuild b/www-servers/boa/boa-0.94.14_rc21-r1.ebuild
new file mode 100644
index 000000000000..898373146388
--- /dev/null
+++ b/www-servers/boa/boa-0.94.14_rc21-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils systemd
+
+MY_P=${P/_/}
+DESCRIPTION="A very small and very fast http daemon"
+SRC_URI="http://www.boa.org/${MY_P}.tar.gz"
+HOMEPAGE="http://www.boa.org/"
+
+KEYWORDS="~amd64 ~mips ~ppc ~sparc ~x86"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="doc"
+
+RDEPEND=""
+DEPEND="sys-devel/bison
+ sys-devel/flex
+ doc? ( virtual/latex-base )"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-texi.patch
+ epatch "${FILESDIR}"/${P}-ENOSYS.patch
+}
+
+src_compile() {
+ default
+
+ use doc || sed -i -e '/^all:/s/boa.dvi //' docs/Makefile
+ emake docs
+}
+
+src_install() {
+ dosbin src/boa
+ doman docs/boa.8
+ doinfo docs/boa.info
+ if use doc; then
+ dodoc docs/boa.html
+ dodoc docs/boa_banner.png
+ dodoc docs/boa.dvi
+ fi
+
+ keepdir /var/log/boa
+ keepdir /var/www/localhost/htdocs
+ keepdir /var/www/localhost/cgi-bin
+ keepdir /var/www/localhost/icons
+
+ newinitd "${FILESDIR}"/boa.rc6 boa
+ newconfd "${FILESDIR}"/boa.conf.d boa
+
+ systemd_dounit "${FILESDIR}"/boa.service
+
+ exeinto /usr/lib/boa
+ doexe src/boa_indexer
+
+ insinto /etc/boa
+ doins "${FILESDIR}"/boa.conf
+ doins "${FILESDIR}"/mime.types
+}
diff --git a/www-servers/boa/files/boa-0.94.14_rc21-ENOSYS.patch b/www-servers/boa/files/boa-0.94.14_rc21-ENOSYS.patch
new file mode 100644
index 000000000000..35dc3d2493e7
--- /dev/null
+++ b/www-servers/boa/files/boa-0.94.14_rc21-ENOSYS.patch
@@ -0,0 +1,17 @@
+check for sendfile() returning ENOSYS and fall back to standard I/O.
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=330871
+
+diff -Naur boa-0.94.14rc21-orig/src/pipe.c boa-0.94.14rc21/src/pipe.c
+--- boa-0.94.14rc21-orig/src/pipe.c 2007-07-01 10:49:23.000000000 -0600
++++ boa-0.94.14rc21/src/pipe.c 2007-07-01 10:56:56.000000000 -0600
+@@ -215,7 +215,9 @@
+ }
+ req->ranges->start = sendfile_offset;
+ if (bytes_written < 0) {
+- if (errno == EWOULDBLOCK || errno == EAGAIN) {
++ if (errno == ENOSYS) {
++ return io_shuffle(req);
++ } else if (errno == EWOULDBLOCK || errno == EAGAIN) {
+ return -1; /* request blocked at the pipe level, but keep going */
+ } else if (errno == EINTR) {
+ goto retrysendfile;
diff --git a/www-servers/boa/files/boa-0.94.14_rc21-texi.patch b/www-servers/boa/files/boa-0.94.14_rc21-texi.patch
new file mode 100644
index 000000000000..68fcdfbe08e3
--- /dev/null
+++ b/www-servers/boa/files/boa-0.94.14_rc21-texi.patch
@@ -0,0 +1,14 @@
+--- docs/boa.texi.org 2003-02-02 06:02:22.000000000 +0100
++++ docs/boa.texi 2007-05-21 01:22:27.997819260 +0200
+@@ -33,10 +33,10 @@
+ @direntry
+ * Boa: (boa). The Boa Webserver
+ @end direntry
+-@end ifinfo
+
+ @comment node-name, next, previous, up
+ @node Top, Introduction, , (dir)
++@end ifinfo
+
+ Welcome to the documentation for Boa, a high performance
+ HTTP Server for UN*X-alike computers, covered by the
diff --git a/www-servers/boa/files/boa.conf b/www-servers/boa/files/boa.conf
new file mode 100644
index 000000000000..186fcfa8958b
--- /dev/null
+++ b/www-servers/boa/files/boa.conf
@@ -0,0 +1,187 @@
+# Boa v0.94 configuration file
+# File format has not changed from 0.93
+# File format has changed little from 0.92
+# version changes are noted in the comments
+#
+# The Boa configuration file is parsed with a lex/yacc or flex/bison
+# generated parser. If it reports an error, the line number will be
+# provided; it should be easy to spot. The syntax of each of these
+# rules is very simple, and they can occur in any order. Where possible
+# these directives mimic those of NCSA httpd 1.3; I saw no reason to
+# introduce gratuitous differences.
+
+# $Id$
+
+# The "ServerRoot" is not in this configuration file. It can be compiled
+# into the server (see defines.h) or specified on the command line with
+# the -c option, for example:
+#
+# boa -c /usr/local/boa
+
+
+# Port: The port Boa runs on. The default port for http servers is 80.
+# If it is less than 1024, the server must be started as root.
+
+Port 80
+
+# Listen: the Internet address to bind(2) to. If you leave it out,
+# it takes the behavior before 0.93.17.2, which is to bind to all
+# addresses (INADDR_ANY). You only get one "Listen" directive,
+# if you want service on multiple IP addresses, you have three choices:
+# 1. Run boa without a "Listen" directive
+# a. All addresses are treated the same; makes sense if the addresses
+# are localhost, ppp, and eth0.
+# b. Use the VirtualHost directive below to point requests to different
+# files. Should be good for a very large number of addresses (web
+# hosting clients).
+# 2. Run one copy of boa per IP address, each has its own configuration
+# with a "Listen" directive. No big deal up to a few tens of addresses.
+# Nice separation between clients.
+# The name you provide gets run through inet_aton(3), so you have to use dotted
+# quad notation. This configuration is too important to trust some DNS.
+
+#Listen 192.68.0.5
+
+# User: The name or UID the server should run as.
+# Group: The group name or GID the server should run as.
+
+User nobody
+Group nogroup
+
+# ServerAdmin: The email address where server problems should be sent.
+# Note: this is not currently used, except as an environment variable
+# for CGIs.
+
+#ServerAdmin root@localhost
+
+# ErrorLog: The location of the error log file. If this does not start
+# with /, it is considered relative to the server root.
+# Set to /dev/null if you don't want errors logged.
+# If unset, defaults to /dev/stderr
+
+ErrorLog /var/log/boa/error_log
+# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+# is somewhat experimental and might fail under heavy load.
+# "Usual libc implementations of printf will stall the whole
+# process if the receiving end of a pipe stops reading."
+#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log /var/log/boa/error-%Y%m%d.log"
+
+# AccessLog: The location of the access log file. If this does not
+# start with /, it is considered relative to the server root.
+# Comment out or set to /dev/null (less effective) to disable
+# Access logging.
+
+AccessLog /var/log/boa/access_log
+# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
+# is somewhat experimental and might fail under heavy load.
+# "Usual libc implementations of printf will stall the whole
+# process if the receiving end of a pipe stops reading."
+#AccessLog "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log /var/log/boa/access-%Y%m%d.log"
+
+# UseLocaltime: Logical switch. Uncomment to use localtime
+# instead of UTC time
+#UseLocaltime
+
+# VerboseCGILogs: this is just a logical switch.
+# It simply notes the start and stop times of cgis in the error log
+# Comment out to disable.
+
+#VerboseCGILogs
+
+# ServerName: the name of this server that should be sent back to
+# clients if different than that returned by gethostname + gethostbyname
+
+#ServerName www.your.org.here
+
+# VirtualHost: a logical switch.
+# Comment out to disable.
+# Given DocumentRoot /var/www, requests on interface 'A' or IP 'IP-A'
+# become /var/www/IP-A.
+# Example: http://localhost/ becomes /var/www/127.0.0.1
+#
+# Not used until version 0.93.17.2. This "feature" also breaks commonlog
+# output rules, it prepends the interface number to each access_log line.
+# You are expected to fix that problem with a postprocessing script.
+
+#VirtualHost
+
+# DocumentRoot: The root directory of the HTML documents.
+# Comment out to disable server non user files.
+
+DocumentRoot /var/www/localhost/htdocs
+
+# UserDir: The name of the directory which is appended onto a user's home
+# directory if a ~user request is recieved.
+
+UserDir public_html
+
+# DirectoryIndex: Name of the file to use as a pre-written HTML
+# directory index. Please MAKE AND USE THESE FILES. On the
+# fly creation of directory indexes can be _slow_.
+# Comment out to always use DirectoryMaker
+
+DirectoryIndex index.html
+
+# DirectoryMaker: Name of program used to create a directory listing.
+# Comment out to disable directory listings. If both this and
+# DirectoryIndex are commented out, accessing a directory will give
+# an error (though accessing files in the directory are still ok).
+
+DirectoryMaker /usr/lib/boa/boa_indexer
+
+# DirectoryCache: If DirectoryIndex doesn't exist, and DirectoryMaker
+# has been commented out, the the on-the-fly indexing of Boa can be used
+# to generate indexes of directories. Be warned that the output is
+# extremely minimal and can cause delays when slow disks are used.
+# Note: The DirectoryCache must be writable by the same user/group that
+# Boa runs as.
+
+# DirectoryCache /var/spool/boa/dircache
+
+# KeepAliveMax: Number of KeepAlive requests to allow per connection
+# Comment out, or set to 0 to disable keepalive processing
+
+KeepAliveMax 1000
+
+# KeepAliveTimeout: seconds to wait before keepalive connection times out
+
+KeepAliveTimeout 10
+
+# MimeTypes: This is the file that is used to generate mime type pairs
+# and Content-Type fields for boa.
+# Comment out to avoid loading mime.types (better use AddType!)
+
+MimeTypes /etc/boa/mime.types
+
+# DefaultType: MIME type used if the file extension is unknown, or there
+# is no file extension.
+
+DefaultType text/plain
+
+# AddType: adds types without editing mime.types
+# Example: AddType type extension [extension ...]
+
+# Uncomment the next line if you want .cgi files to execute from anywhere
+#AddType application/x-httpd-cgi cgi
+
+# Redirect, Alias, and ScriptAlias all have the same semantics -- they
+# match the beginning of a request and take appropriate action. Use
+# Redirect for other servers, Alias for the same server, and ScriptAlias
+# to enable directories for script execution.
+
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Example: Redirect /bar http://elsewhere/feh/bar
+
+# Aliases: Aliases one path to another.
+# Example: Alias /path1/bar /path2/foo
+
+Alias /doc /usr/share/doc
+Alias /icons /var/www/localhost/icons
+
+# ScriptAlias: Maps a virtual path to a directory for serving scripts
+# Example: ScriptAlias /htbin/ /www/htbin/
+
+ScriptAlias /cgi-bin/ /var/www/localhost/cgi-bin/
+
diff --git a/www-servers/boa/files/boa.conf.d b/www-servers/boa/files/boa.conf.d
new file mode 100644
index 000000000000..5952e434dbc5
--- /dev/null
+++ b/www-servers/boa/files/boa.conf.d
@@ -0,0 +1,4 @@
+# config file for /etc/init.d/boa
+#
+# The only option allowed is '-c ServerRoot'
+BOA_OPTS="-c /etc/boa"
diff --git a/www-servers/boa/files/boa.rc6 b/www-servers/boa/files/boa.rc6
new file mode 100644
index 000000000000..3b480ce3636c
--- /dev/null
+++ b/www-servers/boa/files/boa.rc6
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# NB: Standard config is in /etc/boa/boa.conf
+# NB: Arguments to pass to boa are in /etc/conf.d/boa
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ -e /etc/conf.d/boa ] && [ -n "${BOA_OPTS}" ]; then
+ SR=`echo ${BOA_OPTS} | awk '{ FS = " " } { print $2 }'`
+ else
+ SR=/etc/boa
+ fi
+
+ if [ ! -e ${SR}/boa.conf ] ; then
+ eerror "You need a ${SR}/boa.conf to run Boa"
+ eerror "There is a sample file in /usr/share/docs/boa"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting Boa"
+ start-stop-daemon --quiet --start --exec /usr/sbin/boa -- ${BOA_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Boa"
+ start-stop-daemon --quiet --stop --name boa --exec /usr/sbin/boa
+ eend $?
+}
diff --git a/www-servers/boa/files/boa.service b/www-servers/boa/files/boa.service
new file mode 100644
index 000000000000..e4410d8e061f
--- /dev/null
+++ b/www-servers/boa/files/boa.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Boa web server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/boa -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/boa/files/mime.types b/www-servers/boa/files/mime.types
new file mode 100644
index 000000000000..53f6ea1011c8
--- /dev/null
+++ b/www-servers/boa/files/mime.types
@@ -0,0 +1,205 @@
+###############################################################################
+#
+# MIME-TYPES and the extensions that represent them
+#
+# This file is part of the "mime-support" package. Please send email (not a
+# bug report) to mime-support@packages.debian.org if you would like new types
+# and/or extensions to be added.
+#
+# Note: Compression schemes like "gzip", "bzip", and "compress" are not
+# actually "mime-types". They are "encodings" and hence must _not_ have
+# entries in this file to map their extensions. The "mime-type" of an
+# encoded file refers to the type of data that has been encoded, not the
+# type of the encoding.
+#
+###############################################################################
+
+
+application/activemessage
+application/andrew-inset
+application/applefile
+application/atomicmail
+application/cu-seeme csm cu
+application/dca-rft
+application/dec-dx
+application/dsptype tsp
+application/futuresplash spl
+application/ghostview
+application/mac-binhex40 hqx
+application/macwriteii
+application/msaccess mdb
+application/msword doc dot
+application/news-message-id
+application/news-transmission
+application/octet-stream bin
+application/oda oda
+application/pdf pdf
+application/pgp-signature pgp
+application/postscript ps ai eps
+application/remote-printing
+application/rtf rtf
+application/slate
+application/vnd.ms-excel xls xlb
+application/vnd.ms-powerpoint ppt pps pot
+application/vnd.wap.wmlc wmlc
+application/vnd.wap.wmlscriptc wmlsc
+application/wita
+application/wordperfect5.1 wp5
+application/zip zip
+application/x-123 wk
+application/x-bcpio bcpio
+application/x-chess-pgn pgn
+application/x-core
+application/x-cpio cpio
+application/x-csh
+application/x-debian-package deb
+application/x-director dcr dir dxr
+application/x-dms dms
+application/x-dvi dvi
+application/x-executable
+application/x-font pfa pfb gsf pcf pcf.Z
+application/x-gnumeric gnumeric
+application/x-gtar gtar tgz
+application/x-hdf hdf
+application/x-httpd-php phtml pht php
+application/x-httpd-php3 php3
+application/x-httpd-php3-source phps
+application/x-httpd-php3-preprocessed php3p
+application/x-httpd-php4 php4
+application/x-ica ica
+application/x-java class
+application/x-javascript js
+application/x-kdelnk
+application/x-kchart chrt
+application/x-killustrator kil
+application/x-kpresenter kpr kpt
+application/x-kspread ksp
+application/x-kword kwd kwt
+application/x-latex latex
+application/x-lha lha
+application/x-lzh lzh
+application/x-lzx lzx
+application/x-maker frm maker frame fm fb book fbdoc
+application/x-mif mif
+application/x-msdos-program com exe bat dll
+application/x-msi msi
+application/x-netcdf nc cdf
+application/x-ns-proxy-autoconfig pac
+application/x-object o
+application/x-ogg ogg
+application/x-oz-application oza
+application/x-perl pl pm
+application/x-redhat-package-manager rpm
+application/x-rx
+application/x-sh
+application/x-shar shar
+application/x-shellscript
+application/x-shockwave-flash swf swfl
+application/x-stuffit sit
+application/x-sv4cpio sv4cpio
+application/x-sv4crc sv4crc
+application/x-tar tar
+application/x-tcl
+application/x-tex
+application/x-tex-gf gf
+application/x-tex-pk pk PK
+application/x-texinfo texinfo texi
+application/x-trash ~ % bak old sik
+application/x-troff t tr roff
+application/x-troff-man man
+application/x-troff-me me
+application/x-troff-ms ms
+application/x-ustar ustar
+application/x-wais-source src
+application/x-wingz wz
+
+audio/basic au snd
+audio/midi mid midi
+audio/mpeg mpga mpega mp2 mp3
+audio/mpegurl m3u
+audio/prs.sid sid
+audio/x-aiff aif aiff aifc
+audio/x-gsm gsm
+audio/x-pn-realaudio ra rm ram
+audio/x-wav wav
+
+image/bitmap bmp
+image/gif gif
+image/ief ief
+image/jpeg jpeg jpg jpe
+image/pcx pcx
+image/png png
+image/tiff tiff tif
+image/vnd.wap.wbmp wbmp
+image/x-cmu-raster ras
+image/x-coreldraw cdr
+image/x-coreldrawpattern pat
+image/x-coreldrawtemplate cdt
+image/x-corelphotopaint cpt
+image/x-jng jng
+image/x-portable-anymap pnm
+image/x-portable-bitmap pbm
+image/x-portable-graymap pgm
+image/x-portable-pixmap ppm
+image/x-rgb rgb
+image/x-xbitmap xbm
+image/x-xpixmap xpm
+image/x-xwindowdump xwd
+
+inode/chardevice
+inode/blockdevice
+inode/directory-locked
+inode/directory
+inode/fifo
+inode/socket
+
+message/external-body
+message/news
+message/partial
+message/rfc822
+
+multipart/alternative
+multipart/appledouble
+multipart/digest
+multipart/mixed
+multipart/parallel
+
+text/comma-separated-values csv
+text/css css
+text/english
+text/html htm html xhtml
+text/mathml mml
+text/plain txt text diff
+text/richtext rtx
+text/tab-separated-values tsv
+text/vnd.wap.wml wml
+text/vnd.wap.wmlscript wmls
+text/xml xml
+text/x-c++hdr h++ hpp hxx hh
+text/x-c++src c++ cpp cxx cc
+text/x-chdr h
+text/x-crontab
+text/x-csh csh
+text/x-csrc c
+text/x-java java
+text/x-makefile
+text/x-moc moc
+text/x-pascal p pas
+text/x-setext etx
+text/x-sh sh
+text/x-tcl tcl tk
+text/x-tex tex ltx sty cls
+text/x-vcalendar vcs
+text/x-vcard vcf
+
+video/dl dl
+video/fli fli
+video/gl gl
+video/mpeg mpeg mpg mpe
+video/quicktime qt mov
+video/x-mng mng
+video/x-ms-asf asf asx
+video/x-msvideo avi
+video/x-sgi-movie movie
+
+x-world/x-vrml vrm vrml wrl
diff --git a/www-servers/boa/metadata.xml b/www-servers/boa/metadata.xml
new file mode 100644
index 000000000000..5cb9324943ab
--- /dev/null
+++ b/www-servers/boa/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/www-servers/bozohttpd/Manifest b/www-servers/bozohttpd/Manifest
new file mode 100644
index 000000000000..2ced85fe9062
--- /dev/null
+++ b/www-servers/bozohttpd/Manifest
@@ -0,0 +1 @@
+DIST bozohttpd-20140708.tar.bz2 58024 SHA256 3919e4beec82dd67f19a99e222a05358ef4d06433dbf2df48b5895499af28fc7 SHA512 ebdb27f33cd9e8c893edcb8d62f8d78d2127a3fadde0f75432b9c95fac56a0b743c1b917405b2090c15f4729e9be4ee725f73f14978b62071d2ac7261629607f WHIRLPOOL d3a59f1c39b8668fc3695f4dea649c18f11dba36115e6ba6de0a40800140bd790ce32d53354e72f829a37a3dcd5ad3bef6833144d4637d07dcfde34b6610ce32
diff --git a/www-servers/bozohttpd/bozohttpd-20140708.ebuild b/www-servers/bozohttpd/bozohttpd-20140708.ebuild
new file mode 100644
index 000000000000..3bd0745052c8
--- /dev/null
+++ b/www-servers/bozohttpd/bozohttpd-20140708.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs
+
+DESCRIPTION="bozohttpd is a small and secure http server"
+HOMEPAGE="http://www.eterna.com.au/bozohttpd/"
+SRC_URI="http://www.eterna.com.au/bozohttpd/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc x86"
+
+DEPEND="dev-libs/openssl"
+RDEPEND="${DEPEND}
+ virtual/logger"
+
+src_prepare() {
+ mv Makefile{.boot,}
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" OPT="${CFLAGS}"
+}
+
+src_install() {
+ dobin bozohttpd
+ doman bozohttpd.8
+
+ newconfd "${FILESDIR}"/${PN}.conffile bozohttpd
+ newinitd "${FILESDIR}"/${PN}.initscript bozohttpd
+}
diff --git a/www-servers/bozohttpd/files/bozohttpd.conffile b/www-servers/bozohttpd/files/bozohttpd.conffile
new file mode 100644
index 000000000000..49dbbe5517c4
--- /dev/null
+++ b/www-servers/bozohttpd/files/bozohttpd.conffile
@@ -0,0 +1,11 @@
+# Config file for /etc/init.d/bozohttpd
+
+# necessary stuff
+DATADIR=/var/www/localhost/htdocs
+BIND_ADDRESS=localhost
+LISTEN_PORT=80
+
+# optional stuff
+#USER=daemon
+#INDEX_DEFAULT=index.php
+#APPEND="-C .php /usr/bin/php"
diff --git a/www-servers/bozohttpd/files/bozohttpd.initscript b/www-servers/bozohttpd/files/bozohttpd.initscript
new file mode 100644
index 000000000000..9374e692765a
--- /dev/null
+++ b/www-servers/bozohttpd/files/bozohttpd.initscript
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+#NB: Config is in /etc/conf.d/bozohttpd
+
+
+depend() {
+ need logger net
+}
+
+checkconfig() {
+ if [ -z "$DATADIR" ] || [ -z "$BIND_ADDRESS" ] || [ -z "$LISTEN_PORT" ]; then
+ eerror "You need to setup DATADIR, BIND_ADDRESS and LISTEN PORT in /etc/conf.d/bozohttpd first"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ local params=""
+
+ [ -n "$USER" ] && params="$params -U $USER"
+ [ -n "$INDEX_DEFAULT" ] && params="$params -x $INDEX_DEFAULT"
+ [ -n "$APPEND" ] && params="$params $APPEND"
+
+ ebegin "Starting bozohttpd"
+ start-stop-daemon --start --exec /usr/bin/bozohttpd -- -b -i $BIND_ADDRESS -I $LISTEN_PORT -X ${params} $DATADIR
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping bozohttpd"
+ start-stop-daemon --stop --exec /usr/bin/bozohttpd
+ eend ${?}
+}
diff --git a/www-servers/bozohttpd/metadata.xml b/www-servers/bozohttpd/metadata.xml
new file mode 100644
index 000000000000..66bebd492cf5
--- /dev/null
+++ b/www-servers/bozohttpd/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+<email>maintainer-needed@gentoo.org</email>
+</maintainer>
+<longdescription>
+ bozohttpd is designed to be small, simple and relatively
+ featureless, hopefully increasing its security.
+</longdescription>
+</pkgmetadata>
diff --git a/www-servers/cherokee/Manifest b/www-servers/cherokee/Manifest
new file mode 100644
index 000000000000..d62c4198dccf
--- /dev/null
+++ b/www-servers/cherokee/Manifest
@@ -0,0 +1,3 @@
+DIST cherokee-1.2.103.zip 5783906 SHA256 0e125cba2ad2d0dc48ecca3af4894b92ec5fab422a9d7d27fd0c7a74751e5f35 SHA512 63ba5d41f61d2816df7dce3b572616eca5fc09dd2e9dca9efa2cbf28a38d6d5e1840e4cd302a0eb5780b1a0abe7632232511c77d9e383f0b945d3eca960af4ab WHIRLPOOL 00f592bc41eecd6422a95d6e36bf5c46b4845afe2adad756635d0d2c1e5c1bfde03e633bcbde8cab207c31050dc055e26fcdbf69512a8b61422242905b792754
+DIST cherokee-1.2.104.zip 6200164 SHA256 1acc80de22ed0aa4a0d95aa643ac92a2cce435480258081213214bec05da4098 SHA512 9c9f44643d0d2636f2e3e61ef8e2918d91d9bb6099be761826c8ffad01d339739ed40984d01151044c2e536d4754b5157d6d20c37627ce49eecdb404a716cd9d WHIRLPOOL b0c13205014daee461538d0b7968bf255fd6633dbf3defeb2505ce463772c6f56b06ef91ff6b055bd589a15d19974d794fcbe039c1552b04a6bd1228a690f417
+DIST cherokee-ctk-master.zip 415092 SHA256 dede313f1d396f1deaf78d9fd9a1270820d2e91761efe827a207b46061f27993 SHA512 c933f15aa7197f5001b3120fd27898b2e97b78998e0bd0d68e7ced16a57950b7e85e4d731ca0420cd8a0fb292b4cd34b9497928183ccca22c9aa3a16285f9ef7 WHIRLPOOL 92453d3478ae238e5d9422fc2e8f0f1406576f9753ba0ed644ae8e093862b72c8c634bdaaeec4c0f725bdef8f4bc5c7113a916c2cdd8fbb0a14db61e54173c57
diff --git a/www-servers/cherokee/cherokee-1.2.103-r2.ebuild b/www-servers/cherokee/cherokee-1.2.103-r2.ebuild
new file mode 100644
index 000000000000..1d87b9ec2d41
--- /dev/null
+++ b/www-servers/cherokee/cherokee-1.2.103-r2.ebuild
@@ -0,0 +1,194 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_AUTOMAKE="1.11"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools python-r1 eutils multilib pam systemd user
+
+DESCRIPTION="An extremely fast and tiny web server"
+SRC_URI="https://github.com/cherokee/webserver/archive/v${PV}.zip -> ${P}.zip
+ https://github.com/cherokee/CTK/archive/master.zip -> ${PN}-ctk-master.zip"
+HOMEPAGE="http://www.cherokee-project.com/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE="admin ffmpeg debug geoip ipv6 kernel_linux ldap mysql nls pam php rrdtool ssl static static-libs"
+
+COMMON_DEPEND="dev-libs/libpcre
+ >=sys-libs/zlib-1.1.4-r1
+ ffmpeg? ( virtual/ffmpeg )
+ geoip? ( dev-libs/geoip )
+ ldap? ( net-nds/openldap )
+ mysql? ( >=virtual/mysql-5 )
+ nls? ( virtual/libintl )
+ pam? ( virtual/pam )
+ php? ( || (
+ dev-lang/php[fpm]
+ dev-lang/php[cgi]
+ ) )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${COMMON_DEPEND}
+ rrdtool? ( net-analyzer/rrdtool )"
+
+RESTRICT="test"
+
+WEBROOT="/var/www/localhost"
+
+src_unpack() {
+ unpack ${A}
+ mv "webserver-${PV}" "${S}" || die
+ rmdir "${S}/admin/CTK" || die
+ mv "CTK-master" "${S}/admin/CTK" || die
+}
+
+pkg_setup() {
+ enewgroup cherokee
+ enewuser cherokee -1 -1 /var/www cherokee
+}
+
+src_prepare() {
+ python_setup
+ epatch \
+ "${FILESDIR}/${PN}-1.2.99-gentoo.patch" \
+ "${FILESDIR}/${PN}-1.2.103-linux3.patch"
+
+ "${S}/po/admin/generate_POTFILESin.py" > po/admin/POTFILES.in
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use admin ; then
+ myconf="${myconf} --enable-admin --with-python=/usr/bin/python"
+ else
+ myconf="${myconf} --disable-admin"
+ fi
+
+ # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
+ if ! use php ; then
+ myconf="${myconf} --without-php"
+ fi
+
+ if use static ; then
+ myconf="${myconf} --enable-static-module=all"
+ fi
+
+ local os="Unknown"
+ case "${CHOST}" in
+ *-freebsd*)
+ os="FreeBSD" ;;
+ *-netbsd*)
+ os="NetBSD" ;;
+ *-openbsd*)
+ os="OpenBSD" ;;
+ *)
+ os="Linux" ;;
+ esac
+
+ econf \
+ $(use_enable debug trace) \
+ $(use_enable debug backtraces) \
+ $(use_enable ipv6) \
+ $(use_enable kernel_linux epoll) \
+ $(use_enable nls) \
+ $(use_enable pam) \
+ $(use_enable static-libs static) \
+ $(use_with ffmpeg) \
+ $(use_with geoip) \
+ $(use_with ldap) \
+ $(use_with mysql) \
+ $(use_with ssl libssl) \
+ --disable-dependency-tracking \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --enable-os-string="Gentoo ${os}" \
+ --enable-tmpdir="${EPREFIX}/var/tmp" \
+ --localstatedir="${EPREFIX}/var" \
+ --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
+ --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
+ --with-wwwuser=cherokee \
+ --with-wwwgroup=cherokee \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if ! use static-libs ; then
+ find "${ED}" -name '*.la' -delete || die
+ elif ! use static ; then
+ find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
+ fi
+
+ dodoc AUTHORS NEWS README.rst
+
+ if use pam ; then
+ pamd_mimic system-auth cherokee auth account session || die
+ fi
+
+ newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN}
+ newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
+
+ if ! use admin ; then
+ rm -r \
+ "${ED}"/usr/bin/cherokee-admin-launcher \
+ "${ED}"/usr/bin/CTK-run \
+ "${ED}"/usr/sbin/cherokee-admin \
+ "${ED}"/usr/share/cherokee/admin || die
+ fi
+
+ exeinto /usr/share/doc/${PF}/contrib
+ doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py}
+
+ #move the htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${ED}"${WEBROOT}/htdocs \
+ "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${ED}"${WEBROOT}/htdocs
+
+ keepdir \
+ "${WEBROOT}"/htdocs \
+ /var/log/cherokee \
+ /var/lib/cherokee/graphs/images
+ fowners cherokee:cherokee \
+ /var/log/cherokee \
+ /var/lib/cherokee/graphs \
+ /var/lib/cherokee/graphs/images
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
+
+ systemd_dounit "${FILESDIR}"/cherokee.service
+}
+
+pkg_postinst() {
+ elog
+ if use admin ; then
+ elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
+ elog
+ elog "Cherokee currently supports configuration versioning, so from now on,"
+ elog "whenever a change is made to the configuration file format,"
+ elog "Cherokee-Admin will be able to automatically convert yours to the new"
+ elog "release. You simply have to load Cherokee-Admin and it will be converted"
+ elog "once you proceed to saving it."
+ elog
+ elog "There is also a command line utility that you can use to do the exact"
+ elog "same thing. Config format can change in different versions. It is"
+ elog "provided under:"
+ elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
+ else
+ elog "Try USE=admin if you want an easy way to configure cherokee."
+ fi
+ elog
+ elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
+ elog
+}
diff --git a/www-servers/cherokee/cherokee-1.2.104.ebuild b/www-servers/cherokee/cherokee-1.2.104.ebuild
new file mode 100644
index 000000000000..a78bc089d0e4
--- /dev/null
+++ b/www-servers/cherokee/cherokee-1.2.104.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+WANT_AUTOMAKE="1.11"
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools python-r1 eutils multilib pam systemd user
+
+DESCRIPTION="An extremely fast and tiny web server"
+SRC_URI="https://github.com/cherokee/webserver/archive/v${PV}.zip -> ${P}.zip"
+HOMEPAGE="http://www.cherokee-project.com/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE="admin ffmpeg debug geoip ipv6 kernel_linux ldap mysql nls pam php rrdtool ssl static static-libs"
+
+COMMON_DEPEND="dev-libs/libpcre
+ >=sys-libs/zlib-1.1.4-r1
+ ffmpeg? ( virtual/ffmpeg )
+ geoip? ( dev-libs/geoip )
+ ldap? ( net-nds/openldap )
+ mysql? ( >=virtual/mysql-5 )
+ nls? ( virtual/libintl )
+ pam? ( virtual/pam )
+ php? ( || (
+ dev-lang/php[fpm]
+ dev-lang/php[cgi]
+ ) )
+ ssl? ( dev-libs/openssl )"
+DEPEND="${COMMON_DEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${COMMON_DEPEND}
+ rrdtool? ( net-analyzer/rrdtool )"
+
+RESTRICT="test"
+
+WEBROOT="/var/www/localhost"
+
+src_unpack() {
+ unpack ${A}
+ mv "webserver-${PV}" "${S}" || die
+}
+
+pkg_setup() {
+ enewgroup cherokee
+ enewuser cherokee -1 -1 /var/www cherokee
+}
+
+src_prepare() {
+ python_setup
+ epatch \
+ "${FILESDIR}/${PN}-1.2.99-gentoo.patch"
+
+ "${S}/po/admin/generate_POTFILESin.py" > po/admin/POTFILES.in
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use admin ; then
+ myconf="${myconf} --enable-admin --with-python=/usr/bin/python"
+ else
+ myconf="${myconf} --disable-admin"
+ fi
+
+ # Uses autodetect because --with-php requires path to php-{fpm,cgi}.
+ if ! use php ; then
+ myconf="${myconf} --without-php"
+ fi
+
+ if use static ; then
+ myconf="${myconf} --enable-static-module=all"
+ fi
+
+ local os="Unknown"
+ case "${CHOST}" in
+ *-freebsd*)
+ os="FreeBSD" ;;
+ *-netbsd*)
+ os="NetBSD" ;;
+ *-openbsd*)
+ os="OpenBSD" ;;
+ *)
+ os="Linux" ;;
+ esac
+
+ econf \
+ $(use_enable debug trace) \
+ $(use_enable debug backtraces) \
+ $(use_enable ipv6) \
+ $(use_enable kernel_linux epoll) \
+ $(use_enable nls) \
+ $(use_enable pam) \
+ $(use_enable static-libs static) \
+ $(use_with ffmpeg) \
+ $(use_with geoip) \
+ $(use_with ldap) \
+ $(use_with mysql) \
+ $(use_with ssl libssl) \
+ --disable-dependency-tracking \
+ --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
+ --enable-os-string="Gentoo ${os}" \
+ --enable-tmpdir="${EPREFIX}/var/tmp" \
+ --localstatedir="${EPREFIX}/var" \
+ --with-wwwroot="${EPREFIX}${WEBROOT}/htdocs" \
+ --with-cgiroot="${EPREFIX}${WEBROOT}/cgi-bin" \
+ --with-wwwuser=cherokee \
+ --with-wwwgroup=cherokee \
+ ${myconf}
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if ! use static-libs ; then
+ find "${ED}" -name '*.la' -delete || die
+ elif ! use static ; then
+ find "${ED}/usr/$(get_libdir)/cherokee" '(' -name '*.la' -o -name '*.a' ')' -delete || die
+ fi
+
+ dodoc AUTHORS NEWS README.rst
+
+ if use pam ; then
+ pamd_mimic system-auth cherokee auth account session || die
+ fi
+
+ newinitd "${FILESDIR}/${PN}-initd-1.2.99" ${PN}
+ newconfd "${FILESDIR}/${PN}-confd-1.2.98" ${PN}
+
+ if ! use admin ; then
+ rm -r \
+ "${ED}"/usr/bin/cherokee-admin-launcher \
+ "${ED}"/usr/bin/CTK-run \
+ "${ED}"/usr/sbin/cherokee-admin \
+ "${ED}"/usr/share/cherokee/admin || die
+ fi
+
+ exeinto /usr/share/doc/${PF}/contrib
+ doexe contrib/{bin2buffer.py,make-cert.sh,make-dh_params.sh,tracelor.py}
+
+ #move the htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${ED}"${WEBROOT}/htdocs \
+ "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${ED}"${WEBROOT}/htdocs
+
+ keepdir \
+ "${WEBROOT}"/htdocs \
+ /var/log/cherokee \
+ /var/lib/cherokee/graphs/images
+ fowners cherokee:cherokee \
+ /var/log/cherokee \
+ /var/lib/cherokee/graphs \
+ /var/lib/cherokee/graphs/images
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}.logrotate-r1 ${PN}
+
+ systemd_dounit "${FILESDIR}"/cherokee.service
+}
+
+pkg_postinst() {
+ elog
+ if use admin ; then
+ elog "Just run '/usr/sbin/cherokee-admin' and go to: http://localhost:9090"
+ elog
+ elog "Cherokee currently supports configuration versioning, so from now on,"
+ elog "whenever a change is made to the configuration file format,"
+ elog "Cherokee-Admin will be able to automatically convert yours to the new"
+ elog "release. You simply have to load Cherokee-Admin and it will be converted"
+ elog "once you proceed to saving it."
+ elog
+ elog "There is also a command line utility that you can use to do the exact"
+ elog "same thing. Config format can change in different versions. It is"
+ elog "provided under:"
+ elog " ${EPREFIX}/usr/share/cherokee/admin/upgrade_config.py"
+ else
+ elog "Try USE=admin if you want an easy way to configure cherokee."
+ fi
+ elog
+ elog "emerge www-servers/spawn-fcgi if you use Ruby on Rails with ${PN}."
+ elog
+}
diff --git a/www-servers/cherokee/files/cherokee-1.2.103-linux3.patch b/www-servers/cherokee/files/cherokee-1.2.103-linux3.patch
new file mode 100644
index 000000000000..7f96f68ab97e
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee-1.2.103-linux3.patch
@@ -0,0 +1,36 @@
+diff -Naur webserver-1.2.103.orig/admin/SystemStats.py webserver-1.2.103/admin/SystemStats.py
+--- webserver-1.2.103.orig/admin/SystemStats.py 2013-01-26 17:52:44.000000000 -0500
++++ webserver-1.2.103/admin/SystemStats.py 2013-07-15 07:27:11.000000000 -0400
+@@ -39,7 +39,7 @@
+ global _stats
+
+ if not _stats:
+- if sys.platform == 'linux2':
++ if sys.platform == 'linux2' or sys.platform == 'linux3':
+ _stats = System_stats__Linux()
+ elif sys.platform == 'darwin':
+ _stats = System_stats__Darwin()
+diff -Naur webserver-1.2.103.orig/admin/util.py webserver-1.2.103/admin/util.py
+--- webserver-1.2.103.orig/admin/util.py 2013-01-26 17:52:44.000000000 -0500
++++ webserver-1.2.103/admin/util.py 2013-07-15 07:29:12.000000000 -0400
+@@ -341,7 +341,7 @@
+ def os_get_document_root():
+ if sys.platform == 'darwin':
+ return "/Library/WebServer/Documents"
+- elif sys.platform == 'linux2':
++ elif sys.platform == 'linux2' or sys.platform == 'linux3':
+ if os.path.exists ("/etc/redhat-release"):
+ return '/var/www'
+ elif os.path.exists ("/etc/fedora-release"):
+diff -Naur webserver-1.2.103.orig/admin/wizards/php.py webserver-1.2.103/admin/wizards/php.py
+--- webserver-1.2.103.orig/admin/wizards/php.py 2013-01-26 17:52:44.000000000 -0500
++++ webserver-1.2.103/admin/wizards/php.py 2013-07-15 07:29:47.000000000 -0400
+@@ -607,7 +607,7 @@
+ first_group = str(root_group)
+
+ # Systems
+- if sys.platform == 'linux2':
++ if sys.platform == 'linux2' or sys.platform == 'linux3':
+ if os.getuid() == 0:
+ return root_group
+ return first_group
diff --git a/www-servers/cherokee/files/cherokee-1.2.99-gentoo.patch b/www-servers/cherokee/files/cherokee-1.2.99-gentoo.patch
new file mode 100644
index 000000000000..d55a5a2a82cf
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee-1.2.99-gentoo.patch
@@ -0,0 +1,38 @@
+diff -Naur cherokee-1.2.99.orig/admin/configured.py.pre cherokee-1.2.99/admin/configured.py.pre
+--- cherokee-1.2.99.orig/admin/configured.py.pre 2011-03-31 17:30:04.000000000 +0900
++++ cherokee-1.2.99/admin/configured.py.pre 2011-09-16 19:37:15.893487362 +0900
+@@ -22,7 +22,7 @@
+ CHEROKEE_DATADIR = join (DATADIR, "cherokee")
+ CHEROKEE_DEPSDIR = join (DATADIR, "cherokee/deps")
+ CHEROKEE_CONFDIR = join (SYSCONFDIR, "cherokee")
+-CHEROKEE_VAR_LOG = join (LOCALSTATE, "log")
++CHEROKEE_VAR_LOG = join (LOCALSTATE, "log/cherokee")
+ CHEROKEE_VAR_RUN = join (LOCALSTATE, "run")
+ CHEROKEE_VAR_LIB = join (LOCALSTATE, "lib/cherokee")
+ CHEROKEE_RRD_DIR = join (LOCALSTATE, "lib/cherokee/graphs")
+diff -Naur cherokee-1.2.99.orig/cherokee.conf.sample.pre cherokee-1.2.99/cherokee.conf.sample.pre
+--- cherokee-1.2.99.orig/cherokee.conf.sample.pre 2011-05-03 18:01:42.000000000 +0900
++++ cherokee-1.2.99/cherokee.conf.sample.pre 2011-09-16 19:37:15.894487368 +0900
+@@ -18,6 +18,8 @@
+ server!server_tokens = full
+ server!panic_action = %prefix%/bin/cherokee-panic
+ server!pid_file = %localstatedir%/run/cherokee.pid
++server!user = cherokee
++server!group = cherokee
+
+ # Default virtual server
+ #
+@@ -27,11 +29,11 @@
+
+ vserver!1!logger = combined
+ vserver!1!logger!access!type = file
+-vserver!1!logger!access!filename = %localstatedir%/log/cherokee.access
++vserver!1!logger!access!filename = %localstatedir%/log/cherokee/cherokee.access
+ vserver!1!logger!access!buffsize = 16384
+
+ vserver!1!error_writer!type = file
+-vserver!1!error_writer!filename = %localstatedir%/log/cherokee.error
++vserver!1!error_writer!filename = %localstatedir%/log/cherokee/cherokee.error
+
+ vserver!1!rule!1!match = default
+ vserver!1!rule!1!handler = common
diff --git a/www-servers/cherokee/files/cherokee-confd-1.2.98 b/www-servers/cherokee/files/cherokee-confd-1.2.98
new file mode 100644
index 000000000000..62e7fd64f787
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee-confd-1.2.98
@@ -0,0 +1,4 @@
+# /etc/conf.d/cherokee: config file for /etc/init.d/cherokee
+
+#CHEROKEE_OPTS="--config=/etc/cherokee/cherokee.conf --valgrind"
+CHEROKEE_OPTS=""
diff --git a/www-servers/cherokee/files/cherokee-initd-1.2.99 b/www-servers/cherokee/files/cherokee-initd-1.2.99
new file mode 100644
index 000000000000..ad4fb7f2d865
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee-initd-1.2.99
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/cherokee"
+extra_commands="configtest"
+extra_started_commands="graceful reload"
+
+
+depend() {
+ need net
+ use dns ldap logger mysql netmount
+}
+
+checkconfig() {
+ ${command} -t 1>/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your config:"
+ ${command} -t ${CHEROKEE_OPTS}
+ fi
+ return $?
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet \
+ --exec ${command} -- -d ${CHEROKEE_OPTS}
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet \
+ --exec ${command}
+ eend $?
+}
+
+graceful() {
+ checkconfig || return 1
+
+ ebegin "Restarting ${SVCNAME} and closing all the opened connections"
+ start-stop-daemon \
+ --exec ${command} \
+ --signal USR1
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading ${SVCNAME} configuration"
+ start-stop-daemon \
+ --exec ${command} \
+ --signal HUP
+ eend $?
+}
diff --git a/www-servers/cherokee/files/cherokee.logrotate-r1 b/www-servers/cherokee/files/cherokee.logrotate-r1
new file mode 100644
index 000000000000..acb30e2cefa5
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee.logrotate-r1
@@ -0,0 +1,11 @@
+# $Id$
+# lighttpd logrotate script for Gentoo
+
+/var/log/cherokee/cherokee.access /var/log/cherokee/cherokee.error {
+ missingok
+ notifempty
+ sharedscripts
+ postrotate
+ [ -f /var/run/cherokee.pid ] && /bin/kill -USR2 `cat /var/run/cherokee.pid`
+ endscript
+}
diff --git a/www-servers/cherokee/files/cherokee.service b/www-servers/cherokee/files/cherokee.service
new file mode 100644
index 000000000000..a2d703185d37
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Cherokee web server
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/cherokee -d -C /etc/cherokee/cherokee.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/cherokee/metadata.xml b/www-servers/cherokee/metadata.xml
new file mode 100644
index 000000000000..322df7139a03
--- /dev/null
+++ b/www-servers/cherokee/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="admin">Install web based cherokee conf tool</flag>
+ <flag name="rrdtool">Enable rrdtool support</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">cherokee/webserver</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/fnord/Manifest b/www-servers/fnord/Manifest
new file mode 100644
index 000000000000..710284a62f66
--- /dev/null
+++ b/www-servers/fnord/Manifest
@@ -0,0 +1,2 @@
+DIST fnord-1.10.tar.bz2 33408 SHA256 39a878e910d569fbf3909d8efe7ec6dd85c9484711b0d748b51012a15ddf3cc7
+DIST fnord-1.11.tar.bz2 28845 SHA256 896f734b589b52a145dbb1d268f41ae94eff90529db36658a66eda3aada21d35 SHA512 12a3751a2f98acb3ba2d468972bb785b656fa01bfb0828bc9ba5488dc7a2a66e9f226a6cc49ceda57aa7875d8d90954a9e79806c9506a7906cfff346cd400154 WHIRLPOOL b6d644b6689f1b90bec777ae0d85852767ba7f83e69420590645883ce81e2d8f72debf1d993e061fb984a01936ecb001b31f212d281d7847c736cb9b00259a2e
diff --git a/www-servers/fnord/files/fnord-1.10-gentoo.diff b/www-servers/fnord/files/fnord-1.10-gentoo.diff
new file mode 100644
index 000000000000..3e2f1f5fc7c4
--- /dev/null
+++ b/www-servers/fnord/files/fnord-1.10-gentoo.diff
@@ -0,0 +1,99 @@
+diff -Naur fnord-1.10.orig/fnord-conf fnord-1.10/fnord-conf
+--- fnord-1.10.orig/fnord-conf 2010-10-22 17:31:41.000000000 +0200
++++ fnord-1.10/fnord-conf 2010-10-22 19:57:28.000000000 +0200
+@@ -17,7 +17,7 @@
+ mkdir -p $dir
+ echo "#!/bin/sh" > $dir/run
+ echo "cd $webroot" >> $dir/run
+-echo "exec envuidgid $acct tcpserver -RHl localhost ${myip:-0} 80 fnord 2>&1" >> $dir/run
++echo "exec envuidgid $acct tcpserver -RHl localhost ${myip:-0} 80 /usr/bin/fnord 2>&1" >> $dir/run
+ chmod 755 $dir/run
+
+ # tell old daemontools that it should spawn a log process, too
+diff -Naur fnord-1.10.orig/httpd.c fnord-1.10/httpd.c
+--- fnord-1.10.orig/httpd.c 2010-10-22 17:31:41.000000000 +0200
++++ fnord-1.10/httpd.c 2010-10-22 19:57:28.000000000 +0200
+@@ -25,7 +25,9 @@
+ #include "scan.h"
+
+ /* uncomment the following line to enable support for CGI */
+-// #define CGI
++#ifndef CGI
++# define CGI
++#endif
+
+ #ifdef CGI
+ /* uncomment the following line to enable support for "index.cgi"
+@@ -39,7 +41,9 @@
+
+ /* uncomment the following line to enable support for autogenerated
+ * directory-listings for directories without index */
+-/* #define DIR_LIST */
++#ifndef DIR_LIST
++# define DIR_LIST
++#endif
+
+ #ifdef DIR_LIST
+ /* uncomment the following line to enable support for system symlink
+diff -Naur fnord-1.10.orig/Makefile fnord-1.10/Makefile
+--- fnord-1.10.orig/Makefile 2010-10-22 17:31:41.000000000 +0200
++++ fnord-1.10/Makefile 2010-10-22 19:58:56.000000000 +0200
+@@ -1,28 +1,19 @@
+-CC=gcc
+-CXX=g++
+-
+-#LIBOWFAT=../libowfat/
+-DIET=diet -Os
+-
+-CFLAGS=-Os -fomit-frame-pointer
+-#CFLAGS=-g
++CC:=gcc
++CXX:=g++
+
+ all: fnord fnord-cgi fnord-idx
+
+ fnord: httpd
+ cp -p $^ $@
+- -strip -R .note -R .comment $@
+
+ httpd: httpd.o libowfat.a
+- $(DIET) $(CC) -o $@ $^ $(CFLAGS)
++ $(DIET) $(CC) $(LDFLAGS) -o $@ $^ $(CFLAGS)
+
+ fnord-cgi: httpd-cgi.o libowfat.a
+- $(DIET) $(CC) -o $@ $^ $(CFLAGS)
+- -strip -R .note -R .comment $@
++ $(DIET) $(CC) $(LDFLAGS) -o $@ $^ $(CFLAGS)
+
+ fnord-idx: httpd-idx.o libowfat.a
+- $(DIET) $(CC) -o $@ $^ $(CFLAGS)
+- -strip -R .note -R .comment $@
++ $(DIET) $(CC) $(LDFLAGS) -o $@ $^ $(CFLAGS)
+
+ libowfat.a: httpd.o buffer_1.o buffer_puts.o buffer_flush.o buffer_put.o \
+ buffer_putulong.o buffer_2.o buffer_putspace.o buffer_stubborn.o \
+@@ -32,19 +23,19 @@
+ -ranlib $@
+
+ httpd.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c $^ -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c $^ -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ httpd-cgi.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c httpd.c -o $@ -DCGI -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c httpd.c -o $@ -DCGI -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ httpd-idx.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c httpd.c -o $@ -DDIR_LIST -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c httpd.c -o $@ -DDIR_LIST -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ %.o: %.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c $^
++ $(DIET) $(CC) $(CFLAGS) -c $^
+
+ %.o: %.cpp
+- $(DIET) $(CXX) -pipe $(CFLAGS) -c $^
++ $(DIET) $(CXX) $(CFLAGS) -c $^
+
+ .PHONY: rename clean install server
+ server: fnord
diff --git a/www-servers/fnord/files/fnord-1.9-gentoo.diff b/www-servers/fnord/files/fnord-1.9-gentoo.diff
new file mode 100644
index 000000000000..c32c53daf539
--- /dev/null
+++ b/www-servers/fnord/files/fnord-1.9-gentoo.diff
@@ -0,0 +1,96 @@
+diff --exclude='*~' -urN fnord-1.9.orig/fnord-conf fnord-1.9/fnord-conf
+--- fnord-1.9.orig/fnord-conf 2003-06-05 19:32:39.000000000 -0400
++++ fnord-1.9/fnord-conf 2005-03-06 22:39:30.243806792 -0500
+@@ -17,7 +17,7 @@
+ mkdir -p $dir
+ echo "#!/bin/sh" > $dir/run
+ echo "cd $webroot" >> $dir/run
+-echo "exec envuidgid $acct tcpserver -RHl localhost ${myip:-0} 80 fnord 2>&1" >> $dir/run
++echo "exec envuidgid $acct tcpserver -RHl localhost ${myip:-0} 80 /usr/bin/fnord 2>&1" >> $dir/run
+ chmod 755 $dir/run
+
+ # tell old daemontools that it should spawn a log process, too
+diff --exclude='*~' -urN fnord-1.9.orig/httpd.c fnord-1.9/httpd.c
+--- fnord-1.9.orig/httpd.c 2005-01-31 11:10:39.000000000 -0500
++++ fnord-1.9/httpd.c 2005-03-06 22:42:07.761860408 -0500
+@@ -25,7 +25,9 @@
+ #include "scan.h"
+
+ /* uncomment the following line to enable support for CGI */
+-// #define CGI
++#ifndef CGI
++# define CGI
++#endif
+
+ #ifdef CGI
+ /* uncomment the following line to enable support for "index.cgi"
+@@ -39,7 +41,9 @@
+
+ /* uncomment the following line to enable support for autogenerated
+ * directory-listings for directories without index */
+-/* #define DIR_LIST */
++#ifndef DIR_LIST
++# define DIR_LIST
++#endif
+
+ #ifdef DIR_LIST
+ /* uncomment the following line to enable support for system symlink
+diff --exclude='*~' -urN fnord-1.9.orig/Makefile fnord-1.9/Makefile
+--- fnord-1.9.orig/Makefile 2005-01-31 13:33:58.000000000 -0500
++++ fnord-1.9/Makefile 2005-03-06 22:51:27.914704232 -0500
+@@ -1,28 +1,19 @@
+-CC=gcc
+-CXX=g++
+-
+-#LIBOWFAT=../libowfat/
+-DIET=diet -Os
+-
+-CFLAGS=-Os -fomit-frame-pointer
+-#CFLAGS=-g
++CC:=gcc
++CXX:=g++
+
+ all: fnord fnord-cgi fnord-idx
+
+ fnord: httpd
+ cp -p $^ $@
+- -strip -R .note -R .comment $@
+
+ httpd: httpd.o libowfat.a
+ $(DIET) $(CC) -o $@ $^ $(CFLAGS)
+
+ fnord-cgi: httpd-cgi.o libowfat.a
+ $(DIET) $(CC) -o $@ $^ $(CFLAGS)
+- -strip -R .note -R .comment $@
+
+ fnord-idx: httpd-idx.o libowfat.a
+ $(DIET) $(CC) -o $@ $^ $(CFLAGS)
+- -strip -R .note -R .comment $@
+
+ libowfat.a: httpd.o buffer_1.o buffer_puts.o buffer_flush.o buffer_put.o \
+ buffer_putulong.o buffer_2.o buffer_putspace.o buffer_stubborn.o \
+@@ -32,19 +23,19 @@
+ -ranlib $@
+
+ httpd.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c $^ -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c $^ -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ httpd-cgi.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c httpd.c -o $@ -DCGI -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c httpd.c -o $@ -DCGI -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ httpd-idx.o: httpd.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c httpd.c -o $@ -DDIR_LIST -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
++ $(DIET) $(CC) $(CFLAGS) -c httpd.c -o $@ -DDIR_LIST -DFNORD=\"fnord/$(shell head -n 1 CHANGES|sed 's/://')\"
+
+ %.o: %.c
+- $(DIET) $(CC) -pipe $(CFLAGS) -c $^
++ $(DIET) $(CC) $(CFLAGS) -c $^
+
+ %.o: %.cpp
+- $(DIET) $(CXX) -pipe $(CFLAGS) -c $^
++ $(DIET) $(CXX) $(CFLAGS) -c $^
+
+ .PHONY: rename clean install server
+ server: fnord
diff --git a/www-servers/fnord/fnord-1.10-r2.ebuild b/www-servers/fnord/fnord-1.10-r2.ebuild
new file mode 100644
index 000000000000..48f64b429f05
--- /dev/null
+++ b/www-servers/fnord/fnord-1.10-r2.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs user
+
+DESCRIPTION="Yet another small httpd"
+HOMEPAGE="http://www.fefe.de/fnord/"
+SRC_URI="http://www.fefe.de/fnord/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="hppa ppc sparc x86"
+IUSE="auth"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ virtual/daemontools
+ sys-apps/ucspi-tcp"
+
+pkg_setup() {
+ enewgroup nofiles 200
+ enewuser fnord -1 -1 /etc/fnord nofiles
+ enewuser fnordlog -1 -1 /etc/fnord nofiles
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}"-1.10-gentoo.diff
+}
+
+src_compile() {
+ # Fix for bug #45716
+ replace-sparc64-flags
+
+ use auth && \
+ append-flags -DAUTH
+
+ emake DIET="" CC=$(tc-getCC) \
+ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_install () {
+ dobin fnord-conf fnord || die
+ dodoc TODO README* SPEED CHANGES
+}
diff --git a/www-servers/fnord/fnord-1.11.ebuild b/www-servers/fnord/fnord-1.11.ebuild
new file mode 100644
index 000000000000..bcfee8f25ebe
--- /dev/null
+++ b/www-servers/fnord/fnord-1.11.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+
+inherit eutils flag-o-matic toolchain-funcs user
+
+DESCRIPTION="Yet another small httpd"
+HOMEPAGE="http://www.fefe.de/fnord/"
+SRC_URI="http://www.fefe.de/fnord/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+IUSE="auth"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ virtual/daemontools
+ sys-apps/ucspi-tcp"
+
+pkg_setup() {
+ enewgroup nofiles 200
+ enewuser fnord -1 -1 /etc/fnord nofiles
+ enewuser fnordlog -1 -1 /etc/fnord nofiles
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}"-1.10-gentoo.diff
+}
+
+src_compile() {
+ # Fix for bug #45716
+ replace-sparc64-flags
+
+ use auth && \
+ append-flags -DAUTH
+
+ emake DIET="" CC=$(tc-getCC) \
+ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die "emake failed"
+}
+
+src_install () {
+ dobin fnord-conf fnord || die
+ dodoc TODO README* SPEED CHANGES
+}
diff --git a/www-servers/fnord/metadata.xml b/www-servers/fnord/metadata.xml
new file mode 100644
index 000000000000..5122b8786215
--- /dev/null
+++ b/www-servers/fnord/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+ <use>
+ <flag name='auth'>Enable HTTP authentication support</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/gatling/Manifest b/www-servers/gatling/Manifest
new file mode 100644
index 000000000000..64cc3741df75
--- /dev/null
+++ b/www-servers/gatling/Manifest
@@ -0,0 +1,2 @@
+DIST gatling-0.12.tar.bz2 99540 SHA256 ffe4dbff99404eb80e6aac215fdf6bf8174355edc33dd1848a51fc1093296a7c
+DIST gatling-0.13.tar.bz2 108128 SHA256 b42145fdf7b66602fa8bc64661c2762172f6d33dbd9d53efebf821cd81e89245 SHA512 b9fa604aa8bb8c5d40d9c3eaaa536ed5e73d0ed93eccb41ca4744316ad893dc6fe92fe2c1f0247de82d4eda63b0ab7ab338355d9963fb58f23d39a2c678a1db8 WHIRLPOOL c9d90bec09cf07bc506bd84491d550834d48e0e3b19b2e7095ab43a4a3cd7a182fc1660d5a5cef878f1e1a7b3d367c5e76efc75df77269ab89d64c73c2af7a59
diff --git a/www-servers/gatling/files/gatling-0.12-FLAGS.patch b/www-servers/gatling/files/gatling-0.12-FLAGS.patch
new file mode 100644
index 000000000000..c7bd1fe4ceaf
--- /dev/null
+++ b/www-servers/gatling/files/gatling-0.12-FLAGS.patch
@@ -0,0 +1,40 @@
+diff -NrU5 gatling-0.12.original/GNUmakefile gatling-0.12/GNUmakefile
+--- gatling-0.12.original/GNUmakefile 2010-05-30 16:58:29.000000000 -0600
++++ gatling-0.12/GNUmakefile 2010-05-30 17:03:21.000000000 -0600
+@@ -1,8 +1,8 @@
+ #DEBUG=1
+ ZLIB=1
+-prefix=/opt/diet
++prefix=/usr
+ BINDIR=${prefix}/bin
+ MANDIR=${prefix}/man
+ man1dir=$(MANDIR)/man1
+
+ TARGETS=gatling httpbench bindbench dl ioerr bench tlsgatling \
+@@ -14,12 +14,12 @@
+ all: $(ALLTARGETS)
+
+ CROSS=
+ #CROSS=i686-mingw32-
+ CC=$(CROSS)gcc
+-CFLAGS=-pipe -Wall
+-LDFLAGS=
++CFLAGS+=-pipe -Wall -I/usr/include/libowfat
++LDFLAGS+=
+
+ path = $(subst :, ,$(PATH))
+ diet_path = $(foreach dir,$(path),$(wildcard $(dir)/diet))
+ ifeq ($(strip $(diet_path)),)
+ ifneq ($(wildcard /opt/diet/bin/diet),)
+@@ -37,11 +37,10 @@
+ ifneq ($(DEBUG),)
+ CFLAGS+=-g
+ LDFLAGS+=-g
+ else
+ CFLAGS+=-O2 -fomit-frame-pointer -I/usr/local/include
+-LDFLAGS+=-s
+ ifneq ($(DIET),)
+ DIET+=-Os
+ endif
+ endif
+
diff --git a/www-servers/gatling/files/gatling-0.12-compile.patch b/www-servers/gatling/files/gatling-0.12-compile.patch
new file mode 100644
index 000000000000..db609836332b
--- /dev/null
+++ b/www-servers/gatling/files/gatling-0.12-compile.patch
@@ -0,0 +1,20 @@
+--- GNUmakefile 2012-04-10 04:31:14.505474482 +0200
++++ GNUmakefile 2012-04-10 04:31:53.821982958 +0200
+@@ -64,7 +64,7 @@
+ acc: acc.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) -lowfat
+
+-CC:=$(DIET) $(CC)
++override CC:=$(DIET) $(CC)
+
+ pthreadbench: pthreadbench.o
+ $(CC) $< -o $@ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS) -lpthread
+@@ -80,7 +80,7 @@
+ $(OBJS) https.o gatling.o: gatling.h version.h gatling_features.h
+
+ tlsgatling: gatling.c ssl.o $(HTTPS_OBJS)
+- -$(CC) -o $@ gatling.c ssl.o $(HTTPS_OBJS) $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS)
++ $(CC) -o $@ gatling.c ssl.o $(HTTPS_OBJS) $(CFLAGS) -DSUPPORT_HTTPS $(LDFLAGS) -lssl -lcrypto $(LDLIBS)
+
+ gatling: gatling.o $(OBJS) md5lib
+ $(CC) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LDLIBS) `cat md5lib`
diff --git a/www-servers/gatling/files/gatling-0.13-compile.patch b/www-servers/gatling/files/gatling-0.13-compile.patch
new file mode 100644
index 000000000000..7b4d44af9c09
--- /dev/null
+++ b/www-servers/gatling/files/gatling-0.13-compile.patch
@@ -0,0 +1,11 @@
+--- GNUmakefile 2012-04-10 04:31:14.505474482 +0200
++++ GNUmakefile 2012-04-10 04:31:53.821982958 +0200
+@@ -64,7 +64,7 @@
+ acc: acc.c
+ $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS) -lowfat
+
+-CC:=$(DIET) $(CC)
++override CC:=$(DIET) $(CC)
+
+ pthreadbench: pthreadbench.o
+ $(CC) $< -o $@ -I. $(CFLAGS) $(LDFLAGS) $(LDLIBS) -lpthread
diff --git a/www-servers/gatling/files/gatling.confd b/www-servers/gatling/files/gatling.confd
new file mode 100644
index 000000000000..afbaecf80780
--- /dev/null
+++ b/www-servers/gatling/files/gatling.confd
@@ -0,0 +1,49 @@
+# /etc/conf.d/gatling
+
+# UID to run gatling server on
+GATLING_UID="gatling"
+
+# Bind to IP address
+IP="127.0.0.1"
+
+# Root directory
+ROOTDIR="/var/www"
+
+# Bind to Port
+PORT="80"
+
+# HTTP timeout
+HTTP_TIMEOUT="23"
+
+# Gatling pid file
+PID="/var/run/gatling.pid"
+
+# Virtual domain hosting
+VHOST="NO"
+
+# Directory indexing
+DIR_INDEXING="NO"
+
+# Secure Socket Connections SSL
+SSL="NO"
+
+# Prefetch value (see man page for details)
+PREFETCH="2M"
+
+# FTP access
+FTP="YES"
+
+# FTP timeout
+FTP_TIMEOUT="60"
+
+# FTP User Authorization
+FTP_AUTH="YES"
+
+# FTP file uploads
+FTP_UP="NO"
+
+# Enable ftp file downloads
+FTP_FILE_FETCH="YES"
+
+# Transparent proxy mode
+TRANS_PROXY="YES"
diff --git a/www-servers/gatling/files/gatling.initd b/www-servers/gatling/files/gatling.initd
new file mode 100644
index 000000000000..be28d958a027
--- /dev/null
+++ b/www-servers/gatling/files/gatling.initd
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Gatling high performance web server init script"
+opts="reload"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ # Verify UID is valid for running process.
+ if [[ ! $(id ${GATLING_UID} 2>/dev/null) ]]; then
+ ewarn "User ${GATLING_UID} not found!"
+ return 1
+ fi
+
+ # Set gatling run opts
+ if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi
+ if yesno ${SSL};then SSL=-e;else SSL=-E;fi
+ if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi
+ if yesno ${FTP}; then FTP=-f;else FTP=-F;fi
+ if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi
+ if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi
+ yesno ${TRANS_PROXY} && TRANS_PROXY=-t
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting gatling"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
+--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gatling"
+ start-stop-daemon --quiet --stop --pidfile ${PID}
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+
+ checkconfig || return 1
+
+ ebegin "Sending gatling the HUP signal"
+ start-stop-daemon --quiet --signal HUP --pidfile ${PID}
+
+ ebegin "Restarting gatling server"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
+--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
diff --git a/www-servers/gatling/files/gatling.initd-2 b/www-servers/gatling/files/gatling.initd-2
new file mode 100644
index 000000000000..0d5c5fcd4c19
--- /dev/null
+++ b/www-servers/gatling/files/gatling.initd-2
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Gatling high performance web server init script"
+extra_started_commands="reload"
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ # Verify UID is valid for running process.
+ if [[ ! $(id ${GATLING_UID} 2>/dev/null) ]]; then
+ ewarn "User ${GATLING_UID} not found!"
+ return 1
+ fi
+
+ # Set gatling run opts
+ if yesno ${VHOST};then VHOST=-v;else VHOST=-V;fi
+ if yesno ${SSL};then SSL=-e;else SSL=-E;fi
+ if yesno ${DIR_INDEXING};then DIR_INDEXING=-d;else DIR_INDEXING=-D;fi
+ if yesno ${FTP}; then FTP=-f;else FTP=-F;fi
+ if yesno ${FTP_AUTH}; then FTP_AUTH=-l;else unset FTP_AUTH;fi
+ if yesno ${FTP_UP};then unset FTP_UP;else FTP_UP=-U;fi
+ if yesno ${TRANS_PROXY};then TRANS_PROXY=-t;else unset TRANS_PROXY;fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting gatling"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
+--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping gatling"
+ start-stop-daemon --quiet --stop --pidfile ${PID}
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+
+ checkconfig || return 1
+
+ ebegin "Sending gatling the HUP signal"
+ start-stop-daemon --quiet --signal HUP --pidfile ${PID}
+
+ ebegin "Restarting gatling server"
+ start-stop-daemon --start --quiet --background --make-pidfile --pidfile ${PID} \
+--name gatling --exec /usr/bin/gatling -- -T ${HTTP_TIMEOUT} -i ${IP} -p ${PORT} -P ${PREFETCH} \
+${VHOST} -c ${ROOTDIR} ${DIR_INDEXING} ${TRANS_PROXY} -u ${GATLING_UID} ${FTP} -T ${FTP_TIMEOUT} \
+${FTP_AUTH} ${FTP_UPLOADS}
+ eend $?
+}
diff --git a/www-servers/gatling/gatling-0.12-r2.ebuild b/www-servers/gatling/gatling-0.12-r2.ebuild
new file mode 100644
index 000000000000..b6bbf828cbc7
--- /dev/null
+++ b/www-servers/gatling/gatling-0.12-r2.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="High performance web server"
+HOMEPAGE="http://www.fefe.de/gatling/"
+SRC_URI="http://dl.fefe.de/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ssl diet"
+REQUIRED_USE="ssl? ( !diet )"
+
+DEPEND=">=dev-libs/libowfat-0.25[diet=]
+ diet? ( dev-libs/dietlibc )
+ ssl? ( dev-libs/openssl )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ rm Makefile # leaves us with GNUmakefile
+ epatch "${FILESDIR}/${P}-compile.patch"
+}
+
+src_compile() {
+ local DIET=
+ use diet && DIET='/usr/bin/diet'
+
+ local targets='gatling'
+ use ssl && targets+=' tlsgatling'
+
+ emake DIET="${DIET}" CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} -I/usr/include/libowfat" \
+ LDFLAGS="${LDFLAGS}" prefix=/usr ${targets} \
+ || die "emake ${targets} failed"
+}
+
+src_install() {
+ doman gatling.1 || die "installing manpage failed"
+
+ newconfd "${FILESDIR}/gatling.confd" gatling || die
+ newinitd "${FILESDIR}/gatling.initd-2" gatling || die
+ dodoc README.{ftp,http} || die "installing docs failed"
+
+ dobin gatling || die "installing gatling binary failed"
+ use ssl && {
+ dodoc README.tls || die "installing docs failed"
+ dobin tlsgatling || die "installing tlsgatling binary failed"
+ }
+}
+
+pkg_setup() {
+ ebegin "Creating gatling user and group"
+ enewgroup gatling
+ enewuser ${PN} -1 -1 /var/www/localhost ${PN}
+}
diff --git a/www-servers/gatling/gatling-0.13.ebuild b/www-servers/gatling/gatling-0.13.ebuild
new file mode 100644
index 000000000000..598865946b75
--- /dev/null
+++ b/www-servers/gatling/gatling-0.13.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils toolchain-funcs user
+
+DESCRIPTION="High performance web server"
+HOMEPAGE="http://www.fefe.de/gatling/"
+SRC_URI="http://dl.fefe.de/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="ssl diet"
+REQUIRED_USE="ssl? ( !diet )"
+
+DEPEND=">=dev-libs/libowfat-0.25[diet=]
+ diet? ( dev-libs/dietlibc )
+ ssl? ( dev-libs/openssl )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ rm Makefile # leaves us with GNUmakefile
+ epatch "${FILESDIR}/${P}-compile.patch"
+}
+
+src_compile() {
+ local DIET=
+ use diet && DIET='/usr/bin/diet'
+
+ local targets='gatling'
+ use ssl && targets+=' tlsgatling'
+
+ emake DIET="${DIET}" CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS} -I${ROOT}usr/include/libowfat" \
+ LDFLAGS="${LDFLAGS}" prefix=/usr ${targets} \
+ || die "emake ${targets} failed"
+}
+
+src_install() {
+ doman gatling.1 || die "installing manpage failed"
+
+ newconfd "${FILESDIR}/gatling.confd" gatling || die
+ newinitd "${FILESDIR}/gatling.initd-2" gatling || die
+ dodoc README.{ftp,http} || die "installing docs failed"
+
+ dobin gatling || die "installing gatling binary failed"
+ use ssl && {
+ dodoc README.tls || die "installing docs failed"
+ dobin tlsgatling || die "installing tlsgatling binary failed"
+ }
+}
+
+pkg_setup() {
+ ebegin "Creating gatling user and group"
+ enewgroup gatling
+ enewuser ${PN} -1 -1 /var/www/localhost ${PN}
+}
diff --git a/www-servers/gatling/metadata.xml b/www-servers/gatling/metadata.xml
new file mode 100644
index 000000000000..34daeb2fc29c
--- /dev/null
+++ b/www-servers/gatling/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+ </maintainer>
+ <maintainer>
+ <email>vostorga@gentoo.org</email>
+ <name>Víctor Ostorga</name>
+ </maintainer>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+ <use>
+ <flag name="diet">Compile against <pkg>dev-libs/dietlibc</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/gunicorn/Manifest b/www-servers/gunicorn/Manifest
new file mode 100644
index 000000000000..1bc7ab3b7169
--- /dev/null
+++ b/www-servers/gunicorn/Manifest
@@ -0,0 +1,3 @@
+DIST gunicorn-0.17.4.tar.gz 372737 SHA256 0f5b63f87ab66b9aaca6938e2b97dd6e785498a0cb4567560996192d7e40ad21 SHA512 e227e2e3b1240d1090c0ef86db884ed68dea92f7d4de6a949afee00a0c258a1cf77309391fd88a6c9861942a246495018b81443e8be3055c14af2373e1f4d793 WHIRLPOOL 873220a9c0065ec5df81ad807d212b641dc3d5a4a9a0dceae28c17f07d1d9a63110a25fd1881bac765198cd10600ca5b802ba20f3a763da8db2ecf7d8bc0e25f
+DIST gunicorn-19.0.0.tar.gz 382899 SHA256 0ccb71a2d9e0764fb3abc5dc6f7a44d5d44e3137545be8869befc8aedc02878e SHA512 5e041cfd65c664e687538c1ab1680949492fa76abe8e39f9ab3f8b5239f5ca4f1d91cbb9235e6d671ecd13eec1e58eb440c42f21534488c6acafb34c65288c41 WHIRLPOOL 21bf2f771125c575c85eb8c3c3a8c4b95a29f5e29a157affde2bf2446b29ccef1f192c9f93f5ebe86b1a1196c716a0d9101e94c4f2fcfa7f7304cf5e351b051c
+DIST gunicorn-19.1.1.tar.gz 385155 SHA256 82715511fb6246fad4ba66d812eb93416ae8371b464fa88bf3867c9c177daa14 SHA512 1b42f0dadb8ced12954e821ad3dc7fad67ae6f1123218fe79e32d7089d9ae65bcd973613c226d9a16b11d7d35632990f2c9499594c7a383a79698a1c2db471de WHIRLPOOL 29c99b33b72d00dc248adedf89517804f58ee4ee36a3c9fdddb9d65ee047dd57d381d719e1ed44b7b5284f11ac703d29f3d66fd077f996de2ab9effa8fb15fda
diff --git a/www-servers/gunicorn/files/gunicorn-0.14.0-noegg.patch b/www-servers/gunicorn/files/gunicorn-0.14.0-noegg.patch
new file mode 100644
index 000000000000..7be449f5c6c3
--- /dev/null
+++ b/www-servers/gunicorn/files/gunicorn-0.14.0-noegg.patch
@@ -0,0 +1,64 @@
+diff --git a/tests/003-test-config.py b/tests/003-test-config.py
+index 4d9ef92..218a8e4 100644
+--- a/tests/003-test-config.py
++++ b/tests/003-test-config.py
+@@ -24,12 +24,7 @@ def paster_ini():
+ return os.path.join(dirname, "..", "examples", "frameworks", "pylonstest", "nose.ini")
+
+ def PasterApp():
+- try:
+- from paste.deploy import loadapp, loadwsgi
+- except ImportError:
+- raise SkipTest()
+- from gunicorn.app.pasterapp import PasterApplication
+- return PasterApplication("no_usage")
++ raise SkipTest()
+
+ class AltArgs(object):
+ def __init__(self, args=None):
+@@ -59,43 +54,8 @@ def test_defaults():
+ t.eq(s.default, c.settings[s.name].get())
+
+ def test_property_access():
+- c = config.Config()
+- for s in config.KNOWN_SETTINGS:
+- getattr(c, s.name)
+-
+- # Class was loaded
+- t.eq(c.worker_class, SyncWorker)
+-
+- # Debug affects workers
+- t.eq(c.workers, 1)
+- c.set("workers", 3)
+- t.eq(c.workers, 3)
+-
+- # Address is parsed
+- t.eq(c.address, ("127.0.0.1", 8000))
+-
+- # User and group defaults
+- t.eq(os.geteuid(), c.uid)
+- t.eq(os.getegid(), c.gid)
+-
+- # Proc name
+- t.eq("gunicorn", c.proc_name)
+-
+- # Not a config property
+- t.raises(AttributeError, getattr, c, "foo")
+- # Force to be not an error
+- class Baz(object):
+- def get(self):
+- return 3.14
+- c.settings["foo"] = Baz()
+- t.eq(c.foo, 3.14)
+-
+- # Attempt to set a cfg not via c.set
+- t.raises(AttributeError, setattr, c, "proc_name", "baz")
+-
+- # No setting for name
+- t.raises(AttributeError, c.set, "baz", "bar")
+-
++ raise SkipTest()
++
+ def test_bool_validation():
+ c = config.Config()
+ t.eq(c.debug, False)
diff --git a/www-servers/gunicorn/files/gunicorn-19.0.0-gaiohttp.patch b/www-servers/gunicorn/files/gunicorn-19.0.0-gaiohttp.patch
new file mode 100644
index 000000000000..7561ab2f3027
--- /dev/null
+++ b/www-servers/gunicorn/files/gunicorn-19.0.0-gaiohttp.patch
@@ -0,0 +1,59 @@
+From 86f740420cb12cf071f7dc7981330353e258931a Mon Sep 17 00:00:00 2001
+From: Andrew Svetlov <andrew.svetlov@gmail.com>
+Date: Sun, 22 Jun 2014 15:19:27 +0300
+Subject: [PATCH] Don't install gaiohttp if python < 3.3
+
+---
+ setup.py | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index be54106..f538734 100644
+--- a/setup.py
++++ b/setup.py
+@@ -5,12 +5,15 @@
+
+
+ import os
+-from setuptools import setup, find_packages, Command
++from setuptools import setup, Command
+ import sys
+
+ from gunicorn import __version__
+
+
++ASYNCIO_COMPAT = sys.version_info >= (3, 3)
++
++
+ CLASSIFIERS = [
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Other Environment',
+@@ -65,6 +68,17 @@ def run(self):
+
+ REQUIREMENTS = []
+
++py_modules = []
++
++for root, folders, files in os.walk('gunicorn'):
++ for f in files:
++ if f.endswith('.py') and (ASYNCIO_COMPAT or f != 'gaiohttp.py'):
++ full = os.path.join(root, f[:-3])
++ parts = full.split(os.path.sep)
++ modname = '.'.join(parts)
++ py_modules.append(modname)
++
++
+ setup(
+ name = 'gunicorn',
+ version = __version__,
+@@ -78,7 +92,7 @@ def run(self):
+
+ classifiers = CLASSIFIERS,
+ zip_safe = False,
+- packages = find_packages(exclude=['examples', 'tests']),
++ py_modules = py_modules,
+ include_package_data = True,
+
+ tests_require = tests_require,
+--
+1.9.3
diff --git a/www-servers/gunicorn/gunicorn-0.17.4.ebuild b/www-servers/gunicorn/gunicorn-0.17.4.ebuild
new file mode 100644
index 000000000000..6871afdd9d26
--- /dev/null
+++ b/www-servers/gunicorn/gunicorn-0.17.4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="2.5 3.1 *-jython"
+DISTUTILS_SRC_TEST="nosetests"
+
+inherit distutils eutils
+
+DESCRIPTION="A WSGI HTTP Server for UNIX"
+HOMEPAGE="http://gunicorn.org http://pypi.python.org/pypi/gunicorn"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc test"
+KEYWORDS="amd64 x86"
+
+RDEPEND="dev-python/setproctitle"
+DEPEND="dev-python/setuptools
+ doc? ( dev-python/sphinx )
+ test? ( dev-python/pytest )"
+
+DOCS="README.rst"
+
+src_prepare() {
+ # these tests requires an already installed version of gunicorn
+ rm tests/test_003-config.py
+}
+
+src_compile() {
+ distutils_src_compile
+
+ if use doc; then
+ einfo "Generation of documentation"
+ cd docs
+ sphinx-build -b html source build || die "Generation of documentation failed"
+ fi
+}
+
+src_install() {
+ distutils_src_install
+
+ use doc && dohtml -r docs/build/
+}
diff --git a/www-servers/gunicorn/gunicorn-19.0.0.ebuild b/www-servers/gunicorn/gunicorn-19.0.0.ebuild
new file mode 100644
index 000000000000..d079c54e181a
--- /dev/null
+++ b/www-servers/gunicorn/gunicorn-19.0.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="A WSGI HTTP Server for UNIX"
+HOMEPAGE="http://gunicorn.org http://pypi.python.org/pypi/gunicorn"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc examples test"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="dev-python/setproctitle[${PYTHON_USEDEP}]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+
+DOCS="README.rst"
+
+python_prepare() {
+ # these tests requires an already installed version of gunicorn
+ rm tests/test_003-config.py
+
+ sed -ie "s/..\/bin/\/usr\/bin\//" docs/Makefile || die
+
+ epatch "${FILESDIR}/${P}-gaiohttp.patch"
+
+ distutils-r1_python_prepare
+}
+
+python_compile_all() {
+ use doc && emake -C docs html
+}
+
+python_test() {
+ py.test -v || die "Testing failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+
+ distutils-r1_python_install_all
+
+ if use examples; then
+ insinto /usr/share/doc/${P}
+ doins -r examples
+ fi
+}
diff --git a/www-servers/gunicorn/gunicorn-19.1.1.ebuild b/www-servers/gunicorn/gunicorn-19.1.1.ebuild
new file mode 100644
index 000000000000..b7eceefe76a7
--- /dev/null
+++ b/www-servers/gunicorn/gunicorn-19.1.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="A WSGI HTTP Server for UNIX"
+HOMEPAGE="http://gunicorn.org http://pypi.python.org/pypi/gunicorn"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="doc examples test"
+KEYWORDS="amd64 x86"
+
+RDEPEND="dev-python/setproctitle[${PYTHON_USEDEP}]"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+ test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
+
+DOCS="README.rst"
+
+python_prepare() {
+ # these tests requires an already installed version of gunicorn
+ rm tests/test_003-config.py
+
+ sed -ie "s/..\/bin/\/usr\/bin\//" docs/Makefile || die
+
+ distutils-r1_python_prepare
+}
+
+python_compile_all() {
+ use doc && emake -C docs html
+}
+
+python_test() {
+ py.test -v || die "Testing failed with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+
+ distutils-r1_python_install_all
+
+ if use examples; then
+ insinto /usr/share/doc/${P}
+ doins -r examples
+ fi
+}
diff --git a/www-servers/gunicorn/metadata.xml b/www-servers/gunicorn/metadata.xml
new file mode 100644
index 000000000000..9f4816df4ece
--- /dev/null
+++ b/www-servers/gunicorn/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>rafaelmartins@gentoo.org</email>
+ <name>Rafael G. Martins</name>
+ </maintainer>
+ <maintainer>
+ <email>bugs@bergstroem.nu</email>
+ <name>Johan Bergström</name>
+ <description>Co-maintainer, CC on bugs.</description>
+ </maintainer>
+ <longdescription lang="en">Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a
+ pre-fork worker model ported from Ruby's Unicorn project. The Gunicorn
+ server is broadly compatible with various web frameworks, simply
+ implemented, light on server resources, and fairly speedy. </longdescription>
+ <upstream>
+ <remote-id type="pypi">gunicorn</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/hiawatha/Manifest b/www-servers/hiawatha/Manifest
new file mode 100644
index 000000000000..b32d151f1303
--- /dev/null
+++ b/www-servers/hiawatha/Manifest
@@ -0,0 +1 @@
+DIST hiawatha-9.8.tar.gz 888977 SHA256 6fe9bd408361bc07b47fe6eeaf98d6b644e1cd258b3470da3e70aba510e83b64 SHA512 f55b6065e0dd1dab11ccbbb44e981944aab5b542077fc2b4a03ec8c055be80bedb7b639fe9c52ccf0fc279648b9f4bfc0cbfa018b195b155907810bdfc4ec51a WHIRLPOOL 342c19df23dbe4eef7056f2424d53badede5a8dcf8bb713e7d3892f21e1061ae5e1a0c985f1fc824b10f25eb9fcc9cf0cbf8d384240bf814df4f9dca45dd96f2
diff --git a/www-servers/hiawatha/files/hiawatha-9.5-cflags.patch b/www-servers/hiawatha/files/hiawatha-9.5-cflags.patch
new file mode 100644
index 000000000000..4ff33cd0d126
--- /dev/null
+++ b/www-servers/hiawatha/files/hiawatha-9.5-cflags.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Fri May 23 16:59:33 UTC 2014
+Subject: make optimization level build-type dependant
+
+--- hiawatha-9.5/CMakeLists.txt
++++ hiawatha-9.5/CMakeLists.txt
+@@ -2,7 +2,9 @@
+ project(Hiawatha C)
+
+ # Compiler
+-set(CMAKE_C_FLAGS "-O2 -Wall -Wextra ${CMAKE_C_FLAGS}")
++set(CMAKE_C_FLAGS "-Wall -Wextra ${CMAKE_C_FLAGS}")
++set(CMAKE_C_FLAGS_RELEASE "-O2")
++set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2")
+ set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+
+ # Options
diff --git a/www-servers/hiawatha/files/hiawatha.initd b/www-servers/hiawatha/files/hiawatha.initd
new file mode 100644
index 000000000000..36720dc26278
--- /dev/null
+++ b/www-servers/hiawatha/files/hiawatha.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon \
+ --start \
+ --exec "/usr/sbin/hiawatha" \
+ --pidfile "/var/run/hiawatha.pid"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon \
+ --stop \
+ --exec "/usr/sbin/hiawatha" \
+ --pidfile "/var/run/hiawatha.pid"
+ eend $?
+}
diff --git a/www-servers/hiawatha/files/hiawatha.service b/www-servers/hiawatha/files/hiawatha.service
new file mode 100644
index 000000000000..35e740b7e390
--- /dev/null
+++ b/www-servers/hiawatha/files/hiawatha.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hiawatha webserver
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/hiawatha -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/hiawatha/hiawatha-9.8.ebuild b/www-servers/hiawatha/hiawatha-9.8.ebuild
new file mode 100644
index 000000000000..37ebe2492239
--- /dev/null
+++ b/www-servers/hiawatha/hiawatha-9.8.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# ssl USE flag currently broken, unconditionally enabled
+# rproxy USE flag broken too, unconditionally enabled
+
+EAPI=5
+
+CMAKE_MIN_VERSION="2.8.4"
+
+inherit cmake-utils systemd user
+
+DESCRIPTION="Advanced and secure webserver"
+HOMEPAGE="http://www.hiawatha-webserver.org"
+SRC_URI="http://www.hiawatha-webserver.org/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +cache ipv6 monitor +rewrite tomahawk +xslt"
+
+RDEPEND="
+ >=net-libs/polarssl-1.3[threads]
+ xslt? ( dev-libs/libxslt
+ dev-libs/libxml2 )"
+DEPEND="${RDEPEND}"
+PDEPEND="monitor? ( www-apps/hiawatha-monitor )"
+
+# set this in make.conf if you want to use a different user/group
+HIAWATHA_USER=${HIAWATHA_USER:-hiawatha}
+HIAWATHA_GROUP=${HIAWATHA_GROUP:-hiawatha}
+
+pkg_setup() {
+ enewgroup ${HIAWATHA_GROUP}
+ enewuser ${HIAWATHA_USER} -1 -1 /var/www/hiawatha ${HIAWATHA_GROUP}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-9.5-cflags.patch
+
+ rm -r polarssl || die
+
+ grep '#ServerId =' config/hiawatha.conf.in 1>/dev/null || die
+ sed -i \
+ -e "s/#ServerId =.*$/ServerId = ${HIAWATHA_USER}/" \
+ config/hiawatha.conf.in || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCONFIG_DIR:STRING=/etc/hiawatha
+ $(cmake-utils_use_enable cache CACHE)
+ $(cmake-utils_use_enable debug DEBUG)
+ $(cmake-utils_use_enable ipv6 IPV6)
+ $(cmake-utils_use_enable kernel_linux LOADCHECK)
+ $(cmake-utils_use_enable monitor MONITOR)
+ -DENABLE_SSL=YES
+ $(cmake-utils_use_enable tomahawk TOMAHAWK)
+ $(cmake-utils_use_enable rewrite TOOLKIT)
+ $(cmake-utils_use_enable xslt XSLT)
+ -DLOG_DIR:STRING=/var/log/hiawatha
+ -DPID_DIR:STRING=/var/run
+ -DUSE_SHARED_POLARSSL_LIBRARY=ON
+ -DUSE_SYSTEM_POLARSSL=ON
+ -DWEBROOT_DIR:STRING=/var/www/hiawatha
+ -DWORK_DIR:STRING=/var/lib/hiawatha
+ )
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ cmake-utils_src_install
+
+ rm -rf "${ED%%/}"/var/www/hiawatha/*
+
+ newinitd "${FILESDIR}"/hiawatha.initd hiawatha
+ systemd_dounit "${FILESDIR}"/hiawatha.service
+
+ local i
+ for i in /var/{lib,log}/hiawatha ; do
+ keepdir ${i}
+ fowners ${HIAWATHA_USER}:${HIAWATHA_GROUP} ${i}
+ fperms 0750 ${i}
+ done
+
+ keepdir /var/www/hiawatha
+ fowners ${HIAWATHA_USER}:${HIAWATHA_GROUP} /var/www/hiawatha
+}
diff --git a/www-servers/hiawatha/metadata.xml b/www-servers/hiawatha/metadata.xml
new file mode 100644
index 000000000000..f9fc42478ea8
--- /dev/null
+++ b/www-servers/hiawatha/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='cache'>Enable caching of content.</flag>
+ <flag name='monitor'>Pull in www-apps/hiawatha-monitor.</flag>
+ <flag name='rewrite'>Enable the rewrite toolkit.</flag>
+ <flag name='tomahawk'>Enable Tomahawk control server.</flag>
+ <flag name='xslt'>Enable XSLT support.
+ This is also needed for directory listings.</flag>
+ </use>
+ <upstream>
+ <remote-id type='github'>hsleisink/hiawatha</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/lighttpd/Manifest b/www-servers/lighttpd/Manifest
new file mode 100644
index 000000000000..85fc0ff8d24d
--- /dev/null
+++ b/www-servers/lighttpd/Manifest
@@ -0,0 +1 @@
+DIST lighttpd-1.4.35.tar.bz2 665955 SHA256 4a71c1f6d8af41ed894b507720c4c17184dc320590013881d5170ca7f15c5bf7 SHA512 13f8562fb735964fe7ef1b127a15c43907f34be70b6bd2dd4ba61b59275d7c2a8d9a7947ff1a4d7cc5fd7efd309fc66b7de6d954b59424f814ea2eb98fd876b9 WHIRLPOOL edbeb94ae29475be398e9281135fc43f915be68c5836ae3da302f7c94c3af19eeca601cedc9bfe59d552f45c6248a945b2de725613de395087e4e195efe9a62e
diff --git a/www-servers/lighttpd/files/conf/lighttpd.conf b/www-servers/lighttpd/files/conf/lighttpd.conf
new file mode 100644
index 000000000000..1c69581a192c
--- /dev/null
+++ b/www-servers/lighttpd/files/conf/lighttpd.conf
@@ -0,0 +1,330 @@
+###############################################################################
+# Default lighttpd.conf for Gentoo.
+# $Id$
+###############################################################################
+
+# {{{ variables
+var.basedir = "/var/www/localhost"
+var.logdir = "/var/log/lighttpd"
+var.statedir = "/var/lib/lighttpd"
+# }}}
+
+# {{{ modules
+# At the very least, mod_access and mod_accesslog should be enabled.
+# All other modules should only be loaded if necessary.
+# NOTE: the order of modules is important.
+server.modules = (
+# "mod_rewrite",
+# "mod_redirect",
+# "mod_alias",
+ "mod_access",
+# "mod_cml",
+# "mod_trigger_b4_dl",
+# "mod_auth",
+# "mod_status",
+# "mod_setenv",
+# "mod_proxy",
+# "mod_simple_vhost",
+# "mod_evhost",
+# "mod_userdir",
+# "mod_compress",
+# "mod_ssi",
+# "mod_usertrack",
+# "mod_expire",
+# "mod_secdownload",
+# "mod_rrdtool",
+# "mod_webdav",
+ "mod_accesslog"
+)
+# }}}
+
+# {{{ includes
+include "mime-types.conf"
+# fcgi and cgi are included below
+# }}}
+
+# {{{ server settings
+server.username = "lighttpd"
+server.groupname = "lighttpd"
+
+server.document-root = var.basedir + "/htdocs"
+server.pid-file = "/var/run/lighttpd.pid"
+
+server.errorlog = var.logdir + "/error.log"
+# log errors to syslog instead
+# server.errorlog-use-syslog = "enable"
+
+server.indexfiles = ("index.php", "index.html",
+ "index.htm", "default.htm")
+
+# server.tag = "lighttpd"
+
+server.follow-symlink = "enable"
+
+# event handler (defaults to "poll")
+# see performance.txt
+#
+# for >= linux-2.4
+# server.event-handler = "linux-rtsig"
+# for >= linux-2.6
+# server.event-handler = "linux-sysepoll"
+# for FreeBSD
+# server.event-handler = "freebsd-kqueue"
+
+# chroot to directory (defaults to no chroot)
+# server.chroot = "/"
+
+# bind to port (defaults to 80)
+# server.port = 81
+
+# bind to name (defaults to all interfaces)
+# server.bind = "grisu.home.kneschke.de"
+
+# error-handler for status 404
+# server.error-handler-404 = "/error-handler.html"
+# server.error-handler-404 = "/error-handler.php"
+
+# Format: <errorfile-prefix><status-code>.html
+# -> ..../status-404.html for 'File not found'
+# server.errorfile-prefix = var.basedir + "/error/status-"
+
+# FAM support for caching stat() calls
+# requires that lighttpd be built with USE=fam
+# server.stat-cache-engine = "fam"
+
+# If lighttpd was build with IPv6 support, and you would like to listen on IPv6,
+# uncomment the following:
+# server.use-ipv6 = "enable"
+
+# }}}
+
+# {{{ mod_staticfile
+
+# which extensions should not be handled via static-file transfer
+# (extensions that are usually handled by mod_cgi, mod_fastcgi, etc).
+static-file.exclude-extensions = (".php", ".pl", ".cgi", ".fcgi")
+# }}}
+
+# {{{ mod_accesslog
+accesslog.filename = var.logdir + "/access.log"
+# }}}
+
+# {{{ mod_dirlisting
+# enable directory listings
+# dir-listing.activate = "enable"
+#
+# don't list hidden files/directories
+# dir-listing.hide-dotfiles = "enable"
+#
+# use a different css for directory listings
+# dir-listing.external-css = "/path/to/dir-listing.css"
+#
+# list of regular expressions. files that match any of the
+# specified regular expressions will be excluded from directory
+# listings.
+# dir-listing.exclude = ("^\.", "~$")
+# }}}
+
+# {{{ mod_access
+# see access.txt
+
+url.access-deny = ("~", ".inc")
+# }}}
+
+# {{{ mod_userdir
+# see userdir.txt
+#
+# userdir.path = "public_html"
+# userdir.exclude-user = ("root")
+# }}}
+
+# {{{ mod_ssi
+# see ssi.txt
+#
+# ssi.extension = (".shtml")
+# }}}
+
+# {{{ mod_ssl
+# see ssl.txt
+#
+# ssl.engine = "enable"
+# ssl.pemfile = "server.pem"
+# }}}
+
+# {{{ mod_status
+# see status.txt
+#
+# status.status-url = "/server-status"
+# status.config-url = "/server-config"
+# }}}
+
+# {{{ mod_simple_vhost
+# see simple-vhost.txt
+#
+# If you want name-based virtual hosting add the next three settings and load
+# mod_simple_vhost
+#
+# document-root =
+# virtual-server-root + virtual-server-default-host + virtual-server-docroot
+# or
+# virtual-server-root + http-host + virtual-server-docroot
+#
+# simple-vhost.server-root = "/home/weigon/wwwroot/servers/"
+# simple-vhost.default-host = "grisu.home.kneschke.de"
+# simple-vhost.document-root = "/pages/"
+# }}}
+
+# {{{ mod_compress
+# see compress.txt
+#
+# compress.cache-dir = var.statedir + "/cache/compress"
+# compress.filetype = ("text/plain", "text/html")
+# }}}
+
+# {{{ mod_proxy
+# see proxy.txt
+#
+# proxy.server = ( ".php" =>
+# ( "localhost" =>
+# (
+# "host" => "192.168.0.101",
+# "port" => 80
+# )
+# )
+# )
+# }}}
+
+# {{{ mod_auth
+# see authentication.txt
+#
+# auth.backend = "plain"
+# auth.backend.plain.userfile = "lighttpd.user"
+# auth.backend.plain.groupfile = "lighttpd.group"
+
+# auth.backend.ldap.hostname = "localhost"
+# auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
+# auth.backend.ldap.filter = "(uid=$)"
+
+# auth.require = ( "/server-status" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "user=jan"
+# ),
+# "/server-info" =>
+# (
+# "method" => "digest",
+# "realm" => "download archiv",
+# "require" => "valid-user"
+# )
+# )
+# }}}
+
+# {{{ mod_rewrite
+# see rewrite.txt
+#
+# url.rewrite = (
+# "^/$" => "/server-status"
+# )
+# }}}
+
+# {{{ mod_redirect
+# see redirect.txt
+#
+# url.redirect = (
+# "^/wishlist/(.+)" => "http://www.123.org/$1"
+# )
+# }}}
+
+# {{{ mod_evhost
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+# evhost.path-pattern = "/home/storage/dev/www/%3/htdocs/"
+# }}}
+
+# {{{ mod_expire
+# expire.url = (
+# "/buggy/" => "access 2 hours",
+# "/asdhas/" => "access plus 1 seconds 2 minutes"
+# )
+# }}}
+
+# {{{ mod_rrdtool
+# see rrdtool.txt
+#
+# rrdtool.binary = "/usr/bin/rrdtool"
+# rrdtool.db-name = var.statedir + "/lighttpd.rrd"
+# }}}
+
+# {{{ mod_setenv
+# see setenv.txt
+#
+# setenv.add-request-header = ( "TRAV_ENV" => "mysql://user@host/db" )
+# setenv.add-response-header = ( "X-Secret-Message" => "42" )
+# }}}
+
+# {{{ mod_trigger_b4_dl
+# see trigger_b4_dl.txt
+#
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+# }}}
+
+# {{{ mod_cml
+# see cml.txt
+#
+# don't forget to add index.cml to server.indexfiles
+# cml.extension = ".cml"
+# cml.memcache-hosts = ( "127.0.0.1:11211" )
+# }}}
+
+# {{{ mod_webdav
+# see webdav.txt
+#
+# $HTTP["url"] =~ "^/dav($|/)" {
+# webdav.activate = "enable"
+# webdav.is-readonly = "enable"
+# }
+# }}}
+
+# {{{ extra rules
+#
+# set Content-Encoding and reset Content-Type for browsers that
+# support decompressing on-thy-fly (requires mod_setenv)
+# $HTTP["url"] =~ "\.gz$" {
+# setenv.add-response-header = ("Content-Encoding" => "x-gzip")
+# mimetype.assign = (".gz" => "text/plain")
+# }
+
+# $HTTP["url"] =~ "\.bz2$" {
+# setenv.add-response-header = ("Content-Encoding" => "x-bzip2")
+# mimetype.assign = (".bz2" => "text/plain")
+# }
+#
+# }}}
+
+# {{{ debug
+# debug.log-request-header = "enable"
+# debug.log-response-header = "enable"
+# debug.log-request-handling = "enable"
+# debug.log-file-not-found = "enable"
+# }}}
+
+# {{{ cgi includes
+# uncomment for cgi support
+# include "mod_cgi.conf"
+# uncomment for php/fastcgi support
+# include "mod_fastcgi.conf"
+# }}}
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/www-servers/lighttpd/files/conf/mime-types.conf b/www-servers/lighttpd/files/conf/mime-types.conf
new file mode 100644
index 000000000000..4d083e3abec7
--- /dev/null
+++ b/www-servers/lighttpd/files/conf/mime-types.conf
@@ -0,0 +1,79 @@
+###############################################################################
+# Default mime-types.conf for Gentoo.
+# include'd from lighttpd.conf.
+# $Id$
+###############################################################################
+
+# {{{ mime types
+mimetype.assign = (
+ ".svg" => "image/svg+xml",
+ ".svgz" => "image/svg+xml",
+ ".pdf" => "application/pdf",
+ ".sig" => "application/pgp-signature",
+ ".spl" => "application/futuresplash",
+ ".class" => "application/octet-stream",
+ ".ps" => "application/postscript",
+ ".torrent" => "application/x-bittorrent",
+ ".dvi" => "application/x-dvi",
+ ".gz" => "application/x-gzip",
+ ".pac" => "application/x-ns-proxy-autoconfig",
+ ".swf" => "application/x-shockwave-flash",
+ ".tar.gz" => "application/x-tgz",
+ ".tgz" => "application/x-tgz",
+ ".tar" => "application/x-tar",
+ ".zip" => "application/zip",
+ ".dmg" => "application/x-apple-diskimage",
+ ".mp3" => "audio/mpeg",
+ ".m3u" => "audio/x-mpegurl",
+ ".wma" => "audio/x-ms-wma",
+ ".wax" => "audio/x-ms-wax",
+ ".ogg" => "application/ogg",
+ ".wav" => "audio/x-wav",
+ ".gif" => "image/gif",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".png" => "image/png",
+ ".xbm" => "image/x-xbitmap",
+ ".xpm" => "image/x-xpixmap",
+ ".xwd" => "image/x-xwindowdump",
+ ".css" => "text/css",
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".js" => "text/javascript",
+ ".asc" => "text/plain",
+ ".c" => "text/plain",
+ ".h" => "text/plain",
+ ".cc" => "text/plain",
+ ".cpp" => "text/plain",
+ ".hh" => "text/plain",
+ ".hpp" => "text/plain",
+ ".conf" => "text/plain",
+ ".log" => "text/plain",
+ ".text" => "text/plain",
+ ".txt" => "text/plain",
+ ".diff" => "text/plain",
+ ".patch" => "text/plain",
+ ".ebuild" => "text/plain",
+ ".eclass" => "text/plain",
+ ".rtf" => "application/rtf",
+ ".bmp" => "image/bmp",
+ ".tif" => "image/tiff",
+ ".tiff" => "image/tiff",
+ ".ico" => "image/x-icon",
+ ".dtd" => "text/xml",
+ ".xml" => "text/xml",
+ ".mpeg" => "video/mpeg",
+ ".mpg" => "video/mpeg",
+ ".mov" => "video/quicktime",
+ ".qt" => "video/quicktime",
+ ".avi" => "video/x-msvideo",
+ ".asf" => "video/x-ms-asf",
+ ".asx" => "video/x-ms-asf",
+ ".wmv" => "video/x-ms-wmv",
+ ".bz2" => "application/x-bzip",
+ ".tbz" => "application/x-bzip-compressed-tar",
+ ".tar.bz2" => "application/x-bzip-compressed-tar"
+ )
+# }}}
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/www-servers/lighttpd/files/conf/mod_cgi.conf b/www-servers/lighttpd/files/conf/mod_cgi.conf
new file mode 100644
index 000000000000..306f927f0791
--- /dev/null
+++ b/www-servers/lighttpd/files/conf/mod_cgi.conf
@@ -0,0 +1,33 @@
+###############################################################################
+# mod_cgi.conf
+# include'd by lighttpd.conf.
+# $Id$
+###############################################################################
+
+#
+# see cgi.txt for more information on using mod_cgi
+#
+
+server.modules += ("mod_cgi")
+
+# NOTE: this requires mod_alias
+alias.url = (
+ "/cgi-bin/" => var.basedir + "/cgi-bin/"
+)
+
+#
+# Note that you'll also want to enable the
+# cgi-bin alias via mod_alias (above).
+#
+
+$HTTP["url"] =~ "^/cgi-bin/" {
+ # disable directory listings
+ dir-listing.activate = "disable"
+ # only allow cgi's in this directory
+ cgi.assign = (
+ ".pl" => "/usr/bin/perl",
+ ".cgi" => "/usr/bin/perl"
+ )
+}
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/www-servers/lighttpd/files/conf/mod_fastcgi.conf b/www-servers/lighttpd/files/conf/mod_fastcgi.conf
new file mode 100644
index 000000000000..fe1c84fece6b
--- /dev/null
+++ b/www-servers/lighttpd/files/conf/mod_fastcgi.conf
@@ -0,0 +1,17 @@
+###############################################################################
+# mod_fastcgi.conf
+# include'd by lighttpd.conf.
+# $Id$
+###############################################################################
+
+server.modules += ("mod_fastcgi")
+fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ (
+ "socket" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
+ "bin-path" => "/usr/bin/php-cgi"
+ )
+ )
+ )
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2 b/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2
new file mode 100644
index 000000000000..fe1c84fece6b
--- /dev/null
+++ b/www-servers/lighttpd/files/conf/mod_fastcgi.conf-1.4.13-r2
@@ -0,0 +1,17 @@
+###############################################################################
+# mod_fastcgi.conf
+# include'd by lighttpd.conf.
+# $Id$
+###############################################################################
+
+server.modules += ("mod_fastcgi")
+fastcgi.server = ( ".php" =>
+ ( "localhost" =>
+ (
+ "socket" => "/var/run/lighttpd/lighttpd-fastcgi-php-" + PID + ".socket",
+ "bin-path" => "/usr/bin/php-cgi"
+ )
+ )
+ )
+
+# vim: set ft=conf foldmethod=marker et :
diff --git a/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch b/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch
new file mode 100644
index 000000000000..c99886af1e7b
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd-1.4.29-mod_uploadprogress.patch
@@ -0,0 +1,738 @@
+diff -Nru lighttpd-1.4.22.orig/src/connections.c lighttpd-1.4.22/src/connections.c
+--- lighttpd-1.4.22.orig/src/connections.c 2009-02-19 14:15:14.000000000 +0100
++++ lighttpd-1.4.28/src/connections.c 2009-04-22 17:45:20.000000000 +0200
+@@ -1401,11 +1401,15 @@
+ if (http_request_parse(srv, con)) {
+ /* we have to read some data from the POST request */
+
++ plugins_call_handle_request_end(srv, con);
++
+ connection_set_state(srv, con, CON_STATE_READ_POST);
+
+ break;
+ }
+
++ plugins_call_handle_request_end(srv, con);
++
+ connection_set_state(srv, con, CON_STATE_HANDLE_REQUEST);
+
+ break;
+diff -Nru lighttpd-1.4.22.orig/src/Makefile.am lighttpd-1.4.22/src/Makefile.am
+--- lighttpd-1.4.22.orig/src/Makefile.am 2009-02-19 14:15:14.000000000 +0100
++++ lighttpd-1.4.28/src/Makefile.am 2009-04-22 17:46:34.000000000 +0200
+@@ -246,6 +246,11 @@
+ mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
+ mod_accesslog_la_LIBADD = $(common_libadd)
+
++lib_LTLIBRARIES += mod_uploadprogress.la
++mod_uploadprogress_la_SOURCES = mod_uploadprogress.c
++mod_uploadprogress_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
++mod_uploadprogress_la_LIBADD = $(common_libadd)
++
+
+ hdr = server.h buffer.h network.h log.h keyvalue.h \
+ response.h request.h fastcgi.h chunk.h \
+diff -Nru lighttpd-1.4.22.orig/src/plugin.c lighttpd-1.4.22/src/plugin.c
+--- lighttpd-1.4.22.orig/src/plugin.c 2009-02-19 14:15:14.000000000 +0100
++++ lighttpd-1.4.28/src/plugin.c 2009-04-22 17:45:20.000000000 +0200
+@@ -34,6 +34,7 @@
+ PLUGIN_FUNC_UNSET,
+ PLUGIN_FUNC_HANDLE_URI_CLEAN,
+ PLUGIN_FUNC_HANDLE_URI_RAW,
++ PLUGIN_FUNC_HANDLE_REQUEST_END,
+ PLUGIN_FUNC_HANDLE_REQUEST_DONE,
+ PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE,
+ PLUGIN_FUNC_HANDLE_TRIGGER,
+@@ -262,6 +263,7 @@
+
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean)
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw)
++PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_END, handle_request_end)
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_DONE, handle_request_done)
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, handle_connection_close)
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_SUBREQUEST, handle_subrequest)
+@@ -389,6 +391,7 @@
+
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_CLEAN, handle_uri_clean);
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_URI_RAW, handle_uri_raw);
++ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_END, handle_request_end);
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_REQUEST_DONE, handle_request_done);
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_CONNECTION_CLOSE, handle_connection_close);
+ PLUGIN_TO_SLOT(PLUGIN_FUNC_HANDLE_TRIGGER, handle_trigger);
+diff -Nru lighttpd-1.4.22.orig/src/plugin.h lighttpd-1.4.22/src/plugin.h
+--- lighttpd-1.4.22.orig/src/plugin.h 2009-02-19 14:15:14.000000000 +0100
++++ lighttpd-1.4.28/src/plugin.h 2009-04-22 17:45:20.000000000 +0200
+@@ -42,12 +42,12 @@
+ handler_t (* handle_uri_clean) (server *srv, connection *con, void *p_d); /* after uri is set */
+ handler_t (* handle_docroot) (server *srv, connection *con, void *p_d); /* getting the document-root */
+ handler_t (* handle_physical) (server *srv, connection *con, void *p_d); /* mapping url to physical path */
++ handler_t (* handle_request_end) (server *srv, connection *con, void *p_d); /* a handler for the request content */
+ handler_t (* handle_request_done) (server *srv, connection *con, void *p_d); /* at the end of a request */
+ handler_t (* handle_connection_close)(server *srv, connection *con, void *p_d); /* at the end of a connection */
+ handler_t (* handle_joblist) (server *srv, connection *con, void *p_d); /* after all events are handled */
+
+
+-
+ handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d);
+
+ /* when a handler for the request
+@@ -68,6 +68,7 @@
+ handler_t plugins_call_handle_uri_clean(server *srv, connection *con);
+ handler_t plugins_call_handle_subrequest_start(server *srv, connection *con);
+ handler_t plugins_call_handle_subrequest(server *srv, connection *con);
++handler_t plugins_call_handle_request_end(server *srv, connection *con);
+ handler_t plugins_call_handle_request_done(server *srv, connection *con);
+ handler_t plugins_call_handle_docroot(server *srv, connection *con);
+ handler_t plugins_call_handle_physical(server *srv, connection *con);
+diff -Nru lighttpd-1.4.22.orig/src/mod_uploadprogress.c lighttpd-1.4.22/src/mod_uploadprogress.c
+--- lighttpd-1.4.22.orig/src/mod_uploadprogress.c 1970-01-01 01:00:00.000000000 +0100
++++ lighttpd-1.4.28/src/mod_uploadprogress.c 2009-04-22 17:32:38.000000000 +0200
+@@ -0,0 +1,648 @@
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "base.h"
++#include "log.h"
++#include "buffer.h"
++
++#include "plugin.h"
++
++#include "response.h"
++#include "stat_cache.h"
++
++#define CONFIG_UPLOAD_PROGRESS_URL "upload-progress.progress-url"
++#define CONFIG_UPLOAD_PROGRESS_TIMEOUT "upload-progress.remove-timeout"
++#define CONFIG_UPLOAD_PROGRESS_DEBUG "upload-progress.debug"
++
++#define SAFE_BUF_STR(x) x && x->ptr ? x->ptr : "(null)"
++
++/**
++ * uploadprogress for lighttpd
++ *
++ * Initial: Jan Kneschke <jan@kneschke.de>
++ * Timeout+Status addon: Bjoern Kalkbrenner <terminar@cyberphoria.org> [20070112]
++ *
++ * Ported to Lighttpd 1.4.22 by Radek Senfeld <rush@logic.cz>
++ *
++ * Backport based on revision 2369
++ * http://redmine.lighttpd.net/projects/lighttpd/repository/changes/trunk/src/mod_uploadprogress.c
++ *
++ * the timeout is used to keep in the status information intact even if the parent
++ * connection is gone already
++ *
++ */
++
++typedef struct {
++ buffer *tracking_id;
++ connection *con;
++
++ time_t timeout;
++ int status;
++ off_t size;
++} connection_map_entry;
++
++typedef struct {
++ connection_map_entry **ptr;
++
++ size_t used;
++ size_t size;
++} connection_map;
++
++/* plugin config for all request/connections */
++
++typedef struct {
++ buffer *progress_url;
++ unsigned short debug;
++ unsigned short remove_timeout;
++} plugin_config;
++
++typedef struct {
++ PLUGIN_DATA;
++
++ connection_map *con_map;
++
++ buffer *tmp_buf; /** used as temporary buffer for extracting the tracking id */
++
++ plugin_config **config_storage;
++
++ plugin_config conf;
++} plugin_data;
++
++/**
++ *
++ * connection maps
++ *
++ */
++
++/* init the plugin data */
++static connection_map *connection_map_init() {
++ connection_map *cm;
++
++ cm = calloc(1, sizeof(*cm));
++
++ return cm;
++}
++
++static void connection_map_free(connection_map *cm) {
++ size_t i;
++ for (i = 0; i < cm->size; i++) {
++ connection_map_entry *cme = cm->ptr[i];
++
++ if (!cme) break;
++
++ if (cme->tracking_id) {
++ buffer_free(cme->tracking_id);
++ }
++ free(cme);
++ }
++
++ free(cm);
++}
++
++static connection_map_entry *connection_map_insert(connection_map *cm, buffer *tracking_id, connection *con) {
++ connection_map_entry *cme;
++ size_t i;
++
++ if (cm->size == 0) {
++ cm->size = 16;
++ cm->ptr = malloc(cm->size * sizeof(*(cm->ptr)));
++ for (i = 0; i < cm->size; i++) {
++ cm->ptr[i] = NULL;
++ }
++ } else if (cm->used == cm->size) {
++ cm->size += 16;
++ cm->ptr = realloc(cm->ptr, cm->size * sizeof(*(cm->ptr)));
++ for (i = cm->used; i < cm->size; i++) {
++ cm->ptr[i] = NULL;
++ }
++ }
++
++ if (cm->ptr[cm->used]) {
++ /* is already alloced, just reuse it */
++ cme = cm->ptr[cm->used];
++ } else {
++ cme = malloc(sizeof(*cme));
++ cme->tracking_id = buffer_init();
++ }
++ cme->timeout = 0;
++ cme->status = 0;
++ buffer_copy_string_buffer(cme->tracking_id, tracking_id);
++ cme->con = con;
++
++ cm->ptr[cm->used++] = cme;
++
++ return cme;
++}
++
++static connection_map_entry *connection_map_get_connection_entry(connection_map *cm, buffer *tracking_id) {
++ size_t i;
++
++ for (i = 0; i < cm->used; i++) {
++ connection_map_entry *cme = cm->ptr[i];
++
++ if (buffer_is_equal(cme->tracking_id, tracking_id)) {
++ /* found connection */
++ return cme;
++ }
++ }
++ return NULL;
++}
++
++static void connection_map_remove_connection(connection_map *cm, size_t i) {
++ connection_map_entry *cme = cm->ptr[i];
++
++ buffer_reset(cme->tracking_id);
++ cme->timeout=0;
++ cme->status=0;
++
++ cm->used--;
++
++ /* swap positions with the last entry */
++ if (cm->used) {
++ cm->ptr[i] = cm->ptr[cm->used];
++ cm->ptr[cm->used] = cme;
++ }
++}
++
++/**
++ * remove dead tracking IDs
++ *
++ * uploadprogress.remove-timeout sets a grace-period in which the
++ * connection status is still known even of the connection is already
++ * being removed
++ *
++ */
++static void connection_map_clear_timeout_connections(connection_map *cm) {
++ size_t i;
++ time_t now_t = time(NULL);
++
++ for (i = 0; i < cm->used; i++) {
++ connection_map_entry *cme = cm->ptr[i];
++
++ if (cme->timeout != 0 && cme->timeout < now_t) {
++ /* found connection */
++ connection_map_remove_connection(cm, i);
++ }
++ }
++}
++
++/**
++ * extract the tracking-id from the parameters
++ *
++ * for POST requests it is part of the request headers
++ * for GET requests ... too
++ */
++static buffer *get_tracking_id(plugin_data *p, server *srv, connection *con) {
++ data_string *ds;
++ buffer *b = NULL;
++ char *qstr=NULL;
++ size_t i;
++
++ /* the request has to contain a 32byte ID */
++ if (NULL == (ds = (data_string *)array_get_element(con->request.headers, "X-Progress-ID"))) {
++ char *amp = NULL;
++
++ /* perhaps the POST request is using the querystring to pass the X-Progress-ID */
++ if (buffer_is_empty(con->uri.query)) {
++ /*
++ * con->uri.query will not be parsed out if a 413 error happens
++ */
++ if (NULL != (qstr = strchr(con->request.uri->ptr, '?'))) {
++ /** extract query string from request.uri */
++ buffer_copy_string(con->uri.query, qstr + 1);
++ } else {
++ return NULL;
++ }
++ }
++
++ /** split the query-string and extract the X-Progress-ID */
++ do {
++ char *eq = NULL;
++ char *start = amp ? amp + 1 : con->uri.query->ptr;
++
++ amp = strchr(start, '&');
++
++ /* check the string between start and amp for = */
++
++ if (amp) {
++ buffer_copy_string_len(p->tmp_buf, start, amp - start);
++ } else {
++ buffer_copy_string(p->tmp_buf, start);
++ }
++
++ eq = strchr(p->tmp_buf->ptr, '=');
++
++ if (eq) {
++ *eq = '\0';
++
++ if (0 == strcmp(p->tmp_buf->ptr, "X-Progress-ID")) {
++ size_t key_len = sizeof("X-Progress-ID") - 1;
++ size_t var_len = p->tmp_buf->used - 1;
++ /* found */
++
++ buffer_copy_string_len(p->tmp_buf, start + key_len + 1, var_len - key_len - 1);
++
++ b = p->tmp_buf;
++
++ break;
++ }
++ }
++ } while (amp);
++
++ if (!b) return NULL;
++ } else {
++ /* request header was found, use it */
++ b = ds->value;
++ }
++
++ if (b->used != 32 + 1) {
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "sds", "the Progress-ID has to be 32 characters long, got", b->used - 1, "characters");
++ return NULL;
++ }
++
++ for (i = 0; i < b->used - 1; i++) {
++ char c = b->ptr[i];
++
++ if (!light_isxdigit(c)) {
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "sds", "only hex-digits are allowed (0-9 + a-f): (ascii:", c, ")");
++ return NULL;
++ }
++ }
++
++ return b;
++}
++
++/* init the plugin data */
++INIT_FUNC(mod_uploadprogress_init) {
++ plugin_data *p;
++
++ p = calloc(1, sizeof(*p));
++
++ p->con_map = connection_map_init();
++ p->tmp_buf = buffer_init();
++
++ return p;
++}
++
++/* detroy the plugin data */
++FREE_FUNC(mod_uploadprogress_free) {
++ plugin_data *p = p_d;
++
++ UNUSED(srv);
++
++ if (!p) return HANDLER_GO_ON;
++
++ if (p->config_storage) {
++ size_t i;
++ for (i = 0; i < srv->config_context->used; i++) {
++ plugin_config *s = p->config_storage[i];
++
++ buffer_free(s->progress_url);
++ s->remove_timeout=0;
++
++ free(s);
++ }
++ free(p->config_storage);
++ }
++
++ connection_map_free(p->con_map);
++ buffer_free(p->tmp_buf);
++
++ free(p);
++
++ return HANDLER_GO_ON;
++}
++
++/* handle plugin config and check values */
++
++SETDEFAULTS_FUNC(mod_uploadprogress_set_defaults) {
++ plugin_data *p = p_d;
++ size_t i = 0;
++
++ config_values_t cv[] = {
++ { CONFIG_UPLOAD_PROGRESS_URL, NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
++ { CONFIG_UPLOAD_PROGRESS_TIMEOUT, NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
++ { CONFIG_UPLOAD_PROGRESS_DEBUG, NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
++ { NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
++ };
++
++ if (!p) return HANDLER_ERROR;
++
++ p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
++
++ for (i = 0; i < srv->config_context->used; i++) {
++ plugin_config *s;
++
++ s = calloc(1, sizeof(plugin_config));
++ s->progress_url = buffer_init();
++ s->remove_timeout = 60;
++ s->debug = 0;
++
++ cv[0].destination = s->progress_url;
++ cv[1].destination = &(s->remove_timeout);
++ cv[2].destination = &(s->debug);
++
++ p->config_storage[i] = s;
++
++ if (0 != config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv)) {
++ return HANDLER_ERROR;
++ }
++ }
++
++ return HANDLER_GO_ON;
++}
++
++#define PATCH_OPTION(x) \
++ p->conf.x = s->x;
++static int mod_uploadprogress_patch_connection(server *srv, connection *con, plugin_data *p) {
++ size_t i, j;
++ plugin_config *s = p->config_storage[0];
++
++ PATCH_OPTION(progress_url);
++ PATCH_OPTION(remove_timeout);
++ PATCH_OPTION(debug);
++
++ /* skip the first, the global context */
++ for (i = 1; i < srv->config_context->used; i++) {
++ data_config *dc = (data_config *)srv->config_context->data[i];
++ s = p->config_storage[i];
++
++ /* condition didn't match */
++ if (!config_check_cond(srv, con, dc)) continue;
++
++ /* merge config */
++ for (j = 0; j < dc->value->used; j++) {
++ data_unset *du = dc->value->data[j];
++
++ if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_URL))) {
++ PATCH_OPTION(progress_url);
++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_TIMEOUT))) {
++ PATCH_OPTION(remove_timeout);
++ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN(CONFIG_UPLOAD_PROGRESS_DEBUG))) {
++ PATCH_OPTION(debug);
++ }
++ }
++ }
++
++ return 0;
++}
++
++/**
++ *
++ * the idea:
++ *
++ * for the first request we check if it is a post-request
++ *
++ * if no, move out, don't care about them
++ *
++ * if yes, take the connection structure and register it locally
++ * in the progress-struct together with an session-id (md5 ... )
++ *
++ * if the connections closes, cleanup the entry in the progress-struct
++ *
++ * a second request can now get the info about the size of the upload,
++ * the received bytes
++ *
++ */
++
++URIHANDLER_FUNC(mod_uploadprogress_uri_handler) {
++ plugin_data *p = p_d;
++ buffer *tracking_id;
++ buffer *b;
++ connection_map_entry *post_con_entry = NULL;
++ connection_map_entry *map_con_entry = NULL;
++
++ if (buffer_is_empty(con->uri.path)) return HANDLER_GO_ON;
++
++ /* no progress URL set, ignore request */
++ if (buffer_is_empty(p->conf.progress_url)) return HANDLER_GO_ON;
++
++ switch(con->request.http_method) {
++ case HTTP_METHOD_POST:
++ /**
++ * a POST request is the UPLOAD itself
++ *
++ * get the unique tracker id
++ */
++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) {
++ return HANDLER_GO_ON;
++ }
++
++ if (NULL == (map_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) {
++ connection_map_insert(p->con_map, tracking_id, con);
++
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ss", "POST: connection is new, registered:", SAFE_BUF_STR(tracking_id));
++ } else {
++ map_con_entry->timeout = 0;
++ map_con_entry->status = 0;
++
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ss", "POST: connection is known, id:", SAFE_BUF_STR(tracking_id));
++ }
++
++ return HANDLER_GO_ON;
++ case HTTP_METHOD_GET:
++ /**
++ * the status request for the current connection
++ */
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "(uploadprogress) urls", SAFE_BUF_STR(con->uri.path), "==", SAFE_BUF_STR(p->conf.progress_url));
++
++ if (!buffer_is_equal(con->uri.path, p->conf.progress_url)) {
++ return HANDLER_GO_ON;
++ }
++
++ /* get the tracker id */
++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) {
++ return HANDLER_GO_ON;
++ }
++
++ buffer_reset(con->physical.path);
++
++ con->file_started = 1;
++ con->http_status = 200;
++ con->file_finished = 1;
++
++ /* send JSON content */
++
++ response_header_overwrite(srv, con, CONST_STR_LEN("Content-Type"), CONST_STR_LEN("text/javascript"));
++
++ /* just an attempt the force the IE/proxies to NOT cache the request */
++ response_header_overwrite(srv, con, CONST_STR_LEN("Pragma"), CONST_STR_LEN("no-cache"));
++ response_header_overwrite(srv, con, CONST_STR_LEN("Expires"), CONST_STR_LEN("Thu, 19 Nov 1981 08:52:00 GMT"));
++ response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"),
++ CONST_STR_LEN("no-store, no-cache, must-revalidate, post-check=0, pre-check=0"));
++
++ b = chunkqueue_get_append_buffer(con->write_queue);
++
++ /* get the connection */
++ if (NULL == (post_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) {
++ /**
++ * looks like we don't know the tracking id yet, GET and POST out of sync ? */
++ buffer_append_string_len(b, CONST_STR_LEN("{ \"state\" : \"unknown\" }\r\n"));
++ con->response.content_length += b->used - 1;
++
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "connection unknown:", SAFE_BUF_STR(tracking_id), ", sending:", SAFE_BUF_STR(b));
++
++ return HANDLER_FINISHED;
++ }
++
++ buffer_copy_string_len(b, CONST_STR_LEN("{ \"state\" : "));
++
++ if (post_con_entry->status == 413) {
++ /* the upload was too large */
++ buffer_append_string_len(b, CONST_STR_LEN("\"error\", \"status\" : 413"));
++ } else if (post_con_entry->con == NULL) {
++ /* the connection is already gone */
++ buffer_append_string_len(b, CONST_STR_LEN("\"done\", \"size\" : "));
++ buffer_append_off_t(b, post_con_entry->size);
++ } else {
++ /* the upload is already done, but the connection might be still open */
++ buffer_append_string(b, post_con_entry->con->state == CON_STATE_READ_POST ? "\"uploading\"" : "\"done\"");
++ buffer_append_string_len(b, CONST_STR_LEN(", \"received\" : "));
++ buffer_append_off_t(b, post_con_entry->con->bytes_read);
++ buffer_append_string_len(b, CONST_STR_LEN(", \"size\" : "));
++ buffer_append_off_t(b, post_con_entry->con->request.content_length);
++ }
++ buffer_append_string_len(b, CONST_STR_LEN("}\r\n"));
++ con->response.content_length += b->used - 1;
++
++ if (p->conf.debug) log_error_write(srv, __FILE__, __LINE__, "ssss", "connection is known:", SAFE_BUF_STR(tracking_id), ", sending:", SAFE_BUF_STR(b));
++
++ return HANDLER_FINISHED;
++ default:
++ break;
++ }
++
++ return HANDLER_GO_ON;
++}
++
++/**
++ * check for POST request
++ */
++CONNECTION_FUNC(mod_uploadprogress_request_end) {
++ plugin_data *p = p_d;
++
++ buffer *tracking_id;
++ connection_map_entry *map_con_entry = NULL;
++
++ UNUSED(srv);
++
++ /* no request URL, ignore request */
++ if (buffer_is_empty(con->request.uri)) return HANDLER_GO_ON;
++
++ mod_uploadprogress_patch_connection(srv, con, p);
++
++ /*
++ * we only want to process the upload (POST request)
++ */
++ if (con->request.http_method != HTTP_METHOD_POST) {
++ return HANDLER_GO_ON;
++ }
++
++ if (p->conf.debug) {
++ log_error_write(srv, __FILE__, __LINE__, "sxsdsd", "request_end: con=", (void *) con, ", http_method=", con->request.http_method, ", http_status=", con->http_status);
++ }
++
++ /* get the tracker id */
++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) {
++ return HANDLER_GO_ON;
++ }
++
++ if (NULL == (map_con_entry = connection_map_get_connection_entry(p->con_map, tracking_id))) {
++ /**
++ * in case the request parser meant the request was too large the URI handler won't
++ * get called. Insert the connection mapping here
++ */
++ if (NULL == (map_con_entry = connection_map_insert(p->con_map, tracking_id, con))) {
++ return HANDLER_GO_ON;
++ }
++ }
++
++ /* ok, found our entries, setting status */
++ map_con_entry->status = con->http_status;
++
++ return HANDLER_GO_ON;
++}
++
++/**
++ * remove the parent connection from the connection mapping
++ * when it got closed
++ *
++ * keep the mapping active for a while to send a valid final status
++ */
++CONNECTION_FUNC(mod_uploadprogress_request_done) {
++ plugin_data *p = p_d;
++ buffer *tracking_id;
++ connection_map_entry *cm = NULL;
++
++ UNUSED(srv);
++
++ if (buffer_is_empty(con->request.uri)) return HANDLER_GO_ON;
++
++ /*
++ * only need to handle the upload request.
++ */
++ if (con->request.http_method != HTTP_METHOD_POST) {
++ return HANDLER_GO_ON;
++ }
++
++ if (NULL == (tracking_id = get_tracking_id(p, srv, con))) {
++ return HANDLER_GO_ON;
++ }
++
++ if (p->conf.debug) {
++ log_error_write(srv, __FILE__, __LINE__, "sssd", "upload is done, moving tracking-id to backlog: tracking-id=", SAFE_BUF_STR(tracking_id), ", http_status=", con->http_status);
++ }
++
++ /*
++ * set timeout on the upload's connection_map_entry.
++ */
++ if (NULL == (cm = connection_map_get_connection_entry(p->con_map, tracking_id))) {
++ if (p->conf.debug) {
++ log_error_write(srv, __FILE__, __LINE__, "sss", "tracking ID", SAFE_BUF_STR(tracking_id), "not found, can't set timeout");
++ }
++ return HANDLER_GO_ON;
++ }
++
++ /* save request size to be able to report it even when cm->con == NULL */
++ cm->size = con->request.content_length;
++
++ cm->timeout = time(NULL) + p->conf.remove_timeout;
++ cm->con = NULL; /* con becomes invalid very soon */
++
++ return HANDLER_GO_ON;
++}
++
++/**
++ * remove dead connections once in while
++ */
++TRIGGER_FUNC(mod_uploadprogress_trigger) {
++ plugin_data *p = p_d;
++
++ if ((srv->cur_ts % 10) != 0) return HANDLER_GO_ON;
++
++ connection_map_clear_timeout_connections(p->con_map);
++
++ return HANDLER_GO_ON;
++}
++
++
++/* this function is called at dlopen() time and inits the callbacks */
++
++int mod_uploadprogress_plugin_init(plugin *p) {
++ p->version = LIGHTTPD_VERSION_ID;
++ p->name = buffer_init_string("uploadprogress");
++
++ p->init = mod_uploadprogress_init;
++ p->handle_uri_clean = mod_uploadprogress_uri_handler;
++ p->handle_request_end = mod_uploadprogress_request_end;
++ p->handle_request_done = mod_uploadprogress_request_done;
++// p->connection_reset = mod_uploadprogress_request_done;
++ p->set_defaults = mod_uploadprogress_set_defaults;
++ p->cleanup = mod_uploadprogress_free;
++ p->handle_trigger = mod_uploadprogress_trigger;
++
++ p->data = NULL;
++
++ return 0;
++}
diff --git a/www-servers/lighttpd/files/lighttpd-1.4.31-automake-1.12.patch b/www-servers/lighttpd/files/lighttpd-1.4.31-automake-1.12.patch
new file mode 100644
index 000000000000..eb3119fa01f7
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd-1.4.31-automake-1.12.patch
@@ -0,0 +1,21 @@
+http://bugs.gentoo.org/420599
+
+--- configure.ac
++++ configure.ac
+@@ -14,6 +14,8 @@
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+
+ dnl Checks for programs.
++m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
++
+ AC_PROG_CC
+ AM_PROG_CC_C_O
+ AC_PROG_LD
+@@ -39,7 +41,6 @@
+ AC_EXEEXT
+
+ dnl more automake stuff
+-AM_C_PROTOTYPES
+
+ dnl libtool
+ AC_DISABLE_STATIC
diff --git a/www-servers/lighttpd/files/lighttpd-1.4.33-fix-ipv6-build.patch b/www-servers/lighttpd/files/lighttpd-1.4.33-fix-ipv6-build.patch
new file mode 100644
index 000000000000..24acc81e8099
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd-1.4.33-fix-ipv6-build.patch
@@ -0,0 +1,21 @@
+Gentoo bug:
+https://bugs.gentoo.org/show_bug.cgi?id=486426
+
+Upstream bug:
+http://redmine.lighttpd.net/issues/2515
+
+Upstream Commit:
+http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/2911
+
+Index: src/mod_extforward.c
+===================================================================
+--- src/mod_extforward.c (revision 2909)
++++ src/mod_extforward.c (working copy)
+@@ -439,7 +439,6 @@
+ #ifdef HAVE_IPV6
+ ipstr_to_sockaddr(srv, real_remote_addr, &sock);
+ #else
+- UNUSED(addrs_left);
+ sock.ipv4.sin_addr.s_addr = inet_addr(real_remote_addr);
+ sock.plain.sa_family = (sock.ipv4.sin_addr.s_addr == 0xFFFFFFFF) ? AF_UNSPEC : AF_INET;
+ #endif
diff --git a/www-servers/lighttpd/files/lighttpd.confd b/www-servers/lighttpd/files/lighttpd.confd
new file mode 100644
index 000000000000..f3afb07a58e1
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.confd
@@ -0,0 +1,12 @@
+# /etc/conf.d/lighttpd
+
+# Location of a shell used by the 'include_shell' directive
+# in the lighttpd's configuration file
+#export SHELL="/bin/bash"
+
+# Location of the lighttpd configuration file
+LIGHTTPD_CONF="/etc/lighttpd/lighttpd.conf"
+
+# Location of the lighttpd pid file
+LIGHTTPD_PID="$(/usr/bin/awk '/^server.pid-file/{s=$3};{sub("\"","",s)};END{print s}' ${LIGHTTPD_CONF})"
+
diff --git a/www-servers/lighttpd/files/lighttpd.initd b/www-servers/lighttpd/files/lighttpd.initd
new file mode 100644
index 000000000000..23c0983fd77c
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.initd
@@ -0,0 +1,73 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_started_commands="reload graceful"
+
+depend() {
+ need net
+ use mysql logger spawn-fcgi ldap slapd netmount dns
+ after famd
+ after sshd
+}
+
+checkconfig() {
+ if [ ! -f "${LIGHTTPD_CONF}" ] ; then
+ ewarn "${LIGHTTPD_CONF} does not exist."
+ return 1
+ fi
+
+ if [ -z "${LIGHTTPD_PID}" ] ; then
+ ewarn "server.pid-file variable in ${LIGHTTPD_CONF}"
+ ewarn "is not set. Falling back to lighttpd.pid"
+ LIGHTTPD_PID="/run/lighttpd.pid"
+ fi
+ /usr/sbin/lighttpd -t -f ${LIGHTTPD_CONF} >/dev/null
+}
+
+start() {
+ checkconfig || return 1
+ checkpath -d -q -m 0750 -o lighttpd:lighttpd /run/lighttpd/
+
+ ebegin "Starting lighttpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/lighttpd \
+ --pidfile "${LIGHTTPD_PID}" -- -f "${LIGHTTPD_CONF}"
+ eend $?
+}
+
+stop() {
+ local rv=0
+ ebegin "Stopping lighttpd"
+ start-stop-daemon --stop --quiet --pidfile "${LIGHTTPD_PID}"
+ eend $?
+}
+
+reload() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+ checkconfig || return 1
+
+ ebegin "Re-opening lighttpd log files"
+ start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \
+ --signal HUP
+ eend $?
+}
+
+graceful() {
+ if ! service_started "${SVCNAME}" ; then
+ eerror "${SVCNAME} isn't running"
+ return 1
+ fi
+ checkconfig || return 1
+
+ ebegin "Gracefully stopping lighttpd"
+ start-stop-daemon --quiet --pidfile "${LIGHTTPD_PID}" \
+ --signal INT
+ if eend $? ; then
+ rm -f "${LIGHTTPD_PID}"
+ start
+ fi
+}
diff --git a/www-servers/lighttpd/files/lighttpd.logrotate b/www-servers/lighttpd/files/lighttpd.logrotate
new file mode 100644
index 000000000000..ef9dcc082e06
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.logrotate
@@ -0,0 +1,17 @@
+# $Id$
+# lighttpd logrotate script for Gentoo
+
+/var/log/lighttpd/*.log {
+ daily
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+ sharedscripts
+ postrotate
+ if [ -f /var/run/lighttpd.pid ]; then \
+ /etc/init.d/lighttpd reload > /dev/null 2>&1 || true ; \
+ fi;
+ endscript
+}
diff --git a/www-servers/lighttpd/files/lighttpd.logrotate-r1 b/www-servers/lighttpd/files/lighttpd.logrotate-r1
new file mode 100644
index 000000000000..724ff049d3c9
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.logrotate-r1
@@ -0,0 +1,16 @@
+# $Id$
+# lighttpd logrotate script for Gentoo
+
+/var/log/lighttpd/*.log {
+ daily
+ missingok
+ copytruncate
+ rotate 7
+ compress
+ notifempty
+ sharedscripts
+ postrotate
+ test -e /run/openrc/softlevel && /etc/init.d/lighttpd reload 1>/dev/null || true
+ test -e /run/systemd/system && systemctl reload lighttpd.service || true
+ endscript
+}
diff --git a/www-servers/lighttpd/files/lighttpd.service b/www-servers/lighttpd/files/lighttpd.service
new file mode 100644
index 000000000000..f5f5be757626
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lightning Fast Webserver With Light System Requirements
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/lighttpd/files/lighttpd.tmpfiles.conf b/www-servers/lighttpd/files/lighttpd.tmpfiles.conf
new file mode 100644
index 000000000000..325ab13d839c
--- /dev/null
+++ b/www-servers/lighttpd/files/lighttpd.tmpfiles.conf
@@ -0,0 +1 @@
+d /var/run/lighttpd 0750 lighttpd lighttpd - \ No newline at end of file
diff --git a/www-servers/lighttpd/lighttpd-1.4.35-r1.ebuild b/www-servers/lighttpd/lighttpd-1.4.35-r1.ebuild
new file mode 100644
index 000000000000..20b92854a018
--- /dev/null
+++ b/www-servers/lighttpd/lighttpd-1.4.35-r1.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit base autotools eutils depend.php readme.gentoo user systemd
+
+DESCRIPTION="Lightweight high-performance web server"
+HOMEPAGE="http://www.lighttpd.net/"
+SRC_URI="http://download.lighttpd.net/lighttpd/releases-1.4.x/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="bzip2 doc fam gdbm ipv6 kerberos ldap libev lua minimal mmap memcache mysql pcre php rrdtool selinux ssl test uploadprogress webdav xattr zlib"
+
+REQUIRED_USE="kerberos? ( ssl )"
+
+CDEPEND="
+ bzip2? ( app-arch/bzip2 )
+ fam? ( virtual/fam )
+ gdbm? ( sys-libs/gdbm )
+ ldap? ( >=net-nds/openldap-2.1.26 )
+ libev? ( >=dev-libs/libev-4.01 )
+ lua? ( >=dev-lang/lua-5.1 )
+ memcache? ( dev-libs/libmemcache )
+ mysql? ( >=virtual/mysql-4.0 )
+ pcre? ( >=dev-libs/libpcre-3.1 )
+ php? ( dev-lang/php[cgi] )
+ rrdtool? ( net-analyzer/rrdtool )
+ ssl? ( >=dev-libs/openssl-0.9.7[kerberos?] )
+ webdav? (
+ dev-libs/libxml2
+ >=dev-db/sqlite-3
+ sys-fs/e2fsprogs
+ )
+ xattr? ( kernel_linux? ( sys-apps/attr ) )
+ zlib? ( >=sys-libs/zlib-1.1 )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/docutils )
+ test? (
+ virtual/perl-Test-Harness
+ dev-libs/fcgi
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-apache )
+"
+
+# update certain parts of lighttpd.conf based on conditionals
+update_config() {
+ local config="${D}/etc/lighttpd/lighttpd.conf"
+
+ # enable php/mod_fastcgi settings
+ use php && { sed -i -e 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} || die; }
+
+ # enable stat() caching
+ use fam && { sed -i -e 's|#\(.*stat-cache.*$\)|\1|' ${config} || die; }
+
+ # automatically listen on IPv6 if built with USE=ipv6. Bug #234987
+ use ipv6 && { sed -i -e 's|# server.use-ipv6|server.use-ipv6|' ${config} || die; }
+}
+
+# remove non-essential stuff (for USE=minimal)
+remove_non_essential() {
+ local libdir="${D}/usr/$(get_libdir)/${PN}"
+
+ # text docs
+ use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt
+
+ # non-essential modules
+ rm -f \
+ ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.*
+
+ # allow users to keep some based on USE flags
+ use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.*
+ use webdav || rm -f ${libdir}/mod_webdav.*
+ use mysql || rm -f ${libdir}/mod_mysql_vhost.*
+ use lua || rm -f ${libdir}/mod_{cml,magnet}.*
+ use rrdtool || rm -f ${libdir}/mod_rrdtool.*
+ use zlib || rm -f ${libdir}/mod_compress.*
+}
+
+pkg_setup() {
+ if ! use pcre ; then
+ ewarn "It is highly recommended that you build ${PN}"
+ ewarn "with perl regular expressions support via USE=pcre."
+ ewarn "Otherwise you lose support for some core options such"
+ ewarn "as conditionals and modules such as mod_re{write,direct}"
+ ewarn "and mod_ssi."
+ fi
+ if use mmap; then
+ ewarn "You have enabled the mmap option. This option may allow"
+ ewarn "local users to trigger SIGBUG crashes. Use this option"
+ ewarn "with EXTRA care."
+ fi
+ enewgroup lighttpd
+ enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd
+
+ DOC_CONTENTS="IPv6 migration guide:\n
+ http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config"
+}
+
+src_prepare() {
+ base_src_prepare
+ #dev-python/docutils installs rst2html.py not rst2html
+ sed -i -e 's|\(rst2html\)|\1.py|g' doc/outdated/Makefile.am || \
+ die "sed doc/Makefile.am failed"
+ # Experimental patch for progress bar. Bug #380093
+ if use uploadprogress; then
+ epatch "${FILESDIR}"/${PN}-1.4.29-mod_uploadprogress.patch
+ fi
+ eautoreconf
+}
+
+src_configure() {
+ econf --libdir=/usr/$(get_libdir)/${PN} \
+ --enable-lfs \
+ $(use_enable ipv6) \
+ $(use_enable mmap) \
+ $(use_with bzip2) \
+ $(use_with fam) \
+ $(use_with gdbm) \
+ $(use_with kerberos kerberos5) \
+ $(use_with ldap) \
+ $(use_with libev) \
+ $(use_with lua) \
+ $(use_with memcache) \
+ $(use_with mysql) \
+ $(use_with pcre) \
+ $(use_with ssl openssl) \
+ $(use_with webdav webdav-props) \
+ $(use_with webdav webdav-locks) \
+ $(use_with xattr attr) \
+ $(use_with zlib)
+}
+
+src_compile() {
+ emake
+
+ if use doc ; then
+ einfo "Building HTML documentation"
+ cd doc || die
+ emake html
+ fi
+}
+
+src_test() {
+ if [[ ${EUID} -eq 0 ]]; then
+ default_src_test
+ else
+ ewarn "test skipped, please re-run as root if you wish to test ${PN}"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # init script stuff
+ newinitd "${FILESDIR}"/lighttpd.initd lighttpd
+ newconfd "${FILESDIR}"/lighttpd.confd lighttpd
+ use fam && has_version app-admin/fam && \
+ { sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd || die; }
+
+ # configs
+ insinto /etc/lighttpd
+ doins "${FILESDIR}"/conf/lighttpd.conf
+ doins "${FILESDIR}"/conf/mime-types.conf
+ doins "${FILESDIR}"/conf/mod_cgi.conf
+ doins "${FILESDIR}"/conf/mod_fastcgi.conf
+
+ # update lighttpd.conf directives based on conditionals
+ update_config
+
+ # docs
+ dodoc AUTHORS README NEWS doc/scripts/*.sh
+ newdoc doc/config//lighttpd.conf lighttpd.conf.distrib
+ use ipv6 && readme.gentoo_create_doc
+
+ use doc && dohtml -r doc/*
+
+ docinto txt
+ dodoc doc/outdated/*.txt
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/lighttpd.logrotate-r1 lighttpd
+
+ keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs
+ fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd
+ fperms 0750 /var/l{ib,og}/lighttpd
+
+ #spawn-fcgi may optionally be installed via www-servers/spawn-fcgi
+ rm -f "${D}"/usr/bin/spawn-fcgi "${D}"/usr/share/man/man1/spawn-fcgi.*
+
+ use minimal && remove_non_essential
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
+}
+
+pkg_postinst () {
+ use ipv6 && readme.gentoo_print_elog
+
+ if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then
+ einfo "spawn-fcgi is now provided by www-servers/spawn-fcgi."
+ einfo "spawn-fcgi's init script configuration is now located"
+ einfo "at /etc/conf.d/spawn-fcgi."
+ fi
+
+ if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then
+ elog "Gentoo has a customized configuration,"
+ elog "which is now located in /etc/lighttpd. Please migrate your"
+ elog "existing configuration."
+ fi
+
+ if use uploadprogress; then
+ elog "WARNING! mod_uploadprogress is a backported module from the"
+ elog "1.5x-branch, which is not considered stable yet. Please go to"
+ elog "http://redmine.lighttpd.net/wiki/1/Docs:ModUploadProgress"
+ elog "for more information. This configuration also is NOT supported"
+ elog "by upstream, so please refrain from reporting bugs. You have"
+ elog "been warned!"
+ fi
+}
diff --git a/www-servers/lighttpd/lighttpd-1.4.35-r2.ebuild b/www-servers/lighttpd/lighttpd-1.4.35-r2.ebuild
new file mode 100644
index 000000000000..6c3f07724fc8
--- /dev/null
+++ b/www-servers/lighttpd/lighttpd-1.4.35-r2.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+inherit base autotools eutils depend.php readme.gentoo user systemd
+
+DESCRIPTION="Lightweight high-performance web server"
+HOMEPAGE="http://www.lighttpd.net/"
+SRC_URI="http://download.lighttpd.net/lighttpd/releases-1.4.x/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="bzip2 doc fam gdbm ipv6 kerberos ldap libev lua minimal mmap memcache mysql pcre php rrdtool selinux ssl test uploadprogress webdav xattr zlib"
+
+REQUIRED_USE="kerberos? ( ssl )"
+
+CDEPEND="
+ bzip2? ( app-arch/bzip2 )
+ fam? ( virtual/fam )
+ gdbm? ( sys-libs/gdbm )
+ ldap? ( >=net-nds/openldap-2.1.26 )
+ libev? ( >=dev-libs/libev-4.01 )
+ lua? ( >=dev-lang/lua-5.1:= )
+ memcache? ( dev-libs/libmemcache )
+ mysql? ( >=virtual/mysql-4.0 )
+ pcre? ( >=dev-libs/libpcre-3.1 )
+ php? ( dev-lang/php:=[cgi] )
+ rrdtool? ( net-analyzer/rrdtool )
+ ssl? ( >=dev-libs/openssl-0.9.7:=[kerberos?] )
+ webdav? (
+ dev-libs/libxml2
+ >=dev-db/sqlite-3
+ sys-fs/e2fsprogs
+ )
+ xattr? ( kernel_linux? ( sys-apps/attr ) )
+ zlib? ( >=sys-libs/zlib-1.1 )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/docutils )
+ test? (
+ virtual/perl-Test-Harness
+ dev-libs/fcgi
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-apache )
+"
+
+# update certain parts of lighttpd.conf based on conditionals
+update_config() {
+ local config="${D}/etc/lighttpd/lighttpd.conf"
+
+ # enable php/mod_fastcgi settings
+ use php && { sed -i -e 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} || die; }
+
+ # enable stat() caching
+ use fam && { sed -i -e 's|#\(.*stat-cache.*$\)|\1|' ${config} || die; }
+
+ # automatically listen on IPv6 if built with USE=ipv6. Bug #234987
+ use ipv6 && { sed -i -e 's|# server.use-ipv6|server.use-ipv6|' ${config} || die; }
+}
+
+# remove non-essential stuff (for USE=minimal)
+remove_non_essential() {
+ local libdir="${D}/usr/$(get_libdir)/${PN}"
+
+ # text docs
+ use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt
+
+ # non-essential modules
+ rm -f \
+ ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.*
+
+ # allow users to keep some based on USE flags
+ use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.*
+ use webdav || rm -f ${libdir}/mod_webdav.*
+ use mysql || rm -f ${libdir}/mod_mysql_vhost.*
+ use lua || rm -f ${libdir}/mod_{cml,magnet}.*
+ use rrdtool || rm -f ${libdir}/mod_rrdtool.*
+ use zlib || rm -f ${libdir}/mod_compress.*
+}
+
+pkg_setup() {
+ if ! use pcre ; then
+ ewarn "It is highly recommended that you build ${PN}"
+ ewarn "with perl regular expressions support via USE=pcre."
+ ewarn "Otherwise you lose support for some core options such"
+ ewarn "as conditionals and modules such as mod_re{write,direct}"
+ ewarn "and mod_ssi."
+ fi
+ if use mmap; then
+ ewarn "You have enabled the mmap option. This option may allow"
+ ewarn "local users to trigger SIGBUG crashes. Use this option"
+ ewarn "with EXTRA care."
+ fi
+ enewgroup lighttpd
+ enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd
+
+ DOC_CONTENTS="IPv6 migration guide:\n
+ http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config"
+}
+
+src_prepare() {
+ base_src_prepare
+ #dev-python/docutils installs rst2html.py not rst2html
+ sed -i -e 's|\(rst2html\)|\1.py|g' doc/outdated/Makefile.am || \
+ die "sed doc/Makefile.am failed"
+ # Experimental patch for progress bar. Bug #380093
+ if use uploadprogress; then
+ epatch "${FILESDIR}"/${PN}-1.4.29-mod_uploadprogress.patch
+ fi
+ eautoreconf
+}
+
+src_configure() {
+ econf --libdir=/usr/$(get_libdir)/${PN} \
+ --enable-lfs \
+ $(use_enable ipv6) \
+ $(use_enable mmap) \
+ $(use_with bzip2) \
+ $(use_with fam) \
+ $(use_with gdbm) \
+ $(use_with kerberos kerberos5) \
+ $(use_with ldap) \
+ $(use_with libev) \
+ $(use_with lua) \
+ $(use_with memcache) \
+ $(use_with mysql) \
+ $(use_with pcre) \
+ $(use_with ssl openssl) \
+ $(use_with webdav webdav-props) \
+ $(use_with webdav webdav-locks) \
+ $(use_with xattr attr) \
+ $(use_with zlib)
+}
+
+src_compile() {
+ emake
+
+ if use doc ; then
+ einfo "Building HTML documentation"
+ cd doc || die
+ emake html
+ fi
+}
+
+src_test() {
+ if [[ ${EUID} -eq 0 ]]; then
+ default_src_test
+ else
+ ewarn "test skipped, please re-run as root if you wish to test ${PN}"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # init script stuff
+ newinitd "${FILESDIR}"/lighttpd.initd lighttpd
+ newconfd "${FILESDIR}"/lighttpd.confd lighttpd
+ use fam && has_version app-admin/fam && \
+ { sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd || die; }
+
+ # configs
+ insinto /etc/lighttpd
+ doins "${FILESDIR}"/conf/lighttpd.conf
+ doins "${FILESDIR}"/conf/mime-types.conf
+ doins "${FILESDIR}"/conf/mod_cgi.conf
+ doins "${FILESDIR}"/conf/mod_fastcgi.conf
+
+ # update lighttpd.conf directives based on conditionals
+ update_config
+
+ # docs
+ dodoc AUTHORS README NEWS doc/scripts/*.sh
+ newdoc doc/config//lighttpd.conf lighttpd.conf.distrib
+ use ipv6 && readme.gentoo_create_doc
+
+ use doc && dohtml -r doc/*
+
+ docinto txt
+ dodoc doc/outdated/*.txt
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/lighttpd.logrotate-r1 lighttpd
+
+ keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs
+ fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd
+ fperms 0750 /var/l{ib,og}/lighttpd
+
+ #spawn-fcgi may optionally be installed via www-servers/spawn-fcgi
+ rm -f "${D}"/usr/bin/spawn-fcgi "${D}"/usr/share/man/man1/spawn-fcgi.*
+
+ use minimal && remove_non_essential
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
+}
+
+pkg_postinst () {
+ use ipv6 && readme.gentoo_print_elog
+
+ if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then
+ einfo "spawn-fcgi is now provided by www-servers/spawn-fcgi."
+ einfo "spawn-fcgi's init script configuration is now located"
+ einfo "at /etc/conf.d/spawn-fcgi."
+ fi
+
+ if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then
+ elog "Gentoo has a customized configuration,"
+ elog "which is now located in /etc/lighttpd. Please migrate your"
+ elog "existing configuration."
+ fi
+
+ if use uploadprogress; then
+ elog "WARNING! mod_uploadprogress is a backported module from the"
+ elog "1.5x-branch, which is not considered stable yet. Please go to"
+ elog "http://redmine.lighttpd.net/wiki/1/Docs:ModUploadProgress"
+ elog "for more information. This configuration also is NOT supported"
+ elog "by upstream, so please refrain from reporting bugs. You have"
+ elog "been warned!"
+ fi
+}
diff --git a/www-servers/lighttpd/lighttpd-1.4.35.ebuild b/www-servers/lighttpd/lighttpd-1.4.35.ebuild
new file mode 100644
index 000000000000..ef3f07e4c96e
--- /dev/null
+++ b/www-servers/lighttpd/lighttpd-1.4.35.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+inherit base autotools eutils depend.php readme.gentoo user systemd
+
+DESCRIPTION="Lightweight high-performance web server"
+HOMEPAGE="http://www.lighttpd.net/"
+SRC_URI="http://download.lighttpd.net/lighttpd/releases-1.4.x/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="bzip2 doc fam gdbm ipv6 kerberos ldap libev lua minimal mmap memcache mysql pcre php rrdtool selinux ssl test uploadprogress webdav xattr zlib"
+
+REQUIRED_USE="kerberos? ( ssl )"
+
+CDEPEND="
+ bzip2? ( app-arch/bzip2 )
+ fam? ( virtual/fam )
+ gdbm? ( sys-libs/gdbm )
+ ldap? ( >=net-nds/openldap-2.1.26 )
+ libev? ( >=dev-libs/libev-4.01 )
+ lua? ( >=dev-lang/lua-5.1 )
+ memcache? ( dev-libs/libmemcache )
+ mysql? ( >=virtual/mysql-4.0 )
+ pcre? ( >=dev-libs/libpcre-3.1 )
+ php? ( dev-lang/php[cgi] )
+ rrdtool? ( net-analyzer/rrdtool )
+ ssl? ( >=dev-libs/openssl-0.9.7[kerberos?] )
+ webdav? (
+ dev-libs/libxml2
+ >=dev-db/sqlite-3
+ sys-fs/e2fsprogs
+ )
+ xattr? ( kernel_linux? ( sys-apps/attr ) )
+ zlib? ( >=sys-libs/zlib-1.1 )"
+
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( dev-python/docutils )
+ test? (
+ virtual/perl-Test-Harness
+ dev-libs/fcgi
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-apache )
+"
+
+# update certain parts of lighttpd.conf based on conditionals
+update_config() {
+ local config="${D}/etc/lighttpd/lighttpd.conf"
+
+ # enable php/mod_fastcgi settings
+ use php && { sed -i -e 's|#.*\(include.*fastcgi.*$\)|\1|' ${config} || die; }
+
+ # enable stat() caching
+ use fam && { sed -i -e 's|#\(.*stat-cache.*$\)|\1|' ${config} || die; }
+
+ # automatically listen on IPv6 if built with USE=ipv6. Bug #234987
+ use ipv6 && { sed -i -e 's|# server.use-ipv6|server.use-ipv6|' ${config} || die; }
+}
+
+# remove non-essential stuff (for USE=minimal)
+remove_non_essential() {
+ local libdir="${D}/usr/$(get_libdir)/${PN}"
+
+ # text docs
+ use doc || rm -fr "${D}"/usr/share/doc/${PF}/txt
+
+ # non-essential modules
+ rm -f \
+ ${libdir}/mod_{compress,evhost,expire,proxy,scgi,secdownload,simple_vhost,status,setenv,trigger*,usertrack}.*
+
+ # allow users to keep some based on USE flags
+ use pcre || rm -f ${libdir}/mod_{ssi,re{direct,write}}.*
+ use webdav || rm -f ${libdir}/mod_webdav.*
+ use mysql || rm -f ${libdir}/mod_mysql_vhost.*
+ use lua || rm -f ${libdir}/mod_{cml,magnet}.*
+ use rrdtool || rm -f ${libdir}/mod_rrdtool.*
+ use zlib || rm -f ${libdir}/mod_compress.*
+}
+
+pkg_setup() {
+ if ! use pcre ; then
+ ewarn "It is highly recommended that you build ${PN}"
+ ewarn "with perl regular expressions support via USE=pcre."
+ ewarn "Otherwise you lose support for some core options such"
+ ewarn "as conditionals and modules such as mod_re{write,direct}"
+ ewarn "and mod_ssi."
+ fi
+ if use mmap; then
+ ewarn "You have enabled the mmap option. This option may allow"
+ ewarn "local users to trigger SIGBUG crashes. Use this option"
+ ewarn "with EXTRA care."
+ fi
+ enewgroup lighttpd
+ enewuser lighttpd -1 -1 /var/www/localhost/htdocs lighttpd
+
+ DOC_CONTENTS="IPv6 migration guide:\n
+ http://redmine.lighttpd.net/projects/lighttpd/wiki/IPv6-Config"
+}
+
+src_prepare() {
+ base_src_prepare
+ #dev-python/docutils installs rst2html.py not rst2html
+ sed -i -e 's|\(rst2html\)|\1.py|g' doc/outdated/Makefile.am || \
+ die "sed doc/Makefile.am failed"
+ # Experimental patch for progress bar. Bug #380093
+ if use uploadprogress; then
+ epatch "${FILESDIR}"/${PN}-1.4.29-mod_uploadprogress.patch
+ fi
+ eautoreconf
+}
+
+src_configure() {
+ econf --libdir=/usr/$(get_libdir)/${PN} \
+ --enable-lfs \
+ $(use_enable ipv6) \
+ $(use_enable mmap) \
+ $(use_with bzip2) \
+ $(use_with fam) \
+ $(use_with gdbm) \
+ $(use_with kerberos kerberos5) \
+ $(use_with ldap) \
+ $(use_with libev) \
+ $(use_with lua) \
+ $(use_with memcache) \
+ $(use_with mysql) \
+ $(use_with pcre) \
+ $(use_with ssl openssl) \
+ $(use_with webdav webdav-props) \
+ $(use_with webdav webdav-locks) \
+ $(use_with xattr attr) \
+ $(use_with zlib)
+}
+
+src_compile() {
+ emake
+
+ if use doc ; then
+ einfo "Building HTML documentation"
+ cd doc || die
+ emake html
+ fi
+}
+
+src_test() {
+ if [[ ${EUID} -eq 0 ]]; then
+ default_src_test
+ else
+ ewarn "test skipped, please re-run as root if you wish to test ${PN}"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ # init script stuff
+ newinitd "${FILESDIR}"/lighttpd.initd lighttpd
+ newconfd "${FILESDIR}"/lighttpd.confd lighttpd
+ use fam && has_version app-admin/fam && \
+ { sed -i 's/after famd/need famd/g' "${D}"/etc/init.d/lighttpd || die; }
+
+ # configs
+ insinto /etc/lighttpd
+ doins "${FILESDIR}"/conf/lighttpd.conf
+ doins "${FILESDIR}"/conf/mime-types.conf
+ doins "${FILESDIR}"/conf/mod_cgi.conf
+ doins "${FILESDIR}"/conf/mod_fastcgi.conf
+
+ # update lighttpd.conf directives based on conditionals
+ update_config
+
+ # docs
+ dodoc AUTHORS README NEWS doc/scripts/*.sh
+ newdoc doc/config//lighttpd.conf lighttpd.conf.distrib
+ use ipv6 && readme.gentoo_create_doc
+
+ use doc && dohtml -r doc/*
+
+ docinto txt
+ dodoc doc/outdated/*.txt
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/lighttpd.logrotate lighttpd
+
+ keepdir /var/l{ib,og}/lighttpd /var/www/localhost/htdocs
+ fowners lighttpd:lighttpd /var/l{ib,og}/lighttpd
+ fperms 0750 /var/l{ib,og}/lighttpd
+
+ #spawn-fcgi may optionally be installed via www-servers/spawn-fcgi
+ rm -f "${D}"/usr/bin/spawn-fcgi "${D}"/usr/share/man/man1/spawn-fcgi.*
+
+ use minimal && remove_non_essential
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+ systemd_dotmpfilesd "${FILESDIR}/${PN}.tmpfiles.conf"
+}
+
+pkg_postinst () {
+ use ipv6 && readme.gentoo_print_elog
+
+ if [[ -f ${ROOT}etc/conf.d/spawn-fcgi.conf ]] ; then
+ einfo "spawn-fcgi is now provided by www-servers/spawn-fcgi."
+ einfo "spawn-fcgi's init script configuration is now located"
+ einfo "at /etc/conf.d/spawn-fcgi."
+ fi
+
+ if [[ -f ${ROOT}etc/lighttpd.conf ]] ; then
+ elog "Gentoo has a customized configuration,"
+ elog "which is now located in /etc/lighttpd. Please migrate your"
+ elog "existing configuration."
+ fi
+
+ if use uploadprogress; then
+ elog "WARNING! mod_uploadprogress is a backported module from the"
+ elog "1.5x-branch, which is not considered stable yet. Please go to"
+ elog "http://redmine.lighttpd.net/wiki/1/Docs:ModUploadProgress"
+ elog "for more information. This configuration also is NOT supported"
+ elog "by upstream, so please refrain from reporting bugs. You have"
+ elog "been warned!"
+ fi
+}
diff --git a/www-servers/lighttpd/metadata.xml b/www-servers/lighttpd/metadata.xml
new file mode 100644
index 000000000000..c2f3a89122a6
--- /dev/null
+++ b/www-servers/lighttpd/metadata.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>wired@gentoo.org</email>
+ <name>Alex Alexander</name>
+ </maintainer>
+ <maintainer>
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+ lighttpd a secure, fast, compliant and very flexible web-server
+ which has been optimized for high-performance environments. It has a very
+ low memory footprint compared to other webservers and takes care of cpu-load.
+ Its advanced feature-set (FastCGI, CGI, Auth, Output-Compression,
+ URL-Rewriting and many more) make lighttpd the perfect webserver-software
+ for every server that is suffering load problems.
+ </longdescription>
+ <use>
+ <flag name='libev'>Enable fdevent handler</flag>
+ <flag name='memcache'>Enable memcache support for mod_cml and
+ mod_trigger_b4_dl</flag>
+ <flag name='mmap'>Use mmap with files owned by lighttpd. This is a dangerous option as it may allow local users to trigger SIGBUS crashes.</flag>
+ <flag name='rrdtool'>Enable rrdtool support via mod_rrdtool</flag>
+ <flag name='uploadprogress'>Apply experimental patch for upload progress module</flag>
+ <flag name='webdav'>Enable webdav properties</flag>
+ </use>
+</pkgmetadata>
+
diff --git a/www-servers/metadata.xml b/www-servers/metadata.xml
new file mode 100644
index 000000000000..565534f11f2b
--- /dev/null
+++ b/www-servers/metadata.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The www-servers category contains web server packages.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría www-servers contiene servidores web.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie www-server enthält verschiedene Webserver.
+ </longdescription>
+ <longdescription lang="ja">
+ www-miscカテゴリーにはウェブサーバーのパッケージが含まれています。
+ </longdescription>
+ <longdescription lang="nl">
+ De www-server categorie bevat verschillende webservers.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm www-servers chứa các phần mềm web server.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria www-servers contiene una selezione di software web server.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria www-servers contém pacotes de servidores de web.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria www-servers zawiera serwery stron WWW.
+ </longdescription>
+</catmetadata>
+
diff --git a/www-servers/mongoose/Manifest b/www-servers/mongoose/Manifest
new file mode 100644
index 000000000000..7c98b12c217a
--- /dev/null
+++ b/www-servers/mongoose/Manifest
@@ -0,0 +1 @@
+DIST mongoose-5.3.zip 124529 SHA256 9807751a888c7c32008d3ecf3c90d7ddff1469139b07a14e27e2f54874250bd7 SHA512 eb2f5de1bfb7e2314b64a695f579145644ff84c68b886fdd7f1adab40308a468438416799359788d36cc735b06cbb89b402938ed07ac3d4e40fa02c0a859fcd9 WHIRLPOOL 5cf2183d372d8a8117e7411d98242332a04e97f7d39d0186f74fa7925e1e22a9caf83a35eb08772809cc6c280d7270826edca2c13d12cddfce930bf6e2a10c3f
diff --git a/www-servers/mongoose/metadata.xml b/www-servers/mongoose/metadata.xml
new file mode 100644
index 000000000000..252b6ee7ade2
--- /dev/null
+++ b/www-servers/mongoose/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">cesanta/mongoose</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/mongoose/mongoose-5.3.ebuild b/www-servers/mongoose/mongoose-5.3.ebuild
new file mode 100644
index 000000000000..876ae37fe3e9
--- /dev/null
+++ b/www-servers/mongoose/mongoose-5.3.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit toolchain-funcs
+
+DESCRIPTION="easy to use web server"
+SRC_URI="https://github.com/cesanta/${PN}/archive/${PV}.zip -> ${P}.zip"
+HOMEPAGE="https://code.google.com/p/${PN}/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~amd64-linux ~x86 ~arm-linux ~x86-linux"
+IUSE="lua"
+
+RDEPEND="lua? ( >=dev-lang/lua-5.2.3:5.2= )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${P}/examples
+
+src_prepare() {
+ if use lua ; then
+ sed \
+ -e "s|^#CFLAGS += -I\$(LUA) -L\$(LUA) -llua|CFLAGS += -I$($(tc-getPKG_CONFIG) --variable includedir lua5.2)/lua5.2 -L$($(tc-getPKG_CONFIG) --variable libdir lua5.2) -llua5.2|" \
+ -i Makefile || die
+ fi
+ sed \
+ -e 's|^CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)|CFLAGS += -I.. -pthread $(LDFLAGS)|' \
+ -e "s|g++ unit_test.c -Wall -W -pedantic -lssl|$(tc-getCC) unit_test.c -Wall -W -pedantic -lssl -pthread|" \
+ -i Makefile || die
+}
+
+src_compile() {
+ tc-export CC
+ emake server
+}
+
+src_test() {
+ emake u
+}
+
+src_install() {
+ newbin "${S}/server" "${PN}"
+ dodoc ../docs/{FAQ,LuaSqlite,Options,SSL,Usage}.md
+}
diff --git a/www-servers/monkeyd/Manifest b/www-servers/monkeyd/Manifest
new file mode 100644
index 000000000000..acca2cbcbcda
--- /dev/null
+++ b/www-servers/monkeyd/Manifest
@@ -0,0 +1,3 @@
+DIST monkey-1.5.3.tar.gz 892478 SHA256 0ac300e04f052818bc26b7da0183c3c5cd13be8090aaabd3505838587be8c0ec SHA512 6a55ba580bfde3c11329e94055d287e341990e4db4cb5ab12e40b8bab57b4b51fd57cd33fc5aa9d864127f235888f818593be26fe93daa34ca3c40fa8936465f WHIRLPOOL 4038bd2f0b39f6068ab69dc98dec4d5b29feca388c18361f57b653db86c38469d69072ae803ddd565e57350163247072334835216a13d014956a27b91c8a42b6
+DIST monkey-1.5.5.tar.gz 898602 SHA256 5a0554fdb4d8746f5eb665f305bd120c8f2bef3e7fea2a43be6b472461b45b05 SHA512 faf86a36a91c8b1e47f3a2ea7f19aee98eada6f3348ff64f160fc388c268a146d49ad9434043731cf928fca6708db40fa5e1daedc41d4b8cce671f98d590b920 WHIRLPOOL 26b44624f77b72bbd31da6be5855429199a0fc9ab163548f1d0f21a34b84a1f0325241ed7ad5ecbb28c9e9f899458b5d8c15f9f91e27b73a53023c2e3152947d
+DIST monkey-1.5.6.tar.gz 902636 SHA256 7c3d845306aa74ee6effd7ab6169d16ac4e6450e564954d0d0baa2d1e9be1a22 SHA512 4c7c627cb047252252b22da5fba179a21fb5b8dc6280b96307af52757ad049d24b0daaaea51dca4f0429af5e6499c239f6b62a03654cc9e7ad98ae8f5149b64c WHIRLPOOL aba1a928023fc67224f254182eb9707c6594c7092d9ff98ecfa297c91d5c61f79235e7467192b5d46ac114ae67a3cee98e06704721348a40ee825755ab39d9a1
diff --git a/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch b/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch
new file mode 100644
index 000000000000..9e88bc999dee
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd-1.5.0-fix-CPPFLAGS.patch
@@ -0,0 +1,17 @@
+diff -Naur monkey-1.5.0.orig/plugins/auth/tools/Makefile.in monkey-1.5.0/plugins/auth/tools/Makefile.in
+--- monkey-1.5.0.orig/plugins/auth/tools/Makefile.in 2014-05-25 19:12:44.000000000 -0400
++++ monkey-1.5.0/plugins/auth/tools/Makefile.in 2014-05-26 13:15:29.347727637 -0400
+@@ -3,10 +3,11 @@
+
+ CC = @echo " CC $(_PATH)/$@"; $CC
+ CC_QUIET= @echo -n; $CC
+-CFLAGS = -I../../../src/include -I../ $CFLAGS
++CPPFLAGS = -I../../../src/include -I../
++CFLAGS = $CFLAGS
+ LDFLAGS = $LDFLAGS
+ SOURCES = ../sha1.c ../base64.c mk_passwd.c
+ OBJECTS = $(SOURCES:../.c=%.o)
+
+ ../../../bin/mk_passwd: $(OBJECTS)
+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -ldl
++ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ -ldl
diff --git a/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch b/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch
new file mode 100644
index 000000000000..a4934a4e21c1
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd-1.5.2-use-system-jemalloc.patch
@@ -0,0 +1,157 @@
+diff -Naur monkey-1.5.2.orig/configure monkey-1.5.2/configure
+--- monkey-1.5.2.orig/configure 2014-07-19 23:27:13.000000000 -0400
++++ monkey-1.5.2/configure 2014-07-26 10:07:08.808171546 -0400
+@@ -193,7 +193,7 @@
+
+ echo "+ Creating src/Makefile"
+ create_makefile2 mod_libs mod_obj make_script platform \
+- malloc_libc malloc_jemalloc
++ malloc_libc
+
+ echo "+ Creating plugins/Make.common"
+ create_plugins_make_common bindir
+@@ -210,33 +210,12 @@
+
+ echo -e "+ Creating Makefile"
+ if [ "$dir" = 0 ]; then
+- create_makefile1 bindir malloc_jemalloc
++ create_makefile1 bindir
+ else
+ create_makefile1_install prefix bindir mandir sysconfdir \
+- datadir logdir malloc_jemalloc
++ datadir logdir
+ fi
+
+- # if the memory allocator is jemalloc, lets start configuring the dependency
+- if [ $malloc_jemalloc -eq 1 ]; then
+- echo
+- echo -e "\033[1m=== Configuring Memory Allocator ===\033[0m"
+- cd deps/jemalloc
+- ./configure $JEMALLOC_OPTS \
+- --with-jemalloc-prefix=je_ \
+- --enable-cc-silence \
+- CFLAGS="-std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops " \
+- LDFLAGS="" > jemalloc.config 2>&1
+- if [ $? -eq 0 ]; then
+- echo "+ Jemalloc configured"
+- else
+- cat jemalloc.config
+- echo
+- echo "check more details with: $ cat deps/jemalloc/config.log"
+- exit 1
+- fi
+- cd ../../
+- fi
+-
+ echo
+ echo -e "\033[1m=== Monkey Configuration ===\033[0m"
+ echo -e "Platform\t= $platform"
+@@ -316,12 +295,6 @@
+ # Create Makefile
+ create_makefile1()
+ {
+- if [ $malloc_jemalloc -eq 1 ]; then
+- $deps="deps/jemalloc"
+- else
+- $deps=""
+- fi
+-
+ cat > Makefile << EOF
+ # Monkey HTTP Daemon: Makefile
+ # ============================
+@@ -459,13 +432,6 @@
+
+ create_makefile1_install()
+ {
+- # memory allocator
+- if [ $malloc_jemalloc -eq 1 ]; then
+- all_deps="$all_deps jemalloc"
+- else
+- deps=""
+- fi
+-
+ # remove old data
+ rm -rf plugins.conf plugins.list
+ touch plugins.conf
+@@ -523,10 +489,6 @@
+ @\$(MAKE) -s -C plugins all
+ @echo " DONE"
+
+-jemalloc:
+- @echo " CC jemalloc [all]"
+- @\$(MAKE) -s -C deps/jemalloc
+-
+ clean:
+ @(cd src; \$(MAKE) clean)
+ @(cd plugins; \$(MAKE) clean)
+@@ -605,9 +567,7 @@
+ fi
+
+ if [ $malloc_jemalloc -eq 1 ]; then
+- extra="../deps/jemalloc/lib/libjemalloc.a"
+- extraso="-Wl,--whole-archive ../deps/jemalloc/lib/libjemalloc_pic.a -Wl,--no-whole-archive"
+- libs="$libs -lm"
++ libs="$libs -ljemalloc"
+ fi
+
+ cat > src/Makefile<<EOF
+diff -Naur monkey-1.5.2.orig/src/include/mk_memory.h monkey-1.5.2/src/include/mk_memory.h
+--- monkey-1.5.2.orig/src/include/mk_memory.h 2014-07-19 23:27:13.000000000 -0400
++++ monkey-1.5.2/src/include/mk_memory.h 2014-07-26 10:08:06.427168785 -0400
+@@ -23,7 +23,7 @@
+ #include <stdio.h>
+
+ #ifdef MALLOC_JEMALLOC
+-#include "../../deps/jemalloc/include/jemalloc/jemalloc.h"
++#include <jemalloc/jemalloc.h>
+ #endif
+
+ #include "mk_macros.h"
+@@ -43,11 +43,7 @@
+ static inline ALLOCSZ_ATTR(1)
+ void *mk_mem_malloc(const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *aux = je_malloc(size);
+-#else
+ void *aux = malloc(size);
+-#endif
+
+ if (mk_unlikely(!aux && size)) {
+ perror("malloc");
+@@ -60,11 +56,7 @@
+ static inline ALLOCSZ_ATTR(1)
+ void *mk_mem_malloc_z(const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *buf = je_calloc(1, size);
+-#else
+ void *buf = calloc(1, size);
+-#endif
+
+ if (mk_unlikely(!buf)) {
+ return NULL;
+@@ -76,11 +68,7 @@
+ static inline ALLOCSZ_ATTR(2)
+ void *mk_mem_realloc(void *ptr, const size_t size)
+ {
+-#ifdef MALLOC_JEMALLOC
+- void *aux = je_realloc(ptr, size);
+-#else
+ void *aux = realloc(ptr, size);
+-#endif
+
+ if (mk_unlikely(!aux && size)) {
+ perror("realloc");
+@@ -92,11 +80,7 @@
+
+ static inline void mk_mem_free(void *ptr)
+ {
+-#ifdef MALLOC_JEMALLOC
+- je_free(ptr);
+-#else
+ free(ptr);
+-#endif
+ }
+
+ void mk_mem_free(void *ptr);
diff --git a/www-servers/monkeyd/files/monkeyd.confd b/www-servers/monkeyd/files/monkeyd.confd
new file mode 100644
index 000000000000..fe725e80b9c1
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd.confd
@@ -0,0 +1,6 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Add any additional command line arguments here
+MONKEY_ARGS=""
diff --git a/www-servers/monkeyd/files/monkeyd.initd b/www-servers/monkeyd/files/monkeyd.initd
new file mode 100644
index 000000000000..452cc934faa3
--- /dev/null
+++ b/www-servers/monkeyd/files/monkeyd.initd
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON="/usr/bin/monkey"
+CONFFILE="/etc/monkeyd/monkey.conf"
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting monkeyd"
+ start-stop-daemon --start --exec "${DAEMON}" -- "-D" "${MONKEY_ARGS}" >/dev/null
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping monkeyd"
+ local PORT=$(awk '/^ *Port/ { print $2 }' "${CONFFILE}")
+ local PIDFILE=$(awk '/^ *PidFile/ { print $2 }' "${CONFFILE}")
+ PIDFILE="${PIDFILE}"."${PORT}"
+ start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/monkeyd/metadata.xml b/www-servers/monkeyd/metadata.xml
new file mode 100644
index 000000000000..f81ac37e2e76
--- /dev/null
+++ b/www-servers/monkeyd/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable lots of debugging info</flag>
+ <flag name="jemalloc">Use dev-libs/jemalloc for allocations</flag>
+ <flag name="minimal">Do not install shared lib and include files</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/monkeyd/monkeyd-1.5.3.ebuild b/www-servers/monkeyd/monkeyd-1.5.3.ebuild
new file mode 100644
index 000000000000..dc0aeca62acd
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.3.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="elibc_uclibc? ( !debug )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="php? ( dev-lang/php )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ use php && require_php_cgi
+
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}
diff --git a/www-servers/monkeyd/monkeyd-1.5.5.ebuild b/www-servers/monkeyd/monkeyd-1.5.5.ebuild
new file mode 100644
index 000000000000..5c05f5f217bd
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.5.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="elibc_uclibc? ( !debug )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="php? ( dev-lang/php )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ use php && require_php_cgi
+
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}
diff --git a/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild b/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild
new file mode 100644
index 000000000000..8bf5b8363c18
--- /dev/null
+++ b/www-servers/monkeyd/monkeyd-1.5.6-r1.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit toolchain-funcs depend.php multilib
+
+MY_P="${PN/d}-${PV}"
+DESCRIPTION="A small, fast, and scalable web server"
+HOMEPAGE="http://www.monkey-project.com/"
+SRC_URI="http://monkey-project.com/releases/${PV:0:3}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+
+# ssl is broken, so we turn it off until fixed
+IUSE="-debug jemalloc php minimal elibc_musl elibc_uclibc monkeyd_plugins_auth monkeyd_plugins_cheetah cgi monkeyd_plugins_dirlisting fastcgi +monkeyd_plugins_liana monkeyd_plugins_logger monkeyd_plugins_mandril"
+
+# uclibc is often compiled without backtrace info so we should
+# force this off. If someone complains, consider relaxing it.
+# ssl is borken, so we remove "ssl? ( monkeyd_plugins_polarssl )"
+REQUIRED_USE="
+ elibc_uclibc? ( !debug )
+ cgi? ( php )"
+
+DEPEND="jemalloc? ( >=dev-libs/jemalloc-3.3.1 )"
+RDEPEND="
+ php? ( dev-lang/php )
+ cgi? ( dev-lang/php[cgi] )"
+
+S="${WORKDIR}/${MY_P}"
+
+WEBROOT="/var/www/localhost"
+
+pkg_setup() {
+ if use debug; then
+ ewarn
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn "Do not use debug in production!"
+ ewarn "\033[1;33m**************************************************\033[00m"
+ ewarn
+ fi
+}
+
+src_prepare() {
+ # Unconditionally get rid of the bundled jemalloc
+ rm -rf "${S}"/deps
+ epatch "${FILESDIR}"/${PN}-1.5.2-use-system-jemalloc.patch
+ epatch "${FILESDIR}"/${PN}-1.5.0-fix-CPPFLAGS.patch
+
+ # Don't install the banana script, we use ${FILESDIR}/monkeyd.initd instead
+ sed -i '/Creating bin\/banana/d' configure || die "No configure file"
+ sed -i '/create_banana_script bindir/d' configure || die "No configure file"
+
+ # Don't explicitly strip files
+ sed -i -e '/$STRIP /d' -e 's/install -s -m 644/install -m 755/' configure || die "No configure file"
+
+ # We don't need the includes, sym link to libmonkey.so, or monkey.cp when not installing the .so
+ use minimal && {
+ sed -i '/install -d \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/install -m 644 src\/include\/\*.h \\$(INCDIR)/d' configure || die "No configure file"
+ sed -i '/ln -sf/d' configure || die "No configure file"
+ sed -i '/install -d \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ sed -i '/install -m 644 monkey.pc \\$(LIBDIR)\/pkgconfig/d' configure || die "No configure file"
+ }
+
+ # Unquiet build
+ sed -i '/^CC\s/d' configure || die "No configure file"
+ sed -i 's/^\(CC_QUIET=\).*/\1 \\\$(CC)/' configure || die "No configure file"
+ sed -i 's/^\(.*MAKE.*\)-s\(.*\)$/\1\2/' configure || die "No configure file"
+ makes=$(find . -iname Makefile.in)
+ for f in ${makes}; do
+ sed -i '/^CC\s/d' $f || die "No file "$f
+ sed -i 's/^\(CC_QUIET=\).*/\1 \$(CC)/' $f || die "No file "$f
+ done
+}
+
+src_configure() {
+ local myconf=""
+
+ use elibc_uclibc && myconf+=" --uclib-mode"
+ use elibc_musl && myconf+=" --musl-mode"
+
+ use minimal || myconf+=" --enable-shared"
+ use jemalloc || myconf+=" --malloc-libc"
+
+ if use debug; then
+ myconf+=" --debug --trace"
+ else
+ myconf+=" --no-backtrace"
+ fi
+
+ local enable_plugins=""
+ local disable_plugins=""
+ for p in ${PLUGINS}; do
+ cp=${p/monkeyd_plugins_/}
+ use $p && enable_plugins+="${cp}," || disable_plugins+="${cp},"
+ done
+ myconf+=" --enable-plugins=${enable_plugins%,} --disable-plugins=${disable_plugins%,}"
+
+ # Non-autotools configure
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --datadir=${WEBROOT}/htdocs \
+ --logdir=/var/log/${PN} \
+ --mandir=/usr/share/man \
+ --libdir=/usr/$(get_libdir) \
+ --pidfile=/run/monkey.pid \
+ --plugdir=/usr/$(get_libdir)/monkeyd/plugins \
+ --sysconfdir=/etc/${PN} \
+ --platform="generic" \
+ ${myconf} \
+ || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+
+ # Don't install the banana script man page
+ rm "${S}"/man/banana.1
+}
+
+src_install() {
+ default
+
+ if use php ; then
+ sed -i -e '/^#AddScript application\/x-httpd-php/s:^#::' "${D}"/etc/monkeyd/monkey.conf || die
+ sed -i -e 's:/home/my_home/php/bin/php:/usr/bin/php-cgi:' "${D}"/etc/monkeyd/monkey.conf || die
+ fi
+
+ sed -i -e "s:/var/log/monkeyd/monkey.pid:/var/run/monkey.pid:" "${D}"/etc/monkeyd/monkey.conf || die
+ newinitd "${FILESDIR}"/monkeyd.initd monkeyd
+ newconfd "${FILESDIR}"/monkeyd.confd monkeyd
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${D}"${WEBROOT}/htdocs \
+ "${D}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${D}"${WEBROOT}/htdocs
+
+ keepdir \
+ /var/log/monkeyd \
+ ${WEBROOT}/htdocs
+}
diff --git a/www-servers/nginx/Manifest b/www-servers/nginx/Manifest
new file mode 100644
index 000000000000..688404481f70
--- /dev/null
+++ b/www-servers/nginx/Manifest
@@ -0,0 +1,38 @@
+DIST modsecurity-2.9.0.tar.gz 4246467 SHA256 e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434 SHA512 1af04f29bf23c51d03cdd3795c530f88b523a645aa02d776a6b23dcbc31decec7cd574919e5c7c7cf82684df2774062de5e465bddbbaf4c01a442c6d49401d3d WHIRLPOOL 1167ba6048a3ca05dcdabf03c67ae12720cca0cec74547fc223ee92ff76b6d5131785fa77b5f16da180e56590c851c192eaf02817b798e4d6f41fa6bfb2735a6
+DIST modsecurity-apache_2.8.0.tar.gz 3940435 SHA256 95de6ec30982e5bde7981929ba89be89488e9f237ee8c4236e064b074bbb6f28 SHA512 2620d9ee0c7e40e02b908af5be916d1588f2ba55b8718495b6a3654e868973c45e8f8e794bf28b4677eb8a2d96ba427ead6ae4b26e48014bcd2b2f02013ceeef WHIRLPOOL cd90488ca5a85292bae32685ce44bcb82f46d98194636ba68f47a860c648c6933766bd56a38143f7656725fb3bd359de17f1b5513447c6ee40dbad945559fe4d
+DIST nginx-1.7.12.tar.gz 831957 SHA256 22d1f0b6d064e125b01aeb2c6171682559d2488e1b102fc48ec564aa36e66897 SHA512 54dabbf56bdc7ffde69b0a010ab5dbee7237431f35ce81c78598b2205f8af88027521920d52f95f44dffbf872c409f10f0b8dbc9328e94e9e6c5e7d8a84b14d5 WHIRLPOOL baea92734046a997d3b0282e9bb7232c9d99ca0064685930113b1cc2d152c44698726747462a9c0b9afe776393efe9f609df8064a39028995632ef046db44b4f
+DIST nginx-1.7.6.tar.gz 817265 SHA256 08e2efc169c9f9d511ce53ea16f17d8478ab9b0f7a653f212c03c61c52101599 SHA512 ac551020608e0c5ced17519509419e25513ab7a134f5e705cc8dd3866f3164c63ab7e3da9485ba5431d976978f4a9c68c5348bd102f9cb989c16f2e0ba65892a WHIRLPOOL bb247b8215fe10c6ad12df1da5e6fd7dfcd9ff441ef0bc1ecb9047ba132735a79ba4c5f0487bf8d2aee44ed940573b70ddaf0b77499d29fd4de8d9700b0ec038
+DIST nginx-1.8.0.tar.gz 832104 SHA256 23cca1239990c818d8f6da118320c4979aadf5386deda691b1b7c2c96b9df3d5 SHA512 3e5d7e1b01839b2638251c47046149450b9b65985e611ef55e5953846e9eb0128c3708c695540ad4dfd0ce5e3060dfecb51213403048fab1a99dd5cea94f0038 WHIRLPOOL e4619e0e0454b86d725a21abe9300ad33ad700c4d577b33f1762b5af796093abd3c7b6afed38301dd0b2a235d6ff47db189b24fd19a5cbc777398bc237ae8534
+DIST nginx-1.9.2.tar.gz 860233 SHA256 80b6425be14a005c8cb15115f3c775f4bc06bf798aa1affaee84ed9cf641ed78 SHA512 dc433fd0531a310de25dbf5303dbd904dc1f1ecfcb774707bf65f6f5f5ad83b6febc9938cabb0c68fefa4ddd80e121ac954411ed42f87254c95b5ca4daa9d7de WHIRLPOOL c99b9bf75afda286c99f206fa75ab12d83534a80659a3ebd13e1c766763d2aa8a34acedff307f4096c6d7e31693ca124f699482a99e22c1e8b91b7e356806ac3
+DIST nginx-1.9.3.tar.gz 864430 SHA256 4298c5341b2a262fdb8dbc0a1389756181af8f098c7720abfb30bd3060f673eb SHA512 923309de03c86815023f190bda0c3138f3b9e6dba76939e721273bca3ddb6abd06506afe0621dff4e936358e4d4570a8b4dca095b9246a8e13a22c465f31855b WHIRLPOOL 980feb6111c424d4c11ba632c9f602be2242a5976060e3915135feb2af118d3280b18985dc199c4e729a402d029fe17d6e60e7e1db45e0b83514cf211c8a4017
+DIST nginx_http_sticky_module_ng-1.2.5.tar.bz2 124072 SHA256 f975c033eb3c342f7247f6524774bbb727aaf630ed984576dbafe5de7a790c58 SHA512 d6ae723f739efb2f0548461931b1c395801684759962beda08067111426b1c9787ceaede91b0e984c023108fd17864c53c53925506f7e8e25ec8d2fc065585f6 WHIRLPOOL 1013c6a51f5989c8131392b3d9704d42c99f9727a673f6205878d0b7dfd265bb6042c1d30089603c9b38e339d48302e6873e77fe380b7e8edba25b71e9e84ba6
+DIST ngx_devel_kit-0.2.19-r1.tar.gz 65029 SHA256 501f299abdb81b992a980bda182e5de5a4b2b3e275fbf72ee34dd7ae84c4b679 SHA512 915954acf16a27fbd3c93c154012d38e864f1d8dfd51cde401bba26e46eb3e3c778ec4c92f4f8ed83ac001e96cee72765554d0e4da06acf6a4be5184b23b3657 WHIRLPOOL 0ce6bffc0fe2cef28ee74f5862ca6d914ed18fdee18d900608ff2a9983594c707aab3e335957b79dd7e77ae1beed054d8f71965ca0f57fc5f1d41ac06106c5a4
+DIST ngx_http_ajp_module-0.3.0.tar.gz 108832 SHA256 7b3791275ef87dde153679fa459e84784da09b26d35426d61f5477903584b254 SHA512 0934ea3c7dce23e2c55ab5c9210562fcf7b38ef19dc9ca7b80daee3cd983bb5f69743d34a041d35e7089dd6f6aa73363014d0b5f04ce0a5c0d94b4b0bb2dacab WHIRLPOOL 2ebe0db7887f22fb915372ef637214a0a40d7a0b694479b7da066671bd7c64aa152c5a615f368916311f5879840e083fb7a14555d304aea5e059c079aaa9c809
+DIST ngx_http_auth_pam-1.3.tar.gz 6363 SHA256 199dff5d11fbb3b6ddf9c8a60cc141970125a3f8e7a06f245e3175e93ca947e3 SHA512 3c86f709397dfd3edbd98f729193cb7b61895777d02244f1cf255ba5e4cd8e7bcb5bf537bf3d1086a513e46f117fdcb7610d7085dead35f5d36f74b5b3864ef8 WHIRLPOOL fc5b42a6a1143e9d3845e1470caa7bd60cf8e5a01e0dd53925fbf76cba072add024d24e4f926d3d0b3e27eccf5faa839b05f2549144beac6ffc43614b7ca5b19
+DIST ngx_http_auth_pam-1.4.tar.gz 6502 SHA256 095742c5bcb86f2431e215db785bdeb238d594f085a0ac00d16125876a157409 SHA512 8d60347c666736ef39161b287ad32820ad6be4695f1c0f27a000d46bfc7e26c95233247d39cf37296518a6329ba73f06756d0b0b68157b0e5f67796f73264db3 WHIRLPOOL 2f0e60366cf43727c9b3aa07d2cb803a997cb9a4f48ba28e575f470bbb7c28115f41d390e306219ad130501a62e204d403bbca5ee784628fbca35b407f51702c
+DIST ngx_http_cache_purge-2.1.tar.gz 10535 SHA256 424005af0c04e59ffa65a65e446081d4f95ee76a801a7555e001c67810bcb3b9 SHA512 1b70b2c35601949edd53d55922e81425aef0b2c486b071c2bcf53db7c5278e55966ffd2c9e32f599ee63e147a395e708d442515fe414f39b323d26722324db8b WHIRLPOOL f020841139988ae516969ffcd5bf7b2c264749fef5c20a5c8f0cca70f5eddcd3efcb3676bbe9a4550535de7b53fcd7326294fcae2a14dc6bf66d1ab77205b83f
+DIST ngx_http_cache_purge-2.3.tar.gz 12248 SHA256 279e0d8a46d3b1521fd43b3f78bc1c08b263899142a7cc5058c1c0361a92c89c SHA512 50a31dbf2216a6fae74a186af56dec4600cf55777e76a10ac0075f609e7737135aab063a64f2590dddcd0369ebebd4a523027f3d9ebcca74f7b4355be1c5dcc0 WHIRLPOOL 5451ef3e33044210453995ea916acec679599c0ded5471d464db5003a07e7a06e9690812091148c2af7b50384e52b32e49136eac02e0330724ba2408d893f96c
+DIST ngx_http_dav_ext-0.0.3.tar.gz 6260 SHA256 d428a0236c933779cb40ac8c91afb19d5c25a376dc3caab825bfd543e1ee530d SHA512 4763b1c5e417248d80acfacf20bfc5ba3e06675ff08e37703867daef99a400980b536941e4955c259432905bd11ab998bc2e2489a50350413c7bf37e18eafb74 WHIRLPOOL 5adbcea768fbb179249a03fe69304505ec09a1dafac848dd5e3cde96693c6fbcf6cf6c128ca116d02b36c1be0008807d9e86fee5b411e137b18b15a60291f29b
+DIST ngx_http_echo-0.56.tar.gz 65109 SHA256 99027e63f5e625f28fedd163b9d18f29382ea55f079a9b7a2f16beed6a1d3ddf SHA512 4f6e87878564dddfa0e1d62414a7bbcf0726a01b7b53bc0b4be891658c39b85125fab4bb68ba7293d44c66c3ce5b967f289cf83628b2d78e9f3c01f5bcc37b75 WHIRLPOOL b5677d8133a0ad4c395479cfc29bc0b2cfb9362b55e4b27f20683beeace4830e6a0764a140a8f7dc518406769cda0f7a15cb340b2442a9c500a8e7c00fa0279a
+DIST ngx_http_echo-0.57.tar.gz 65073 SHA256 8467237ca0fae74ca7a32fbd34fc6044df307098415d48068214c9c235695a07 SHA512 c89780eca9267c9984a022a4dbd9ebf603dbd5c323bfea5ea7898ca9fc0a744388ce7520e7a9799aeabd6573f8e71ee595fe9998fa54e5d5c412b21031edd31d WHIRLPOOL e481b6f57a6ff48706fa7e281f31f15a5522c29b98620559cebe8412207d5595497cdce9156e7762cceff6369e9f678d5a81bf3c83fb2e8c5d8786622f1c27b8
+DIST ngx_http_echo-0.58.tar.gz 64779 SHA256 190fe3977dd1910e82059f30f9baae3da2ee6e6fb50f18c9bc2605a19dbb9626 SHA512 03bca117b2a7f9fa78450d24b2a25fcf19528a37d842dbd740e9ccf0f3ad6652d9927757f1317441438ec1e474211e2b4c84829015a51c5e25ca9f2dbd3809a0 WHIRLPOOL 0c3623f881cd127d1f3450f6e46456d98501d9d21f5292ec6bae877fa3020adbaae2dbb83f105c8c7eb0273fedd927753238d2399385721167680200c8b51a15
+DIST ngx_http_fancyindex-0.3.4.tar.gz 14275 SHA256 d7a84e66b3b3571e6a7e2531d00767f4354f85ce2f281d532ace2bcc35035f8b SHA512 a8a78f83f34c910e0959b04f45ba897f0c84f2a3f36d1c36cd32a8e2a5d9e53f2d0f30cf6a99ffd76edc6179cb70561984745943ec05cca10bdda7ed29c8bfe4 WHIRLPOOL eaafe4a95eed6f43efed354978040c0856ca5819ed0b141637aee0b1c0aafcf2cc205b130f0ca4de39b224dbfb7083c158a4388768fa2515890e227a43245474
+DIST ngx_http_fancyindex-0.3.5.tar.gz 14837 SHA256 e0998e83be58bc5787fa9243a76a9d21de3cd01088d3cf63177ba88a562634a1 SHA512 ddb4ab3e8e47e1c49680db3e9f648f7cd582c07f963204105118e61432fa1e80c3f1bce69ed689db383011a9c155184bcc7e931eeae20bbd7cbdb5d4eb35a0a8 WHIRLPOOL a45db854d75f05a59c6f5e67c652850b5410162e7852abda20bb6720d29cc716f25ce7ea93ef52f9ff3f11d6d3a744c1fa4c7a6270fc1bd6d42f6743accb8e73
+DIST ngx_http_headers_more-0.25-r1.tar.gz 27973 SHA256 1473f96f59dcec9d83ce65d691559993c1f80da8c0a4c0c0a30dae9f969eeabf SHA512 1a03e72ac5847b0eeada0ba1e5d5872399dd636db6aa54d10c9e53d96f4b5be4c785bf9117991d27ed558532fe9ce95d6f6c63f94f5b83350f5ea14a60c03aaf WHIRLPOOL 03a7e21814a05644bd1a459bc7b0b26dee0d4ec6ae81f4677f631fa1e4c52c679b651341d673319c6469adcf0ad8e29db58065f542e5907729a609edb6e633f4
+DIST ngx_http_headers_more-0.26.tar.gz 28028 SHA256 d6bdc51f9e778a3b23e41a51cae542c1467a1e5e55c1329a7ffc454be084fb6f SHA512 842927de67d28f3cff596607f209d1004b6d49f1d45b861758405ed6fe6f7aab76ad63530ccdfff1c1947db1190dd65dee0a29f50026bfa7a39a9a051561cf88 WHIRLPOOL 0dc37c36717be40a07112388d913d20bc99d76f90604da618d5547f24d93c636c14c2cca18191ff5916b40ec0113da648cfc07e1c00b1853f2b15ce056d5f3d7
+DIST ngx_http_lua-0.9.12.tar.gz 512403 SHA256 e85c1924ca4670d5708b58efcd6e77793c43f243317a9850a112964067f63150 SHA512 c08546c074570408f646fc7ee60e60d732763a91f10b652858d95de070bd0dd4f0d4117114fc4b46d0f32cff88b21db5f394c3fbb2d2e5f1494fc01eedb782e4 WHIRLPOOL 2223bacff56b4ef942372e4eac3b1a02f21952804b0df6c626456ac2b6894ea068b704606f8a25c47de7887e97577a771fca6ce31d7288992f6f28eb0be27022
+DIST ngx_http_lua-0.9.15.tar.gz 520190 SHA256 659fe4c201f4a4ae1007fa029cef472aaa837bf0904babb6158f83b86536c5b7 SHA512 1d809f873ced8e50422298bb4b730b8e7aaf442c11570cbe892fd73a414ff4f6d6eca7be8b2d2dbf57a136136b17d80596ee2f2f195dcb59776e78df5a94ae92 WHIRLPOOL caf128254f99d674eb370779c6e41c0b459be1c5a2baac7df1ff3498a38349bd2c140594eea3eb29c468a366e265421f90363886be73db0b3484cc6f386cb563
+DIST ngx_http_lua-0.9.16.tar.gz 523900 SHA256 a3cda55b8cba5bc6632aa270b8a02d543fdb43f4d60a3bd2cb411c2a3b467656 SHA512 01be7dca10c1c1f25d2b8e65c9944662d5ba0235ecccba1143f7c30dcb76fad847a4a2fa7a34055906a33d50ecf8fb463aac9f76581390035a88e48c9b9f5319 WHIRLPOOL 6f8c04f8d284d1fdcf69471a4590ad0381335ae64e6f0bc5b3ec4a13c8e7254d2363cbf23304f559997d7e5695832390bc187e18ee57b9c72c39c8ed5a98b7e0
+DIST ngx_http_naxsi-0.53-2.tar.gz 165690 SHA256 3eadff1d91995beae41b92733ade28091c2075a24ae37058f4d6aa90b0f4b660 SHA512 ada592f5e7f80a6d549cc435ee8720df01a788dc88cf27a7d55521bb7e4c66fa11b9ec28216aff7e13c70a5faf12cb745bd398b8a782ed4dea1eecd04b07e24c WHIRLPOOL c5b736dbe9bd66daf7e023f176a08f78225b61990781d7ad5a55d0f35391df7e05bf1b2623a6227e0355cf0204ef9eac1b9fa03aa62b3c0d6eac515f1213f270
+DIST ngx_http_push_stream-0.4.0.tar.gz 165341 SHA256 4662cb5680e8dada55ada47b91ef563dd0322f94d775bf1c09e90d83d12c33a6 SHA512 45e68b75f6156df73b2c45d68a9b471560459eb608203b554ecbfcbef6923e4710c92aaefb6a7f8c1d90c7dbf31f4fcc59802d0e8f5c29418be52acad0073c02 WHIRLPOOL 15f2bfa1f9b56005559b8122ce047166e48f0428677401df0b41bcbb52daa6f176c4527b02e145aec9cd3d2fa48c12bb17bc0fce2d04bd7c223b4c5ca91253a0
+DIST ngx_http_push_stream-0.4.1.tar.gz 166928 SHA256 553584f557a3faec73702550e7e1417cbc0021f4f98468cc83e61e9d94def5cc SHA512 3b2289cc3abe6df0ee39360816675a39de1669a284e23770aa04b29e1e5dc73f5d99f3db6c7e8e4895a4abad0602aa64024ec19a2e741e138a70191501f038be WHIRLPOOL 9d203d4a78a3bd189527ebeaf1ff98613ee6a3150ae433efa17ed45dd9f6cb263b2a4c329a6fc2d04c6583ac2beaf24e87e3263d71a910f720b80038c9bc09c2
+DIST ngx_http_push_stream-0.5.1.tar.gz 175263 SHA256 a95f31e80120fd7324795b92a0d94c0b43e1265df7fd0f1eba11a337c1e0a626 SHA512 b996c6fe48b97540d1ee9879f37aca1a4c8262ad7577d607d402a00d79f5d32676f010da303f89db18e6f90351b8bb5cf0265338cc5df8154e94d5f332a227c8 WHIRLPOOL aacf93841af0384b2be1d4075ceb23e67b89a4cac0a06fe40e2efd5f0334309ccc83e29014c9746dda9e6b59df0866f0a796c0a9dc9d14e2625a11c019c8e79d
+DIST ngx_http_slowfs_cache-1.10.tar.gz 11809 SHA256 1e81453942e5b0877de1f1f06c56ae82918ea9818255cb935bcb673c95a758a1 SHA512 fbc9609a8d6913aeefe535f206b9e53477503f131934ead2ae5a6169e395af2f5fb54778704824d5eeb22a4ef40a11ebbcde580db62a631f70edcc2cfc06b15d WHIRLPOOL a02ed77422c47d9e476f8746186d19d632ddb953635d8d9dd51ff076225a78044286ee7e114478bc02e4b2a422e4fdc207154fc287629dd2cd7c3f9a634dad18
+DIST ngx_http_upload_progress-0.9.1-r1.tar.gz 17166 SHA256 99ec072cca35cd7791e77c40a8ded41a7a8c1111e057be26e55fba2fdf105f43 SHA512 6c1e3776402b6e2cda50d9c48c4b578a85feffe15891c075443f6d9c7b9e2414e0614b50a8f417ddda9faf5f719957c77ade519c88b48caec970fc51fe12f0d1 WHIRLPOOL 12970d0f75ee3f0d8a97c4948b97fca2bd707a93e4e578c0e2ac0d18991986e620dd6b15c2ab5680ff726c0490671e3bc5e1ee6109baf81877d8baa6a5357825
+DIST ngx_http_upstream_check-0.1.9.tar.gz 116307 SHA256 b3bb240fb236ba9ae3e807de0f69aa0804d100496c1063a523b29a184e438562 SHA512 b50c15aa311e38101d9b4f6178684a43abcfa66d0483dbf62b3dc5b595d85f59b52a4f564a5f35c54966042074598fef0fc59635ea38c064ec0e8921d9c3229d WHIRLPOOL f878e4833d445a75076455aba34f85a23c0377d922d9ff3d542f887379730e127e969fe3108cd476279d7ff1aa396f686e9e7b8594fb38eb2ea36d3d928602e6
+DIST ngx_http_upstream_check-0.3.0.tar.gz 136542 SHA256 c543bf427b38643c10dcd1a0c701392bc666708313e7b63f9272396a6cc9a461 SHA512 ca19e8bcae218c639ff59e8f743bd2fb78de2c1f33dfb0de7b7b5ce82ae7ef04488255715e3e0311ebbc8c9741726573ac532cb269052925b0935f349414e959 WHIRLPOOL acee2ea955f87844a724815fc78d0296f23e9d6726551febd6bbff563625e8eadd04213394b6029c45b6036138c4f8957b2621f1b033a6177410fa7778176749
+DIST ngx_memc_module-0.16.tar.gz 38560 SHA256 24f3c3270831aed2d157c01ef74cb26eab26b832971fe7b9f42a03dbfac10ce4 SHA512 e48a864ac9ae627e840b189f33157aa3a1c0966d2bcffd1f93030b0e6f5962355c004737cae0a5a00f2a1cbcb201369c37053f0823bb601618d18ef87561e353 WHIRLPOOL c53decff852790758b3b92ca1d207a5b99b592e708271411699d70dd9683d7f551b469e057f480f66adfdffa1cb1b91b9c7e031835311ac0b6bfab0f444852f9
+DIST ngx_metrics-0.1.1.tar.gz 2964 SHA256 1c62ebb31e3caafad91720962770b0e7a4287f195520cf12471c262ac19b154e SHA512 d36a8fb0104c83b6b564e03b351aa750cab08650264c74d6f786af357bfb7006b531a93270dd961896ea8dafe27e5db8548ede714c5f52c4742876bc73af4b5e WHIRLPOOL 2796f5a97e76dfcc91133240e8e90ba493f0356f781a173d8cacdd09eba64b75ef531db398c0566fda395124700de8c991b771433e376ca0d5898c2ea6f82868
+DIST ngx_mogilefs_module-1.0.4.tar.gz 11208 SHA256 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae SHA512 b8cb7eaf6274f4e2247dbcb39db05072d2b2d4361256a325fafab5533d7ce0c4ae9e2905b954dfcfa4789c9cab5cccf2ac1c3a1f02f6a327ed95b562d7773ed1 WHIRLPOOL 64c9b11ad938e6dbe5ba31298f1cd46f6e6bb4ba039c96b1e43bd85919d1606326f74b677f789ecabe0b0f4e0f08ac5aaf8148bf820de65aaa1e9966a28b9f61
+DIST ngx_rtmp-1.1.6.tar.gz 519666 SHA256 4039d1e7febd93188f729b594772d04d8a1137b2e90b12fa53bb061f200add87 SHA512 6db0cc5a3cff600a836483f9cc4ff76860e9c893167561ad818cb41e2eb4fa31af8a4213e42c7c5766e389aed0ad713cffe776aa4bc4ebf279dd63eb65d4162c WHIRLPOOL f23860df6df0de87aa7d65f2411ea7104e635e5b13987853599a06c064b93229c8a900dca84b983e0dcabac96c8918889932cd303836a3cab4ac7c6d7c2a0b10
+DIST ngx_rtmp-1.1.7.tar.gz 519735 SHA256 7922b0e3d5f3d9c4b275e4908cfb8f5fb1bfb3ac2df77f4c262cda56df21aab3 SHA512 9883462a04683f1e7af175da04b86d259ff6d677864667588fb073143f7130969eb2a5a5a48ddceda7a555b908580f179bdcacb7f0111413d51db5bfe43b396e WHIRLPOOL e9c1fc9c3c965ae7047657f76e0997d5da107aff7dd9e5cf3ddb5a2d8f388efd8439b82923e199dc36def449567b8529e06c80f69c36f42128236ac0be5719d5
diff --git a/www-servers/nginx/files/AJP-nginx-1.7.9+.patch b/www-servers/nginx/files/AJP-nginx-1.7.9+.patch
new file mode 100644
index 000000000000..35460fc5ad80
--- /dev/null
+++ b/www-servers/nginx/files/AJP-nginx-1.7.9+.patch
@@ -0,0 +1,184 @@
+From bf6cd93f2098b59260de8d494f0f4b1f11a84627 Mon Sep 17 00:00:00 2001
+From: Weibin Yao <yaoweibin@gmail.com>
+Date: Fri, 27 Feb 2015 23:13:30 +0800
+Subject: [PATCH] fixed the compatible problem with nginx-1.7.9+
+
+---
+ ngx_http_ajp.h | 1 +
+ ngx_http_ajp_module.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 86 insertions(+)
+
+diff --git a/ngx_http_ajp.h b/ngx_http_ajp.h
+index 72502ad..b3c7051 100644
+--- a/ngx_http_ajp.h
++++ b/ngx_http_ajp.h
+@@ -5,6 +5,7 @@
+ #include <ngx_config.h>
+ #include <ngx_core.h>
+ #include <ngx_http.h>
++#include <nginx.h>
+ #include "ngx_http_ajp_module.h"
+
+ #define AJP13_DEF_HOST "127.0.0.1"
+diff --git a/ngx_http_ajp_module.c b/ngx_http_ajp_module.c
+index e4d5b00..be32459 100644
+--- a/ngx_http_ajp_module.c
++++ b/ngx_http_ajp_module.c
+@@ -464,8 +464,12 @@ ngx_http_ajp_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+
+ #if (NGX_HTTP_CACHE)
+
++#if (nginx_version >= 1007009)
++ if (alcf->upstream.cache > 0)
++#else
+ if (alcf->upstream.cache != NGX_CONF_UNSET_PTR
+ && alcf->upstream.cache != NULL)
++#endif
+ {
+ return "is incompatible with \"ajp_cache\"";
+ }
+@@ -534,15 +538,27 @@ ngx_http_ajp_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+ ngx_http_ajp_loc_conf_t *alcf = conf;
+
+ ngx_str_t *value;
++#if (nginx_version >= 1007009)
++ ngx_http_complex_value_t cv;
++ ngx_http_compile_complex_value_t ccv;
++#endif
+
+ value = cf->args->elts;
+
++#if (nginx_version >= 1007009)
++ if (alcf->upstream.cache != NGX_CONF_UNSET) {
++#else
+ if (alcf->upstream.cache != NGX_CONF_UNSET_PTR) {
++#endif
+ return "is duplicate";
+ }
+
+ if (ngx_strcmp(value[1].data, "off") == 0) {
++#if (nginx_version >= 1007009)
++ alcf->upstream.cache = 0;
++#else
+ alcf->upstream.cache = NULL;
++#endif
+ return NGX_CONF_OK;
+ }
+
+@@ -550,11 +566,44 @@ ngx_http_ajp_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+ return "is incompatible with \"ajp_store\"";
+ }
+
++#if (nginx_version >= 1007009)
++ alcf->upstream.cache = 1;
++
++ ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
++
++ ccv.cf = cf;
++ ccv.value = &value[1];
++ ccv.complex_value = &cv;
++
++ if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
++ return NGX_CONF_ERROR;
++ }
++
++ if (cv.lengths != NULL) {
++
++ alcf->upstream.cache_value = ngx_palloc(cf->pool,
++ sizeof(ngx_http_complex_value_t));
++ if (alcf->upstream.cache_value == NULL) {
++ return NGX_CONF_ERROR;
++ }
++
++ *alcf->upstream.cache_value = cv;
++
++ return NGX_CONF_OK;
++ }
++
++ alcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0,
++ &ngx_http_ajp_module);
++ if (alcf->upstream.cache_zone == NULL) {
++ return NGX_CONF_ERROR;
++ }
++#else
+ alcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
+ &ngx_http_ajp_module);
+ if (alcf->upstream.cache == NULL) {
+ return NGX_CONF_ERROR;
+ }
++#endif
+
+ return NGX_CONF_OK;
+ }
+@@ -666,7 +715,11 @@ ngx_http_ajp_create_loc_conf(ngx_conf_t *cf)
+ conf->upstream.pass_request_body = NGX_CONF_UNSET;
+
+ #if (NGX_HTTP_CACHE)
++#if (nginx_version >= 1007009)
++ conf->upstream.cache = NGX_CONF_UNSET;
++#else
+ conf->upstream.cache = NGX_CONF_UNSET_PTR;
++#endif
+ conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
+ conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
+ conf->upstream.cache_lock = NGX_CONF_UNSET;
+@@ -699,6 +752,18 @@ ngx_http_ajp_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
+ ngx_str_t *h;
+ ngx_hash_init_t hash;
+
++#if (NGX_HTTP_CACHE) && (nginx_version >= 1007009)
++
++ if (conf->upstream.store > 0) {
++ conf->upstream.cache = 0;
++ }
++
++ if (conf->upstream.cache > 0) {
++ conf->upstream.store = 0;
++ }
++
++#endif
++
+ if (conf->upstream.store != 0) {
+ ngx_conf_merge_value(conf->upstream.store,
+ prev->upstream.store, 0);
+@@ -864,6 +929,20 @@ ngx_http_ajp_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
+
+ #if (NGX_HTTP_CACHE)
+
++#if (nginx_version >= 1007009)
++ if (conf->upstream.cache == NGX_CONF_UNSET) {
++ ngx_conf_merge_value(conf->upstream.cache,
++ prev->upstream.cache, 0);
++
++ conf->upstream.cache_zone = prev->upstream.cache_zone;
++ conf->upstream.cache_value = prev->upstream.cache_value;
++ }
++
++ if (conf->upstream.cache_zone && conf->upstream.cache_zone->data == NULL) {
++ ngx_shm_zone_t *shm_zone;
++
++ shm_zone = conf->upstream.cache_zone;
++#else
+ ngx_conf_merge_ptr_value(conf->upstream.cache,
+ prev->upstream.cache, NULL);
+
+@@ -871,6 +950,7 @@ ngx_http_ajp_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
+ ngx_shm_zone_t *shm_zone;
+
+ shm_zone = conf->upstream.cache;
++#endif
+
+ ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+ "\"ajp_cache\" zone \"%V\" is unknown, "
+@@ -910,6 +990,11 @@ ngx_http_ajp_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
+ conf->cache_key = prev->cache_key;
+ }
+
++ if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
++ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
++ "no \"fastcgi_cache_key\" for \"fastcgi_cache\"");
++ }
++
+ ngx_conf_merge_value(conf->upstream.cache_lock,
+ prev->upstream.cache_lock, 0);
+
diff --git a/www-servers/nginx/files/check-1.9.2.patch b/www-servers/nginx/files/check-1.9.2.patch
new file mode 100644
index 000000000000..35cb8a753af4
--- /dev/null
+++ b/www-servers/nginx/files/check-1.9.2.patch
@@ -0,0 +1,242 @@
+diff --git src/http/modules/ngx_http_upstream_hash_module.c src/http/modules/ngx_http_upstream_hash_module.c
+index 1e2e05c..44a72e2 100644
+--- src/http/modules/ngx_http_upstream_hash_module.c
++++ src/http/modules/ngx_http_upstream_hash_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ typedef struct {
+ uint32_t hash;
+@@ -235,6 +238,15 @@ ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data)
+ goto next;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto next;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+@@ -535,6 +547,15 @@ ngx_http_upstream_get_chash_peer(ngx_peer_connection_t *pc, void *data)
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get consistent_hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->server.len != server->len
+ || ngx_strncmp(peer->server.data, server->data, server->len)
+ != 0)
+diff --git src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c
+index 401b58e..ba656bd 100644
+--- src/http/modules/ngx_http_upstream_ip_hash_module.c
++++ src/http/modules/ngx_http_upstream_ip_hash_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ typedef struct {
+ /* the round robin data must be first */
+@@ -205,6 +208,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
+ goto next;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get ip_hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto next;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+diff --git src/http/modules/ngx_http_upstream_least_conn_module.c src/http/modules/ngx_http_upstream_least_conn_module.c
+index 92951bd..48aca2c 100644
+--- src/http/modules/ngx_http_upstream_least_conn_module.c
++++ src/http/modules/ngx_http_upstream_least_conn_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r,
+ ngx_http_upstream_srv_conf_t *us);
+@@ -148,6 +151,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+@@ -199,6 +212,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->conns * best->weight != best->conns * peer->weight) {
+ continue;
+ }
+diff --git src/http/ngx_http_upstream_round_robin.c src/http/ngx_http_upstream_round_robin.c
+index d6ae33b..416572a 100644
+--- src/http/ngx_http_upstream_round_robin.c
++++ src/http/ngx_http_upstream_round_robin.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++#include "ngx_http_upstream_check_module.h"
++#endif
+
+ #define ngx_http_upstream_tries(p) ((p)->number \
+ + ((p)->next ? (p)->next->number : 0))
+@@ -96,7 +99,14 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
+-
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (!server[i].down) {
++ peer[n].check_index =
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++ } else {
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ *peerp = &peer[n];
+ peerp = &peer[n].next;
+ n++;
+@@ -159,7 +169,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
+-
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (!server[i].down) {
++ peer[n].check_index =
++ ngx_http_upstream_check_add_peer(cf, us, &server[i].addrs[j]);
++ }
++ else {
++ peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ *peerp = &peer[n];
+ peerp = &peer[n].next;
+ n++;
+@@ -225,6 +243,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ *peerp = &peer[i];
+ peerp = &peer[i].next;
+ }
+@@ -339,6 +360,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
+ peer[0].current_weight = 0;
+ peer[0].max_fails = 1;
+ peer[0].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[0].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ peers->peer = peer;
+
+ } else {
+@@ -381,6 +405,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ *peerp = &peer[i];
+ peerp = &peer[i].next;
+ }
+@@ -441,6 +468,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
+ goto failed;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ goto failed;
++ }
++#endif
++
+ rrp->current = peer;
+
+ } else {
+@@ -542,6 +575,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)
+ continue;
+ }
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ if (ngx_http_upstream_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+diff --git src/http/ngx_http_upstream_round_robin.h src/http/ngx_http_upstream_round_robin.h
+index f2c573f..75e0ed6 100644
+--- src/http/ngx_http_upstream_round_robin.h
++++ src/http/ngx_http_upstream_round_robin.h
+@@ -35,6 +35,10 @@ struct ngx_http_upstream_rr_peer_s {
+ ngx_uint_t max_fails;
+ time_t fail_timeout;
+
++#if (NGX_HTTP_UPSTREAM_CHECK)
++ ngx_uint_t check_index;
++#endif
++
+ ngx_uint_t down; /* unsigned down:1; */
+
+ #if (NGX_HTTP_SSL)
diff --git a/www-servers/nginx/files/check_1.7.2+.patch b/www-servers/nginx/files/check_1.7.2+.patch
new file mode 100644
index 000000000000..50405a5b84ae
--- /dev/null
+++ b/www-servers/nginx/files/check_1.7.2+.patch
@@ -0,0 +1,201 @@
+commit 21116e1c0bba730ca59327ffba9320bc63f11462
+Author: Johan Bergström <bugs@bergstroem.nu>
+Date: Thu Jun 19 10:17:22 2014 +1000
+
+ Add support for upstream_check to nginx 1.7.2
+
+diff --git src/http/modules/ngx_http_upstream_ip_hash_module.c src/http/modules/ngx_http_upstream_ip_hash_module.c
+index 148d73a..be9e03d 100644
+--- src/http/modules/ngx_http_upstream_ip_hash_module.c
++++ src/http/modules/ngx_http_upstream_ip_hash_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++#include "ngx_http_upstream_check_handler.h"
++#endif
+
+ typedef struct {
+ /* the round robin data must be first */
+@@ -212,6 +215,15 @@ ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
+ goto next_try;
+ }
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get ip_hash peer, check_index: %ui",
++ peer->check_index);
++ if (ngx_http_check_peer_down(peer->check_index)) {
++ goto next_try;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+diff --git src/http/modules/ngx_http_upstream_least_conn_module.c src/http/modules/ngx_http_upstream_least_conn_module.c
+index dbef95d..14e9e40 100644
+--- src/http/modules/ngx_http_upstream_least_conn_module.c
++++ src/http/modules/ngx_http_upstream_least_conn_module.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++#include "ngx_http_upstream_check_handler.h"
++#endif
+
+ typedef struct {
+ ngx_uint_t *conns;
+@@ -203,6 +206,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
+ continue;
+ }
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+@@ -256,6 +269,16 @@ ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
+ continue;
+ }
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
++ "get least_conn peer, check_index: %ui",
++ peer->check_index);
++
++ if (ngx_http_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (lcp->conns[i] * best->weight != lcp->conns[p] * peer->weight) {
+ continue;
+ }
+diff --git src/http/ngx_http_upstream_round_robin.c src/http/ngx_http_upstream_round_robin.c
+index 37c835c..43ccdcf 100644
+--- src/http/ngx_http_upstream_round_robin.c
++++ src/http/ngx_http_upstream_round_robin.c
+@@ -9,6 +9,9 @@
+ #include <ngx_core.h>
+ #include <ngx_http.h>
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++#include "ngx_http_upstream_check_handler.h"
++#endif
+
+ static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer(
+ ngx_http_upstream_rr_peer_data_t *rrp);
+@@ -88,6 +91,14 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ if (!server[i].down) {
++ peers->peer[n].check_index =
++ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]);
++ } else {
++ peers->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ n++;
+ }
+ }
+@@ -144,6 +155,15 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[n].fail_timeout = server[i].fail_timeout;
+ peer[n].down = server[i].down;
+ peer[n].server = server[i].name;
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ if (!server[i].down) {
++ backup->peer[n].check_index =
++ ngx_http_check_add_peer(cf, us, &server[i].addrs[j]);
++ }
++ else {
++ backup->peer[n].check_index = (ngx_uint_t) NGX_ERROR;
++ }
++#endif
+ n++;
+ }
+ }
+@@ -203,6 +223,9 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ }
+
+ us->peer.data = peers;
+@@ -312,7 +335,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
+ peer[0].current_weight = 0;
+ peer[0].max_fails = 1;
+ peer[0].fail_timeout = 10;
+-
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ peers->peer[0].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ } else {
+
+ for (i = 0; i < ur->naddrs; i++) {
+@@ -352,6 +377,9 @@ ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
+ peer[i].current_weight = 0;
+ peer[i].max_fails = 1;
+ peer[i].fail_timeout = 10;
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ peers->peer[i].check_index = (ngx_uint_t) NGX_ERROR;
++#endif
+ }
+ }
+
+@@ -411,6 +439,12 @@ ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
+ goto failed;
+ }
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ if (ngx_http_check_peer_down(peer->check_index)) {
++ goto failed;
++ }
++#endif
++
+ } else {
+
+ /* there are several peers */
+@@ -508,6 +542,12 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)
+ continue;
+ }
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ if (ngx_http_check_peer_down(peer->check_index)) {
++ continue;
++ }
++#endif
++
+ if (peer->max_fails
+ && peer->fails >= peer->max_fails
+ && now - peer->checked <= peer->fail_timeout)
+diff --git src/http/ngx_http_upstream_round_robin.h src/http/ngx_http_upstream_round_robin.h
+index 9db82a6..2fedd46 100644
+--- src/http/ngx_http_upstream_round_robin.h
++++ src/http/ngx_http_upstream_round_robin.h
+@@ -31,6 +31,10 @@ typedef struct {
+ ngx_uint_t max_fails;
+ time_t fail_timeout;
+
++#if (NGX_UPSTREAM_CHECK_MODULE)
++ ngx_uint_t check_index;
++#endif
++
+ ngx_uint_t down; /* unsigned down:1; */
+
+ #if (NGX_HTTP_SSL)
diff --git a/www-servers/nginx/files/lua-nginx-1.7.6.patch b/www-servers/nginx/files/lua-nginx-1.7.6.patch
new file mode 100644
index 000000000000..3cce343186f3
--- /dev/null
+++ b/www-servers/nginx/files/lua-nginx-1.7.6.patch
@@ -0,0 +1,39 @@
+From 0c4528e50dc45de322a6ae86b1fff544d777e722 Mon Sep 17 00:00:00 2001
+From: "Yichun Zhang (agentzh)" <agentzh@gmail.com>
+Date: Wed, 17 Sep 2014 13:18:42 -0700
+Subject: [PATCH] bugfix: fixed compilation error with nginx 1.7.5+ because
+ nginx 1.7.5+ changes the API in the events subsystem. thanks Charles R.
+ Portwood II and Mathieu Le Marec for the report in #422.
+
+---
+ src/ngx_http_lua_socket_tcp.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/ngx_http_lua_socket_tcp.c b/src/ngx_http_lua_socket_tcp.c
+index 52cc89d..3743548 100644
+--- a/src/ngx_http_lua_socket_tcp.c
++++ b/src/ngx_http_lua_socket_tcp.c
+@@ -3212,7 +3212,11 @@ ngx_http_lua_socket_tcp_finalize_read_part(ngx_http_request_t *r,
+ ngx_del_event(c->read, NGX_READ_EVENT, NGX_CLOSE_EVENT);
+ }
+
++#if defined(nginx_version) && nginx_version >= 1007005
++ if (c->read->posted) {
++#else
+ if (c->read->prev) {
++#endif
+ ngx_delete_posted_event(c->read);
+ }
+
+@@ -3261,7 +3265,11 @@ ngx_http_lua_socket_tcp_finalize_write_part(ngx_http_request_t *r,
+ ngx_del_event(c->write, NGX_WRITE_EVENT, NGX_CLOSE_EVENT);
+ }
+
++#if defined(nginx_version) && nginx_version >= 1007005
++ if (c->write->posted) {
++#else
+ if (c->write->prev) {
++#endif
+ ngx_delete_posted_event(c->write);
+ }
+
diff --git a/www-servers/nginx/files/nginx-1.4.1-fix-perl-install-path.patch b/www-servers/nginx/files/nginx-1.4.1-fix-perl-install-path.patch
new file mode 100644
index 000000000000..601a79ba8a0f
--- /dev/null
+++ b/www-servers/nginx/files/nginx-1.4.1-fix-perl-install-path.patch
@@ -0,0 +1,13 @@
+diff --git a/auto/lib/perl/make b/auto/lib/perl/make
+index 260bd95..857ece6 100644
+--- a/auto/lib/perl/make
++++ b/auto/lib/perl/make
+@@ -35,6 +35,8 @@ $NGX_OBJS/src/http/modules/perl/Makefile: \\
+ NGX_DEPS="\$(CORE_DEPS) \$(HTTP_DEPS)" \\
+ $NGX_PERL Makefile.PL \\
+ LIB=$NGX_PERL_MODULES \\
++ PREFIX=$NGX_PREFIX \\
++ INSTALLDIRS=vendor \\
+ INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN
+
+ END
diff --git a/www-servers/nginx/files/nginx.conf b/www-servers/nginx/files/nginx.conf
new file mode 100644
index 000000000000..74c015f708ca
--- /dev/null
+++ b/www-servers/nginx/files/nginx.conf
@@ -0,0 +1,72 @@
+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;
+
+ 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 example
+ #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;
+ #}
+}
diff --git a/www-servers/nginx/files/nginx.initd-r2 b/www-servers/nginx/files/nginx.initd-r2
new file mode 100644
index 000000000000..54605c4b86e3
--- /dev/null
+++ b/www-servers/nginx/files/nginx.initd-r2
@@ -0,0 +1,89 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="configtest"
+extra_started_commands="upgrade reload"
+
+description="Robust, small and high performance http and reverse proxy server"
+description_configtest="Run nginx' internal config check."
+description_upgrade="Upgrade the nginx binary without losing connections."
+description_reload="Reload the nginx configuration without losing connections."
+
+nginx_config=${nginx_config:-/etc/nginx/nginx.conf}
+
+command="/usr/sbin/nginx"
+command_args="-c ${nginx_config}"
+pidfile=${pidfile:-/run/nginx.pid}
+user=${user:-nginx}
+group=${group:-nginx}
+
+depend() {
+ need net
+ use dns logger netmount
+}
+
+start_pre() {
+ if [ "${RC_CMD}" != "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ configtest || return 1
+ fi
+}
+
+stop_post() {
+ rm -f ${pidfile}
+}
+
+reload() {
+ configtest || return 1
+ ebegin "Refreshing nginx' configuration"
+ kill -HUP `cat ${pidfile}` &>/dev/null
+ eend $? "Failed to reload nginx"
+}
+
+upgrade() {
+ configtest || return 1
+ ebegin "Upgrading nginx"
+
+ einfo "Sending USR2 to old binary"
+ kill -USR2 `cat ${pidfile}` &>/dev/null
+
+ einfo "Sleeping 3 seconds before pid-files checking"
+ sleep 3
+
+ if [ ! -f ${pidfile}.oldbin ]; then
+ eerror "File with old pid not found"
+ return 1
+ fi
+
+ if [ ! -f ${pidfile} ]; then
+ eerror "New binary failed to start"
+ return 1
+ fi
+
+ einfo "Sleeping 3 seconds before WINCH"
+ sleep 3 ; kill -WINCH `cat ${pidfile}.oldbin`
+
+ einfo "Sending QUIT to old binary"
+ kill -QUIT `cat ${pidfile}.oldbin`
+
+ einfo "Upgrade completed"
+ eend $? "Upgrade failed"
+}
+
+configtest() {
+ ebegin "Checking nginx' configuration"
+ ${command} -c ${nginx_config} -t -q
+
+ if [ $? -ne 0 ]; then
+ ${command} -c ${nginx_config} -t
+ fi
+
+ eend $? "failed, please correct errors above"
+}
diff --git a/www-servers/nginx/files/nginx.logrotate-r1 b/www-servers/nginx/files/nginx.logrotate-r1
new file mode 100644
index 000000000000..a78ed7a1a79c
--- /dev/null
+++ b/www-servers/nginx/files/nginx.logrotate-r1
@@ -0,0 +1,12 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+/var/log/nginx/*_log {
+ missingok
+ delaycompress
+ sharedscripts
+ postrotate
+ test -r /run/nginx.pid && kill -USR1 `cat /run/nginx.pid`
+ endscript
+}
diff --git a/www-servers/nginx/files/nginx.service-r1 b/www-servers/nginx/files/nginx.service-r1
new file mode 100644
index 000000000000..797c7edffafa
--- /dev/null
+++ b/www-servers/nginx/files/nginx.service-r1
@@ -0,0 +1,14 @@
+[Unit]
+Description=The nginx HTTP and reverse proxy server
+After=network.target remote-fs.target nss-lookup.target
+
+[Service]
+Type=forking
+PIDFile=/run/nginx.pid
+ExecStartPre=/usr/sbin/nginx -t
+ExecStart=/usr/sbin/nginx
+ExecReload=/bin/kill -HUP $MAINPID
+ExecStop=/bin/kill -QUIT $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/nginx/files/rtmp-nginx-1.7.6.patch b/www-servers/nginx/files/rtmp-nginx-1.7.6.patch
new file mode 100644
index 000000000000..ae8ccce8cb39
--- /dev/null
+++ b/www-servers/nginx/files/rtmp-nginx-1.7.6.patch
@@ -0,0 +1,89 @@
+From dd5f2aa117c617e1f0fde26f8fd58903be2d85e8 Mon Sep 17 00:00:00 2001
+From: Roman Arutyunyan <arut@qip.ru>
+Date: Wed, 17 Sep 2014 07:10:38 +0400
+Subject: [PATCH] fixed compilation
+
+---
+ ngx_rtmp.c | 4 ++++
+ ngx_rtmp.h | 9 +++++++++
+ ngx_rtmp_play_module.c | 8 +++++++-
+ 3 files changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/ngx_rtmp.c b/ngx_rtmp.c
+index c079c90..e525a93 100644
+--- a/ngx_rtmp.c
++++ b/ngx_rtmp.c
+@@ -31,7 +31,11 @@ static char * ngx_rtmp_merge_applications(ngx_conf_t *cf,
+ ngx_uint_t ctx_index);
+
+
++#if (nginx_version >= 1007005)
++ngx_thread_volatile ngx_queue_t ngx_rtmp_init_queue;
++#else
+ ngx_thread_volatile ngx_event_t *ngx_rtmp_init_queue;
++#endif
+
+
+ ngx_uint_t ngx_rtmp_max_module;
+diff --git a/ngx_rtmp.h b/ngx_rtmp.h
+index d3648f7..b87e99e 100644
+--- a/ngx_rtmp.h
++++ b/ngx_rtmp.h
+@@ -12,6 +12,7 @@
+ #include <ngx_core.h>
+ #include <ngx_event.h>
+ #include <ngx_event_connect.h>
++#include <nginx.h>
+
+ #include "ngx_rtmp_amf.h"
+ #include "ngx_rtmp_bandwidth.h"
+@@ -198,7 +199,11 @@ typedef struct {
+ ngx_str_t *addr_text;
+ int connected;
+
++#if (nginx_version >= 1007005)
++ ngx_queue_t posted_dry_events;
++#else
+ ngx_event_t *posted_dry_events;
++#endif
+
+ /* client buffer time in msec */
+ uint32_t buflen;
+@@ -602,7 +607,11 @@ extern ngx_rtmp_bandwidth_t ngx_rtmp_bw_in;
+
+
+ extern ngx_uint_t ngx_rtmp_naccepted;
++#if (nginx_version >= 1007005)
++extern ngx_thread_volatile ngx_queue_t ngx_rtmp_init_queue;
++#else
+ extern ngx_thread_volatile ngx_event_t *ngx_rtmp_init_queue;
++#endif
+
+ extern ngx_uint_t ngx_rtmp_max_module;
+ extern ngx_module_t ngx_rtmp_core_module;
+diff --git a/ngx_rtmp_play_module.c b/ngx_rtmp_play_module.c
+index acaa46c..f6ea6c3 100644
+--- a/ngx_rtmp_play_module.c
++++ b/ngx_rtmp_play_module.c
+@@ -6,6 +6,7 @@
+
+ #include <ngx_config.h>
+ #include <ngx_core.h>
++#include <nginx.h>
+ #include "ngx_rtmp_play_module.h"
+ #include "ngx_rtmp_cmd_module.h"
+ #include "ngx_rtmp_netcall_module.h"
+@@ -430,7 +431,12 @@ ngx_rtmp_play_do_stop(ngx_rtmp_session_t *s)
+ ngx_del_timer(&ctx->send_evt);
+ }
+
+- if (ctx->send_evt.prev) {
++#if (nginx_version >= 1007005)
++ if (ctx->send_evt.posted)
++#else
++ if (ctx->send_evt.prev)
++#endif
++ {
+ ngx_delete_posted_event((&ctx->send_evt));
+ }
+
diff --git a/www-servers/nginx/metadata.xml b/www-servers/nginx/metadata.xml
new file mode 100644
index 000000000000..d39145448ee8
--- /dev/null
+++ b/www-servers/nginx/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+ <maintainer>
+ <email>bugs@bergstroem.nu</email>
+ <name>Johan Bergström</name>
+ <description>Co-maintainer, CC on bugs.</description>
+ </maintainer>
+ <use>
+ <flag name="aio">Enables file AIO support</flag>
+ <flag name="http">Enable HTTP core support</flag>
+ <flag name="http-cache">Enable HTTP cache support</flag>
+ <flag name="libatomic">Use libatomic instead of builtin atomic operations</flag>
+ <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of <pkg>dev-lang/lua</pkg> for lua support when building the lua http module.</flag>
+ <flag name="pcre-jit">Enable JIT for pcre</flag>
+ <flag name="ssl">Enable HTTPS module for http. Enable SSL/TLS support for POP3/IMAP/SMTP for mail.</flag>
+ <flag name="rtmp">NGINX-based Media Streaming Server</flag>
+ </use>
+ <upstream>
+ <changelog>http://nginx.org/en/CHANGES</changelog>
+ <remote-id type="github">yaoweibin/nginx_ajp_module</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/nginx/nginx-1.7.12.ebuild b/www-servers/nginx/nginx-1.7.12.ebuild
new file mode 100644
index 000000000000..99e6c5b72bcf
--- /dev/null
+++ b/www-servers/nginx/nginx-1.7.12.ebuild
@@ -0,0 +1,683 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+# Maintainer notes:
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
+# - any http-module activates the main http-functionality and overrides USE=-http
+# - keep the following requirements in mind before adding external modules:
+# * alive upstream
+# * sane packaging
+# * builds cleanly
+# * does not need a patch for nginx core
+# - TODO: test the google-perftools module (included in vanilla tarball)
+
+# prevent perl-module from adding automagic perl DEPENDs
+GENTOO_DEPEND_ON_PERL="no"
+
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
+DEVEL_KIT_MODULE_PV="0.2.19"
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
+
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
+
+# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
+HTTP_HEADERS_MORE_MODULE_PV="0.26"
+HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
+HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
+HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
+
+# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
+HTTP_CACHE_PURGE_MODULE_PV="2.3"
+HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
+HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+
+# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
+HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
+HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
+HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+
+# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
+HTTP_FANCYINDEX_MODULE_PV="0.3.5"
+HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
+HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+
+# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
+HTTP_LUA_MODULE_PV="0.9.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}"
+
+# http_auth_pam (http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
+HTTP_AUTH_PAM_MODULE_PV="1.4"
+HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
+HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
+
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0"
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
+HTTP_METRICS_MODULE_PV="0.1.1"
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
+HTTP_NAXSI_MODULE_PV="0.53-2"
+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 (http://github.com/arut/nginx-rtmp-module, BSD license)
+RTMP_MODULE_PV="1.1.7"
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
+RTMP_MODULE_URI="http://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 (http://github.com/arut/nginx-dav-ext-module, BSD license)
+HTTP_DAV_EXT_MODULE_PV="0.0.3"
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
+HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_MODULE_PV="0.57"
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
+HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
+
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication
+HTTP_SECURITY_MODULE_PV="2.9.0"
+HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
+HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
+HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
+
+# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
+HTTP_PUSH_STREAM_MODULE_PV="0.4.1"
+HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
+HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
+HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
+
+# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
+HTTP_STICKY_MODULE_PV="1.2.5"
+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-bd312d586752"
+
+# ajp-module (https://github.com/yaoweibin/nginx_ajp_module, BSD-2)
+HTTP_AJP_MODULE_PV="0.3.0"
+HTTP_AJP_MODULE_P="ngx_http_ajp_module-${HTTP_AJP_MODULE_PV}"
+HTTP_AJP_MODULE_URI="https://github.com/yaoweibin/nginx_ajp_module/archive/v${HTTP_AJP_MODULE_PV}.tar.gz"
+HTTP_AJP_MODULE_WD="${WORKDIR}/nginx_ajp_module-${HTTP_AJP_MODULE_PV}"
+
+# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2)
+HTTP_MOGILEFS_MODULE_PV="1.0.4"
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+
+inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
+
+DESCRIPTION="Robust, small and high performance http and reverse proxy server"
+HOMEPAGE="http://nginx.org"
+SRC_URI="http://nginx.org/download/${P}.tar.gz
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
+ nginx_modules_http_ajp? ( ${HTTP_AJP_MODULE_URI} -> ${HTTP_AJP_MODULE_P}.tar.gz )
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_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="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
+geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
+split_clients upstream_ip_hash userid uwsgi"
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static
+image_filter mp4 perl random_index realip secure_link spdy stub_status sub xslt"
+NGINX_MODULES_MAIL="imap pop3 smtp"
+NGINX_MODULES_3RD="
+ http_upload_progress
+ http_headers_more
+ http_cache_purge
+ http_slowfs_cache
+ http_fancyindex
+ http_lua
+ http_auth_pam
+ http_upstream_check
+ http_metrics
+ http_naxsi
+ http_dav_ext
+ http_echo
+ http_security
+ http_push_stream
+ http_sticky
+ http_ajp
+ http_mogilefs"
+
+IUSE="aio debug +http +http-cache ipv6 libatomic luajit +pcre pcre-jit rtmp
+selinux ssl 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_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] )
+ ssl? ( dev-libs/openssl:0= )
+ http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_geoip? ( dev-libs/geoip )
+ nginx_modules_http_gunzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip_static? ( sys-libs/zlib )
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
+ nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c:0= )
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
+ nginx_modules_http_auth_pam? ( virtual/pam )
+ nginx_modules_http_metrics? ( dev-libs/yajl )
+ nginx_modules_http_dav_ext? ( dev-libs/expat )
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-nginx )
+"
+DEPEND="${CDEPEND}
+ arm? ( dev-libs/libatomic_ops )
+ libatomic? ( dev-libs/libatomic_ops )"
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
+
+REQUIRED_USE="pcre-jit? ( pcre )
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite )
+ nginx_modules_http_naxsi? ( pcre )
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
+ nginx_modules_http_security? ( pcre )
+ nginx_modules_http_push_stream? ( ssl )"
+
+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}/${PN}-1.4.1-fix-perl-install-path.patch"
+
+ if use nginx_modules_http_upstream_check; then
+ epatch "${FILESDIR}"/check_1.7.2+.patch
+ fi
+
+ if use nginx_modules_http_lua; then
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
+ fi
+
+ if use nginx_modules_http_ajp; then
+ pushd "${HTTP_AJP_MODULE_WD}" > /dev/null
+ epatch "${FILESDIR}"/AJP-nginx-1.7.9+.patch
+ popd > /dev/null
+ 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
+
+ epatch_user
+}
+
+src_configure() {
+ # mod_security needs to generate nginx/modsecurity/config before including it
+ if use nginx_modules_http_security; then
+ cd "${HTTP_SECURITY_MODULE_WD}"
+ if use luajit ; then
+ sed -i \
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
+ configure || die
+ fi
+ ./configure \
+ --enable-standalone-module \
+ $(use_enable pcre-jit) \
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
+ fi
+
+ cd "${S}"
+
+ local myconf= http_enabled= mail_enabled=
+
+ 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=${HTTP_UPLOAD_PROGRESS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_headers_more; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_HEADERS_MORE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_CACHE_PURGE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_FANCYINDEX_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_lua; then
+ http_enabled=1
+ if use luajit; then
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit)
+ else
+ export LUA_LIB=$(pkg-config --variable libdir lua)
+ export LUA_INC=$(pkg-config --variable includedir lua)
+ fi
+ myconf+=" --add-module=${DEVEL_KIT_MODULE_WD}"
+ myconf+=" --add-module=${HTTP_LUA_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_AUTH_PAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_metrics; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_METRICS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_naxsi ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_NAXSI_MODULE_WD}"
+ fi
+
+ if use rtmp ; then
+ http_enabled=1
+ myconf+=" --add-module=${RTMP_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_dav_ext ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_DAV_EXT_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_echo ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_ECHO_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_security ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity"
+ fi
+
+ if use nginx_modules_http_push_stream ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_PUSH_STREAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_sticky ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_STICKY_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_ajp ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_AJP_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_mogilefs ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_MOGILEFS_MODULE_WD}"
+ 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/$(get_libdir)" \
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
+ --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
+ --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
+ --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
+ --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
+ --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
+ ${myconf} || die "configure failed"
+
+ # A purely cosmetic change that makes nginx -V more readable. This can be
+ # good if people outside the gentoo community would troubleshoot and
+ # question the users setup.
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
+}
+
+src_compile() {
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
+
+ # https://bugs.gentoo.org/286772
+ export LANG=C LC_ALL=C
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+
+ cp "${FILESDIR}"/nginx.conf "${ED}"etc/nginx/nginx.conf || die
+
+ newinitd "${FILESDIR}"/nginx.initd-r2 nginx
+
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
+
+ doman man/nginx.8
+ dodoc CHANGES* README
+
+ # just keepdir. do not copy the default htdocs files (bug #449136)
+ keepdir /var/www/localhost
+ rm -rf "${D}"usr/html || die
+
+ # set up a list of directories to keep
+ local keepdir_list="${NGINX_HOME_TMP}"/client
+ local module
+ for module in proxy fastcgi scgi uwsgi; do
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
+ done
+
+ keepdir /var/log/nginx ${keepdir_list}
+
+ # this solves a problem with SELinux where nginx doesn't see the directories
+ # as root and tries to create them as nginx
+ fperms 0750 "${NGINX_HOME_TMP}"
+ fowners ${PN}:0 "${NGINX_HOME_TMP}"
+
+ fperms 0700 /var/log/nginx ${keepdir_list}
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx
+
+ if use nginx_modules_http_perl; then
+ cd "${S}"/objs/src/http/modules/perl/
+ emake DESTDIR="${D}" INSTALLDIRS=vendor
+ perl_delete_localpod
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ docinto ${HTTP_CACHE_PURGE_MODULE_P}
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ docinto ${HTTP_FANCYINDEX_MODULE_P}
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
+ fi
+
+ if use nginx_modules_http_lua; then
+ docinto ${HTTP_LUA_MODULE_P}
+ dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ docinto ${HTTP_AUTH_PAM_MODULE_P}
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
+ dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
+ fi
+
+# README.md is still empty
+# 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
+ fi
+
+ if use rtmp; then
+ docinto ${RTMP_MODULE_P}
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
+ fi
+
+ if use nginx_modules_http_dav_ext; then
+ docinto ${HTTP_DAV_EXT_MODULE_P}
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
+ fi
+
+ if use nginx_modules_http_echo; then
+ docinto ${HTTP_ECHO_MODULE_P}
+ dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
+ fi
+
+ if use nginx_modules_http_security; then
+ docinto ${HTTP_SECURITY_MODULE_P}
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
+ fi
+
+ if use nginx_modules_http_push_stream; then
+ docinto ${HTTP_PUSH_STREAM_MODULE_P}
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
+ fi
+
+ if use nginx_modules_http_sticky; then
+ docinto ${HTTP_STICKY_MODULE_P}
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
+ fi
+
+ if use nginx_modules_http_ajp; then
+ docinto ${HTTP_AJP_MODULE_P}
+ dodoc "${HTTP_AJP_MODULE_WD}"/README
+ 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 -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
+ fi
+
+ # If the nginx user can't change into or read the dir, display a warning.
+ # If su is not available we display the warning nevertheless since we can't check properly
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
+ if [ $? -ne 0 ] ; then
+ ewarn "Please make sure that the nginx user or group has at least"
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
+ ewarn "Otherwise you end up with empty log files after a logrotate."
+ fi
+}
diff --git a/www-servers/nginx/nginx-1.7.6.ebuild b/www-servers/nginx/nginx-1.7.6.ebuild
new file mode 100644
index 000000000000..aec6df562cc9
--- /dev/null
+++ b/www-servers/nginx/nginx-1.7.6.ebuild
@@ -0,0 +1,681 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+# Maintainer notes:
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
+# - any http-module activates the main http-functionality and overrides USE=-http
+# - keep the following requirements in mind before adding external modules:
+# * alive upstream
+# * sane packaging
+# * builds cleanly
+# * does not need a patch for nginx core
+# - TODO: test the google-perftools module (included in vanilla tarball)
+
+# prevent perl-module from adding automagic perl DEPENDs
+GENTOO_DEPEND_ON_PERL="no"
+
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
+DEVEL_KIT_MODULE_PV="0.2.19"
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
+
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
+
+# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
+HTTP_HEADERS_MORE_MODULE_PV="0.25"
+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_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 (https://github.com/aperezdc/ngx-fancyindex, BSD license)
+HTTP_FANCYINDEX_MODULE_PV="0.3.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/chaoslawful/lua-nginx-module, BSD license)
+HTTP_LUA_MODULE_PV="0.9.12"
+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/, BSD-2 license)
+HTTP_AUTH_PAM_MODULE_PV="1.3"
+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}.tgz"
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
+
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.1.9"
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
+HTTP_METRICS_MODULE_PV="0.1.1"
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
+HTTP_NAXSI_MODULE_PV="0.53-2"
+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 (http://github.com/arut/nginx-rtmp-module, BSD license)
+RTMP_MODULE_PV="1.1.6"
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
+RTMP_MODULE_URI="http://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 (http://github.com/arut/nginx-dav-ext-module, BSD license)
+HTTP_DAV_EXT_MODULE_PV="0.0.3"
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
+HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_MODULE_PV="0.56"
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
+HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
+
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication
+HTTP_SECURITY_MODULE_PV="2.8.0"
+HTTP_SECURITY_MODULE_P="modsecurity-apache_${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 (https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
+HTTP_PUSH_STREAM_MODULE_PV="0.4.0"
+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.5"
+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-bd312d586752"
+
+# ajp-module (https://github.com/yaoweibin/nginx_ajp_module, BSD-2)
+HTTP_AJP_MODULE_PV="0.3.0"
+HTTP_AJP_MODULE_P="ngx_http_ajp_module-${HTTP_AJP_MODULE_PV}"
+HTTP_AJP_MODULE_URI="https://github.com/yaoweibin/nginx_ajp_module/archive/v${HTTP_AJP_MODULE_PV}.tar.gz"
+HTTP_AJP_MODULE_WD="${WORKDIR}/nginx_ajp_module-${HTTP_AJP_MODULE_PV}"
+
+# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2)
+HTTP_MOGILEFS_MODULE_PV="1.0.4"
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+
+inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
+
+DESCRIPTION="Robust, small and high performance http and reverse proxy server"
+HOMEPAGE="http://nginx.org"
+SRC_URI="http://nginx.org/download/${P}.tar.gz
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
+ nginx_modules_http_ajp? ( ${HTTP_AJP_MODULE_URI} -> ${HTTP_AJP_MODULE_P}.tar.gz )
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_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="0"
+KEYWORDS="amd64 ~arm ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
+geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
+split_clients upstream_ip_hash userid uwsgi"
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static
+image_filter mp4 perl random_index realip secure_link spdy stub_status sub xslt"
+NGINX_MODULES_MAIL="imap pop3 smtp"
+NGINX_MODULES_3RD="
+ http_upload_progress
+ http_headers_more
+ http_cache_purge
+ http_slowfs_cache
+ http_fancyindex
+ http_lua
+ http_auth_pam
+ http_upstream_check
+ http_metrics
+ http_naxsi
+ http_dav_ext
+ http_echo
+ http_security
+ http_push_stream
+ http_sticky
+ http_ajp
+ http_mogilefs"
+
+IUSE="aio debug +http +http-cache ipv6 libatomic luajit +pcre pcre-jit rtmp
+selinux ssl 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_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] )
+ ssl? ( dev-libs/openssl:0= )
+ http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_geoip? ( dev-libs/geoip )
+ nginx_modules_http_gunzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip_static? ( sys-libs/zlib )
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
+ nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c:0= )
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
+ nginx_modules_http_auth_pam? ( virtual/pam )
+ nginx_modules_http_metrics? ( dev-libs/yajl )
+ nginx_modules_http_dav_ext? ( dev-libs/expat )
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-nginx )
+"
+DEPEND="${CDEPEND}
+ arm? ( dev-libs/libatomic_ops )
+ libatomic? ( dev-libs/libatomic_ops )"
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
+
+REQUIRED_USE="pcre-jit? ( pcre )
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite )
+ nginx_modules_http_naxsi? ( pcre )
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
+ nginx_modules_http_security? ( pcre )
+ nginx_modules_http_push_stream? ( ssl )"
+
+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}/${PN}-1.4.1-fix-perl-install-path.patch"
+
+ if use nginx_modules_http_upstream_check; then
+ epatch "${FILESDIR}"/check_1.7.2+.patch
+ fi
+
+ if use nginx_modules_http_lua; then
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config"
+ # fix for nginx 1.7.5
+ cd "${HTTP_LUA_MODULE_WD}"
+ epatch "${FILESDIR}/lua-${P}.patch"
+ cd "${S}"
+ 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
+
+ epatch_user
+}
+
+src_configure() {
+ # mod_security needs to generate nginx/modsecurity/config before including it
+ if use nginx_modules_http_security; then
+ cd "${HTTP_SECURITY_MODULE_WD}"
+ if use luajit ; then
+ sed -i \
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
+ configure || die
+ fi
+ ./configure \
+ --enable-standalone-module \
+ $(use_enable pcre-jit) \
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
+ fi
+
+ cd "${S}"
+
+ local myconf= http_enabled= mail_enabled=
+
+ 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=${HTTP_UPLOAD_PROGRESS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_headers_more; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_HEADERS_MORE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_CACHE_PURGE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_FANCYINDEX_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_lua; then
+ http_enabled=1
+ if use luajit; then
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit)
+ else
+ export LUA_LIB=$(pkg-config --variable libdir lua)
+ export LUA_INC=$(pkg-config --variable includedir lua)
+ fi
+ myconf+=" --add-module=${DEVEL_KIT_MODULE_WD}"
+ myconf+=" --add-module=${HTTP_LUA_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_AUTH_PAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_metrics; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_METRICS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_naxsi ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_NAXSI_MODULE_WD}"
+ fi
+
+ if use rtmp ; then
+ http_enabled=1
+ myconf+=" --add-module=${RTMP_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_dav_ext ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_DAV_EXT_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_echo ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_ECHO_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_security ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity"
+ fi
+
+ if use nginx_modules_http_push_stream ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_PUSH_STREAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_sticky ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_STICKY_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_ajp ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_AJP_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_mogilefs ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_MOGILEFS_MODULE_WD}"
+ 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/$(get_libdir)" \
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
+ --http-client-body-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/client \
+ --http-proxy-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/proxy \
+ --http-fastcgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/fastcgi \
+ --http-scgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/scgi \
+ --http-uwsgi-temp-path="${EPREFIX}/${NGINX_HOME_TMP}"/uwsgi \
+ ${myconf} || die "configure failed"
+
+ # A purely cosmetic change that makes nginx -V more readable. This can be
+ # good if people outside the gentoo community would troubleshoot and
+ # question the users setup.
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
+}
+
+src_compile() {
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
+
+ # https://bugs.gentoo.org/286772
+ export LANG=C LC_ALL=C
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ cp "${FILESDIR}"/nginx.conf "${ED}"/etc/nginx/nginx.conf || die
+
+ newinitd "${FILESDIR}"/nginx.initd-r2 nginx
+
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
+
+ doman man/nginx.8
+ dodoc CHANGES* README
+
+ # just keepdir. do not copy the default htdocs files (bug #449136)
+ keepdir /var/www/localhost
+ rm -rf "${D}"/usr/html || die
+
+ # set up a list of directories to keep
+ local keepdir_list="${NGINX_HOME_TMP}"/client
+ local module
+ for module in proxy fastcgi scgi uwsgi; do
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
+ done
+
+ keepdir /var/log/nginx ${keepdir_list}
+
+ # this solves a problem with SELinux where nginx doesn't see the directories
+ # as root and tries to create them as nginx
+ fperms 0750 "${NGINX_HOME_TMP}"
+ fowners ${PN}:0 "${NGINX_HOME_TMP}"
+
+ fperms 0700 /var/log/nginx ${keepdir_list}
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx
+
+ if use nginx_modules_http_perl; then
+ cd "${S}"/objs/src/http/modules/perl/
+ einstall DESTDIR="${D}" INSTALLDIRS=vendor
+ perl_delete_localpod
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ docinto ${HTTP_CACHE_PURGE_MODULE_P}
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ docinto ${HTTP_FANCYINDEX_MODULE_P}
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
+ fi
+
+ if use nginx_modules_http_lua; then
+ docinto ${HTTP_LUA_MODULE_P}
+ dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ docinto ${HTTP_AUTH_PAM_MODULE_P}
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README,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
+
+# README.md is still empty
+# 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
+ fi
+
+ if use rtmp; then
+ docinto ${RTMP_MODULE_P}
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
+ fi
+
+ if use nginx_modules_http_dav_ext; then
+ docinto ${HTTP_DAV_EXT_MODULE_P}
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
+ fi
+
+ if use nginx_modules_http_echo; then
+ docinto ${HTTP_ECHO_MODULE_P}
+ dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
+ fi
+
+ if use nginx_modules_http_security; then
+ docinto ${HTTP_SECURITY_MODULE_P}
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
+ fi
+
+ if use nginx_modules_http_push_stream; then
+ docinto ${HTTP_PUSH_STREAM_MODULE_P}
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
+ fi
+
+ if use nginx_modules_http_sticky; then
+ docinto ${HTTP_STICKY_MODULE_P}
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
+ fi
+
+ if use nginx_modules_http_ajp; then
+ docinto ${HTTP_AJP_MODULE_P}
+ dodoc "${HTTP_AJP_MODULE_WD}"/README
+ 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 -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}/${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
+ fi
+
+ # If the nginx user can't change into or read the dir, display a warning.
+ # If su is not available we display the warning nevertheless since we can't check properly
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
+ if [ $? -ne 0 ] ; then
+ ewarn "Please make sure that the nginx user or group has at least"
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
+ ewarn "Otherwise you end up with empty log files after a logrotate."
+ fi
+}
diff --git a/www-servers/nginx/nginx-1.8.0.ebuild b/www-servers/nginx/nginx-1.8.0.ebuild
new file mode 100644
index 000000000000..bc27547990ed
--- /dev/null
+++ b/www-servers/nginx/nginx-1.8.0.ebuild
@@ -0,0 +1,667 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+# Maintainer notes:
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
+# - any http-module activates the main http-functionality and overrides USE=-http
+# - keep the following requirements in mind before adding external modules:
+# * alive upstream
+# * sane packaging
+# * builds cleanly
+# * does not need a patch for nginx core
+# - TODO: test the google-perftools module (included in vanilla tarball)
+
+# prevent perl-module from adding automagic perl DEPENDs
+GENTOO_DEPEND_ON_PERL="no"
+
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
+DEVEL_KIT_MODULE_PV="0.2.19"
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
+
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
+
+# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
+HTTP_HEADERS_MORE_MODULE_PV="0.26"
+HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
+HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
+HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
+
+# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
+HTTP_CACHE_PURGE_MODULE_PV="2.3"
+HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
+HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+
+# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
+HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
+HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
+HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+
+# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
+HTTP_FANCYINDEX_MODULE_PV="0.3.5"
+HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
+HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+
+# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
+HTTP_LUA_MODULE_PV="0.9.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}"
+
+# http_auth_pam (http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
+HTTP_AUTH_PAM_MODULE_PV="1.4"
+HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
+HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
+
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0"
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
+HTTP_METRICS_MODULE_PV="0.1.1"
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
+HTTP_NAXSI_MODULE_PV="0.53-2"
+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 (http://github.com/arut/nginx-rtmp-module, BSD license)
+RTMP_MODULE_PV="1.1.7"
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
+RTMP_MODULE_URI="http://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 (http://github.com/arut/nginx-dav-ext-module, BSD license)
+HTTP_DAV_EXT_MODULE_PV="0.0.3"
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
+HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_MODULE_PV="0.57"
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
+HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
+
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication
+HTTP_SECURITY_MODULE_PV="2.9.0"
+HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
+HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
+HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
+
+# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
+HTTP_PUSH_STREAM_MODULE_PV="0.4.1"
+HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
+HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
+HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
+
+# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
+HTTP_STICKY_MODULE_PV="1.2.5"
+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-bd312d586752"
+
+# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2)
+HTTP_MOGILEFS_MODULE_PV="1.0.4"
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+
+inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
+
+DESCRIPTION="Robust, small and high performance http and reverse proxy server"
+HOMEPAGE="http://nginx.org"
+SRC_URI="http://nginx.org/download/${P}.tar.gz
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )"
+
+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="0"
+KEYWORDS="amd64 ~arm ~arm64 ~ppc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
+geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
+split_clients upstream_ip_hash userid uwsgi"
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static
+image_filter mp4 perl random_index realip secure_link spdy stub_status sub xslt"
+NGINX_MODULES_MAIL="imap pop3 smtp"
+NGINX_MODULES_3RD="
+ http_upload_progress
+ http_headers_more
+ http_cache_purge
+ http_slowfs_cache
+ http_fancyindex
+ http_lua
+ http_auth_pam
+ http_upstream_check
+ http_metrics
+ http_naxsi
+ http_dav_ext
+ http_echo
+ http_security
+ http_push_stream
+ http_sticky
+ http_ajp
+ http_mogilefs"
+
+IUSE="aio debug +http +http-cache ipv6 libatomic luajit +pcre pcre-jit rtmp
+selinux ssl 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_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] )
+ ssl? ( dev-libs/openssl:0= )
+ http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_geoip? ( dev-libs/geoip )
+ nginx_modules_http_gunzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip_static? ( sys-libs/zlib )
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
+ nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c:0= )
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
+ nginx_modules_http_auth_pam? ( virtual/pam )
+ nginx_modules_http_metrics? ( dev-libs/yajl )
+ nginx_modules_http_dav_ext? ( dev-libs/expat )
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-nginx )
+"
+DEPEND="${CDEPEND}
+ arm? ( dev-libs/libatomic_ops )
+ libatomic? ( dev-libs/libatomic_ops )"
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
+
+REQUIRED_USE="pcre-jit? ( pcre )
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite )
+ nginx_modules_http_naxsi? ( pcre )
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
+ nginx_modules_http_security? ( pcre )
+ nginx_modules_http_push_stream? ( ssl )"
+
+pkg_setup() {
+ NGINX_HOME="/var/lib/nginx"
+ NGINX_HOME_TMP="${NGINX_HOME}/tmp"
+
+ ebegin "Creating nginx user and group"
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
+ eend $?
+
+ if use libatomic; then
+ ewarn "GCC 4.1+ features built-in atomic operations."
+ ewarn "Using libatomic_ops is only needed if using"
+ ewarn "a different compiler or a GCC prior to 4.1"
+ fi
+
+ if [[ -n $NGINX_ADD_MODULES ]]; then
+ ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
+ ewarn "This nginx installation is not supported!"
+ ewarn "Make sure you can reproduce the bug without those modules"
+ ewarn "_before_ reporting bugs."
+ fi
+
+ if use !http; then
+ ewarn "To actually disable all http-functionality you also have to disable"
+ ewarn "all nginx http modules."
+ fi
+
+ if use nginx_modules_http_ajp; then
+ eerror "The AJP module currently doesn't build for nginx >1.8."
+ eerror "It will be reintroduced with the 1.9 series when proven stable."
+ eerror "Either disable it or stick with nginx 1.7.x."
+ die "AJP module not supported"
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
+
+ if use nginx_modules_http_upstream_check; then
+ epatch "${FILESDIR}"/check_1.7.2+.patch
+ fi
+
+ if use nginx_modules_http_lua; then
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
+ fi
+
+ find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
+ # We have config protection, don't rename etc files
+ sed -i 's:.default::' auto/install || die
+ # remove useless files
+ sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
+
+ # don't install to /etc/nginx/ if not in use
+ local module
+ for module in fastcgi scgi uwsgi ; do
+ if ! use nginx_modules_http_${module}; then
+ sed -i -e "/${module}/d" auto/install || die
+ fi
+ done
+
+ epatch_user
+}
+
+src_configure() {
+ # mod_security needs to generate nginx/modsecurity/config before including it
+ if use nginx_modules_http_security; then
+ cd "${HTTP_SECURITY_MODULE_WD}"
+ if use luajit ; then
+ sed -i \
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
+ configure || die
+ fi
+ ./configure \
+ --enable-standalone-module \
+ $(use_enable pcre-jit) \
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
+ fi
+
+ cd "${S}"
+
+ local myconf= http_enabled= mail_enabled=
+
+ 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=${HTTP_UPLOAD_PROGRESS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_headers_more; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_HEADERS_MORE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_CACHE_PURGE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_FANCYINDEX_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_lua; then
+ http_enabled=1
+ if use luajit; then
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit)
+ else
+ export LUA_LIB=$(pkg-config --variable libdir lua)
+ export LUA_INC=$(pkg-config --variable includedir lua)
+ fi
+ myconf+=" --add-module=${DEVEL_KIT_MODULE_WD}"
+ myconf+=" --add-module=${HTTP_LUA_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_AUTH_PAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_metrics; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_METRICS_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_naxsi ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_NAXSI_MODULE_WD}"
+ fi
+
+ if use rtmp ; then
+ http_enabled=1
+ myconf+=" --add-module=${RTMP_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_dav_ext ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_DAV_EXT_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_echo ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_ECHO_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_security ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity"
+ fi
+
+ if use nginx_modules_http_push_stream ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_PUSH_STREAM_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_sticky ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_STICKY_MODULE_WD}"
+ fi
+
+ if use nginx_modules_http_mogilefs ; then
+ http_enabled=1
+ myconf+=" --add-module=${HTTP_MOGILEFS_MODULE_WD}"
+ fi
+
+ if use 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/$(get_libdir)" \
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
+ --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
+ --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
+ --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
+ --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
+ --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
+ ${myconf} || die "configure failed"
+
+ # A purely cosmetic change that makes nginx -V more readable. This can be
+ # good if people outside the gentoo community would troubleshoot and
+ # question the users setup.
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
+}
+
+src_compile() {
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
+
+ # https://bugs.gentoo.org/286772
+ export LANG=C LC_ALL=C
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+
+ cp "${FILESDIR}"/nginx.conf "${ED}"etc/nginx/nginx.conf || die
+
+ newinitd "${FILESDIR}"/nginx.initd-r2 nginx
+
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
+
+ doman man/nginx.8
+ dodoc CHANGES* README
+
+ # just keepdir. do not copy the default htdocs files (bug #449136)
+ keepdir /var/www/localhost
+ rm -rf "${D}"usr/html || die
+
+ # set up a list of directories to keep
+ local keepdir_list="${NGINX_HOME_TMP}"/client
+ local module
+ for module in proxy fastcgi scgi uwsgi; do
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
+ done
+
+ keepdir /var/log/nginx ${keepdir_list}
+
+ # this solves a problem with SELinux where nginx doesn't see the directories
+ # as root and tries to create them as nginx
+ fperms 0750 "${NGINX_HOME_TMP}"
+ fowners ${PN}:0 "${NGINX_HOME_TMP}"
+
+ fperms 0700 /var/log/nginx ${keepdir_list}
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx
+
+ if use nginx_modules_http_perl; then
+ cd "${S}"/objs/src/http/modules/perl/
+ emake DESTDIR="${D}" INSTALLDIRS=vendor
+ perl_delete_localpod
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ docinto ${HTTP_CACHE_PURGE_MODULE_P}
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ docinto ${HTTP_FANCYINDEX_MODULE_P}
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
+ fi
+
+ if use nginx_modules_http_lua; then
+ docinto ${HTTP_LUA_MODULE_P}
+ dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ docinto ${HTTP_AUTH_PAM_MODULE_P}
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
+ dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
+ fi
+
+# README.md is still empty
+# 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
+ fi
+
+ if use rtmp; then
+ docinto ${RTMP_MODULE_P}
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
+ fi
+
+ if use nginx_modules_http_dav_ext; then
+ docinto ${HTTP_DAV_EXT_MODULE_P}
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
+ fi
+
+ if use nginx_modules_http_echo; then
+ docinto ${HTTP_ECHO_MODULE_P}
+ dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
+ fi
+
+ if use nginx_modules_http_security; then
+ docinto ${HTTP_SECURITY_MODULE_P}
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
+ fi
+
+ if use nginx_modules_http_push_stream; then
+ docinto ${HTTP_PUSH_STREAM_MODULE_P}
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
+ fi
+
+ if use nginx_modules_http_sticky; then
+ docinto ${HTTP_STICKY_MODULE_P}
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
+ fi
+}
+
+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 -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
+ fi
+
+ # If the nginx user can't change into or read the dir, display a warning.
+ # If su is not available we display the warning nevertheless since we can't check properly
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
+ if [ $? -ne 0 ] ; then
+ ewarn "Please make sure that the nginx user or group has at least"
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
+ ewarn "Otherwise you end up with empty log files after a logrotate."
+ fi
+}
diff --git a/www-servers/nginx/nginx-1.9.2.ebuild b/www-servers/nginx/nginx-1.9.2.ebuild
new file mode 100644
index 000000000000..2629e0d3243a
--- /dev/null
+++ b/www-servers/nginx/nginx-1.9.2.ebuild
@@ -0,0 +1,686 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+# Maintainer notes:
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
+# - any http-module activates the main http-functionality and overrides USE=-http
+# - keep the following requirements in mind before adding external modules:
+# * alive upstream
+# * sane packaging
+# * builds cleanly
+# * does not need a patch for nginx core
+# - TODO: test the google-perftools module (included in vanilla tarball)
+
+# prevent perl-module from adding automagic perl DEPENDs
+GENTOO_DEPEND_ON_PERL="no"
+
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
+DEVEL_KIT_MODULE_PV="0.2.19"
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
+
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
+
+# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
+HTTP_HEADERS_MORE_MODULE_PV="0.26"
+HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
+HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
+HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
+
+# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
+HTTP_CACHE_PURGE_MODULE_PV="2.3"
+HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
+HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+
+# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
+HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
+HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
+HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+
+# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
+HTTP_FANCYINDEX_MODULE_PV="0.3.5"
+HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
+HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+
+# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
+HTTP_LUA_MODULE_PV="0.9.16"
+HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
+HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
+HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
+
+# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
+HTTP_AUTH_PAM_MODULE_PV="1.4"
+HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
+HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
+
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0"
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
+HTTP_METRICS_MODULE_PV="0.1.1"
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
+HTTP_NAXSI_MODULE_PV="0.53-2"
+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 (http://github.com/arut/nginx-rtmp-module, BSD license)
+RTMP_MODULE_PV="1.1.7"
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
+RTMP_MODULE_URI="http://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 (http://github.com/arut/nginx-dav-ext-module, BSD license)
+HTTP_DAV_EXT_MODULE_PV="0.0.3"
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
+HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_MODULE_PV="0.58"
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
+HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
+
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication
+HTTP_SECURITY_MODULE_PV="2.9.0"
+HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
+HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
+HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
+
+# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
+HTTP_PUSH_STREAM_MODULE_PV="0.5.1"
+HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
+HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
+HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
+
+# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
+HTTP_STICKY_MODULE_PV="1.2.5"
+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-bd312d586752"
+
+# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2)
+HTTP_MOGILEFS_MODULE_PV="1.0.4"
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+
+# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
+HTTP_MEMC_MODULE_PV="0.16"
+HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
+HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
+HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
+
+inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
+
+DESCRIPTION="Robust, small and high performance http and reverse proxy server"
+HOMEPAGE="http://nginx.org"
+SRC_URI="http://nginx.org/download/${P}.tar.gz
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
+ nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )"
+
+LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
+ nginx_modules_http_security? ( Apache-2.0 )
+ nginx_modules_http_push_stream? ( GPL-3 )"
+
+SLOT="mainline"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
+geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
+split_clients upstream_ip_hash userid uwsgi"
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static
+image_filter mp4 perl random_index realip secure_link spdy stub_status sub xslt"
+NGINX_MODULES_MAIL="imap pop3 smtp"
+NGINX_MODULES_3RD="
+ http_upload_progress
+ http_headers_more
+ http_cache_purge
+ http_slowfs_cache
+ http_fancyindex
+ http_lua
+ http_auth_pam
+ http_upstream_check
+ http_metrics
+ http_naxsi
+ http_dav_ext
+ http_echo
+ http_security
+ http_push_stream
+ http_sticky
+ http_ajp
+ http_mogilefs
+ http_memc"
+
+IUSE="aio debug +http +http-cache ipv6 libatomic luajit +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_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] )
+ ssl? ( dev-libs/openssl:0= )
+ http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_geoip? ( dev-libs/geoip )
+ nginx_modules_http_gunzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip_static? ( sys-libs/zlib )
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
+ nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c:0= )
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
+ nginx_modules_http_auth_pam? ( virtual/pam )
+ nginx_modules_http_metrics? ( dev-libs/yajl )
+ nginx_modules_http_dav_ext? ( dev-libs/expat )
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-nginx )
+ !www-servers/nginx:0"
+DEPEND="${CDEPEND}
+ arm? ( dev-libs/libatomic_ops )
+ libatomic? ( dev-libs/libatomic_ops )"
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
+
+REQUIRED_USE="pcre-jit? ( pcre )
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite )
+ nginx_modules_http_naxsi? ( pcre )
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
+ nginx_modules_http_security? ( pcre )
+ nginx_modules_http_push_stream? ( ssl )"
+
+pkg_setup() {
+ NGINX_HOME="/var/lib/nginx"
+ NGINX_HOME_TMP="${NGINX_HOME}/tmp"
+
+ ebegin "Creating nginx user and group"
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
+ eend $?
+
+ if use libatomic; then
+ ewarn "GCC 4.1+ features built-in atomic operations."
+ ewarn "Using libatomic_ops is only needed if using"
+ ewarn "a different compiler or a GCC prior to 4.1"
+ fi
+
+ if [[ -n $NGINX_ADD_MODULES ]]; then
+ ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
+ ewarn "This nginx installation is not supported!"
+ ewarn "Make sure you can reproduce the bug without those modules"
+ ewarn "_before_ reporting bugs."
+ fi
+
+ if use !http; then
+ ewarn "To actually disable all http-functionality you also have to disable"
+ ewarn "all nginx http modules."
+ fi
+
+ if use nginx_modules_http_ajp; then
+ eerror "The AJP module currently doesn't build for nginx >1.8."
+ eerror "It will be reintroduced with the 1.9 series when proven stable."
+ eerror "Either disable it or stick with nginx 1.7.x."
+ die "AJP module not supported"
+ fi
+
+ if use nginx_modules_http_mogilefs && use threads; then
+ eerror "mogilefs won't compile with threads support."
+ eerror "Please disable either flag and try again."
+ die "Can't compile mogilefs with threads support"
+ fi
+}
+
+src_prepare() {
+ epatch_user
+
+ epatch "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
+
+ if use nginx_modules_http_upstream_check; then
+ epatch "${FILESDIR}/check-${PV}".patch
+ fi
+
+ if use nginx_modules_http_lua; then
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
+ fi
+
+ find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
+ # We have config protection, don't rename etc files
+ sed -i 's:.default::' auto/install || die
+ # remove useless files
+ sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
+
+ # don't install to /etc/nginx/ if not in use
+ local module
+ for module in fastcgi scgi uwsgi ; do
+ if ! use nginx_modules_http_${module}; then
+ sed -i -e "/${module}/d" auto/install || die
+ fi
+ done
+}
+
+src_configure() {
+ # mod_security needs to generate nginx/modsecurity/config before including it
+ if use nginx_modules_http_security; then
+ cd "${HTTP_SECURITY_MODULE_WD}"
+ if use luajit ; then
+ sed -i \
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
+ configure || die
+ fi
+ ./configure \
+ --enable-standalone-module \
+ $(use_enable pcre-jit) \
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
+ fi
+
+ cd "${S}"
+
+ local myconf=() http_enabled= mail_enabled=
+
+ use aio && myconf+=( --with-file-aio )
+ use debug && myconf+=( --with-debug )
+ use ipv6 && myconf+=( --with-ipv6 )
+ use libatomic && myconf+=( --with-libatomic )
+ use pcre && myconf+=( --with-pcre )
+ use pcre-jit && myconf+=( --with-pcre-jit )
+ use threads && myconf+=( --with-threads )
+
+ # HTTP modules
+ for mod in $NGINX_MODULES_STD; do
+ if use nginx_modules_http_${mod}; then
+ http_enabled=1
+ else
+ myconf+=( --without-http_${mod}_module )
+ fi
+ done
+
+ for mod in $NGINX_MODULES_OPT; do
+ if use nginx_modules_http_${mod}; then
+ http_enabled=1
+ myconf+=( --with-http_${mod}_module )
+ fi
+ done
+
+ if use nginx_modules_http_fastcgi; then
+ myconf+=( --with-http_realip_module )
+ fi
+
+ # third-party modules
+ if use nginx_modules_http_upload_progress; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_headers_more; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_lua; then
+ http_enabled=1
+ if use luajit; then
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit)
+ else
+ export LUA_LIB=$(pkg-config --variable libdir lua)
+ export LUA_INC=$(pkg-config --variable includedir lua)
+ fi
+ myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
+ myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_metrics; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_naxsi ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
+ fi
+
+ if use rtmp ; then
+ http_enabled=1
+ myconf+=( --add-module=${RTMP_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_dav_ext ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_echo ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_security ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
+ fi
+
+ if use nginx_modules_http_push_stream ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_sticky ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_mogilefs ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_memc ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
+ fi
+
+ if use 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/$(get_libdir)" \
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
+ --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
+ --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
+ --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
+ --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
+ --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
+ "${myconf[@]}" || die "configure failed"
+
+ # A purely cosmetic change that makes nginx -V more readable. This can be
+ # good if people outside the gentoo community would troubleshoot and
+ # question the users setup.
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
+}
+
+src_compile() {
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
+
+ # https://bugs.gentoo.org/286772
+ export LANG=C LC_ALL=C
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+
+ cp "${FILESDIR}"/nginx.conf "${ED}"etc/nginx/nginx.conf || die
+
+ newinitd "${FILESDIR}"/nginx.initd-r2 nginx
+
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
+
+ doman man/nginx.8
+ dodoc CHANGES* README
+
+ # just keepdir. do not copy the default htdocs files (bug #449136)
+ keepdir /var/www/localhost
+ rm -rf "${D}"usr/html || die
+
+ # set up a list of directories to keep
+ local keepdir_list="${NGINX_HOME_TMP}"/client
+ local module
+ for module in proxy fastcgi scgi uwsgi; do
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
+ done
+
+ keepdir /var/log/nginx ${keepdir_list}
+
+ # this solves a problem with SELinux where nginx doesn't see the directories
+ # as root and tries to create them as nginx
+ fperms 0750 "${NGINX_HOME_TMP}"
+ fowners ${PN}:0 "${NGINX_HOME_TMP}"
+
+ fperms 0700 /var/log/nginx ${keepdir_list}
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx
+
+ if use nginx_modules_http_perl; then
+ cd "${S}"/objs/src/http/modules/perl/
+ emake DESTDIR="${D}" INSTALLDIRS=vendor
+ perl_delete_localpod
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ docinto ${HTTP_CACHE_PURGE_MODULE_P}
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ docinto ${HTTP_FANCYINDEX_MODULE_P}
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
+ fi
+
+ if use nginx_modules_http_lua; then
+ docinto ${HTTP_LUA_MODULE_P}
+ dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ docinto ${HTTP_AUTH_PAM_MODULE_P}
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
+ dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
+ fi
+
+ if use nginx_modules_http_naxsi; then
+ insinto /etc/nginx
+ doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
+ fi
+
+ if use rtmp; then
+ docinto ${RTMP_MODULE_P}
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
+ fi
+
+ if use nginx_modules_http_dav_ext; then
+ docinto ${HTTP_DAV_EXT_MODULE_P}
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
+ fi
+
+ if use nginx_modules_http_echo; then
+ docinto ${HTTP_ECHO_MODULE_P}
+ dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
+ fi
+
+ if use nginx_modules_http_security; then
+ docinto ${HTTP_SECURITY_MODULE_P}
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
+ fi
+
+ if use nginx_modules_http_push_stream; then
+ docinto ${HTTP_PUSH_STREAM_MODULE_P}
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
+ fi
+
+ if use nginx_modules_http_sticky; then
+ docinto ${HTTP_STICKY_MODULE_P}
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
+ fi
+
+ if use nginx_modules_http_memc; then
+ docinto ${HTTP_MEMC_MODULE_P}
+ dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
+ fi
+}
+
+pkg_postinst() {
+ if use ssl; then
+ if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then
+ install_cert /etc/ssl/${PN}/${PN}
+ use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
+ fi
+ fi
+
+ if use nginx_modules_http_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 -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
+ fi
+
+ # If the nginx user can't change into or read the dir, display a warning.
+ # If su is not available we display the warning nevertheless since we can't check properly
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
+ if [ $? -ne 0 ] ; then
+ ewarn "Please make sure that the nginx user or group has at least"
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
+ ewarn "Otherwise you end up with empty log files after a logrotate."
+ fi
+}
diff --git a/www-servers/nginx/nginx-1.9.3.ebuild b/www-servers/nginx/nginx-1.9.3.ebuild
new file mode 100644
index 000000000000..6baafcdf4a9e
--- /dev/null
+++ b/www-servers/nginx/nginx-1.9.3.ebuild
@@ -0,0 +1,686 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+# Maintainer notes:
+# - http_rewrite-independent pcre-support makes sense for matching locations without an actual rewrite
+# - any http-module activates the main http-functionality and overrides USE=-http
+# - keep the following requirements in mind before adding external modules:
+# * alive upstream
+# * sane packaging
+# * builds cleanly
+# * does not need a patch for nginx core
+# - TODO: test the google-perftools module (included in vanilla tarball)
+
+# prevent perl-module from adding automagic perl DEPENDs
+GENTOO_DEPEND_ON_PERL="no"
+
+# devel_kit (https://github.com/simpl/ngx_devel_kit, BSD license)
+DEVEL_KIT_MODULE_PV="0.2.19"
+DEVEL_KIT_MODULE_P="ngx_devel_kit-${DEVEL_KIT_MODULE_PV}-r1"
+DEVEL_KIT_MODULE_URI="https://github.com/simpl/ngx_devel_kit/archive/v${DEVEL_KIT_MODULE_PV}.tar.gz"
+DEVEL_KIT_MODULE_WD="${WORKDIR}/ngx_devel_kit-${DEVEL_KIT_MODULE_PV}"
+
+# http_uploadprogress (https://github.com/masterzen/nginx-upload-progress-module, BSD-2 license)
+HTTP_UPLOAD_PROGRESS_MODULE_PV="0.9.1"
+HTTP_UPLOAD_PROGRESS_MODULE_P="ngx_http_upload_progress-${HTTP_UPLOAD_PROGRESS_MODULE_PV}-r1"
+HTTP_UPLOAD_PROGRESS_MODULE_URI="https://github.com/masterzen/nginx-upload-progress-module/archive/v${HTTP_UPLOAD_PROGRESS_MODULE_PV}.tar.gz"
+HTTP_UPLOAD_PROGRESS_MODULE_WD="${WORKDIR}/nginx-upload-progress-module-${HTTP_UPLOAD_PROGRESS_MODULE_PV}"
+
+# http_headers_more (http://github.com/agentzh/headers-more-nginx-module, BSD license)
+HTTP_HEADERS_MORE_MODULE_PV="0.26"
+HTTP_HEADERS_MORE_MODULE_P="ngx_http_headers_more-${HTTP_HEADERS_MORE_MODULE_PV}"
+HTTP_HEADERS_MORE_MODULE_URI="https://github.com/agentzh/headers-more-nginx-module/archive/v${HTTP_HEADERS_MORE_MODULE_PV}.tar.gz"
+HTTP_HEADERS_MORE_MODULE_WD="${WORKDIR}/headers-more-nginx-module-${HTTP_HEADERS_MORE_MODULE_PV}"
+
+# http_cache_purge (http://labs.frickle.com/nginx_ngx_cache_purge/, BSD-2 license)
+HTTP_CACHE_PURGE_MODULE_PV="2.3"
+HTTP_CACHE_PURGE_MODULE_P="ngx_http_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+HTTP_CACHE_PURGE_MODULE_URI="http://labs.frickle.com/files/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}.tar.gz"
+HTTP_CACHE_PURGE_MODULE_WD="${WORKDIR}/ngx_cache_purge-${HTTP_CACHE_PURGE_MODULE_PV}"
+
+# http_slowfs_cache (http://labs.frickle.com/nginx_ngx_slowfs_cache/, BSD-2 license)
+HTTP_SLOWFS_CACHE_MODULE_PV="1.10"
+HTTP_SLOWFS_CACHE_MODULE_P="ngx_http_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+HTTP_SLOWFS_CACHE_MODULE_URI="http://labs.frickle.com/files/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}.tar.gz"
+HTTP_SLOWFS_CACHE_MODULE_WD="${WORKDIR}/ngx_slowfs_cache-${HTTP_SLOWFS_CACHE_MODULE_PV}"
+
+# http_fancyindex (https://github.com/aperezdc/ngx-fancyindex, BSD license)
+HTTP_FANCYINDEX_MODULE_PV="0.3.5"
+HTTP_FANCYINDEX_MODULE_P="ngx_http_fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+HTTP_FANCYINDEX_MODULE_URI="https://github.com/aperezdc/ngx-fancyindex/archive/v${HTTP_FANCYINDEX_MODULE_PV}.tar.gz"
+HTTP_FANCYINDEX_MODULE_WD="${WORKDIR}/ngx-fancyindex-${HTTP_FANCYINDEX_MODULE_PV}"
+
+# http_lua (https://github.com/openresty/lua-nginx-module, BSD license)
+HTTP_LUA_MODULE_PV="0.9.16"
+HTTP_LUA_MODULE_P="ngx_http_lua-${HTTP_LUA_MODULE_PV}"
+HTTP_LUA_MODULE_URI="https://github.com/openresty/lua-nginx-module/archive/v${HTTP_LUA_MODULE_PV}.tar.gz"
+HTTP_LUA_MODULE_WD="${WORKDIR}/lua-nginx-module-${HTTP_LUA_MODULE_PV}"
+
+# http_auth_pam (https://github.com/stogh/ngx_http_auth_pam_module/, http://web.iti.upv.es/~sto/nginx/, BSD-2 license)
+HTTP_AUTH_PAM_MODULE_PV="1.4"
+HTTP_AUTH_PAM_MODULE_P="ngx_http_auth_pam-${HTTP_AUTH_PAM_MODULE_PV}"
+HTTP_AUTH_PAM_MODULE_URI="https://github.com/stogh/ngx_http_auth_pam_module/archive/v${HTTP_AUTH_PAM_MODULE_PV}.tar.gz"
+HTTP_AUTH_PAM_MODULE_WD="${WORKDIR}/ngx_http_auth_pam_module-${HTTP_AUTH_PAM_MODULE_PV}"
+
+# http_upstream_check (https://github.com/yaoweibin/nginx_upstream_check_module, BSD license)
+HTTP_UPSTREAM_CHECK_MODULE_PV="0.3.0"
+HTTP_UPSTREAM_CHECK_MODULE_P="ngx_http_upstream_check-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+HTTP_UPSTREAM_CHECK_MODULE_URI="https://github.com/yaoweibin/nginx_upstream_check_module/archive/v${HTTP_UPSTREAM_CHECK_MODULE_PV}.tar.gz"
+HTTP_UPSTREAM_CHECK_MODULE_WD="${WORKDIR}/nginx_upstream_check_module-${HTTP_UPSTREAM_CHECK_MODULE_PV}"
+
+# http_metrics (https://github.com/zenops/ngx_metrics, BSD license)
+HTTP_METRICS_MODULE_PV="0.1.1"
+HTTP_METRICS_MODULE_P="ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+HTTP_METRICS_MODULE_URI="https://github.com/madvertise/ngx_metrics/archive/v${HTTP_METRICS_MODULE_PV}.tar.gz"
+HTTP_METRICS_MODULE_WD="${WORKDIR}/ngx_metrics-${HTTP_METRICS_MODULE_PV}"
+
+# naxsi-core (https://github.com/nbs-system/naxsi, GPLv2+)
+HTTP_NAXSI_MODULE_PV="0.53-2"
+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 (http://github.com/arut/nginx-rtmp-module, BSD license)
+RTMP_MODULE_PV="1.1.7"
+RTMP_MODULE_P="ngx_rtmp-${RTMP_MODULE_PV}"
+RTMP_MODULE_URI="http://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 (http://github.com/arut/nginx-dav-ext-module, BSD license)
+HTTP_DAV_EXT_MODULE_PV="0.0.3"
+HTTP_DAV_EXT_MODULE_P="ngx_http_dav_ext-${HTTP_DAV_EXT_MODULE_PV}"
+HTTP_DAV_EXT_MODULE_URI="http://github.com/arut/nginx-dav-ext-module/archive/v${HTTP_DAV_EXT_MODULE_PV}.tar.gz"
+HTTP_DAV_EXT_MODULE_WD="${WORKDIR}/nginx-dav-ext-module-${HTTP_DAV_EXT_MODULE_PV}"
+
+# echo-nginx-module (https://github.com/agentzh/echo-nginx-module, BSD license)
+HTTP_ECHO_MODULE_PV="0.58"
+HTTP_ECHO_MODULE_P="ngx_http_echo-${HTTP_ECHO_MODULE_PV}"
+HTTP_ECHO_MODULE_URI="https://github.com/agentzh/echo-nginx-module/archive/v${HTTP_ECHO_MODULE_PV}.tar.gz"
+HTTP_ECHO_MODULE_WD="${WORKDIR}/echo-nginx-module-${HTTP_ECHO_MODULE_PV}"
+
+# mod_security for nginx (https://modsecurity.org/, Apache-2.0)
+# keep the MODULE_P here consistent with upstream to avoid tarball duplication
+HTTP_SECURITY_MODULE_PV="2.9.0"
+HTTP_SECURITY_MODULE_P="modsecurity-${HTTP_SECURITY_MODULE_PV}"
+HTTP_SECURITY_MODULE_URI="https://www.modsecurity.org/tarball/${HTTP_SECURITY_MODULE_PV}/${HTTP_SECURITY_MODULE_P}.tar.gz"
+HTTP_SECURITY_MODULE_WD="${WORKDIR}/${HTTP_SECURITY_MODULE_P}"
+
+# push-stream-module (http://www.nginxpushstream.com, https://github.com/wandenberg/nginx-push-stream-module, GPL-3)
+HTTP_PUSH_STREAM_MODULE_PV="0.5.1"
+HTTP_PUSH_STREAM_MODULE_P="ngx_http_push_stream-${HTTP_PUSH_STREAM_MODULE_PV}"
+HTTP_PUSH_STREAM_MODULE_URI="https://github.com/wandenberg/nginx-push-stream-module/archive/${HTTP_PUSH_STREAM_MODULE_PV}.tar.gz"
+HTTP_PUSH_STREAM_MODULE_WD="${WORKDIR}/nginx-push-stream-module-${HTTP_PUSH_STREAM_MODULE_PV}"
+
+# sticky-module (https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng, BSD-2)
+HTTP_STICKY_MODULE_PV="1.2.5"
+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-bd312d586752"
+
+# mogilefs-module (http://www.grid.net.ru/nginx/mogilefs.en.html, BSD-2)
+HTTP_MOGILEFS_MODULE_PV="1.0.4"
+HTTP_MOGILEFS_MODULE_P="ngx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+HTTP_MOGILEFS_MODULE_URI="http://www.grid.net.ru/nginx/download/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}.tar.gz"
+HTTP_MOGILEFS_MODULE_WD="${WORKDIR}/nginx_mogilefs_module-${HTTP_MOGILEFS_MODULE_PV}"
+
+# memc-module (https://github.com/openresty/memc-nginx-module, BSD-2)
+HTTP_MEMC_MODULE_PV="0.16"
+HTTP_MEMC_MODULE_P="ngx_memc_module-${HTTP_MEMC_MODULE_PV}"
+HTTP_MEMC_MODULE_URI="https://github.com/openresty/memc-nginx-module/archive/v${HTTP_MEMC_MODULE_PV}.tar.gz"
+HTTP_MEMC_MODULE_WD="${WORKDIR}/memc-nginx-module-${HTTP_MEMC_MODULE_PV}"
+
+inherit eutils ssl-cert toolchain-funcs perl-module flag-o-matic user systemd versionator multilib
+
+DESCRIPTION="Robust, small and high performance http and reverse proxy server"
+HOMEPAGE="http://nginx.org"
+SRC_URI="http://nginx.org/download/${P}.tar.gz
+ ${DEVEL_KIT_MODULE_URI} -> ${DEVEL_KIT_MODULE_P}.tar.gz
+ nginx_modules_http_upload_progress? ( ${HTTP_UPLOAD_PROGRESS_MODULE_URI} -> ${HTTP_UPLOAD_PROGRESS_MODULE_P}.tar.gz )
+ nginx_modules_http_headers_more? ( ${HTTP_HEADERS_MORE_MODULE_URI} -> ${HTTP_HEADERS_MORE_MODULE_P}.tar.gz )
+ nginx_modules_http_cache_purge? ( ${HTTP_CACHE_PURGE_MODULE_URI} -> ${HTTP_CACHE_PURGE_MODULE_P}.tar.gz )
+ nginx_modules_http_slowfs_cache? ( ${HTTP_SLOWFS_CACHE_MODULE_URI} -> ${HTTP_SLOWFS_CACHE_MODULE_P}.tar.gz )
+ nginx_modules_http_fancyindex? ( ${HTTP_FANCYINDEX_MODULE_URI} -> ${HTTP_FANCYINDEX_MODULE_P}.tar.gz )
+ nginx_modules_http_lua? ( ${HTTP_LUA_MODULE_URI} -> ${HTTP_LUA_MODULE_P}.tar.gz )
+ nginx_modules_http_auth_pam? ( ${HTTP_AUTH_PAM_MODULE_URI} -> ${HTTP_AUTH_PAM_MODULE_P}.tar.gz )
+ nginx_modules_http_upstream_check? ( ${HTTP_UPSTREAM_CHECK_MODULE_URI} -> ${HTTP_UPSTREAM_CHECK_MODULE_P}.tar.gz )
+ nginx_modules_http_metrics? ( ${HTTP_METRICS_MODULE_URI} -> ${HTTP_METRICS_MODULE_P}.tar.gz )
+ nginx_modules_http_naxsi? ( ${HTTP_NAXSI_MODULE_URI} -> ${HTTP_NAXSI_MODULE_P}.tar.gz )
+ rtmp? ( ${RTMP_MODULE_URI} -> ${RTMP_MODULE_P}.tar.gz )
+ nginx_modules_http_dav_ext? ( ${HTTP_DAV_EXT_MODULE_URI} -> ${HTTP_DAV_EXT_MODULE_P}.tar.gz )
+ nginx_modules_http_echo? ( ${HTTP_ECHO_MODULE_URI} -> ${HTTP_ECHO_MODULE_P}.tar.gz )
+ nginx_modules_http_security? ( ${HTTP_SECURITY_MODULE_URI} -> ${HTTP_SECURITY_MODULE_P}.tar.gz )
+ nginx_modules_http_push_stream? ( ${HTTP_PUSH_STREAM_MODULE_URI} -> ${HTTP_PUSH_STREAM_MODULE_P}.tar.gz )
+ nginx_modules_http_sticky? ( ${HTTP_STICKY_MODULE_URI} -> ${HTTP_STICKY_MODULE_P}.tar.bz2 )
+ nginx_modules_http_mogilefs? ( ${HTTP_MOGILEFS_MODULE_URI} -> ${HTTP_MOGILEFS_MODULE_P}.tar.gz )
+ nginx_modules_http_memc? ( ${HTTP_MEMC_MODULE_URI} -> ${HTTP_MEMC_MODULE_P}.tar.gz )"
+
+LICENSE="BSD-2 BSD SSLeay MIT GPL-2 GPL-2+
+ nginx_modules_http_security? ( Apache-2.0 )
+ nginx_modules_http_push_stream? ( GPL-3 )"
+
+SLOT="mainline"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+
+NGINX_MODULES_STD="access auth_basic autoindex browser charset empty_gif fastcgi
+geo gzip limit_req limit_conn map memcached proxy referer rewrite scgi ssi
+split_clients upstream_ip_hash userid uwsgi"
+NGINX_MODULES_OPT="addition auth_request dav degradation flv geoip gunzip gzip_static
+image_filter mp4 perl random_index realip secure_link spdy stub_status sub xslt"
+NGINX_MODULES_MAIL="imap pop3 smtp"
+NGINX_MODULES_3RD="
+ http_upload_progress
+ http_headers_more
+ http_cache_purge
+ http_slowfs_cache
+ http_fancyindex
+ http_lua
+ http_auth_pam
+ http_upstream_check
+ http_metrics
+ http_naxsi
+ http_dav_ext
+ http_echo
+ http_security
+ http_push_stream
+ http_sticky
+ http_ajp
+ http_mogilefs
+ http_memc"
+
+IUSE="aio debug +http +http-cache ipv6 libatomic luajit +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_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] )
+ ssl? ( dev-libs/openssl:0= )
+ http-cache? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_geoip? ( dev-libs/geoip )
+ nginx_modules_http_gunzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip? ( sys-libs/zlib )
+ nginx_modules_http_gzip_static? ( sys-libs/zlib )
+ nginx_modules_http_image_filter? ( media-libs/gd[jpeg,png] )
+ nginx_modules_http_perl? ( >=dev-lang/perl-5.8 )
+ nginx_modules_http_rewrite? ( >=dev-libs/libpcre-4.2 )
+ nginx_modules_http_secure_link? ( userland_GNU? ( dev-libs/openssl:0= ) )
+ nginx_modules_http_spdy? ( >=dev-libs/openssl-1.0.1c:0= )
+ nginx_modules_http_xslt? ( dev-libs/libxml2 dev-libs/libxslt )
+ nginx_modules_http_lua? ( !luajit? ( dev-lang/lua:0= ) luajit? ( dev-lang/luajit:2= ) )
+ nginx_modules_http_auth_pam? ( virtual/pam )
+ nginx_modules_http_metrics? ( dev-libs/yajl )
+ nginx_modules_http_dav_ext? ( dev-libs/expat )
+ nginx_modules_http_security? ( >=dev-libs/libxml2-2.7.8 dev-libs/apr-util www-servers/apache )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-nginx )
+ !www-servers/nginx:0"
+DEPEND="${CDEPEND}
+ arm? ( dev-libs/libatomic_ops )
+ libatomic? ( dev-libs/libatomic_ops )"
+PDEPEND="vim-syntax? ( app-vim/nginx-syntax )"
+
+REQUIRED_USE="pcre-jit? ( pcre )
+ nginx_modules_http_lua? ( nginx_modules_http_rewrite )
+ nginx_modules_http_naxsi? ( pcre )
+ nginx_modules_http_dav_ext? ( nginx_modules_http_dav )
+ nginx_modules_http_metrics? ( nginx_modules_http_stub_status )
+ nginx_modules_http_security? ( pcre )
+ nginx_modules_http_push_stream? ( ssl )"
+
+pkg_setup() {
+ NGINX_HOME="/var/lib/nginx"
+ NGINX_HOME_TMP="${NGINX_HOME}/tmp"
+
+ ebegin "Creating nginx user and group"
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 "${NGINX_HOME}" ${PN}
+ eend $?
+
+ if use libatomic; then
+ ewarn "GCC 4.1+ features built-in atomic operations."
+ ewarn "Using libatomic_ops is only needed if using"
+ ewarn "a different compiler or a GCC prior to 4.1"
+ fi
+
+ if [[ -n $NGINX_ADD_MODULES ]]; then
+ ewarn "You are building custom modules via \$NGINX_ADD_MODULES!"
+ ewarn "This nginx installation is not supported!"
+ ewarn "Make sure you can reproduce the bug without those modules"
+ ewarn "_before_ reporting bugs."
+ fi
+
+ if use !http; then
+ ewarn "To actually disable all http-functionality you also have to disable"
+ ewarn "all nginx http modules."
+ fi
+
+ if use nginx_modules_http_ajp; then
+ eerror "The AJP module currently doesn't build for nginx >1.8."
+ eerror "It will be reintroduced with the 1.9 series when proven stable."
+ eerror "Either disable it or stick with nginx 1.7.x."
+ die "AJP module not supported"
+ fi
+
+ if use nginx_modules_http_mogilefs && use threads; then
+ eerror "mogilefs won't compile with threads support."
+ eerror "Please disable either flag and try again."
+ die "Can't compile mogilefs with threads support"
+ fi
+}
+
+src_prepare() {
+ epatch_user
+
+ epatch "${FILESDIR}/${PN}-1.4.1-fix-perl-install-path.patch"
+
+ if use nginx_modules_http_upstream_check; then
+ epatch "${FILESDIR}/check-1.9.2".patch
+ fi
+
+ if use nginx_modules_http_lua; then
+ sed -i -e 's/-llua5.1/-llua/' "${HTTP_LUA_MODULE_WD}/config" || die
+ fi
+
+ find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& \\$(MAKE):' || die
+ # We have config protection, don't rename etc files
+ sed -i 's:.default::' auto/install || die
+ # remove useless files
+ sed -i -e '/koi-/d' -e '/win-/d' auto/install || die
+
+ # don't install to /etc/nginx/ if not in use
+ local module
+ for module in fastcgi scgi uwsgi ; do
+ if ! use nginx_modules_http_${module}; then
+ sed -i -e "/${module}/d" auto/install || die
+ fi
+ done
+}
+
+src_configure() {
+ # mod_security needs to generate nginx/modsecurity/config before including it
+ if use nginx_modules_http_security; then
+ cd "${HTTP_SECURITY_MODULE_WD}"
+ if use luajit ; then
+ sed -i \
+ -e 's|^\(LUA_PKGNAMES\)=.*|\1="luajit"|' \
+ configure || die
+ fi
+ ./configure \
+ --enable-standalone-module \
+ $(use_enable pcre-jit) \
+ $(use_with nginx_modules_http_lua lua) || die "configure failed for mod_security"
+ fi
+
+ cd "${S}"
+
+ local myconf=() http_enabled= mail_enabled=
+
+ use aio && myconf+=( --with-file-aio )
+ use debug && myconf+=( --with-debug )
+ use ipv6 && myconf+=( --with-ipv6 )
+ use libatomic && myconf+=( --with-libatomic )
+ use pcre && myconf+=( --with-pcre )
+ use pcre-jit && myconf+=( --with-pcre-jit )
+ use threads && myconf+=( --with-threads )
+
+ # HTTP modules
+ for mod in $NGINX_MODULES_STD; do
+ if use nginx_modules_http_${mod}; then
+ http_enabled=1
+ else
+ myconf+=( --without-http_${mod}_module )
+ fi
+ done
+
+ for mod in $NGINX_MODULES_OPT; do
+ if use nginx_modules_http_${mod}; then
+ http_enabled=1
+ myconf+=( --with-http_${mod}_module )
+ fi
+ done
+
+ if use nginx_modules_http_fastcgi; then
+ myconf+=( --with-http_realip_module )
+ fi
+
+ # third-party modules
+ if use nginx_modules_http_upload_progress; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_UPLOAD_PROGRESS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_headers_more; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_HEADERS_MORE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_CACHE_PURGE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_SLOWFS_CACHE_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_FANCYINDEX_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_lua; then
+ http_enabled=1
+ if use luajit; then
+ export LUAJIT_LIB=$(pkg-config --variable libdir luajit)
+ export LUAJIT_INC=$(pkg-config --variable includedir luajit)
+ else
+ export LUA_LIB=$(pkg-config --variable libdir lua)
+ export LUA_INC=$(pkg-config --variable includedir lua)
+ fi
+ myconf+=( --add-module=${DEVEL_KIT_MODULE_WD} )
+ myconf+=( --add-module=${HTTP_LUA_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_AUTH_PAM_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_UPSTREAM_CHECK_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_metrics; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_METRICS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_naxsi ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_NAXSI_MODULE_WD} )
+ fi
+
+ if use rtmp ; then
+ http_enabled=1
+ myconf+=( --add-module=${RTMP_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_dav_ext ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_DAV_EXT_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_echo ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_ECHO_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_security ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_SECURITY_MODULE_WD}/nginx/modsecurity )
+ fi
+
+ if use nginx_modules_http_push_stream ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_PUSH_STREAM_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_sticky ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_STICKY_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_mogilefs ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_MOGILEFS_MODULE_WD} )
+ fi
+
+ if use nginx_modules_http_memc ; then
+ http_enabled=1
+ myconf+=( --add-module=${HTTP_MEMC_MODULE_WD} )
+ fi
+
+ if use 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/$(get_libdir)" \
+ --http-log-path="${EPREFIX}"/var/log/${PN}/access_log \
+ --http-client-body-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/client \
+ --http-proxy-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/proxy \
+ --http-fastcgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/fastcgi \
+ --http-scgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/scgi \
+ --http-uwsgi-temp-path="${EPREFIX}${NGINX_HOME_TMP}"/uwsgi \
+ "${myconf[@]}" || die "configure failed"
+
+ # A purely cosmetic change that makes nginx -V more readable. This can be
+ # good if people outside the gentoo community would troubleshoot and
+ # question the users setup.
+ sed -i -e "s|${WORKDIR}|external_module|g" objs/ngx_auto_config.h || die
+}
+
+src_compile() {
+ use nginx_modules_http_security && emake -C "${HTTP_SECURITY_MODULE_WD}"
+
+ # https://bugs.gentoo.org/286772
+ export LANG=C LC_ALL=C
+ emake LINK="${CC} ${LDFLAGS}" OTHERLDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+
+ cp "${FILESDIR}"/nginx.conf "${ED}"etc/nginx/nginx.conf || die
+
+ newinitd "${FILESDIR}"/nginx.initd-r2 nginx
+
+ systemd_newunit "${FILESDIR}"/nginx.service-r1 nginx.service
+
+ doman man/nginx.8
+ dodoc CHANGES* README
+
+ # just keepdir. do not copy the default htdocs files (bug #449136)
+ keepdir /var/www/localhost
+ rm -rf "${D}"usr/html || die
+
+ # set up a list of directories to keep
+ local keepdir_list="${NGINX_HOME_TMP}"/client
+ local module
+ for module in proxy fastcgi scgi uwsgi; do
+ use nginx_modules_http_${module} && keepdir_list+=" ${NGINX_HOME_TMP}/${module}"
+ done
+
+ keepdir /var/log/nginx ${keepdir_list}
+
+ # this solves a problem with SELinux where nginx doesn't see the directories
+ # as root and tries to create them as nginx
+ fperms 0750 "${NGINX_HOME_TMP}"
+ fowners ${PN}:0 "${NGINX_HOME_TMP}"
+
+ fperms 0700 /var/log/nginx ${keepdir_list}
+ fowners ${PN}:${PN} /var/log/nginx ${keepdir_list}
+
+ # logrotate
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/nginx.logrotate-r1 nginx
+
+ if use nginx_modules_http_perl; then
+ cd "${S}"/objs/src/http/modules/perl/
+ emake DESTDIR="${D}" INSTALLDIRS=vendor
+ perl_delete_localpod
+ fi
+
+ if use nginx_modules_http_cache_purge; then
+ docinto ${HTTP_CACHE_PURGE_MODULE_P}
+ dodoc "${HTTP_CACHE_PURGE_MODULE_WD}"/{CHANGES,README.md,TODO.md}
+ fi
+
+ if use nginx_modules_http_slowfs_cache; then
+ docinto ${HTTP_SLOWFS_CACHE_MODULE_P}
+ dodoc "${HTTP_SLOWFS_CACHE_MODULE_WD}"/{CHANGES,README.md}
+ fi
+
+ if use nginx_modules_http_fancyindex; then
+ docinto ${HTTP_FANCYINDEX_MODULE_P}
+ dodoc "${HTTP_FANCYINDEX_MODULE_WD}"/README.rst
+ fi
+
+ if use nginx_modules_http_lua; then
+ docinto ${HTTP_LUA_MODULE_P}
+ dodoc "${HTTP_LUA_MODULE_WD}"/{Changes,README.markdown}
+ fi
+
+ if use nginx_modules_http_auth_pam; then
+ docinto ${HTTP_AUTH_PAM_MODULE_P}
+ dodoc "${HTTP_AUTH_PAM_MODULE_WD}"/{README.md,ChangeLog}
+ fi
+
+ if use nginx_modules_http_upstream_check; then
+ docinto ${HTTP_UPSTREAM_CHECK_MODULE_P}
+ dodoc "${HTTP_UPSTREAM_CHECK_MODULE_WD}"/{README,CHANGES}
+ fi
+
+ if use nginx_modules_http_naxsi; then
+ insinto /etc/nginx
+ doins "${HTTP_NAXSI_MODULE_WD}"/../naxsi_config/naxsi_core.rules
+ fi
+
+ if use rtmp; then
+ docinto ${RTMP_MODULE_P}
+ dodoc "${RTMP_MODULE_WD}"/{AUTHORS,README.md,stat.xsl}
+ fi
+
+ if use nginx_modules_http_dav_ext; then
+ docinto ${HTTP_DAV_EXT_MODULE_P}
+ dodoc "${HTTP_DAV_EXT_MODULE_WD}"/README
+ fi
+
+ if use nginx_modules_http_echo; then
+ docinto ${HTTP_ECHO_MODULE_P}
+ dodoc "${HTTP_ECHO_MODULE_WD}"/{README.markdown,doc/HttpEchoModule.wiki}
+ fi
+
+ if use nginx_modules_http_security; then
+ docinto ${HTTP_SECURITY_MODULE_P}
+ dodoc "${HTTP_SECURITY_MODULE_WD}"/{CHANGES,README.TXT,authors.txt}
+ fi
+
+ if use nginx_modules_http_push_stream; then
+ docinto ${HTTP_PUSH_STREAM_MODULE_P}
+ dodoc "${HTTP_PUSH_STREAM_MODULE_WD}"/{AUTHORS,CHANGELOG.textile,README.textile}
+ fi
+
+ if use nginx_modules_http_sticky; then
+ docinto ${HTTP_STICKY_MODULE_P}
+ dodoc "${HTTP_STICKY_MODULE_WD}"/{README.md,Changelog.txt,docs/sticky.pdf}
+ fi
+
+ if use nginx_modules_http_memc; then
+ docinto ${HTTP_MEMC_MODULE_P}
+ dodoc "${HTTP_MEMC_MODULE_WD}"/README.markdown
+ fi
+}
+
+pkg_postinst() {
+ if use ssl; then
+ if [ ! -f "${EROOT}"etc/ssl/${PN}/${PN}.key ]; then
+ install_cert /etc/ssl/${PN}/${PN}
+ use prefix || chown ${PN}:${PN} "${EROOT}"etc/ssl/${PN}/${PN}.{crt,csr,key,pem}
+ fi
+ fi
+
+ if use nginx_modules_http_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 -f o-rwx "${EPREFIX}"/var/log/nginx "${EPREFIX}${NGINX_HOME_TMP}"/{,client,proxy,fastcgi,scgi,uwsgi}
+ fi
+
+ # If the nginx user can't change into or read the dir, display a warning.
+ # If su is not available we display the warning nevertheless since we can't check properly
+ su -s /bin/sh -c 'cd /var/log/nginx/ && ls' nginx >&/dev/null
+ if [ $? -ne 0 ] ; then
+ ewarn "Please make sure that the nginx user or group has at least"
+ ewarn "'rx' permissions on /var/log/nginx (default on a fresh install)"
+ ewarn "Otherwise you end up with empty log files after a logrotate."
+ fi
+}
diff --git a/www-servers/ocsigenserver/Manifest b/www-servers/ocsigenserver/Manifest
new file mode 100644
index 000000000000..b387c9c5d47e
--- /dev/null
+++ b/www-servers/ocsigenserver/Manifest
@@ -0,0 +1,2 @@
+DIST ocsigenserver-2.5.tar.gz 1259472 SHA256 d9107e0543a286b2264b0f4255886cdc3670196d5453a689da2985c7e5a7df2b SHA512 8d90ce99bdda2fefdc0d22497badfa885ff310801c6cc205e0360e823964b4b01a1fecef8549121647abfd113bfe45a0b6cb306a326b26657bd95fbafaa59e72 WHIRLPOOL 9feac8009a83520d3f82c3e4162d72cdff7e54b5077af63e1b04d63da0364035480de5a30f04f23c6124e0d4dd4c6c885687d2a24e00b1432b23d572bf90f13e
+DIST ocsigenserver-2.6.tar.gz 1261542 SHA256 f70751f1a1dcc9b9021f0773e92347bdbdb50f7c90b79a95dc5a6b90e9ee6818 SHA512 56805378d375de7e7653f74b3681fe21c798df2c50ee6889bd238df8f64aa053dfdbd1df2b6396b2f8c9ed8547b8176ef9498ccbf19df4bf111469353a6d9434 WHIRLPOOL 5128a3a429db49a5f8161cf008c91020c0e40e5bd58716adeee5580222bae0393dfdd73ffa01f167626f46e699ffff3e76b1aa0fb8c91d53889dc6e15cbe1ea9
diff --git a/www-servers/ocsigenserver/files/lwt.patch b/www-servers/ocsigenserver/files/lwt.patch
new file mode 100644
index 000000000000..360b2b06e913
--- /dev/null
+++ b/www-servers/ocsigenserver/files/lwt.patch
@@ -0,0 +1,19 @@
+commit 156f8deaae2a50d8b9614b99488f34b284382eaa
+Author: Drup <drupyog@zoho.com>
+Date: Thu Dec 11 16:52:33 2014 +0100
+
+ Remove dependency to Lwt_util.
+
+diff --git a/src/server/ocsigen_server.ml b/src/server/ocsigen_server.ml
+index c5563a6..e548f5e 100644
+--- a/src/server/ocsigen_server.ml
++++ b/src/server/ocsigen_server.ml
+@@ -1040,7 +1040,7 @@ let rec wait_connection use_ssl port socket =
+ >>= decr_connected
+ in
+
+- Lwt_util.iter handle_one l >>= fun () ->
++ Lwt_list.iter_p handle_one l >>= fun () ->
+ match e with
+ | Some e -> handle_exn e
+ | None -> Lwt.return ())
diff --git a/www-servers/ocsigenserver/files/lwt2.patch b/www-servers/ocsigenserver/files/lwt2.patch
new file mode 100644
index 000000000000..9b9e1b808853
--- /dev/null
+++ b/www-servers/ocsigenserver/files/lwt2.patch
@@ -0,0 +1,19 @@
+commit faaa943aacaeaee27e5a309bb54bd539ec1a58a2
+Author: Drup <drupyog@zoho.com>
+Date: Sat Dec 6 05:08:13 2014 +0100
+
+ Replace use of the deprecated `Lwt_event` by `Lwt_react.E`.
+
+diff --git a/src/extensions/ocsigen_comet.ml b/src/extensions/ocsigen_comet.ml
+index ad7d9dd..ccc0719 100644
+--- a/src/extensions/ocsigen_comet.ml
++++ b/src/extensions/ocsigen_comet.ml
+@@ -468,7 +468,7 @@ end = struct
+ Lwt.choose
+ [ (choosed >|= fun x -> Some x);
+ (Lwt_unix.sleep (get_timeout ()) >|= fun () -> None);
+- (Lwt_event.next Security.kill >>= fun () -> Lwt.fail Kill);
++ (Lwt_react.E.next Security.kill >>= fun () -> Lwt.fail Kill);
+ ] >|= fun x ->
+ List.iter (fun c -> Channels.send_listeners c (-1)) active ;
+ let s = Messages.encode_downgoing ended x in
diff --git a/www-servers/ocsigenserver/files/lwt3.patch b/www-servers/ocsigenserver/files/lwt3.patch
new file mode 100644
index 000000000000..d2a9ca578fe2
--- /dev/null
+++ b/www-servers/ocsigenserver/files/lwt3.patch
@@ -0,0 +1,86 @@
+commit 5b60babe229189c2be999e138c500527334c3415
+Author: pveber <philippe.veber@gmail.com>
+Date: Fri Feb 27 09:24:50 2015 +0100
+
+ fix configure and Makefiles following lwt.extra deprecation
+
+ Now that lwt.extra has been deprecated [0], the configure and Makefile
+ scripts should refer directly to lwt.preemptive.
+
+ [0] https://github.com/ocsigen/lwt/commit/91d549b54397a33ed80de962771d07180c4b8d4e
+
+Index: ocsigenserver-2.5/Makefile.options
+===================================================================
+--- ocsigenserver-2.5.orig/Makefile.options
++++ ocsigenserver-2.5/Makefile.options
+@@ -26,14 +26,14 @@ endif
+ ## but also to generate src/baselib/ocsigen_config.ml and src/files/META
+
+ ifeq "$(PREEMPTIVE)" "YES"
+-LWT_EXTRA_PACKAGE:=lwt.extra
++LWT_PREEMPTIVE_PACKAGE:=lwt.preemptive
+ endif
+
+ BASE_PACKAGE := lwt ipaddr
+
+ SERVER_PACKAGE := lwt.ssl \
+- ${LWT_EXTRA_PACKAGE} \
+- ipaddr \
++ ${LWT_PREEMPTIVE_PACKAGE} \
++ ipaddr \
+ netstring \
+ netstring-pcre \
+ findlib \
+Index: ocsigenserver-2.5/configure
+===================================================================
+--- ocsigenserver-2.5.orig/configure
++++ ocsigenserver-2.5/configure
+@@ -410,7 +410,7 @@ check_library lwt "See: http://ocsigen.o
+ check_library lwt.unix "Missing support for 'unix' in lwt."
+ check_library lwt.react "Missing support for 'react' in lwt."
+ check_library lwt.ssl "Missing support for 'ssl' in lwt."
+-#check_library lwt.extra "Missing support for 'extra' in lwt."
++check_library lwt.preemptive "Missing support for 'preemptive' in lwt."
+
+ check_library netstring \
+ "See ocamlnet: http://projects.camlcity.org/projects/ocamlnet.html"
+@@ -454,12 +454,12 @@ if [ "$with_camlzip" -gt 0 ]; then
+ fi
+ fi
+
+-# Check Lwt.extra
++# Check Lwt.preemptive
+ if [ "$with_preempt" -gt 0 ]; then
+- if test_library lwt.extra; then
++ if test_library lwt.preemptive; then
+ echo -n
+ elif [ "$with_preempt" -gt 1 ]; then
+- fail_library lwt.extra "Missing support for 'extra' in lwt."
++ fail_library lwt.preemptive "Missing support for 'preemptive' in lwt."
+ else
+ with_preempt=0
+ fi
+Index: ocsigenserver-2.5/src/baselib/Makefile
+===================================================================
+--- ocsigenserver-2.5.orig/src/baselib/Makefile
++++ ocsigenserver-2.5/src/baselib/Makefile
+@@ -1,6 +1,6 @@
+ include ../../Makefile.config
+
+-LIBS := -package lwt.unix,netstring,netstring-pcre,cryptokit,findlib,tyxml,lwt.syntax,${LWT_EXTRA_PACKAGE},ipaddr
++LIBS := -package lwt.unix,netstring,netstring-pcre,cryptokit,findlib,tyxml,lwt.syntax,${LWT_PREEMPTIVE_PACKAGE},ipaddr
+ OCAMLC := $(OCAMLFIND) ocamlc${BYTEDBG} ${THREAD}
+ OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD}
+ OCAMLDOC := $(OCAMLFIND) ocamldoc
+Index: ocsigenserver-2.5/src/extensions/ocsipersist-dbm/Makefile
+===================================================================
+--- ocsigenserver-2.5.orig/src/extensions/ocsipersist-dbm/Makefile
++++ ocsigenserver-2.5/src/extensions/ocsipersist-dbm/Makefile
+@@ -1,6 +1,6 @@
+ include ../../../Makefile.config
+
+-PACKAGE := ${LWT_EXTRA_PACKAGE} \
++PACKAGE := ${LWT_PREEMPTIVE_PACKAGE} \
+ lwt.unix \
+ tyxml.parser \
+ dbm \
diff --git a/www-servers/ocsigenserver/files/ocsigenserver.confd b/www-servers/ocsigenserver/files/ocsigenserver.confd
new file mode 100644
index 000000000000..70638b7c8709
--- /dev/null
+++ b/www-servers/ocsigenserver/files/ocsigenserver.confd
@@ -0,0 +1,25 @@
+# /etc/conf.d/ocsigenserver : config file for /etc/init.d/ocsigenserver
+
+# Path for the ocsigen binary (add opt for native executable)
+
+#DAEMON=/usr/bin/ocsigenserver.opt
+DAEMON=/usr/bin/ocsigenserver
+
+# Name for ocsigen daemon
+
+NAME=ocsigenserver
+
+# Locstion of Ocsigen config file
+
+CONF=/etc/$NAME/ocsigenserver.conf
+
+# PID file location
+
+PIDFILE=/var/run/$NAME.pid
+
+# Add here any additional aptions for ocsigen
+
+OCSIGEN_OPTS=""
+
+# Command pipe
+COMMANDPIPE=/var/run/ocsigenserver_command
diff --git a/www-servers/ocsigenserver/files/ocsigenserver.initd b/www-servers/ocsigenserver/files/ocsigenserver.initd
new file mode 100644
index 000000000000..accf4753e179
--- /dev/null
+++ b/www-servers/ocsigenserver/files/ocsigenserver.initd
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="depend checkconfig reload"
+
+depend() {
+ need net
+ use logger
+ after bootmist
+}
+
+
+checkconfig() {
+ if [ ! -f "$DAEMON" ] ; then
+ ewarn "Unable to find $DAEMON"
+ return 1
+ fi
+ if [ ! -f "$CONF" ] ; then
+ ewarn $CONF " does not exist."
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Creating command pipe (${COMMANDPIPE})"
+ mkfifo -m 660 "${COMMANDPIPE}"
+ chown ocsigenserver:ocsigenserver "${COMMANDPIPE}"
+ eend $?
+
+ ebegin "Starting ocsigen"
+ start-stop-daemon --start --exec $DAEMON -- \
+ --pidfile $PIDFILE \
+ --daemon \
+ $OCSIGEN_OPTS
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ocsigen"
+ start-stop-daemon --stop --pidfile $PIDFILE
+ eend $?
+ ebegin "Removing command pipe (${COMMANDPIPE})"
+ rm -f "${COMMANDPIPE}"
+ eend $?
+}
+
+reload() {
+ if [ ! -f "$PIDFILE" ] ; then
+ ewarn "$PIDFILE not found!!"
+ ewarn "Ocsigen is not running. Not reloading."
+ return 1
+ fi
+ ebegin "Reloading ocsigen"
+ echo reload > /var/run/ocsigen_command
+ eend $?
+}
diff --git a/www-servers/ocsigenserver/metadata.xml b/www-servers/ocsigenserver/metadata.xml
new file mode 100644
index 000000000000..6c2941a2a9ed
--- /dev/null
+++ b/www-servers/ocsigenserver/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ml</herd>
+ <upstream>
+ <remote-id type="github">ocsigen/ocsigenserver</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/ocsigenserver/ocsigenserver-2.5-r2.ebuild b/www-servers/ocsigenserver/ocsigenserver-2.5-r2.ebuild
new file mode 100644
index 000000000000..b2a3ba40ad40
--- /dev/null
+++ b/www-servers/ocsigenserver/ocsigenserver-2.5-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib findlib user
+
+DESCRIPTION="Ocaml-powered webserver and framework for dynamic web programming"
+HOMEPAGE="http://www.ocsigen.org"
+SRC_URI="https://github.com/ocsigen/ocsigenserver/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1-with-linking-exception"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="debug doc dbm +ocamlopt +sqlite zlib"
+REQUIRED_USE="|| ( sqlite dbm )"
+RESTRICT="strip installsources"
+
+DEPEND=">=dev-ml/lwt-2.5.0:=[react,ssl]
+ >=dev-ml/react-0.9.3:=
+ zlib? ( >=dev-ml/camlzip-1.03-r1:= )
+ dev-ml/cryptokit:=
+ >=dev-ml/ocamlnet-3.6:=[pcre]
+ >=dev-ml/pcre-ocaml-6.2.5:=
+ >=dev-ml/tyxml-3.3:=
+ >=dev-lang/ocaml-3.12:=[ocamlopt?]
+ dev-ml/ocaml-ipaddr:=
+ dbm? ( || ( dev-ml/camldbm:= >=dev-lang/ocaml-3.12[gdbm] ) )
+ sqlite? ( dev-ml/ocaml-sqlite3:= )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup ocsigenserver
+ enewuser ocsigenserver -1 -1 /var/www ocsigenserver
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/lwt.patch"
+ epatch "${FILESDIR}/lwt2.patch"
+ epatch "${FILESDIR}/lwt3.patch"
+}
+
+src_configure() {
+ sh configure \
+ --prefix /usr \
+ --temproot "${ED}" \
+ --bindir /usr/bin \
+ --docdir /usr/share/doc/${PF} \
+ --mandir /usr/share/man/man1 \
+ --libdir /usr/$(get_libdir)/ocaml \
+ $(use_enable debug) \
+ $(use_with zlib camlzip) \
+ $(use_with sqlite) \
+ $(use_with dbm) \
+ --with-preempt \
+ --ocsigen-group ocsigenserver \
+ --ocsigen-user ocsigenserver \
+ --name ocsigenserver \
+ || die "Error : configure failed!"
+}
+
+src_compile() {
+ if use ocamlopt; then
+ emake
+ else
+ emake byte
+ fi
+ use doc && emake doc
+}
+
+src_install() {
+ findlib_src_preinst
+ if use ocamlopt; then
+ emake install
+ else
+ emake install.byte
+ fi
+ if use doc ; then
+ emake install.doc
+ fi
+ emake logrotate
+
+ newinitd "${FILESDIR}"/ocsigenserver.initd ocsigenserver || die
+ newconfd "${FILESDIR}"/ocsigenserver.confd ocsigenserver || die
+
+ dodoc README
+
+ # We create it at runtime
+ rm -f "${ED}/var/run/ocsigenserver_command" || die
+}
diff --git a/www-servers/ocsigenserver/ocsigenserver-2.6.ebuild b/www-servers/ocsigenserver/ocsigenserver-2.6.ebuild
new file mode 100644
index 000000000000..b5ef6ae2f66c
--- /dev/null
+++ b/www-servers/ocsigenserver/ocsigenserver-2.6.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib findlib user
+
+DESCRIPTION="Ocaml-powered webserver and framework for dynamic web programming"
+HOMEPAGE="http://www.ocsigen.org"
+SRC_URI="https://github.com/ocsigen/ocsigenserver/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1-with-linking-exception"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="debug doc dbm +ocamlopt +sqlite zlib"
+REQUIRED_USE="|| ( sqlite dbm )"
+RESTRICT="strip installsources"
+
+DEPEND=">=dev-ml/lwt-2.5.0:=[react,ssl]
+ >=dev-ml/react-0.9.3:=
+ zlib? ( >=dev-ml/camlzip-1.03-r1:= )
+ dev-ml/cryptokit:=
+ >=dev-ml/ocamlnet-3.6:=[pcre]
+ >=dev-ml/pcre-ocaml-6.2.5:=
+ >=dev-ml/tyxml-3.3:=
+ >=dev-lang/ocaml-3.12:=[ocamlopt?]
+ dev-ml/ocaml-ipaddr:=
+ dbm? ( || ( dev-ml/camldbm:= >=dev-lang/ocaml-3.12[gdbm] ) )
+ sqlite? ( dev-ml/ocaml-sqlite3:= )"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup ocsigenserver
+ enewuser ocsigenserver -1 -1 /var/www ocsigenserver
+}
+
+src_configure() {
+ sh configure \
+ --prefix /usr \
+ --temproot "${ED}" \
+ --bindir /usr/bin \
+ --docdir /usr/share/doc/${PF} \
+ --mandir /usr/share/man/man1 \
+ --libdir /usr/$(get_libdir)/ocaml \
+ $(use_enable debug) \
+ $(use_with zlib camlzip) \
+ $(use_with sqlite) \
+ $(use_with dbm) \
+ --with-preempt \
+ --ocsigen-group ocsigenserver \
+ --ocsigen-user ocsigenserver \
+ --name ocsigenserver \
+ || die "Error : configure failed!"
+}
+
+src_compile() {
+ if use ocamlopt; then
+ emake
+ else
+ emake byte
+ fi
+ use doc && emake doc
+}
+
+src_install() {
+ findlib_src_preinst
+ if use ocamlopt; then
+ emake install
+ else
+ emake install.byte
+ fi
+ if use doc ; then
+ emake install.doc
+ fi
+ emake logrotate
+
+ newinitd "${FILESDIR}"/ocsigenserver.initd ocsigenserver || die
+ newconfd "${FILESDIR}"/ocsigenserver.confd ocsigenserver || die
+
+ dodoc README.md
+
+ # We create it at runtime
+ rm -f "${ED}/var/run/ocsigenserver_command" || die
+}
diff --git a/www-servers/pathod/Manifest b/www-servers/pathod/Manifest
new file mode 100644
index 000000000000..9124bfd1fd20
--- /dev/null
+++ b/www-servers/pathod/Manifest
@@ -0,0 +1,3 @@
+DIST pathod-0.10.tar.gz 245837 SHA256 54170dcb03b1e5d693be87c0c069c16f6a794b64f86c9abb96996b13f2382ebf SHA512 c096268cdd459ffaf2ced67699be57bdcdc51db271ce141734d4984795d045ef24a7301f18d67af9b48d802b5107d246ec891b5eed5dace52d0835c2c7dbb336 WHIRLPOOL 09aecc68e43f5948aaded63bbcc5c705f2584dbf3aba207ed24a3975586b6fd1ed860d73e364f8f37dd0addabd74b5d4fc65bc78656597d70e617dc27f79c68a
+DIST pathod-0.11.1.tar.gz 271616 SHA256 69d91a494a8ac71e8d1e2c0cc7140fc52be0a04aa37f7fc8560ca3b168479058 SHA512 8fa4957bd7f25492a9db58eec7e83a67cd998bda17f93224435ef3f75ed6723bec96d24e20956069d148af3708d81f04d9089c2302d260d3ba95c1993ee0954e WHIRLPOOL 4120b9fa4471529201de98345be86cbbdd2cded9ca7d6dace51ea2bae47ea48e6e542367bd8594a4213982b2e5635c83cf9df3581e8496467fc56efdc20baff6
+DIST pathod-0.12.0.tar.gz 228515 SHA256 4c43a442f77dc1fae9bad8c22380661a80563c0d367e51772df7f37293bce001 SHA512 5273736b972670e009d24b610ff1e43d1296ae5e5a42e360fdd7ea3aa355016c02ceccd8b6d342e99b754b5fbd9f7beca92852607b9dd3af9d395128453fd0af WHIRLPOOL f32f917df02a11aa0f6fad02e15dcb0b3476aa00889747f1e29f389d6a727d2fb3c4c6a3ebb9eac2b8eba5d14065fd2bec17dbd427a927dd6af38ec1764af3b6
diff --git a/www-servers/pathod/metadata.xml b/www-servers/pathod/metadata.xml
new file mode 100644
index 000000000000..a7f2d4e455e4
--- /dev/null
+++ b/www-servers/pathod/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>radhermit@gentoo.org</email>
+ <name>Tim Harder</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">pathod</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/pathod/pathod-0.10.ebuild b/www-servers/pathod/pathod-0.10.ebuild
new file mode 100644
index 000000000000..0e3afcafa063
--- /dev/null
+++ b/www-servers/pathod/pathod-0.10.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="A collection of pathological tools for testing and torturing HTTP clients and servers"
+HOMEPAGE="http://pathod.net/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND=">=dev-python/netlib-${PV}[${PYTHON_USEDEP}]
+ >=dev-python/requests-1.1.0[${PYTHON_USEDEP}]
+ dev-python/flask[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ test? ( >=dev-python/nose-1.3.0[${PYTHON_USEDEP}] )"
+
+python_test() {
+ nosetests -v || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/pathod/pathod-0.11.1.ebuild b/www-servers/pathod/pathod-0.11.1.ebuild
new file mode 100644
index 000000000000..ba229673a788
--- /dev/null
+++ b/www-servers/pathod/pathod-0.11.1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="A collection of pathological tools for testing and torturing HTTP clients and servers"
+HOMEPAGE="http://pathod.net/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND=">=dev-python/netlib-${PV}[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.4.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-0.10.1[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ test? ( >=dev-python/nose-1.3.0[${PYTHON_USEDEP}] )"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ # remove bundled netlib
+ rm -r netlib || die
+
+ # remove unnecessary pip dep
+ sed -i '/pip/d' setup.py || die
+}
+
+python_test() {
+ nosetests -v || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/pathod/pathod-0.12.0.ebuild b/www-servers/pathod/pathod-0.12.0.ebuild
new file mode 100644
index 000000000000..06d810d26dde
--- /dev/null
+++ b/www-servers/pathod/pathod-0.12.0.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+DESCRIPTION="A collection of pathological tools for testing and torturing HTTP clients and servers"
+HOMEPAGE="http://pathod.net/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND=">=dev-python/netlib-${PV}[${PYTHON_USEDEP}]
+ >=dev-python/requests-2.4.1[${PYTHON_USEDEP}]
+ >=dev-python/flask-0.10.1[${PYTHON_USEDEP}]
+ dev-python/pyparsing[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ test? ( >=dev-python/nose-1.3.0[${PYTHON_USEDEP}] )"
+
+python_prepare_all() {
+ distutils-r1_python_prepare_all
+
+ # remove unnecessary pip dep
+ sed -i '/pip/d' setup.py || die
+}
+
+python_test() {
+ nosetests -v || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/pound/Manifest b/www-servers/pound/Manifest
new file mode 100644
index 000000000000..b2555aab7f7a
--- /dev/null
+++ b/www-servers/pound/Manifest
@@ -0,0 +1,3 @@
+DIST Pound-2.6.tgz 180595 SHA256 0ad25e3652e22117abbc17a70b5d8913e05991318a5506bc7437e662616fdf21
+DIST Pound-2.7d.tgz 184801 SHA256 4eabba4b0139c09c58a3eb0a6c91c0487f429eb5a322a75d76d67a49aa8b09b8 SHA512 3a64a910327c3acbc43daaaca28612fe5f98f89937612844fc2a4de9d638499465783b09782daceda0a10f8cfdf396d233fa231fb967b7889213898078015416 WHIRLPOOL bcc58f1978a8b0d0150430759198ef4e860b74c1c151503b2ba62033ba789706d69dd080d22be9ed682ed610e6fc6e41ca3a70692135cd341030f14c2edd6d7a
+DIST Pound-2.7f.tgz 186719 SHA256 0aba1a8b152f85c1521e7e0ca1b3d4258bd7a74382d4b64eb5e812a7704a9375 SHA512 292f4f7b4363365829f204b687080eae9e17b9a67ae7eb6021eb5a028321191d97abd9633d5664db5ebca6467795f73a787be4a0bd29360d737865930ff81830 WHIRLPOOL b5d5a0b7479f12428ace3e6f1d85e82dbcea222701de5031f5499b29acd911637193764d534020f6f5a365162201eb6601b1f766371ed039ca480ce9d583e2df
diff --git a/www-servers/pound/files/pound-2.2.cfg b/www-servers/pound/files/pound-2.2.cfg
new file mode 100644
index 000000000000..664ea53c9edd
--- /dev/null
+++ b/www-servers/pound/files/pound-2.2.cfg
@@ -0,0 +1,54 @@
+## Minimal sample pound.cfg
+##
+## see pound(8) for details
+
+
+######################################################################
+## global options:
+
+User "nobody"
+Group "nobody"
+#RootJail /chroot/pound
+
+## Logging: (goes to syslog by default)
+## 0 no logging
+## 1 normal
+## 2 extended
+## 3 Apache-style (common log format)
+LogLevel 1
+
+## check backend every X secs:
+Alive 30
+
+## use hardware-accelleration card supported by openssl(1):
+#SSLEngine <hw>
+
+
+######################################################################
+## listen, redirect and ... to:
+
+## redirect all requests on port 8888 ("ListenHTTP") to the local webserver see "UrlGroup" below):
+ListenHTTP
+Address 127.0.0.1
+Port 8888
+
+## allow PUT and DELETE also (by default only GET, POST and HEAD)?:
+xHTTP 0
+
+Service
+URL ".*"
+
+BackEnd
+Address 127.0.0.1
+Port 80
+Priority 1
+
+## End Backend
+End
+
+## End Service
+End
+
+## End listener
+End
+
diff --git a/www-servers/pound/files/pound-2.5-openssl-1.patch b/www-servers/pound/files/pound-2.5-openssl-1.patch
new file mode 100644
index 000000000000..6491c0fddad0
--- /dev/null
+++ b/www-servers/pound/files/pound-2.5-openssl-1.patch
@@ -0,0 +1,289 @@
+http://bugs.gentoo.org/327721
+
+--- config.c
++++ config.c
+@@ -431,14 +431,22 @@ t_hash(const TABNODE *e)
+ res = (res ^ *k++) * 16777619;
+ return res;
+ }
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++static IMPLEMENT_LHASH_HASH_FN(t, TABNODE)
++#else
+ static IMPLEMENT_LHASH_HASH_FN(t_hash, const TABNODE *)
++#endif
+
+ static int
+ t_cmp(const TABNODE *d1, const TABNODE *d2)
+ {
+ return strcmp(d1->key, d2->key);
+ }
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++static IMPLEMENT_LHASH_COMP_FN(t, TABNODE)
++#else
+ static IMPLEMENT_LHASH_COMP_FN(t_cmp, const TABNODE *)
++#endif
+
+ /*
+ * parse a service
+@@ -460,7 +468,11 @@ parse_service(const char *svc_name)
+ pthread_mutex_init(&res->mut, NULL);
+ if(svc_name)
+ strncpy(res->name, svc_name, KEY_SIZE);
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ if((res->sessions = LHM_lh_new(TABNODE, t)) == NULL)
++#else
+ if((res->sessions = lh_new(LHASH_HASH_FN(t_hash), LHASH_COMP_FN(t_cmp))) == NULL)
++#endif
+ conf_err("lh_new failed - aborted");
+ ign_case = ignore_case;
+ while(conf_fgets(lin, MAXBUF)) {
+--- pound.h
++++ pound.h
+@@ -322,6 +322,10 @@ typedef struct _tn {
+ /* maximal session key size */
+ #define KEY_SIZE 127
+
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++DECLARE_LHASH_OF(TABNODE);
++#endif
++
+ /* service definition */
+ typedef struct _service {
+ char name[KEY_SIZE + 1]; /* symbolic name */
+@@ -337,7 +341,11 @@ typedef struct _service {
+ int sess_ttl; /* session time-to-live */
+ regex_t sess_start; /* pattern to identify the session data */
+ regex_t sess_pat; /* pattern to match the session data */
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHASH_OF(TABNODE) *sessions; /* currently active sessions */
++#else
+ LHASH *sessions; /* currently active sessions */
++#endif
+ int dynscale; /* true if the back-ends should be dynamically rescaled */
+ int disabled; /* true if the service is disabled */
+ struct _service *next;
+--- svc.c
++++ svc.c
+@@ -27,12 +27,17 @@
+
+ #include "pound.h"
+
++#ifndef LHASH_OF
++#define LHASH_OF(x) LHASH
++#define CHECKED_LHASH_OF(type, h) h
++#endif
++
+ /*
+ * Add a new key/content pair to a hash table
+ * the table should be already locked
+ */
+ static void
+-t_add(LHASH *const tab, const char *key, const void *content, const size_t cont_len)
++t_add(LHASH_OF(TABNODE) *const tab, const char *key, const void *content, const size_t cont_len)
+ {
+ TABNODE *t, *old;
+
+@@ -53,7 +58,11 @@ t_add(LHASH *const tab, const char *key,
+ }
+ memcpy(t->content, content, cont_len);
+ t->last_acc = time(NULL);
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ if((old = LHM_lh_insert(TABNODE, tab, t)) != NULL) {
++#else
+ if((old = (TABNODE *)lh_insert(tab, t)) != NULL) {
++#endif
+ free(old->key);
+ free(old->content);
+ free(old);
+@@ -68,12 +77,16 @@ t_add(LHASH *const tab, const char *key,
+ * side-effect: update the time of last access
+ */
+ static void *
+-t_find(LHASH *const tab, char *const key)
++t_find(LHASH_OF(TABNODE) *const tab, char *const key)
+ {
+ TABNODE t, *res;
+
+ t.key = key;
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ if((res = LHM_lh_retrieve(TABNODE, tab, &t)) != NULL) {
++#else
+ if((res = (TABNODE *)lh_retrieve(tab, &t)) != NULL) {
++#endif
+ res->last_acc = time(NULL);
+ return res->content;
+ }
+@@ -84,12 +97,16 @@ t_find(LHASH *const tab, char *const key
+ * Delete a key
+ */
+ static void
+-t_remove(LHASH *const tab, char *const key)
++t_remove(LHASH_OF(TABNODE) *const tab, char *const key)
+ {
+ TABNODE t, *res;
+
+ t.key = key;
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ if((res = LHM_lh_delete(TABNODE, tab, &t)) != NULL) {
++#else
+ if((res = (TABNODE *)lh_delete(tab, &t)) != NULL) {
++#endif
+ free(res->key);
+ free(res->content);
+ free(res);
+@@ -98,59 +115,75 @@ t_remove(LHASH *const tab, char *const k
+ }
+
+ typedef struct {
+- LHASH *tab;
++ LHASH_OF(TABNODE) *tab;
+ time_t lim;
+ void *content;
+ int cont_len;
+ } ALL_ARG;
+
+ static void
+-t_old(TABNODE *t, void *arg)
++t_old_doall_arg(TABNODE *t, ALL_ARG *a)
+ {
+- ALL_ARG *a;
+-
+- a = (ALL_ARG *)arg;
+ if(t->last_acc < a->lim)
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHM_lh_delete(TABNODE, a->tab, t);
++#else
+ lh_delete(a->tab, t);
++#endif
+ return;
+ }
+-IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE *, void *)
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE, ALL_ARG)
++#else
++#define t_old t_old_doall_arg
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_old, TABNODE *, ALL_ARG *)
++#endif
+
+ /*
+ * Expire all old nodes
+ */
+ static void
+-t_expire(LHASH *const tab, const time_t lim)
++t_expire(LHASH_OF(TABNODE) *const tab, const time_t lim)
+ {
+ ALL_ARG a;
+ int down_load;
+
+ a.tab = tab;
+ a.lim = lim;
+- down_load = tab->down_load;
+- tab->down_load = 0;
++ down_load = CHECKED_LHASH_OF(TABNODE, tab)->down_load;
++ CHECKED_LHASH_OF(TABNODE, tab)->down_load = 0;
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHM_lh_doall_arg(TABNODE, tab, LHASH_DOALL_ARG_FN(t_old), ALL_ARG, &a);
++#else
+ lh_doall_arg(tab, LHASH_DOALL_ARG_FN(t_old), &a);
+- tab->down_load = down_load;
++#endif
++ CHECKED_LHASH_OF(TABNODE, tab)->down_load = down_load;
+ return;
+ }
+
+ static void
+-t_cont(TABNODE *t, void *arg)
++t_cont_doall_arg(TABNODE *t, ALL_ARG *a)
+ {
+- ALL_ARG *a;
+-
+- a = (ALL_ARG *)arg;
+ if(memcmp(t->content, a->content, a->cont_len) == 0)
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHM_lh_delete(TABNODE, a->tab, t);
++#else
+ lh_delete(a->tab, t);
++#endif
+ return;
+ }
+-IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE *, void *)
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE, ALL_ARG)
++#else
++#define t_cont t_cont_doall_arg
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_cont, TABNODE *, ALL_ARG *)
++#endif
+
+ /*
+ * Remove all nodes with the given content
+ */
+ static void
+-t_clean(LHASH *const tab, void *const content, const size_t cont_len)
++t_clean(LHASH_OF(TABNODE) *const tab, void *const content, const size_t cont_len)
+ {
+ ALL_ARG a;
+ int down_load;
+@@ -158,10 +191,14 @@ t_clean(LHASH *const tab, void *const co
+ a.tab = tab;
+ a.content = content;
+ a.cont_len = cont_len;
+- down_load = tab->down_load;
+- tab->down_load = 0;
++ down_load = CHECKED_LHASH_OF(TABNODE, tab)->down_load;
++ CHECKED_LHASH_OF(TABNODE, tab)->down_load = 0;
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHM_lh_doall_arg(TABNODE, tab, LHASH_DOALL_ARG_FN(t_cont), ALL_ARG, &a);
++#else
+ lh_doall_arg(tab, LHASH_DOALL_ARG_FN(t_cont), &a);
+- tab->down_load = down_load;
++#endif
++ CHECKED_LHASH_OF(TABNODE, tab)->down_load = down_load;
+ return;
+ }
+
+@@ -1410,13 +1447,11 @@ typedef struct {
+ } DUMP_ARG;
+
+ static void
+-t_dump(TABNODE *t, void *arg)
++t_dump_doall_arg(TABNODE *t, DUMP_ARG *a)
+ {
+- DUMP_ARG *a;
+ BACKEND *be, *bep;
+ int n_be, sz;
+
+- a = (DUMP_ARG *)arg;
+ memcpy(&bep, t->content, sizeof(bep));
+ for(n_be = 0, be = a->backends; be; be = be->next, n_be++)
+ if(be == bep)
+@@ -1432,19 +1467,28 @@ t_dump(TABNODE *t, void *arg)
+ return;
+ }
+
+-IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE *, void *)
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE, DUMP_ARG)
++#else
++#define t_dump t_dump_doall_arg
++IMPLEMENT_LHASH_DOALL_ARG_FN(t_dump, TABNODE *, DUMP_ARG *)
++#endif
+
+ /*
+ * write sessions to the control socket
+ */
+ static void
+-dump_sess(const int control_sock, LHASH *const sess, BACKEND *const backends)
++dump_sess(const int control_sock, LHASH_OF(TABNODE) *const sess, BACKEND *const backends)
+ {
+ DUMP_ARG a;
+
+ a.control_sock = control_sock;
+ a.backends = backends;
++#if OPENSSL_VERSION_NUMBER >= 0x10000000L
++ LHM_lh_doall_arg(TABNODE, sess, LHASH_DOALL_ARG_FN(t_dump), DUMP_ARG, &a);
++#else
+ lh_doall_arg(sess, LHASH_DOALL_ARG_FN(t_dump), &a);
++#endif
+ return;
+ }
+
diff --git a/www-servers/pound/files/pound.init-1.9 b/www-servers/pound/files/pound.init-1.9
new file mode 100644
index 000000000000..02da709d0cde
--- /dev/null
+++ b/www-servers/pound/files/pound.init-1.9
@@ -0,0 +1,23 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting pound"
+ if [ ! -f "/etc/pound.cfg" ]; then
+ eend 1 "configfile /etc/pound.cfg not found."
+ fi
+ start-stop-daemon --quiet --start --exec /usr/sbin/pound -- -f /etc/pound.cfg -p /var/run/pound.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping pound"
+ start-stop-daemon --quiet --stop --pidfile /var/run/pound.pid
+ eend $?
+}
diff --git a/www-servers/pound/metadata.xml b/www-servers/pound/metadata.xml
new file mode 100644
index 000000000000..f6ffacd46271
--- /dev/null
+++ b/www-servers/pound/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>patrick@gentoo.org</email>
+ <name>Patrick Lauer</name>
+</maintainer>
+<longdescription lang="en">The Pound program is a reverse proxy, load balancer
+ and HTTPS front-end for Web server(s). Pound was developed to enable
+ distributing the load among several Web-servers and to allow for a convenient
+ SSL wrapper for those Web servers that do not offer it natively. Pound is
+ distributed under the GPL - no warranty, it's free to use, copy and give away.
+</longdescription>
+<use>
+ <flag name='dynscaler'>Enable dynamic rescaling of back-end
+ priorities</flag>
+</use>
+</pkgmetadata>
diff --git a/www-servers/pound/pound-2.6.ebuild b/www-servers/pound/pound-2.6.ebuild
new file mode 100644
index 000000000000..4e36e8689033
--- /dev/null
+++ b/www-servers/pound/pound-2.6.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=2
+inherit eutils
+
+MY_P=${P/p/P}
+DESCRIPTION="A http/https reverse-proxy and load-balancer"
+HOMEPAGE="http://www.apsis.ch/pound/"
+SRC_URI="http://www.apsis.ch/pound/${MY_P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc x86"
+IUSE="dynscaler"
+
+DEPEND="dev-libs/libpcre
+ dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+ econf \
+ $(use_enable dynscaler)
+}
+
+src_install() {
+ dodir /usr/sbin
+ cp "${S}"/pound "${D}"/usr/sbin/
+ cp "${S}"/poundctl "${D}"/usr/sbin/
+
+ doman pound.8
+ doman poundctl.8
+ dodoc README FAQ
+
+ dodir /etc/init.d
+ newinitd "${FILESDIR}"/pound.init-1.9 pound
+
+ insinto /etc
+ newins "${FILESDIR}"/pound-2.2.cfg pound.cfg
+}
+
+pkg_postinst() {
+ elog "No demo-/sample-configfile is included in the distribution -"
+ elog "read the man-page for more info."
+ elog "A sample (localhost:8888 -> localhost:80) for gentoo is given in \"/etc/pound.cfg\"."
+ echo
+ ewarn "You will have to upgrade you configuration file, if you are"
+ ewarn "upgrading from a version <= 2.0."
+ echo
+ ewarn "The 'WebDAV' config statement is no longer supported!"
+ ewarn "Please adjust your configuration, if necessary."
+ echo
+}
diff --git a/www-servers/pound/pound-2.7d.ebuild b/www-servers/pound/pound-2.7d.ebuild
new file mode 100644
index 000000000000..e136705165d5
--- /dev/null
+++ b/www-servers/pound/pound-2.7d.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+MY_P=${P/p/P}
+DESCRIPTION="A http/https reverse-proxy and load-balancer"
+HOMEPAGE="http://www.apsis.ch/pound/"
+SRC_URI="http://www.apsis.ch/pound/${MY_P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libpcre
+ dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ dodir /usr/sbin
+ cp "${S}"/pound "${D}"/usr/sbin/
+ cp "${S}"/poundctl "${D}"/usr/sbin/
+
+ doman pound.8
+ doman poundctl.8
+ dodoc README FAQ
+
+ dodir /etc/init.d
+ newinitd "${FILESDIR}"/pound.init-1.9 pound
+
+ insinto /etc
+ newins "${FILESDIR}"/pound-2.2.cfg pound.cfg
+}
+
+pkg_postinst() {
+ elog "No demo-/sample-configfile is included in the distribution -"
+ elog "read the man-page for more info."
+ elog "A sample (localhost:8888 -> localhost:80) for gentoo is given in \"/etc/pound.cfg\"."
+ echo
+ ewarn "You will have to upgrade you configuration file, if you are"
+ ewarn "upgrading from a version <= 2.0."
+ echo
+ ewarn "The 'WebDAV' config statement is no longer supported!"
+ ewarn "Please adjust your configuration, if necessary."
+ echo
+}
diff --git a/www-servers/pound/pound-2.7f.ebuild b/www-servers/pound/pound-2.7f.ebuild
new file mode 100644
index 000000000000..e136705165d5
--- /dev/null
+++ b/www-servers/pound/pound-2.7f.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+MY_P=${P/p/P}
+DESCRIPTION="A http/https reverse-proxy and load-balancer"
+HOMEPAGE="http://www.apsis.ch/pound/"
+SRC_URI="http://www.apsis.ch/pound/${MY_P}.tgz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~mips ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND="dev-libs/libpcre
+ dev-libs/openssl"
+RDEPEND="${DEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ dodir /usr/sbin
+ cp "${S}"/pound "${D}"/usr/sbin/
+ cp "${S}"/poundctl "${D}"/usr/sbin/
+
+ doman pound.8
+ doman poundctl.8
+ dodoc README FAQ
+
+ dodir /etc/init.d
+ newinitd "${FILESDIR}"/pound.init-1.9 pound
+
+ insinto /etc
+ newins "${FILESDIR}"/pound-2.2.cfg pound.cfg
+}
+
+pkg_postinst() {
+ elog "No demo-/sample-configfile is included in the distribution -"
+ elog "read the man-page for more info."
+ elog "A sample (localhost:8888 -> localhost:80) for gentoo is given in \"/etc/pound.cfg\"."
+ echo
+ ewarn "You will have to upgrade you configuration file, if you are"
+ ewarn "upgrading from a version <= 2.0."
+ echo
+ ewarn "The 'WebDAV' config statement is no longer supported!"
+ ewarn "Please adjust your configuration, if necessary."
+ echo
+}
diff --git a/www-servers/pshs/Manifest b/www-servers/pshs/Manifest
new file mode 100644
index 000000000000..f8004c076c69
--- /dev/null
+++ b/www-servers/pshs/Manifest
@@ -0,0 +1,6 @@
+DIST pshs-0.2.1.tar.bz2 73754 SHA256 3219a824a508ba4305e83900368e460c248bf23765ae6f126b980cdc939138af SHA512 5684f6dea087b2a91265437eefd59baf9ee3052adc120a5d1cbc9fe06c471fcc484320359bd0dd0b68806916a1135e11f9a51dd87b1ffebf64602e6e938fe553 WHIRLPOOL 73891f2527116c0e85dae7a126963726f71b422d3d14e4932e3dfeb4cc34b1e6572e2d7eb33aade498debb851080e297607b0f757b5e3b62475a137ce51b32b1
+DIST pshs-0.2.3.tar.bz2 79531 SHA256 ccacf43f0067cd8d8ebea736d45d6b7af774a8d01ca49967f605cf5fe07d7e13 SHA512 883d620fc470534ec15ed309b8f7b5b86c8fbed38a4bd0df2ddfc17259cbde2334dbb56826e77606b1245b24f1f986d25375f189e924affd168f3ca9cb8b910d WHIRLPOOL 5437826800dd711165a33f2b169760443f9697ffe069d2c25ca204c8ebd30495187e30f7edc670e91438685713fdda285de7079d788c27cd7539348fbd050d97
+DIST pshs-0.2.4.tar.bz2 79751 SHA256 39e6d9e8b5eab27972aba2e2b61235d9cdc034335dafae77005b33941e0af748 SHA512 cf0368785c3c5b30b03dc4a87187ccfa4ec2ac8a3f6ba0831afcd264e2d88fc54b4e9bf56db6435d6b563c43d0b63050d7bf7a02c1f3f4410885ab09efa8dc96 WHIRLPOOL 07ac292593ade22aca06b9e4b4bc6687834f4d7dbd73e082117d0dc4732ca7f32cdd5771838defe77d3d5aeae3623958214f519fc24007f032bfc0abe482db3f
+DIST pshs-0.2.5.tar.bz2 81740 SHA256 d06f2dd1be534157e75159cd638634a601bfb0e125c498b54e8a9c95385f7ed1 SHA512 9e6fce3d97aad3f1131a6f2de6c79d8d24d1af2806c5daa57482a7514c6d51467ffd071efe2c3f2d691afc3d832f463df206452bca91e9d6b1f515f39ef6b726 WHIRLPOOL b7f72a08a0dc2b9e60302155ff4417efaf249414387016a4d5d79b3eb92bec4ce1f91ba96562d49607d0594f4193b5ffc4566db0ae61369e2dcd938367dd9ff8
+DIST pshs-0.2.6.tar.bz2 82150 SHA256 8f3cf95e82de21ae6ffee1b50a1517ef5a63475a70bc2f01af124b6ea52e1459 SHA512 d61addeb3ff1b347d333f0a625ff11c99ae8d2b6d47f980e2983847b85cdc0ac827bdc5a6f9044030016df4104b00a63eebc491b01e630f4f242154d064ec1d6 WHIRLPOOL b11a7c2533895c9a9006562fb87018462498346c7ddb748804ca84891a2bdc643de27e30ff041169d5782b52199375675933222f3aa01cb2e92f5c0e555382c4
+DIST pshs-0.2.tar.bz2 71756 SHA256 9e02ffb80aaa6e2d736999298ce7788dd4d549b407ae49a1964505153d2a46ac SHA512 7dffea2759531d889eebf4c311bcb92eb4c40bd4600c5b548dc0717de134a4cc445f31d89d29edc2d1588388659b8f5271190df689a3ec2349b2ae1b749f3ea5 WHIRLPOOL 71d2ff9936c7c83a32a9d606f2acce84d0701ab582e69afd3d11384e370e433631076571e9e874087f6e21d9cbad6ac891fbeb587c276add2196dec56798c08e
diff --git a/www-servers/pshs/metadata.xml b/www-servers/pshs/metadata.xml
new file mode 100644
index 000000000000..408f94d73e14
--- /dev/null
+++ b/www-servers/pshs/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="magic">Enable automatic detection of Content-Type
+ using libmagic (<pkg>sys-apps/file</pkg>)</flag>
+ <flag name="netlink">Use libnetlink (<pkg>sys-apps/iproute2</pkg>) to
+ get network interface addresses</flag>
+ <flag name="qrcode">Enable generating QRCodes for server URL</flag>
+ </use>
+ <upstream>
+ <maintainer status="active">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <bugs-to>https://bitbucket.org/mgorny/pshs/issues/</bugs-to>
+ <remote-id type="bitbucket">mgorny/pshs</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/pshs/pshs-0.2.1.ebuild b/www-servers/pshs/pshs-0.2.1.ebuild
new file mode 100644
index 000000000000..a76856e5574b
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink upnp"
+
+RDEPEND=">=dev-libs/libevent-2
+ magic? ( sys-apps/file )
+ upnp? ( net-libs/miniupnpc )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-0.2.3.ebuild b/www-servers/pshs/pshs-0.2.3.ebuild
new file mode 100644
index 000000000000..a78f6fe8327a
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.3.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink qrcode upnp"
+
+RDEPEND=">=dev-libs/libevent-2:0=
+ magic? ( sys-apps/file:0= )
+ qrcode? ( media-gfx/qrencode:0= )
+ upnp? ( net-libs/miniupnpc:0= )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable qrcode qrencode)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-0.2.4.ebuild b/www-servers/pshs/pshs-0.2.4.ebuild
new file mode 100644
index 000000000000..a78f6fe8327a
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.4.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink qrcode upnp"
+
+RDEPEND=">=dev-libs/libevent-2:0=
+ magic? ( sys-apps/file:0= )
+ qrcode? ( media-gfx/qrencode:0= )
+ upnp? ( net-libs/miniupnpc:0= )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable qrcode qrencode)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-0.2.5.ebuild b/www-servers/pshs/pshs-0.2.5.ebuild
new file mode 100644
index 000000000000..3fcfada8e920
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.5.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink qrcode ssl upnp"
+
+RDEPEND=">=dev-libs/libevent-2:0=
+ magic? ( sys-apps/file:0= )
+ qrcode? ( media-gfx/qrencode:0= )
+ ssl? ( >=dev-libs/libevent-2.1:0=[ssl]
+ dev-libs/openssl:0= )
+ upnp? ( net-libs/miniupnpc:0= )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable qrcode qrencode)
+ $(use_enable ssl)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-0.2.6.ebuild b/www-servers/pshs/pshs-0.2.6.ebuild
new file mode 100644
index 000000000000..32e3cd11951e
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.6.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink qrcode ssl upnp"
+
+RDEPEND=">=dev-libs/libevent-2:0=
+ magic? ( sys-apps/file:0= )
+ qrcode? ( media-gfx/qrencode:0= )
+ ssl? ( >=dev-libs/libevent-2.1:0=[ssl]
+ dev-libs/openssl:0= )
+ upnp? ( net-libs/miniupnpc:0= )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable qrcode qrencode)
+ $(use_enable ssl)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-0.2.ebuild b/www-servers/pshs/pshs-0.2.ebuild
new file mode 100644
index 000000000000..f9c9609fa8e2
--- /dev/null
+++ b/www-servers/pshs/pshs-0.2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://github.com/mgorny/pshs/"
+SRC_URI="mirror://github/mgorny/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink upnp"
+
+RDEPEND=">=dev-libs/libevent-2
+ magic? ( sys-apps/file )
+ upnp? ( net-libs/miniupnpc )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/pshs/pshs-9999.ebuild b/www-servers/pshs/pshs-9999.ebuild
new file mode 100644
index 000000000000..c6fd0854dbc7
--- /dev/null
+++ b/www-servers/pshs/pshs-9999.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=yes
+EGIT_REPO_URI="http://bitbucket.org/mgorny/${PN}.git"
+
+inherit git-r3
+#endif
+
+inherit autotools-utils
+
+DESCRIPTION="Pretty small HTTP server - a command-line tool to share files"
+HOMEPAGE="https://bitbucket.org/mgorny/pshs/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+magic +netlink qrcode ssl upnp"
+
+RDEPEND=">=dev-libs/libevent-2:0=
+ magic? ( sys-apps/file:0= )
+ qrcode? ( media-gfx/qrencode:0= )
+ ssl? ( >=dev-libs/libevent-2.1:0=[ssl]
+ dev-libs/openssl:0= )
+ upnp? ( net-libs/miniupnpc:0= )"
+DEPEND="${RDEPEND}
+ netlink? ( sys-apps/iproute2
+ >=sys-kernel/linux-headers-2.6.27 )"
+# libnetlink is static only ATM
+
+#if LIVE
+KEYWORDS=
+SRC_URI=
+#endif
+
+src_configure() {
+ myeconfargs=(
+ $(use_enable magic libmagic)
+ $(use_enable netlink)
+ $(use_enable qrcode qrencode)
+ $(use_enable ssl)
+ $(use_enable upnp)
+ )
+
+ autotools-utils_src_configure
+}
diff --git a/www-servers/resin/Manifest b/www-servers/resin/Manifest
new file mode 100644
index 000000000000..5b8c9f1585ea
--- /dev/null
+++ b/www-servers/resin/Manifest
@@ -0,0 +1,6 @@
+DIST resin-4.0.22-src.zip 17540820 SHA256 5b79a28e82849f97fc6bbf670306e29c19159b061b370f7eabc483f56a54053a
+DIST resin-4.0.25-src.zip 17971688 SHA256 e30ace9c2c9ececb1769402ea7a6cd2fe8ea73f9f38009da1b4d2ba23ab6972a
+DIST resin-4.0.26-src.zip 17879008 SHA256 0f7bbea8bd4803d499e1d212a49ac8672500ede80194c4daa12c980ad405e34e
+DIST resin-gentoo-patches-4.0.22-r1.tar.bz2 2625 SHA256 4f29cabe826f535d9b2d324d7f70b9983410cd4b8c250a166fa1e74f1ab3d828
+DIST resin-gentoo-patches-4.0.25-r1.tar.bz2 3208 SHA256 bbdcd0ba71670869171356ff15dd13461aac667e75b6998019864d75876132d2
+DIST resin-gentoo-patches-4.0.26.tar.bz2 3826 SHA256 adff1fb68e38af68add2e16e3832406a105e14532ee022ad315a955d6d6f4f31
diff --git a/www-servers/resin/files/4.0.13/resin.conf b/www-servers/resin/files/4.0.13/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.13/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.13/resin.init b/www-servers/resin/files/4.0.13/resin.init
new file mode 100644
index 000000000000..d36037f4d041
--- /dev/null
+++ b/www-servers/resin/files/4.0.13/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/files/4.0.14/resin.conf b/www-servers/resin/files/4.0.14/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.14/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.14/resin.init b/www-servers/resin/files/4.0.14/resin.init
new file mode 100644
index 000000000000..e772ec53bc5d
--- /dev/null
+++ b/www-servers/resin/files/4.0.14/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/files/4.0.15/resin.conf b/www-servers/resin/files/4.0.15/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.15/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.15/resin.init b/www-servers/resin/files/4.0.15/resin.init
new file mode 100644
index 000000000000..e772ec53bc5d
--- /dev/null
+++ b/www-servers/resin/files/4.0.15/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/files/4.0.22/resin.conf b/www-servers/resin/files/4.0.22/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.22/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.22/resin.init b/www-servers/resin/files/4.0.22/resin.init
new file mode 100644
index 000000000000..e772ec53bc5d
--- /dev/null
+++ b/www-servers/resin/files/4.0.22/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/files/4.0.25/resin.conf b/www-servers/resin/files/4.0.25/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.25/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.25/resin.init b/www-servers/resin/files/4.0.25/resin.init
new file mode 100644
index 000000000000..6103369d40e3
--- /dev/null
+++ b/www-servers/resin/files/4.0.25/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/files/4.0.26/resin.conf b/www-servers/resin/files/4.0.26/resin.conf
new file mode 100644
index 000000000000..a48840b5e9f2
--- /dev/null
+++ b/www-servers/resin/files/4.0.26/resin.conf
@@ -0,0 +1,16 @@
+# JVM Runtime
+# Using the default setting, it will determine your JVM from the system-vm
+# set using java-config.
+# See java-config(1) manual page for assistance in determining this value.
+
+# You can override this value with whatever JDK you want.
+# For a list of valid values for GENTOO_VM see output of
+# java-config -L
+#GENTOO_VM=sun-jdk-1.5
+
+# Verbose starting and stopping? (yes/no, defaults to no)
+#VERBOSE="yes"
+
+# Select which server will be started, this is an advanced feature, please refer
+# to Resin documentation.
+SERVER_ID=""
diff --git a/www-servers/resin/files/4.0.26/resin.init b/www-servers/resin/files/4.0.26/resin.init
new file mode 100644
index 000000000000..6103369d40e3
--- /dev/null
+++ b/www-servers/resin/files/4.0.26/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+ use dns logger mysql postgresql
+}
+
+runResin() {
+ JAVA_HOME=$(java-config -O)
+ [ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
+ export JAVA_HOME
+
+ local extraArgs=
+ if [ "${VERBOSE}" = "yes" ]; then
+ extraArgs="-verbose"
+ fi
+
+ local msg="${1}"
+ shift
+
+ local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.xml -server \"${SERVER_ID}\" -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"
+
+ ebegin "${msg}"
+ su - resin -c "${cmdline}"
+ eend $?
+}
+
+start() {
+ runResin "Starting Resin" "start"
+}
+
+stop() {
+ runResin "Stopping Resin" "shutdown"
+}
diff --git a/www-servers/resin/metadata.xml b/www-servers/resin/metadata.xml
new file mode 100644
index 000000000000..3447822a6fe9
--- /dev/null
+++ b/www-servers/resin/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <use>
+ <flag name='admin'>Enable Resin admin webapp</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/resin/resin-4.0.22.ebuild b/www-servers/resin/resin-4.0.22.ebuild
new file mode 100644
index 000000000000..136621ccf201
--- /dev/null
+++ b/www-servers/resin/resin-4.0.22.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-ant-2 eutils flag-o-matic multilib autotools user
+
+DESCRIPTION="A fast Servlet and JSP engine"
+HOMEPAGE="http://www.caucho.com"
+SRC_URI="http://www.caucho.com/download/${P}-src.zip
+ mirror://gentoo/resin-gentoo-patches-${PV}-r1.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="admin doc"
+
+KEYWORDS="amd64 x86"
+
+COMMON_DEP="~dev-java/resin-servlet-api-${PV}
+ dev-java/glassfish-deployment-api:1.2
+ java-virtuals/javamail
+ dev-java/jsr101
+ dev-java/mojarra:1.2
+ dev-java/validation-api:1.0"
+
+RDEPEND=">=virtual/jdk-1.5
+ ${COMMON_DEP}"
+DEPEND=">=virtual/jdk-1.5
+ app-arch/unzip
+ dev-java/ant-core
+ dev-libs/openssl
+ ${COMMON_DEP}"
+
+RESIN_HOME="/usr/$(get_libdir)/resin"
+
+# Rewrites build.xml in documentation
+JAVA_PKG_BSFIX="off"
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup resin
+ enewuser resin -1 /bin/bash ${RESIN_HOME} resin
+}
+
+src_prepare() {
+ for i in "${WORKDIR}"/${PV}/resin-${PV}-*; do
+ epatch "${i}"
+ done;
+
+ # Respect LDFLAGS:
+ sed -i -e 's/-o/$(LDFLAGS) -o/' modules/c/src/resin_os/Makefile.in || die
+
+ # No bundled JARs!
+ rm -f "${S}/modules/ext/"*.jar || die
+ rm -rf "${S}/project-jars" || die
+
+ java-ant_bsfix_one "${S}/build.xml"
+ java-ant_bsfix_one "${S}/build-common.xml"
+
+ mkdir -p "${S}/m4" || die
+ sed -i -e 's,-O2,,g' configure.ac || die
+ eautoreconf
+
+ # Symlink our libraries:
+ mkdir -p "${S}/gentoo-deps" || die
+ cd "${S}/gentoo-deps/"
+ java-pkg_jar-from --virtual javamail
+ java-pkg_jar-from glassfish-deployment-api-1.2
+ java-pkg_jar-from resin-servlet-api-3.0 resin-servlet-api.jar
+ java-pkg_jar-from mojarra-1.2
+ java-pkg_jar-from jsr101
+ java-pkg_jar-from validation-api-1.0
+ ln -s $(java-config --jdk-home)/lib/tools.jar || die
+}
+
+src_configure() {
+ append-flags -fPIC -DPIC
+
+ chmod 755 "${S}/configure" || die
+ econf --prefix=${RESIN_HOME} || die "econf failed"
+}
+
+src_compile() {
+ einfo "Building libraries..."
+ emake || die "make failed"
+
+ einfo "Building jars..."
+ eant || die "ant failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ einfo "Moving configuration to /etc ..."
+ dodir /etc/
+ mv "${D}/${RESIN_HOME}/conf" "${D}/etc/resin" || die "mv of conf failed"
+ dosym /etc/resin ${RESIN_HOME}/conf
+
+ einfo "Rewriting resin.xml ..."
+ sed -i \
+ -e 's,${resin.root}/doc/resin-doc,webapps/resin-doc,' \
+ -e 's,${resin.root}/doc/admin,webapps/admin,' \
+ "${D}/etc/resin/resin.xml"
+
+ einfo "Fixing log directory ..."
+ rm -rf "${D}/${RESIN_HOME}/log" || die
+ keepdir /var/log/resin
+ dosym /var/log/resin ${RESIN_HOME}/log
+
+ einfo "Installing basic documentation ..."
+ dodoc README "${S}"/conf/*.xml
+
+ einfo "Installing init.d script ..."
+ newinitd "${FILESDIR}/${PV}/resin.init" resin
+ newconfd "${FILESDIR}/${PV}/resin.conf" resin
+
+ sed -i -e "s,__RESIN_HOME__,${RESIN_HOME},g" "${D}/etc/init.d/resin"
+
+ einfo "Fixing location of jars ..."
+ rm -f "${S}/lib/tools.jar" || die
+ java-pkg_dojar "${S}"/lib/*.jar
+ rm -fr "${D}/${RESIN_HOME}/lib"
+ dosym /usr/share/resin/lib ${RESIN_HOME}/lib
+
+ einfo "Symlinking directories from /var/lib/resin ..."
+ rm -rf "${D}/${RESIN_HOME}/resin-data"
+ rm -rf "${D}/${RESIN_HOME}/watchdog-data"
+ dodir /var/lib/resin/webapps
+ keepdir /var/lib/resin/hosts
+ keepdir /var/lib/resin/resin-data
+ keepdir /var/lib/resin/watchdog-data
+ mv "${D}"/${RESIN_HOME}/webapps/* "${D}/var/lib/resin/webapps" || \
+ die "mv of webapps failed"
+ rm -rf "${D}/${RESIN_HOME}/webapps"
+ dosym /var/lib/resin/webapps ${RESIN_HOME}/webapps
+ dosym /var/lib/resin/hosts ${RESIN_HOME}/hosts
+ dosym /var/lib/resin/resin-data ${RESIN_HOME}/resin-data
+ dosym /var/lib/resin/watchdog-data ${RESIN_HOME}/watchdog-data
+
+ dosym \
+ "$(java-pkg_getjar resin-servlet-api-3.0 resin-servlet-api.jar)" \
+ "${JAVA_PKG_JARDEST}/resin-servlet-api.jar" || die
+
+ use admin && {
+ einfo "Installing administration app ..."
+ cp -a "${S}/doc/admin" "${D}/var/lib/resin/webapps/" || die
+ }
+ use doc && {
+ einfo "Installing documentation app ..."
+ cp -a "${S}/doc/resin-doc" "${D}/var/lib/resin/webapps/" || die
+ }
+
+ use source && {
+ einfo "Installing sources ..."
+ java-pkg_dosrc "${S}"/modules/*/src/* > /dev/null
+ }
+
+ einfo "Removing stale directories ..."
+ rm -fr "${D}/${RESIN_HOME}/bin"
+ rm -fr "${D}/${RESIN_HOME}/doc"
+ rm -fr "${D}/${RESIN_HOME}/keys"
+ rm -fr "${D}/${RESIN_HOME}/licenses"
+ rm -fr "${D}/etc/resin/"*.orig
+
+ einfo "Fixing ownerships and permissions ..."
+ fowners -R 0:root /
+ fowners -R resin:resin /etc/resin
+ fowners -R resin:resin /var/lib/resin
+ fowners -R resin:resin /var/log/resin
+
+ fperms 644 /etc/conf.d/resin
+ fperms 755 /etc/init.d/resin
+ fperms 750 /var/lib/resin
+ fperms 750 /etc/resin
+}
+
+pkg_postinst() {
+ elog
+ elog " User and group 'resin' have been added."
+ elog
+ elog " By default, Resin runs on port 8080. You can change this"
+ elog " value by editing /etc/resin/resin.xml."
+ elog
+}
diff --git a/www-servers/resin/resin-4.0.25.ebuild b/www-servers/resin/resin-4.0.25.ebuild
new file mode 100644
index 000000000000..c3173a250f91
--- /dev/null
+++ b/www-servers/resin/resin-4.0.25.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-ant-2 eutils flag-o-matic multilib autotools user
+
+DESCRIPTION="A fast Servlet and JSP engine"
+HOMEPAGE="http://www.caucho.com"
+SRC_URI="http://www.caucho.com/download/${P}-src.zip
+ mirror://gentoo/resin-gentoo-patches-${PV}-r1.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="admin doc"
+
+KEYWORDS="~amd64 ~x86"
+
+COMMON_DEP="~dev-java/resin-servlet-api-${PV}
+ dev-java/glassfish-deployment-api:1.2
+ java-virtuals/javamail
+ dev-java/jsr101
+ dev-java/mojarra:1.2
+ dev-java/validation-api:1.0"
+
+RDEPEND=">=virtual/jdk-1.5
+ ${COMMON_DEP}"
+DEPEND=">=virtual/jdk-1.5
+ app-arch/unzip
+ dev-java/ant-core
+ dev-libs/openssl
+ ${COMMON_DEP}"
+
+RESIN_HOME="/usr/$(get_libdir)/resin"
+
+# Rewrites build.xml in documentation
+JAVA_PKG_BSFIX="off"
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup resin
+ enewuser resin -1 /bin/bash ${RESIN_HOME} resin
+}
+
+src_prepare() {
+ for i in "${WORKDIR}"/${PV}/resin-${PV}-*; do
+ epatch "${i}"
+ done;
+
+ # Respect LDFLAGS:
+ sed -i -e 's/-o/$(LDFLAGS) -o/' modules/c/src/resin_os/Makefile.in || die
+
+ # No bundled JARs!
+ rm -f "${S}/modules/ext/"*.jar || die
+ rm -rf "${S}/project-jars" || die
+
+ java-ant_bsfix_one "${S}/build.xml"
+ java-ant_bsfix_one "${S}/build-common.xml"
+
+ mkdir -p "${S}/m4" || die
+ sed -i -e 's,-O2,,g' configure.ac || die
+ eautoreconf
+
+ # Symlink our libraries:
+ mkdir -p "${S}/gentoo-deps" || die
+ cd "${S}/gentoo-deps/" || die
+ java-pkg_jar-from --virtual javamail
+ java-pkg_jar-from glassfish-deployment-api-1.2
+ java-pkg_jar-from resin-servlet-api-3.0 resin-servlet-api.jar
+ java-pkg_jar-from mojarra-1.2
+ java-pkg_jar-from jsr101
+ java-pkg_jar-from validation-api-1.0
+ ln -s $(java-config --jdk-home)/lib/tools.jar || die
+}
+
+src_configure() {
+ append-flags -fPIC -DPIC
+
+ chmod 755 "${S}/configure" || die
+ econf --prefix=${RESIN_HOME} || die "econf failed"
+}
+
+src_compile() {
+ einfo "Building libraries..."
+ emake || die "make failed"
+
+ einfo "Building jars..."
+ eant || die "ant failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ einfo "Moving configuration to /etc ..."
+ dodir /etc/
+ mv "${D}/${RESIN_HOME}/conf" "${D}/etc/resin" || die "mv of conf failed"
+ dosym /etc/resin ${RESIN_HOME}/conf
+
+ einfo "Rewriting resin.xml ..."
+ sed -i \
+ -e 's,${resin.root}/doc/resin-doc,webapps/resin-doc,' \
+ -e 's,${resin.root}/doc/admin,webapps/admin,' \
+ "${D}/etc/resin/resin.xml" || die
+
+ einfo "Fixing log directory ..."
+ rm -rf "${D}/${RESIN_HOME}/log" || die
+ keepdir /var/log/resin
+ dosym /var/log/resin ${RESIN_HOME}/log
+
+ einfo "Installing basic documentation ..."
+ dodoc README "${S}"/conf/*.xml
+
+ einfo "Installing init.d script ..."
+ newinitd "${FILESDIR}/${PV}/resin.init" resin
+ newconfd "${FILESDIR}/${PV}/resin.conf" resin
+
+ sed -i -e "s,__RESIN_HOME__,${RESIN_HOME},g" "${D}/etc/init.d/resin" || die
+
+ einfo "Fixing location of jars ..."
+ rm -f "${S}/lib/tools.jar" || die
+ java-pkg_dojar "${S}"/lib/*.jar
+ rm -fr "${D}/${RESIN_HOME}/lib" || die
+ dosym /usr/share/resin/lib ${RESIN_HOME}/lib
+
+ einfo "Symlinking directories from /var/lib/resin ..."
+ rm -rf "${D}/${RESIN_HOME}/resin-data" || die
+ rm -rf "${D}/${RESIN_HOME}/watchdog-data" || die
+ dodir /var/lib/resin/webapps
+ keepdir /var/lib/resin/hosts
+ keepdir /var/lib/resin/resin-data
+ keepdir /var/lib/resin/watchdog-data
+ mv "${D}"/${RESIN_HOME}/webapps/* "${D}/var/lib/resin/webapps" || \
+ die "mv of webapps failed"
+ rm -rf "${D}/${RESIN_HOME}/webapps" || die
+ dosym /var/lib/resin/webapps ${RESIN_HOME}/webapps
+ dosym /var/lib/resin/hosts ${RESIN_HOME}/hosts
+ dosym /var/lib/resin/resin-data ${RESIN_HOME}/resin-data
+ dosym /var/lib/resin/watchdog-data ${RESIN_HOME}/watchdog-data
+
+ dosym \
+ "$(java-pkg_getjar resin-servlet-api-3.0 resin-servlet-api.jar)" \
+ "${JAVA_PKG_JARDEST}/resin-servlet-api.jar"
+
+ use admin && {
+ einfo "Installing administration app ..."
+ cp -a "${S}/doc/admin" "${D}/var/lib/resin/webapps/" || die
+ }
+ use doc && {
+ einfo "Installing documentation app ..."
+ cp -a "${S}/doc/resin-doc" "${D}/var/lib/resin/webapps/" || die
+ }
+
+ use source && {
+ einfo "Installing sources ..."
+ java-pkg_dosrc "${S}"/modules/*/src/* > /dev/null
+ }
+
+ einfo "Removing stale directories ..."
+ rm -fr "${D}/${RESIN_HOME}/bin" || die
+ rm -fr "${D}/${RESIN_HOME}/doc" || die
+ rm -fr "${D}/${RESIN_HOME}/keys" || die
+ rm -fr "${D}/${RESIN_HOME}/licenses" || die
+ rm -fr "${D}/etc/resin/"*.orig || die
+
+ einfo "Fixing ownerships and permissions ..."
+ fowners -R 0:root /
+ fowners -R resin:resin /etc/resin
+ fowners -R resin:resin /var/lib/resin
+ fowners -R resin:resin /var/log/resin
+
+ fperms 644 /etc/conf.d/resin
+ fperms 755 /etc/init.d/resin
+ fperms 750 /var/lib/resin
+ fperms 750 /etc/resin
+}
+
+pkg_postinst() {
+ elog
+ elog " User and group 'resin' have been added."
+ elog
+ elog " By default, Resin runs on port 8080. You can change this"
+ elog " value by editing /etc/resin/resin.xml."
+ elog
+}
diff --git a/www-servers/resin/resin-4.0.26.ebuild b/www-servers/resin/resin-4.0.26.ebuild
new file mode 100644
index 000000000000..9a304ba6c79c
--- /dev/null
+++ b/www-servers/resin/resin-4.0.26.ebuild
@@ -0,0 +1,182 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+JAVA_PKG_IUSE="source"
+
+inherit java-pkg-2 java-ant-2 eutils flag-o-matic multilib autotools user
+
+DESCRIPTION="A fast Servlet and JSP engine"
+HOMEPAGE="http://www.caucho.com"
+SRC_URI="http://www.caucho.com/download/${P}-src.zip
+ mirror://gentoo/resin-gentoo-patches-${PV}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="admin doc"
+
+KEYWORDS="~amd64 ~x86"
+
+COMMON_DEP="~dev-java/resin-servlet-api-${PV}
+ dev-java/glassfish-deployment-api:1.2
+ java-virtuals/javamail
+ dev-java/jsr101
+ dev-java/mojarra:1.2
+ dev-java/validation-api:1.0"
+
+RDEPEND=">=virtual/jdk-1.5
+ ${COMMON_DEP}"
+DEPEND=">=virtual/jdk-1.5
+ app-arch/unzip
+ dev-java/ant-core
+ dev-libs/openssl
+ ${COMMON_DEP}"
+
+RESIN_HOME="/usr/$(get_libdir)/resin"
+
+# Rewrites build.xml in documentation
+JAVA_PKG_BSFIX="off"
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup resin
+ enewuser resin -1 /bin/bash ${RESIN_HOME} resin
+}
+
+src_prepare() {
+ for i in "${WORKDIR}"/${PV}/resin-${PV}-*; do
+ epatch "${i}"
+ done;
+
+ # No bundled JARs!
+ rm -f "${S}/modules/ext/"*.jar || die
+ rm -rf "${S}/project-jars" || die
+
+ java-ant_bsfix_one "${S}/build.xml"
+ java-ant_bsfix_one "${S}/build-common.xml"
+
+ mkdir -p "${S}/m4" || die
+ eautoreconf
+
+ # Symlink our libraries:
+ mkdir -p "${S}/gentoo-deps" || die
+ cd "${S}/gentoo-deps/" || die
+ java-pkg_jar-from --virtual javamail
+ java-pkg_jar-from glassfish-deployment-api-1.2
+ java-pkg_jar-from resin-servlet-api-3.0 resin-servlet-api.jar
+ java-pkg_jar-from mojarra-1.2
+ java-pkg_jar-from jsr101
+ java-pkg_jar-from validation-api-1.0
+ ln -s $(java-config --jdk-home)/lib/tools.jar || die
+}
+
+src_configure() {
+ append-flags -fPIC -DPIC
+
+ chmod 755 "${S}/configure" || die
+ econf --prefix=${RESIN_HOME} || die "econf failed"
+}
+
+src_compile() {
+ einfo "Building libraries..."
+ emake || die "make failed"
+
+ einfo "Building jars..."
+ eant || die "ant failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed"
+
+ einfo "Moving configuration to /etc ..."
+ dodir /etc/
+ mv "${D}/${RESIN_HOME}/conf" "${D}/etc/resin" || die "mv of conf failed"
+ dosym /etc/resin ${RESIN_HOME}/conf
+
+ einfo "Rewriting resin.xml ..."
+ sed -i \
+ -e 's,${resin.root}/doc/resin-doc,webapps/resin-doc,' \
+ -e 's,${resin.root}/doc/admin,webapps/admin,' \
+ "${D}/etc/resin/resin.xml" || die
+
+ einfo "Fixing log directory ..."
+ rm -rf "${D}/${RESIN_HOME}/log" || die
+ keepdir /var/log/resin
+ dosym /var/log/resin ${RESIN_HOME}/log
+
+ einfo "Installing basic documentation ..."
+ dodoc README "${S}"/conf/*.xml
+
+ einfo "Installing init.d script ..."
+ newinitd "${FILESDIR}/${PV}/resin.init" resin
+ newconfd "${FILESDIR}/${PV}/resin.conf" resin
+
+ sed -i -e "s,__RESIN_HOME__,${RESIN_HOME},g" "${D}/etc/init.d/resin" || die
+
+ einfo "Fixing location of jars ..."
+ rm -f "${S}/lib/tools.jar" || die
+ java-pkg_dojar "${S}"/lib/*.jar
+ rm -fr "${D}/${RESIN_HOME}/lib" || die
+ dosym /usr/share/resin/lib ${RESIN_HOME}/lib
+
+ einfo "Symlinking directories from /var/lib/resin ..."
+ rm -rf "${D}/${RESIN_HOME}/resin-data" || die
+ rm -rf "${D}/${RESIN_HOME}/watchdog-data" || die
+ dodir /var/lib/resin/webapps
+ keepdir /var/lib/resin/hosts
+ keepdir /var/lib/resin/resin-data
+ keepdir /var/lib/resin/watchdog-data
+ mv "${D}"/${RESIN_HOME}/webapps/* "${D}/var/lib/resin/webapps" || \
+ die "mv of webapps failed"
+ rm -rf "${D}/${RESIN_HOME}/webapps" || die
+ dosym /var/lib/resin/webapps ${RESIN_HOME}/webapps
+ dosym /var/lib/resin/hosts ${RESIN_HOME}/hosts
+ dosym /var/lib/resin/resin-data ${RESIN_HOME}/resin-data
+ dosym /var/lib/resin/watchdog-data ${RESIN_HOME}/watchdog-data
+
+ dosym \
+ "$(java-pkg_getjar resin-servlet-api-3.0 resin-servlet-api.jar)" \
+ "${JAVA_PKG_JARDEST}/resin-servlet-api.jar"
+
+ use admin && {
+ einfo "Installing administration app ..."
+ cp -a "${S}/doc/admin" "${D}/var/lib/resin/webapps/" || die
+ }
+ use doc && {
+ einfo "Installing documentation app ..."
+ cp -a "${S}/doc/resin-doc" "${D}/var/lib/resin/webapps/" || die
+ }
+
+ use source && {
+ einfo "Installing sources ..."
+ java-pkg_dosrc "${S}"/modules/*/src/* > /dev/null
+ }
+
+ einfo "Removing stale directories ..."
+ rm -fr "${D}/${RESIN_HOME}/bin" || die
+ rm -fr "${D}/${RESIN_HOME}/doc" || die
+ rm -fr "${D}/${RESIN_HOME}/keys" || die
+ rm -fr "${D}/${RESIN_HOME}/licenses" || die
+ rm -fr "${D}/etc/resin/"*.orig || die
+
+ einfo "Fixing ownerships and permissions ..."
+ fowners -R 0:root /
+ fowners -R resin:resin /etc/resin
+ fowners -R resin:resin /var/lib/resin
+ fowners -R resin:resin /var/log/resin
+
+ fperms 644 /etc/conf.d/resin
+ fperms 755 /etc/init.d/resin
+ fperms 750 /var/lib/resin
+ fperms 750 /etc/resin
+}
+
+pkg_postinst() {
+ elog
+ elog " User and group 'resin' have been added."
+ elog
+ elog " By default, Resin runs on port 8080. You can change this"
+ elog " value by editing /etc/resin/resin.xml."
+ elog
+}
diff --git a/www-servers/servefile/Manifest b/www-servers/servefile/Manifest
new file mode 100644
index 000000000000..7e447a29cd5e
--- /dev/null
+++ b/www-servers/servefile/Manifest
@@ -0,0 +1,2 @@
+DIST servefile-0.4.2.tar.gz 13334 SHA256 4dc8e293d72dd36c6ff55e975b1acbcc1957164cbd54e19d0fa12bcc33b4ca1f SHA512 56b694e8f1df15270ff6f618bff3dcfe7bf3f942edd181d8ae6183e05a69ee09b27813c01fc523b1448d3f2232b4b3e42cd8aab89c5d4849d5337a8f16533395 WHIRLPOOL 2807a886336a886b2b9038f66d575363ea110fcb4c2bf162e7082bd72a46154bdb3d01e7d5fa49b29c62e3063e182ba5b0fed5b38731014fc2e05825c1ed1913
+DIST servefile-0.4.3.tar.gz 13880 SHA256 53564c0cf4791ce2dbe86aeae9b7f436d85a1b6d0d2d04de1afd237943363c83 SHA512 ccdabe31d41750cc085e47b6d22bcd093ce28e727f82e9b90232d6d859f57e7d931994454287374125665071015eaa485f689d7ea912af8d1321612216128e8a WHIRLPOOL 64eaf048057eec6096e724649058c0dc1668b55a6a87c85597fc54d3e620239ac4eeffe409d2beaa3e823fd8a898e04d64d99581af97f7884e5aa4294f0e88fe
diff --git a/www-servers/servefile/metadata.xml b/www-servers/servefile/metadata.xml
new file mode 100644
index 000000000000..16bcc9f800a2
--- /dev/null
+++ b/www-servers/servefile/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>sping@gentoo.org</email>
+ <name>Sebastian Pipping</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/www-servers/servefile/servefile-0.4.2.ebuild b/www-servers/servefile/servefile-0.4.2.ebuild
new file mode 100644
index 000000000000..472aaac9ee73
--- /dev/null
+++ b/www-servers/servefile/servefile-0.4.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+SUPPORT_PYTHON_ABIS="1"
+PYTHON_DEPEND="2:2.6"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit distutils
+
+DESCRIPTION="Serve a single file via HTTP"
+HOMEPAGE="http://seba-geek.de/stuff/servefile/"
+SRC_URI="http://seba-geek.de/proj/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ssl"
+
+DEPEND=""
+RDEPEND="( sys-apps/iproute2 sys-apps/net-tools )
+ ssl? ( dev-python/pyopenssl )
+ sys-apps/grep
+ sys-apps/sed"
+
+src_install() {
+ distutils_src_install
+ dodoc ChangeLog || die
+ doman ${PN}.1 || die
+}
diff --git a/www-servers/servefile/servefile-0.4.3.ebuild b/www-servers/servefile/servefile-0.4.3.ebuild
new file mode 100644
index 000000000000..472aaac9ee73
--- /dev/null
+++ b/www-servers/servefile/servefile-0.4.3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+SUPPORT_PYTHON_ABIS="1"
+PYTHON_DEPEND="2:2.6"
+RESTRICT_PYTHON_ABIS="3.*"
+
+inherit distutils
+
+DESCRIPTION="Serve a single file via HTTP"
+HOMEPAGE="http://seba-geek.de/stuff/servefile/"
+SRC_URI="http://seba-geek.de/proj/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ssl"
+
+DEPEND=""
+RDEPEND="( sys-apps/iproute2 sys-apps/net-tools )
+ ssl? ( dev-python/pyopenssl )
+ sys-apps/grep
+ sys-apps/sed"
+
+src_install() {
+ distutils_src_install
+ dodoc ChangeLog || die
+ doman ${PN}.1 || die
+}
diff --git a/www-servers/skunkweb/Manifest b/www-servers/skunkweb/Manifest
new file mode 100644
index 000000000000..5b04d027dec1
--- /dev/null
+++ b/www-servers/skunkweb/Manifest
@@ -0,0 +1 @@
+DIST skunkweb-3.4.4.tar.gz 1411045 SHA256 a7f0bc47788cdb01882d53f433599fc1837013f45b7d13ea67d60a81f8c6f1e0
diff --git a/www-servers/skunkweb/files/100_mod_skunkweb.conf b/www-servers/skunkweb/files/100_mod_skunkweb.conf
new file mode 100644
index 000000000000..099993285e38
--- /dev/null
+++ b/www-servers/skunkweb/files/100_mod_skunkweb.conf
@@ -0,0 +1,50 @@
+<IfDefine SKUNKWEB>
+
+ <IfModule !mod_skunkweb.c>
+ LoadModule skunkweb_module modules/mod_skunkweb.so
+ </IfModule>
+
+ # This tells apache to call our module for EVERY request
+ <Location />
+ SetHandler skunkweb-handler
+ </Location>
+
+ # Socket address of SkunkWeb. Either a path to a unix domain socket or
+ # a host:port pair for a TCP socket
+ SkunkWebSocketAddress localhost:9888
+
+ # Number of times to retry accessing the SkunkWeb
+ SkunkWebRetries 3
+
+ # The location of the error page which gets displayed when SkunkWeb is
+ # not accessible
+ SkunkWebErrorDoc /usr/share/skunkweb/share/skunk/modskunkweb_error.html
+
+ # The list of users to receive critical error emails. Should be a list
+ # of space separated entries
+ SkunkWebErrorEmails root@localhost
+
+ # List of uri prefixes for which should be handled in the normal way by
+ # apache and *not* by SkunkWeb.
+ #
+ # THIS OPTION IS NO LONGER SUPPORTED UNDER APACHE 2 AND MAY GO AWAY FOR
+ # APACHE 1.x AS YOU CAN DO THE SAME THING VIA <Location> directives
+ #
+ # SkunkWebExclude /foo/ /bar/
+
+ # In the event that we cannot reach a server running on SkunkWebSocketAddress,
+ # randomly pick socketaddresses from the following list and try to connect to
+ # them instead until we run out of retries (set by SkunkWebRetries).
+ #
+ # SkunkWebFailoverHosts unixsocketaddr otherhost2:port
+
+ # The number of milliseconds we should wait attempting to connect before
+ # bailing out retrying, since otherwise, we'd wait the default amount for TCP
+ # which is 2 minutes -- BLEAH! (default is 1 second = 1000 milliseconds)
+ #
+ # SkunkWebConnectTimeout 1000
+
+ # Whether or not to include SkunkWeb/<version> in the Server header of Apache
+ # Default is On
+ # SkunkWebExpose On
+</IfDefine>
diff --git a/www-servers/skunkweb/files/skunkweb-cron-cache_cleaner b/www-servers/skunkweb/files/skunkweb-cron-cache_cleaner
new file mode 100755
index 000000000000..0ac9bdf8b4f0
--- /dev/null
+++ b/www-servers/skunkweb/files/skunkweb-cron-cache_cleaner
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+nice -n 5 /usr/share/skunkweb/util/cache_reaper.py -c /var/lib/skunkweb/cache > /dev/null 2>&1
+
diff --git a/www-servers/skunkweb/files/skunkweb-init b/www-servers/skunkweb/files/skunkweb-init
new file mode 100755
index 000000000000..c32cc0fe81c2
--- /dev/null
+++ b/www-servers/skunkweb/files/skunkweb-init
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+DAEMON_CMD=/usr/bin/swmgr
+opts="${opts} configtest"
+
+configtest() {
+ ${DAEMON_CMD} configtest
+}
+start() {
+ ebegin "Starting skunkweb"
+ ${DAEMON_CMD} start > /dev/null 2>&1
+ eend $?
+}
+stop() {
+ ebegin "Stopping skunkweb"
+ ${DAEMON_CMD} stop > /dev/null 2>&1
+ eend $?
+}
diff --git a/www-servers/skunkweb/metadata.xml b/www-servers/skunkweb/metadata.xml
new file mode 100644
index 000000000000..52dd0985bf7a
--- /dev/null
+++ b/www-servers/skunkweb/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>python</herd>
+ <longdescription lang="en">
+ SkunkWeb is a multi-process application server written in python,
+ extensively using 'pickle' for caching. Ships with its own web server,
+ or can be deployed with apache and mod-python. Includes server-side form
+ management libraries (docs in cvs).
+ </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">skunkweb</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/skunkweb/skunkweb-3.4.4.ebuild b/www-servers/skunkweb/skunkweb-3.4.4.ebuild
new file mode 100644
index 000000000000..dfb98e3fa503
--- /dev/null
+++ b/www-servers/skunkweb/skunkweb-3.4.4.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+PYTHON_DEPEND="2"
+
+inherit apache-module eutils multilib python user
+
+DESCRIPTION="robust Python web application server"
+HOMEPAGE="http://skunkweb.sourceforge.net/"
+SRC_URI="mirror://sourceforge/skunkweb/${P}.tar.gz"
+
+LICENSE="GPL-2 BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="app-admin/sudo
+ >=dev-python/egenix-mx-base-2.0.4"
+RDEPEND="${DEPEND}"
+
+need_apache
+
+APACHE2_MOD_FILE="${S}/SkunkWeb/mod_skunkweb/.libs/mod_skunkweb.so"
+APACHE2_MOD_DEFINE="SKUNKWEB"
+APACHE2_MOD_CONF="100_mod_skunkweb"
+
+pkg_setup() {
+ enewgroup skunkweb
+ enewuser skunkweb -1 -1 /usr/share/skunkweb skunkweb
+
+ python_set_active_version 2
+}
+
+src_configure() {
+ econf \
+ --with-user=skunkweb \
+ --with-group=skunkweb \
+ --localstatedir=/var/lib/skunkweb \
+ --bindir=/usr/bin \
+ --libdir=/usr/$(get_libdir)/skunkweb \
+ --sysconfdir=/etc/skunkweb \
+ --prefix=/usr/share/skunkweb \
+ --with-cache=/var/lib/skunkweb/cache \
+ --with-docdir=/usr/share/doc/${P} \
+ --with-logdir=/var/log/skunkweb \
+ --with-python="$(PYTHON -a)" \
+ --with-apxs=${APXS}
+}
+
+src_compile() {
+ default
+}
+
+src_install() {
+ emake DESTDIR="${D}" APXSFLAGS="-c" install || die "emake install failed"
+ apache-module_src_install
+
+ python_need_rebuild
+
+ keepdir /var/{lib,log}/${PN}
+ keepdir /var/lib/${PN}/run
+ fowners skunkweb:skunkweb /var/{lib,log}/${PN}
+
+ newinitd "${FILESDIR}"/skunkweb-init skunkweb
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/skunkweb-cron-cache_cleaner skunkweb-cache_cleaner
+
+ dodoc README ChangeLog NEWS HACKING ACKS INSTALL
+}
+
+pkg_postinst() {
+ apache-module_pkg_postinst
+ python_mod_optimize /usr/$(get_libdir)/skunkweb
+}
+
+pkg_postrm() {
+ python_mod_cleanup /usr/$(get_libdir)/skunkweb
+}
diff --git a/www-servers/spawn-fcgi/Manifest b/www-servers/spawn-fcgi/Manifest
new file mode 100644
index 000000000000..bba7e7f12666
--- /dev/null
+++ b/www-servers/spawn-fcgi/Manifest
@@ -0,0 +1,2 @@
+DIST spawn-fcgi-1.6.3.tar.bz2 77607 SHA256 e6721dc0fa59bb00e05f160406815d53c95e81ac28f7e52fbd36497584f846cd SHA512 136a198cbcda0d3ae4e445eac2ccdcc5483801514ce77542c630d615a7a19a68864b9d7d79733adb16347ba64c833afbf2a18df82937107a6bc8467f630b03b4 WHIRLPOOL c424426e39f5151de29491b6e0900a546fcf7fb31a7b226c7246a79a5af62357d7dfddc9179aceb02d993fa09529e973794f70ece961336bb760763663080176
+DIST spawn-fcgi-1.6.4.tar.xz 79944 SHA256 423b0c317e0084773b483985cc21930c4b8dfcb411f7353d6ee6fc41d9cb9d45 SHA512 e2b317997b56f852ad644b80fe36fa08376ae81f93566e181c31a3b6764de2eeb32a2e10e420136d8536487c575678ca52a33f7cb3488aadf7185fbd0196bee0 WHIRLPOOL c62857e0f534c09d67bf8d0c7bd16e9931827453778b56b7e6fe4383570e46452027ad4e982778b558dcc08bf0af25178c2205048f494aba9690ed3ad1baeff2
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.confd b/www-servers/spawn-fcgi/files/spawn-fcgi.confd
new file mode 100644
index 000000000000..7369e13d6c4d
--- /dev/null
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.confd
@@ -0,0 +1,74 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
+
+# The FCGI process can be made available through a filesystem socket or
+# through a inet socket. One and only one of the two types must be choosen.
+# Default is the inet socket.
+
+# The filename specified by
+# FCGI_SOCKET will be suffixed with a number for each child process, for
+# example, fcgi.socket-1.
+# Leave empty to use an IP socket (default). See below. Enabling this,
+# disables the IP socket.
+#
+FCGI_SOCKET=
+
+# When using FCGI_PORT, connections will only be accepted from the following
+# address. The default is 127.0.0.1. Use 0.0.0.0 to bind to all addresses.
+#
+FCGI_ADDRESS=127.0.0.1
+
+# The port specified by FCGI_PORT is the port used
+# by the first child process. If this is set to 1234 then subsequent child
+# processes will use 1235, 1236, etc.
+#
+FCGI_PORT=1234
+
+# The path to your FastCGI application. These sometimes carry the .fcgi
+# extension but not always. For PHP, you should usually point this to
+# /usr/bin/php-cgi.
+#
+#FCGI_PROGRAM=/usr/bin/php-cgi
+FCGI_PROGRAM=
+
+# The number of child processes to spawn. The default is 1.
+#
+FCGI_CHILDREN=1
+
+# If you want to run your application inside a chroot then specify the
+# directory here. Leave this blank otherwise.
+#
+FCGI_CHROOT=
+
+# If you want to run your application from a specific directiory specify
+# it here. Leave this blank otherwise.
+#
+FCGI_CHDIR=
+
+# The user and group to run your application as. If you do not specify these,
+# the application will be run as root:root.
+#
+FCGI_USER=
+FCGI_GROUP=
+
+# Additional options you might want to pass to spawn-fcgi
+#
+#FCGI_EXTRA_OPTIONS=
+
+# If your application requires additional environment variables, you may
+# specify them here. See PHP example below.
+#
+ALLOWED_ENV="PATH"
+
+# PHP ONLY :: These two options are specific to PHP. The first is the number
+# of child processes to spawn. The second is the number of requests to be
+# served by a single PHP process before it is restarted.
+#
+#PHP_FCGI_CHILDREN=5
+#PHP_FCGI_MAX_REQUESTS=500
+#
+# For this to work you would set
+# ALLOWED_ENV="PATH PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS"
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1 b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1
new file mode 100644
index 000000000000..ae24e4327c03
--- /dev/null
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r1
@@ -0,0 +1,117 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+SPAWNFCGI=/usr/bin/spawn-fcgi
+PIDPATH=/var/run/spawn-fcgi
+PIDFILE=${PIDPATH}/${PROGNAME}
+
+depend() {
+ need net
+}
+
+start() {
+ local X E OPTIONS i RETVAL FCGI_PROGRAM_EXEC
+ FCGI_PROGRAM_EXEC=$(echo ${FCGI_PROGRAM} | awk "{print \$1}")
+
+ if [ "${SVCNAME}" = "spawn-fcgi" ]; then
+ eerror "You are not supposed to run this script directly. Create a symlink"
+ eerror "for the FastCGI application you want to run as well as a copy of the"
+ eerror "configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s spawn-fcgi /etc/init.d/spawn-fcgi.trac"
+ eerror " cp /etc/conf.d/spawn-fcgi /etc/conf.d/spawn-fcgi.trac"
+ eerror " `basename "${EDITOR}"` /etc/conf.d/spawn-fcgi.trac"
+ eerror
+ return 1
+ fi
+
+ if [ ! -z "${FCGI_SOCKET}" ] && [ ! -z "${FCGI_PORT}" ]; then
+ eerror "Only one of the two may be defined:"
+ eerror " FCGI_SOCKET=${FCGI_SOCKET}"
+ eerror " FCGI_PORT=${FCGI_PORT}"
+ return 1
+ fi
+
+ if [ -z "${FCGI_PROGRAM}" ]; then
+ eerror "You need to specify which \$FCGI_PROGRAM"
+ eerror "you want to start."
+ eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}"
+ return 1
+ fi
+
+ if [ ! -x "${FCGI_PROGRAM_EXEC}" ]; then
+ eerror "The file specified as \$FCGI_PROGRAM"
+ eerror "does not exist or is not executable."
+ eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}"
+ return 1
+ fi
+
+ if [ -z "${FCGI_ADDRESS}" ]; then
+ FCGI_ADDRESS=127.0.0.1
+ fi
+
+ if [ -z "${FCGI_CHILDREN}" ]; then
+ FCGI_CHILDREN=1
+ fi
+
+ if [ -n "${FCGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}"
+ fi
+
+ if [ -n "${FCGI_DIR}" ]; then
+ OPTIONS="${OPTIONS} -d ${FCGI_DIR}"
+ fi
+
+ if [ -n "${FCGI_USER}" ] && [ "${FCGI_USER}" != "root" ]; then
+ OPTIONS="${OPTIONS} -u ${FCGI_USER}"
+ fi
+
+ if [ -n "${FCGI_GROUP}" ] && [ "${FCGI_GROUP}" != "root" ]; then
+ OPTIONS="${OPTIONS} -g ${FCGI_GROUP}"
+ fi
+
+ if [ -n "${FCGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${FCGI_EXTRA_OPTIONS}"
+ fi
+
+ unset E
+ for i in ${ALLOWED_ENV}; do
+ local j
+ eval j=$(echo \$"$i")
+ [ -n "${j}" ] && E="${E} ${i}=${j}"
+ done
+
+ ebegin "Starting FastCGI application ${PROGNAME}"
+ checkpath -q -d -m 700 /var/run/spawn-fcgi
+ X=0
+ while [ $X -lt ${FCGI_CHILDREN} ]; do
+ X=$(($X+1))
+ local P SOCKET_OPTION INET_OPTION
+ P=${PIDFILE}-${X}.pid
+ [ -n "${FCGI_SOCKET}" ] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}"
+ [ -n "${FCGI_PORT}" ] && INET_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))"
+
+ env -i ${E} /sbin/start-stop-daemon --start --pidfile ${P} --exec ${SPAWNFCGI} \
+ --name ${FCGI_PROGRAM_EXEC} -- ${SOCKET_OPTION} ${INET_OPTION} \
+ -P ${P} ${OPTIONS} -- ${FCGI_PROGRAM}
+ RETVAL=$?
+
+ # Stop on error. Don't want to spawn a mess!
+ [ "${RETVAL}" != "0" ] && break
+ done
+ eend ${RETVAL}
+}
+
+stop() {
+ local X RETVAL=0
+
+ ebegin "Stopping FastCGI application ${PROGNAME}"
+ for X in ${PIDFILE}-[0-9]*.pid ; do
+ start-stop-daemon --stop --pidfile ${X} || \
+ { RETVAL=$? && break ; }
+ done
+ eend ${RETVAL}
+}
diff --git a/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r2 b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r2
new file mode 100644
index 000000000000..46216508db77
--- /dev/null
+++ b/www-servers/spawn-fcgi/files/spawn-fcgi.initd-r2
@@ -0,0 +1,117 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+SPAWNFCGI=/usr/bin/spawn-fcgi
+PIDPATH=/run/spawn-fcgi
+PIDFILE=${PIDPATH}/${PROGNAME}
+
+depend() {
+ need net
+}
+
+start() {
+ local X E OPTIONS i RETVAL FCGI_PROGRAM_EXEC
+ FCGI_PROGRAM_EXEC=$(echo ${FCGI_PROGRAM} | awk "{print \$1}")
+
+ if [ "${SVCNAME}" = "spawn-fcgi" ]; then
+ eerror "You are not supposed to run this script directly. Create a symlink"
+ eerror "for the FastCGI application you want to run as well as a copy of the"
+ eerror "configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s spawn-fcgi /etc/init.d/spawn-fcgi.trac"
+ eerror " cp /etc/conf.d/spawn-fcgi /etc/conf.d/spawn-fcgi.trac"
+ eerror " `basename "${EDITOR}"` /etc/conf.d/spawn-fcgi.trac"
+ eerror
+ return 1
+ fi
+
+ if [ ! -z "${FCGI_SOCKET}" ] && [ ! -z "${FCGI_PORT}" ]; then
+ eerror "Only one of the two may be defined:"
+ eerror " FCGI_SOCKET=${FCGI_SOCKET}"
+ eerror " FCGI_PORT=${FCGI_PORT}"
+ return 1
+ fi
+
+ if [ -z "${FCGI_PROGRAM}" ]; then
+ eerror "You need to specify which \$FCGI_PROGRAM"
+ eerror "you want to start."
+ eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}"
+ return 1
+ fi
+
+ if [ ! -x "${FCGI_PROGRAM_EXEC}" ]; then
+ eerror "The file specified as \$FCGI_PROGRAM"
+ eerror "does not exist or is not executable."
+ eerror "Please adjust /etc/conf.d/spawn-fcgi.${PROGNAME}"
+ return 1
+ fi
+
+ if [ -z "${FCGI_ADDRESS}" ]; then
+ FCGI_ADDRESS=127.0.0.1
+ fi
+
+ if [ -z "${FCGI_CHILDREN}" ]; then
+ FCGI_CHILDREN=1
+ fi
+
+ if [ -n "${FCGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} -c ${FCGI_CHROOT}"
+ fi
+
+ if [ -n "${FCGI_DIR}" ]; then
+ OPTIONS="${OPTIONS} -d ${FCGI_DIR}"
+ fi
+
+ if [ -n "${FCGI_USER}" ] && [ "${FCGI_USER}" != "root" ]; then
+ OPTIONS="${OPTIONS} -u ${FCGI_USER}"
+ fi
+
+ if [ -n "${FCGI_GROUP}" ] && [ "${FCGI_GROUP}" != "root" ]; then
+ OPTIONS="${OPTIONS} -g ${FCGI_GROUP}"
+ fi
+
+ if [ -n "${FCGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${FCGI_EXTRA_OPTIONS}"
+ fi
+
+ unset E
+ for i in ${ALLOWED_ENV}; do
+ local j
+ eval j=$(echo \$"$i")
+ [ -n "${j}" ] && E="${E} ${i}=${j}"
+ done
+
+ ebegin "Starting FastCGI application ${PROGNAME}"
+ checkpath -q -d -m 700 /run/spawn-fcgi
+ X=0
+ while [ $X -lt ${FCGI_CHILDREN} ]; do
+ X=$(($X+1))
+ local P SOCKET_OPTION INET_OPTION
+ P=${PIDFILE}-${X}.pid
+ [ -n "${FCGI_SOCKET}" ] && SOCKET_OPTION="-s ${FCGI_SOCKET}-${X}"
+ [ -n "${FCGI_PORT}" ] && INET_OPTION="-a ${FCGI_ADDRESS} -p $((${FCGI_PORT} + ${X} - 1))"
+
+ env -i ${E} /sbin/start-stop-daemon --start --pidfile ${P} --exec ${SPAWNFCGI} \
+ --name ${FCGI_PROGRAM_EXEC} -- ${SOCKET_OPTION} ${INET_OPTION} \
+ -P ${P} ${OPTIONS} -- ${FCGI_PROGRAM}
+ RETVAL=$?
+
+ # Stop on error. Don't want to spawn a mess!
+ [ "${RETVAL}" != "0" ] && break
+ done
+ eend ${RETVAL}
+}
+
+stop() {
+ local X RETVAL=0
+
+ ebegin "Stopping FastCGI application ${PROGNAME}"
+ for X in ${PIDFILE}-[0-9]*.pid ; do
+ start-stop-daemon --stop --pidfile ${X} || \
+ { RETVAL=$? && break ; }
+ done
+ eend ${RETVAL}
+}
diff --git a/www-servers/spawn-fcgi/metadata.xml b/www-servers/spawn-fcgi/metadata.xml
new file mode 100644
index 000000000000..e2ecfb081079
--- /dev/null
+++ b/www-servers/spawn-fcgi/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <longdescription lang="en">spawn-fcgi is used to spawn FastCGI applications
+
+ Features
+ --------
+ - binds to IPv4 and Unix domain sockets
+ - supports privilege separation: chmod/chown socket, drop to uid/gid
+ - supports chroot
+ - supports daemontools supervise
+ </longdescription>
+</pkgmetadata>
diff --git a/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild
new file mode 100644
index 000000000000..a7bb62a1bcab
--- /dev/null
+++ b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+DESCRIPTION="A FCGI spawner for lighttpd and cherokee and other webservers"
+HOMEPAGE="http://redmine.lighttpd.net/projects/spawn-fcgi"
+SRC_URI="http://www.lighttpd.net/download/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
+IUSE="ipv6"
+
+DEPEND=""
+RDEPEND="!<=www-servers/lighttpd-1.4.20
+ !<=www-servers/cherokee-0.98.1"
+
+src_configure() {
+ econf $(use_enable ipv6)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README NEWS
+
+ newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi
+ newinitd "${FILESDIR}"/spawn-fcgi.initd-r1 spawn-fcgi
+
+ docinto examples
+ dodoc doc/run-generic doc/run-php doc/run-rails
+}
diff --git a/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r2.ebuild b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r2.ebuild
new file mode 100644
index 000000000000..5fd052e44193
--- /dev/null
+++ b/www-servers/spawn-fcgi/spawn-fcgi-1.6.3-r2.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A FCGI spawner for lighttpd and cherokee and other webservers"
+HOMEPAGE="http://redmine.lighttpd.net/projects/spawn-fcgi"
+SRC_URI="http://www.lighttpd.net/download/${P}.tar.bz2"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="ipv6"
+
+DEPEND=""
+RDEPEND="
+ !<=www-servers/lighttpd-1.4.20
+ !<=www-servers/cherokee-0.98.1"
+
+src_configure() {
+ econf $(use_enable ipv6)
+}
+
+src_install() {
+ default
+
+ newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi
+ newinitd "${FILESDIR}"/spawn-fcgi.initd-r2 spawn-fcgi
+
+ docinto examples
+ dodoc doc/run-generic doc/run-php doc/run-rails
+}
diff --git a/www-servers/spawn-fcgi/spawn-fcgi-1.6.4.ebuild b/www-servers/spawn-fcgi/spawn-fcgi-1.6.4.ebuild
new file mode 100644
index 000000000000..3e36addeec9e
--- /dev/null
+++ b/www-servers/spawn-fcgi/spawn-fcgi-1.6.4.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="A FCGI spawner for lighttpd and cherokee and other webservers"
+HOMEPAGE="http://redmine.lighttpd.net/projects/spawn-fcgi"
+SRC_URI="http://www.lighttpd.net/download/${P}.tar.xz"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="ipv6"
+
+DEPEND=""
+RDEPEND="
+ !<=www-servers/lighttpd-1.4.20
+ !<=www-servers/cherokee-0.98.1"
+
+src_configure() {
+ econf $(use_enable ipv6)
+}
+
+src_install() {
+ default
+
+ newconfd "${FILESDIR}"/spawn-fcgi.confd spawn-fcgi
+ newinitd "${FILESDIR}"/spawn-fcgi.initd-r2 spawn-fcgi
+
+ docinto examples
+ dodoc doc/run-generic doc/run-php doc/run-rails
+}
diff --git a/www-servers/thin/Manifest b/www-servers/thin/Manifest
new file mode 100644
index 000000000000..6dc0e4723b8b
--- /dev/null
+++ b/www-servers/thin/Manifest
@@ -0,0 +1 @@
+DIST thin-1.6.3.tar.gz 180296 SHA256 67ad0865c75c09b454bdabfaf7943275282f4aa059a5fb38b9aef8f2c5f7f231 SHA512 de8c564a9af79d6b8ed849d39c2147745deca8744926a96fe9a5f81745ccab0df5f144d74f1a69fb31d61c8b229d9f51331ad39770d20015e7a4e6453b3abed0 WHIRLPOOL bda35046cb67042273cba973a015518d62dce63627d8c58f7ab57e0a2a6eb6398d17a6d2e0e16f6627714c3aca48bbf0260abd3d34790b76e071ea12f5083735
diff --git a/www-servers/thin/files/thin.confd b/www-servers/thin/files/thin.confd
new file mode 100644
index 000000000000..ca517d6fe36c
--- /dev/null
+++ b/www-servers/thin/files/thin.confd
@@ -0,0 +1,20 @@
+# /etc/conf.d/thin: Configuration for /etc/init.d/thin*
+# Copy this file to /etc/conf.d/thin.SERVERNAME for server specific options.
+
+# Set the configuration file location.
+# In start-all mode (/etc/init.d/thin), this must point to the directory where
+# all the thin configurations are located.
+# When starting a specific server (/etc/init.d/thin.SERVER), point to the exact
+# location of the .yml configuration file.
+# CONFIG="/etc/thin/${SVCNAME#*.}.yml"
+
+# Disable looking for a configuration file.
+# You can use THIN_OPTS instead for setting command line options.
+# NOCONFIG=0
+
+# Set the Ruby interpreter to use.
+# RUBY="/usr/bin/ruby"
+
+# Set command line options to pass to thin.
+# In specific server mode, '--tag SERVER_NAME' is automatically appended.
+# THIN_OPTS=
diff --git a/www-servers/thin/files/thin.confd-1 b/www-servers/thin/files/thin.confd-1
new file mode 100644
index 000000000000..16eddf2f524c
--- /dev/null
+++ b/www-servers/thin/files/thin.confd-1
@@ -0,0 +1,32 @@
+# /etc/conf.d/thin: Configuration for /etc/init.d/thin*
+# Copy this file to /etc/conf.d/thin.SERVERNAME for server specific options.
+
+# Set the configuration file location.
+# In start-all mode (/etc/init.d/thin), this must point to the directory where
+# all the thin configurations are located.
+# When starting a specific server (/etc/init.d/thin.SERVER), point to the exact
+# location of the .yml configuration file.
+# CONFIG="/etc/thin/${SVCNAME#*.}.yml"
+
+# Disable looking for a configuration file.
+# You can use THIN_OPTS instead for setting command line options.
+# NOCONFIG=0
+
+# Set the Ruby interpreter to use.
+# RUBY="/usr/bin/ruby"
+
+# Set the user for this instance.
+# (Should mirror "user" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_USER=
+
+# Set the group for this instance.
+# (Should mirror "group" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_GROUP=
+
+# Set the pidfile for this instance.
+# (Should mirror "pid" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_PID=
+
+# Set command line options to pass to thin.
+# In specific server mode, '--tag SERVER_NAME' is automatically appended.
+# THIN_OPTS=
diff --git a/www-servers/thin/files/thin.confd-2 b/www-servers/thin/files/thin.confd-2
new file mode 100644
index 000000000000..ca89c44cfd0e
--- /dev/null
+++ b/www-servers/thin/files/thin.confd-2
@@ -0,0 +1,39 @@
+# /etc/conf.d/thin: Configuration for /etc/init.d/thin*
+# Copy this file to /etc/conf.d/thin.SERVERNAME for server specific options.
+
+# Set the configuration file location.
+# In start-all mode (/etc/init.d/thin), this must point to the directory where
+# all the thin configurations are located.
+# When starting a specific server (/etc/init.d/thin.SERVER), point to the exact
+# location of the .yml configuration file.
+# CONFIG="/etc/thin/${SVCNAME#*.}.yml"
+
+# Disable looking for a configuration file.
+# You can use THIN_OPTS instead for setting command line options.
+# NOCONFIG=0
+
+# Set the Ruby interpreter to use.
+# RUBY="/usr/bin/ruby"
+
+# Whether to start thin using `bundle exec'
+# DO_BUNDLER=0
+
+# What directory to cd into before starting thin
+# (useful for DO_BUNDLER)
+# CHDIR=
+
+# Set the user for this instance.
+# (Should mirror "user" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_USER=
+
+# Set the group for this instance.
+# (Should mirror "group" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_GROUP=
+
+# Set the pidfile for this instance.
+# (Should mirror "pid" value in /etc/thin/${SVCNAME#*.}.yml)
+# THIN_PID=
+
+# Set command line options to pass to thin.
+# In specific server mode, '--tag SERVER_NAME' is automatically appended.
+# THIN_OPTS=
diff --git a/www-servers/thin/files/thin.initd b/www-servers/thin/files/thin.initd
new file mode 100644
index 000000000000..acbb0c7ca35d
--- /dev/null
+++ b/www-servers/thin/files/thin.initd
@@ -0,0 +1,63 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need net localmount
+}
+
+checkconfig() {
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}
diff --git a/www-servers/thin/files/thin.initd-1 b/www-servers/thin/files/thin.initd-1
new file mode 100644
index 000000000000..420aa522089c
--- /dev/null
+++ b/www-servers/thin/files/thin.initd-1
@@ -0,0 +1,70 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+THIN_USER=${THIN_USER:-root}
+THIN_GROUP=${THIN_GROUP:-root}
+THIN_PID=${THIN_PID:-/var/run/thin/thin.pid}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need net localmount
+}
+
+checkconfig() {
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${THIN_USER}:${THIN_GROUP} $(dirname ${THIN_PID})
+}
diff --git a/www-servers/thin/files/thin.initd-2 b/www-servers/thin/files/thin.initd-2
new file mode 100644
index 000000000000..d3cba62de1ea
--- /dev/null
+++ b/www-servers/thin/files/thin.initd-2
@@ -0,0 +1,83 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+DO_BUNDLER=${DO_BUNDLER:-0}
+CHDIR=${CHDIR:-}
+THIN_USER=${THIN_USER:-root}
+THIN_GROUP=${THIN_GROUP:-root}
+THIN_PID=${THIN_PID:-/var/run/thin/thin.pid}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need localmount
+}
+
+checkconfig() {
+ if [ -n ${CHDIR} ]; then
+ cd "${CHDIR}"
+
+ if [ $? -ne 0 ]; then
+ eerror "Cannot cd into requested directory"
+ return 1
+ fi
+ fi
+
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ [ ${DO_BUNDLER} -ne 0 ] && RUBY="${RUBY} /usr/bin/bundle exec"
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}
+
+start_pre() {
+ checkpath -d -m 0775 -o ${THIN_USER}:${THIN_GROUP} $(dirname ${THIN_PID})
+}
diff --git a/www-servers/thin/files/thin.initd-3 b/www-servers/thin/files/thin.initd-3
new file mode 100644
index 000000000000..29406ceb9206
--- /dev/null
+++ b/www-servers/thin/files/thin.initd-3
@@ -0,0 +1,88 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+SERVER=${SVCNAME#*.}
+if [ ${SERVER} != thin ]; then
+ CONFIG=${CONFIG:-/etc/thin/${SERVER}.yml}
+else
+ CONFIG=${CONFIG:-/etc/thin/}
+fi
+NOCONFIG=${NOCONFIG:-0}
+RUBY=${RUBY:-/usr/bin/ruby}
+DO_BUNDLER=${DO_BUNDLER:-0}
+CHDIR=${CHDIR:-}
+THIN_USER=${THIN_USER:-root}
+THIN_GROUP=${THIN_GROUP:-root}
+THIN_PID=${THIN_PID:-/var/run/thin/thin.pid}
+THIN_OPTS=${THIN_OPTS:-}
+
+depend() {
+ need localmount
+}
+
+checkconfig() {
+ if [ -n ${CHDIR} ]; then
+ cd "${CHDIR}"
+
+ if [ $? -ne 0 ]; then
+ eerror "Cannot cd into requested directory"
+ return 1
+ fi
+ fi
+
+ [ ${SERVER} = thin -o ${NOCONFIG} != 0 ] && return 0
+
+ if [ ! -f ${CONFIG} ]; then
+ eerror "Unable to find the server configuration."
+ eerror "Please set the CONFIG variable in /etc/conf.d/${SVCNAME} or"
+ eerror "set NOCONFIG there to 1 to disable looking for a config file."
+ return 1
+ fi
+}
+
+buildargs() {
+ if [ ${NOCONFIG} = 0 -a ${SERVER} != thin ]; then
+ echo -n "-C ${CONFIG} "
+ fi
+
+ echo -n "${THIN_OPTS}"
+}
+
+action() {
+ checkconfig || return 1
+
+ [ ${DO_BUNDLER} -ne 0 ] && RUBY="${RUBY} /usr/bin/bundle exec"
+
+ if [ ${SERVER} = thin ]; then
+ ebegin "$2 all thin servers in ${CONFIG}"
+ ${RUBY} /usr/bin/thin $1 $(buildargs) --all ${CONFIG}
+ eend $?
+ else
+ ebegin "$2 thin server ${SERVER}"
+ ${RUBY} /usr/bin/thin $(buildargs) --tag ${SERVER} $1
+ eend $?
+ fi
+}
+
+start() {
+ action start 'Starting'
+}
+
+stop() {
+ action stop 'Stopping'
+}
+
+restart() {
+ action restart 'Restarting'
+}
+
+start_pre() {
+ # If the path to the pidfile is /var/run/thin/foo/thin.pid
+ # then checkpath will fail if /var/run/thin/ does not exist.
+ # This caught infra...
+ d=$(dirname ${THIN_PID})
+ mkdir -p "$d"
+ checkpath -d -m 0775 -o ${THIN_USER}:${THIN_GROUP} "$d"
+}
diff --git a/www-servers/thin/metadata.xml b/www-servers/thin/metadata.xml
new file mode 100644
index 000000000000..468426a55f69
--- /dev/null
+++ b/www-servers/thin/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>ruby</herd>
+ <longdescription>
+Thin is a very simple web server written in Ruby. It's single-threaded, which
+means it can only serve one request at a time. This simplicity affords increased
+speed and decreased memory usage for singled-threaded framework like Rails.
+</longdescription>
+ <upstream>
+ <remote-id type="github">macournoyer/thin</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/thin/thin-1.6.3-r1.ebuild b/www-servers/thin/thin-1.6.3-r1.ebuild
new file mode 100644
index 000000000000..e98d7933fa49
--- /dev/null
+++ b/www-servers/thin/thin-1.6.3-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+USE_RUBY="ruby19 ruby20 ruby21"
+
+RUBY_FAKEGEM_TASK_TEST="spec:main spec:group:0 spec:group:1 spec:group:2"
+
+RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A fast and very simple Ruby web server"
+HOMEPAGE="http://code.macournoyer.com/thin/"
+SRC_URI="https://github.com/macournoyer/thin/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Ruby"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="doc test"
+
+DEPEND="${DEPEND}
+ dev-util/ragel"
+RDEPEND="${RDEPEND}"
+
+# The runtime dependencies are used at build-time as well since the
+# Rakefile loads thin!
+mydeps=">=dev-ruby/daemons-1.0.9
+ >=dev-ruby/rack-1.0.0
+ >=dev-ruby/eventmachine-1.0.0
+ virtual/ruby-ssl"
+
+ruby_add_rdepend "${mydeps}"
+ruby_add_bdepend "${mydeps}
+ dev-ruby/rake-compiler
+ test? ( dev-ruby/rspec:0 )"
+
+all_ruby_prepare() {
+ # Fix Ragel-based parser generation (uses a *very* old syntax that
+ # is not supported in Gentoo)
+ sed -i -e 's: | rlgen-cd::' Rakefile || die
+
+ # Fix specs' dependencies so that the extension is not rebuilt
+ # when running tests
+ sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die
+
+ # Fix rspec version to allow newer 1.x versions
+ sed -i -e '/gem "rspec"/ s/1.2.9/1.0/' tasks/spec.rake spec/spec_helper.rb || die
+
+ # Avoid CLEAN since it may not be available and we don't need it.
+ sed -i -e '/CLEAN/ s:^:#:' tasks/*.rake || die
+
+ # Disable a test that is known for freezing the testsuite,
+ # reported upstream. In thin 1.5.1 this just fails.
+ sed -i \
+ -e '/should force kill process in pid file/,/^ end/ s:^:#:' \
+ spec/daemonizing_spec.rb || die
+
+ # nasty but too complex to fix up for now :(
+ use doc || rm tasks/rdoc.rake
+ use test || rm tasks/spec.rake
+}
+
+each_ruby_compile() {
+ ${RUBY} -S rake compile || die "rake compile failed"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ keepdir /etc/thin
+ newinitd "${FILESDIR}"/${PN}.initd-3 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-2 ${PN}
+
+ einfo
+ elog "Thin is now shipped with init scripts."
+ elog "The default script (/etc/init.d/thin) will start all servers that have"
+ elog "configuration files in /etc/thin/. You can symlink the init script to"
+ elog "files of the format 'thin.SERVER' to be able to start individual servers."
+ elog "See /etc/conf.d/thin for more configuration options."
+ einfo
+}
diff --git a/www-servers/thin/thin-1.6.3.ebuild b/www-servers/thin/thin-1.6.3.ebuild
new file mode 100644
index 000000000000..c972f511c4aa
--- /dev/null
+++ b/www-servers/thin/thin-1.6.3.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+USE_RUBY="ruby19 ruby20 ruby21"
+
+RUBY_FAKEGEM_TASK_TEST="spec:main spec:group:0 spec:group:1 spec:group:2"
+
+RUBY_FAKEGEM_GEMSPEC="${PN}.gemspec"
+
+inherit ruby-fakegem
+
+DESCRIPTION="A fast and very simple Ruby web server"
+HOMEPAGE="http://code.macournoyer.com/thin/"
+SRC_URI="https://github.com/macournoyer/thin/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Ruby"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="doc test"
+
+DEPEND="${DEPEND}
+ dev-util/ragel"
+RDEPEND="${RDEPEND}"
+
+# The runtime dependencies are used at build-time as well since the
+# Rakefile loads thin!
+mydeps=">=dev-ruby/daemons-1.0.9
+ >=dev-ruby/rack-1.0.0
+ >=dev-ruby/eventmachine-1.0.0
+ virtual/ruby-ssl"
+
+ruby_add_rdepend "${mydeps}"
+ruby_add_bdepend "${mydeps}
+ dev-ruby/rake-compiler
+ test? ( dev-ruby/rspec:0 )"
+
+all_ruby_prepare() {
+ # Fix Ragel-based parser generation (uses a *very* old syntax that
+ # is not supported in Gentoo)
+ sed -i -e 's: | rlgen-cd::' Rakefile || die
+
+ # Fix specs' dependencies so that the extension is not rebuilt
+ # when running tests
+ sed -i -e '/:spec =>/s:^:#:' tasks/spec.rake || die
+
+ # Fix rspec version to allow newer 1.x versions
+ sed -i -e '/gem "rspec"/ s/1.2.9/1.0/' tasks/spec.rake spec/spec_helper.rb || die
+
+ # Avoid CLEAN since it may not be available and we don't need it.
+ sed -i -e '/CLEAN/ s:^:#:' tasks/*.rake || die
+
+ # Disable a test that is known for freezing the testsuite,
+ # reported upstream. In thin 1.5.1 this just fails.
+ sed -i \
+ -e '/should force kill process in pid file/,/^ end/ s:^:#:' \
+ spec/daemonizing_spec.rb || die
+
+ # nasty but too complex to fix up for now :(
+ use doc || rm tasks/rdoc.rake
+ use test || rm tasks/spec.rake
+}
+
+each_ruby_compile() {
+ ${RUBY} -S rake compile || die "rake compile failed"
+}
+
+all_ruby_install() {
+ all_fakegem_install
+
+ keepdir /etc/thin
+ newinitd "${FILESDIR}"/${PN}.initd-2 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd-2 ${PN}
+
+ einfo
+ elog "Thin is now shipped with init scripts."
+ elog "The default script (/etc/init.d/thin) will start all servers that have"
+ elog "configuration files in /etc/thin/. You can symlink the init script to"
+ elog "files of the format 'thin.SERVER' to be able to start individual servers."
+ elog "See /etc/conf.d/thin for more configuration options."
+ einfo
+}
diff --git a/www-servers/thttpd/Manifest b/www-servers/thttpd/Manifest
new file mode 100644
index 000000000000..65853b6ecb91
--- /dev/null
+++ b/www-servers/thttpd/Manifest
@@ -0,0 +1,2 @@
+DIST sthttpd-2.26.4.tar.gz 194544 SHA256 78e87979140cbda123c81b4051552242dbbffb5dec1a17e5f95ec4826b1eaddb SHA512 64d0ab4720cc0a8926bc8537d335f5238e5343cf6caad837fe09fe46bfaaaa7013b690193905b3db31a5e945141e7fb3aca52355459ff151ce56b30cfefccd87 WHIRLPOOL e38cce33dd417ce8e30426d0764797e24ebfab2060bacf2f27ee2717b2025e48e6f32245cc6a5ebfed856f8755098f1540ec7ed2005aad1aeff65454dd731c1a
+DIST sthttpd-2.27.0.tar.gz 206781 SHA256 97d660a881331e93818e872ce11536f461105d70a18dfc5de5895851c4b2afdb SHA512 78945867a01de2f9019deb2d1f21cdedf675c9d67f5de672d0d0bfdc397b444ac287a91d96976dddcdca080cc944e72dd3d1f95f31a592eb839125c494799bdc WHIRLPOOL 55ab90405b3affcb260dc4cfa14008f79cc0b2fd808686078b34ae0a6be2cc4941241406d78f9c2d06360ab6a07f1bf4abc1cf814a46ebe136f031058026419f
diff --git a/www-servers/thttpd/files/thttpd-fix-world-readable-log.patch b/www-servers/thttpd/files/thttpd-fix-world-readable-log.patch
new file mode 100644
index 000000000000..5c011bac52b5
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-fix-world-readable-log.patch
@@ -0,0 +1,59 @@
+From d2e186dbd58d274a0dea9b59357edc8498b5388d Mon Sep 17 00:00:00 2001
+From: "Anthony G. Basile" <blueness@gentoo.org>
+Date: Tue, 26 Feb 2013 14:28:26 -0500
+Subject: [PATCH] src/thttpd.c: Fix world readable log, CVE-2013-0348.
+
+Make sure that the logfile is created or reopened as read/write
+by thttpd user only.
+
+X-gentoo-Bug: 458896
+X-gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=458896
+Reported-by: Agostino Sarubbo <ago@gentoo.org>
+Signed-off-by: Anthony G. Basile <basile@opensource.dyc.edu>
+---
+ src/thttpd.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/thttpd.c b/src/thttpd.c
+index 019b8c0..f33a7a7 100644
+--- a/src/thttpd.c
++++ b/src/thttpd.c
+@@ -326,6 +326,7 @@ static void
+ re_open_logfile( void )
+ {
+ FILE* logfp;
++ int retchmod;
+
+ if ( no_log || hs == (httpd_server*) 0 )
+ return;
+@@ -335,7 +336,8 @@ re_open_logfile( void )
+ {
+ syslog( LOG_NOTICE, "re-opening logfile" );
+ logfp = fopen( logfile, "a" );
+- if ( logfp == (FILE*) 0 )
++ retchmod = chmod( logfile, S_IRUSR|S_IWUSR );
++ if ( logfp == (FILE*) 0 || retchmod != 0 )
+ {
+ syslog( LOG_CRIT, "re-opening %.80s - %m", logfile );
+ return;
+@@ -355,6 +357,7 @@ main( int argc, char** argv )
+ gid_t gid = 32767;
+ char cwd[MAXPATHLEN+1];
+ FILE* logfp;
++ int retchmod;
+ int num_ready;
+ int cnum;
+ connecttab* c;
+@@ -424,7 +427,8 @@ main( int argc, char** argv )
+ else
+ {
+ logfp = fopen( logfile, "a" );
+- if ( logfp == (FILE*) 0 )
++ retchmod = chmod( logfile, S_IRUSR|S_IWUSR );
++ if ( logfp == (FILE*) 0 || retchmod != 0 )
+ {
+ syslog( LOG_CRIT, "%.80s - %m", logfile );
+ perror( logfile );
+--
+1.7.12.4
+
diff --git a/www-servers/thttpd/files/thttpd-renamed-htpasswd.patch b/www-servers/thttpd/files/thttpd-renamed-htpasswd.patch
new file mode 100644
index 000000000000..31e68429dbd6
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd-renamed-htpasswd.patch
@@ -0,0 +1,108 @@
+diff --git a/configure.ac b/configure.ac
+index 2c2dfae..e028a0d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -42,12 +42,6 @@ if test "x${WEBDIR}" = "x" ; then
+ WEBDIR='/usr/local/www'
+ fi
+
+-AC_ARG_VAR(WEBGROUP, [The group that the web server will run as])
+-
+-if test "x${WEBGROUP}" = "x" ; then
+- WEBGROUP='thttpd'
+-fi
+-
+ AC_CONFIG_FILES([Makefile
+ docs/Makefile
+ extras/Makefile
+diff --git a/docs/Makefile.am b/docs/Makefile.am
+index 303c25f..2823290 100644
+--- a/docs/Makefile.am
++++ b/docs/Makefile.am
+@@ -1 +1 @@
+-dist_man_MANS = htpasswd.1 makeweb.1 redirect.8 ssi.8 syslogtocern.8 thttpd.8
++dist_man_MANS = th_htpasswd.1 makeweb.1 redirect.8 ssi.8 syslogtocern.8 thttpd.8
+diff --git a/docs/htpasswd.1 b/docs/htpasswd.1
+deleted file mode 100644
+index 1124b02..0000000
+--- a/docs/htpasswd.1
++++ /dev/null
+@@ -1,16 +0,0 @@
+-.TH htpasswd 1 "05 May 1998"
+-.SH NAME
+-htpasswd - manipulate HTTP-server password files
+-.SH SYNOPSIS
+-.B htpasswd
+-.RB [ -c ]
+-.I passwordfile
+-.I username
+-.SH DESCRIPTION
+-.PP
+-Sets a user's password in an httpd-style password file.
+-The -c flag creates a new file.
+-.SH AUTHOR
+-Rob McCool.
+-Modified 29aug97 by Jef Poskanzer to accept new password on stdin,
+-if stdin is a pipe or file. This is necessary for use from CGI.
+diff --git a/docs/th_htpasswd.1 b/docs/th_htpasswd.1
+new file mode 100644
+index 0000000..f524af9
+--- /dev/null
++++ b/docs/th_htpasswd.1
+@@ -0,0 +1,16 @@
++.TH th_htpasswd 1 "05 May 1998"
++.SH NAME
++th_htpasswd - manipulate HTTP-server password files
++.SH SYNOPSIS
++.B th_htpasswd
++.RB [ -c ]
++.I passwordfile
++.I username
++.SH DESCRIPTION
++.PP
++Sets a user's password in an httpd-style password file.
++The -c flag creates a new file.
++.SH AUTHOR
++Rob McCool.
++Modified 29aug97 by Jef Poskanzer to accept new password on stdin,
++if stdin is a pipe or file. This is necessary for use from CGI.
+diff --git a/docs/thttpd.8 b/docs/thttpd.8
+index a0fd334..78af884 100644
+--- a/docs/thttpd.8
++++ b/docs/thttpd.8
+@@ -270,7 +270,7 @@ called .htpasswd by default.
+ This file is formatted as the familiar colon-separated
+ username/encrypted-password pair, records delimited by newlines.
+ The protection does not carry over to subdirectories.
+-The utility program htpasswd(1) is included to help create and
++The utility program th_htpasswd(1) is included to help create and
+ modify .htpasswd files.
+ .PP
+ Relevant thttpd.h option: AUTH_FILE
+@@ -562,7 +562,7 @@ This is a little tricky to set up correctly, for instance if you are using
+ chroot() then the log file must be within the chroot tree, but it's
+ definitely doable.
+ .SH "SEE ALSO"
+-redirect(8), ssi(8), makeweb(1), htpasswd(1), syslogtocern(8), weblog_parse(1), http_get(1)
++redirect(8), ssi(8), makeweb(1), th_htpasswd(1), syslogtocern(8), weblog_parse(1), http_get(1)
+ .SH THANKS
+ .PP
+ Many thanks to contributors, reviewers, testers:
+diff --git a/extras/Makefile.am b/extras/Makefile.am
+index b1f3b4d..ffd19d7 100644
+--- a/extras/Makefile.am
++++ b/extras/Makefile.am
+@@ -1,11 +1,7 @@
+ AM_CPPFLAGS = -DWEBDIR='"$(WEBDIR)"'
+
+-sbin_PROGRAMS = makeweb htpasswd
++sbin_PROGRAMS = makeweb th_htpasswd
+ makeweb_SOURCES = makeweb.c
+-htpasswd_SOURCES = htpasswd.c
++th_htpasswd_SOURCES = th_htpasswd.c
+
+ dist_sbin_SCRIPTS = syslogtocern
+-
+-install-exec-hook:
+- chgrp $(WEBGROUP) $(DESTDIR)$(sbindir)/makeweb
+- chmod 2751 $(DESTDIR)$(sbindir)/makeweb
diff --git a/www-servers/thttpd/files/thttpd.conf.sample b/www-servers/thttpd/files/thttpd.conf.sample
new file mode 100644
index 000000000000..462bd0c198d0
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.conf.sample
@@ -0,0 +1,38 @@
+## /etc/thttpd.conf
+##
+## do not leave empty lines in here!
+## format is: key=value
+##
+## run in debug-mode?
+#debug
+##
+## what interface to bind to?
+## (default is binding to any interface)
+#host=www.example.org
+port=80
+user=thttpd
+##
+## CGI:
+## ? match a single char
+## * matches any string excluding "/"
+## ** matches any string including "/"
+## separate multiple patterns with "|"
+#cgipat=**.sh|**.cgi
+##
+## chroot:
+chroot
+#nochroot
+##
+logfile=/var/log/thttpd.log
+pidfile=/var/run/thttpd.pid
+##
+charset=iso-8859-1
+##
+## control the caching: (in secs)
+#maxage 60
+##
+## virtual hosting:
+#vhost
+##
+## cache-control: send this "max-age" in all HTTP-responses:
+#max-age=0
diff --git a/www-servers/thttpd/files/thttpd.confd.1 b/www-servers/thttpd/files/thttpd.confd.1
new file mode 100644
index 000000000000..b5f630e7ecc2
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.confd.1
@@ -0,0 +1,35 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+## Config file for /etc/init.d/thttpd
+
+## the startup-dir of thttpd is the docroot, so we specify it here
+## and the init-script does a "cd" prior to startup:
+THTTPD_DOCROOT="/var/www/localhost"
+
+## There are 2 ways to configure thttpd:
+## 1) specify all params on the cmd-line
+## 2) use a config-file (and start with "-C <conf-file>")
+
+## For additional thttpd instances, run:
+# ln -s /etc/init.d/thttpd /etc/init.d/thttpd.$NAME
+# cp /etc/conf.d/thttpd /etc/conf.d/thttpd.$NAME
+
+## Note: 1) and 2) can be mixed but
+## the init-script set PID (option -i) to
+## /var/run/thttpd.$NAME.run
+## and logfile (option -l) to
+## /var/log/thttpd.$NAME.log
+##
+## We choose 1) here -- if you have a more complicated setup read
+## thttpd(8) for details on 2).
+
+THTTPD_OPTS="-p 80 -u thttpd -r"
+
+## For a more complex setup (e.g. cgi-support) use an external configfile:
+## comment the THTTPD_OPTS line above und use the one below.
+#THTTPD_OPTS="-C /etc/thttpd/thttpd.conf"
+
+## If you know what you are doing you can add cgi-support with the line below;
+## but you _should_ use the extern-configfile version!
+#THTTPD_OPTS="$THTTPD_OPTS -c **.cgi|**.sh"
diff --git a/www-servers/thttpd/files/thttpd.init.1 b/www-servers/thttpd/files/thttpd.init.1
new file mode 100644
index 000000000000..415ead79d6a6
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.init.1
@@ -0,0 +1,34 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v3 or later
+
+depend() {
+ need net
+ use dns logger netmount
+ after sshd
+}
+
+checkconfig() {
+ if [ ! -d "$THTTPD_DOCROOT" ]; then
+ eend 1 "THTTPD_DOCROOT not set correctly in /etc/conf.d/${SVCNAME}"
+ fi
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+
+ checkconfig || return 1
+
+ start-stop-daemon --quiet --start --exec /usr/sbin/thttpd \
+ --pidfile /var/run/${SVCNAME}.pid --chdir "$THTTPD_DOCROOT" -- \
+ -i /var/run/${SVCNAME}.pid \
+ -l /var/log/${SVCNAME}.log \
+ ${THTTPD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --quiet --stop --pidfile /var/run/${SVCNAME}.pid
+ eend $?
+}
diff --git a/www-servers/thttpd/files/thttpd.logrotate b/www-servers/thttpd/files/thttpd.logrotate
new file mode 100644
index 000000000000..7e75c813524a
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.logrotate
@@ -0,0 +1,12 @@
+/var/log/thttpd.log {
+ daily
+ rotate 5
+ compress
+ delaycompress
+ missingok
+ notifempty
+ sharedscripts
+ postrotate
+ kill -HUP `cat /var/run/thttpd.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}
diff --git a/www-servers/thttpd/files/thttpd.service b/www-servers/thttpd/files/thttpd.service
new file mode 100644
index 000000000000..4e56c0877d70
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Fork of thttpd, a small, fast, multiplexing webserver.
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/thttpd.pid
+WorkingDirectory=/var/www/localhost
+ExecStart=/usr/sbin/thttpd -C /etc/thttpd/thttpd.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/thttpd/metadata.xml b/www-servers/thttpd/metadata.xml
new file mode 100644
index 000000000000..d67a15ac1284
--- /dev/null
+++ b/www-servers/thttpd/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+</maintainer>
+</pkgmetadata>
diff --git a/www-servers/thttpd/thttpd-2.26.4-r3.ebuild b/www-servers/thttpd/thttpd-2.26.4-r3.ebuild
new file mode 100644
index 000000000000..64a5940df926
--- /dev/null
+++ b/www-servers/thttpd/thttpd-2.26.4-r3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic systemd toolchain-funcs user
+
+MY_P="s${P}"
+
+DESCRIPTION="Fork of thttpd, a small, fast, multiplexing webserver"
+HOMEPAGE="http://opensource.dyc.edu/sthttpd"
+SRC_URI="http://opensource.dyc.edu/pub/sthttpd/${MY_P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm ~hppa ~mips ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+WEBROOT="/var/www/localhost"
+
+THTTPD_USER=thttpd
+THTTPD_GROUP=thttpd
+THTTPD_DOCROOT="${EPREFIX}${WEBROOT}/htdocs"
+
+DOCS=( README TODO )
+
+pkg_setup() {
+ ebegin "Creating thttpd user and group"
+ enewgroup ${THTTPD_GROUP}
+ enewuser ${THTTPD_USER} -1 -1 -1 ${THTTPD_GROUP}
+}
+
+src_prepare () {
+ epatch "${FILESDIR}"/thttpd-fix-world-readable-log.patch
+}
+
+src_configure() {
+ econf WEBDIR=${THTTPD_DOCROOT}
+}
+
+src_install () {
+ default
+
+ newinitd "${FILESDIR}"/thttpd.init.1 thttpd
+ newconfd "${FILESDIR}"/thttpd.confd.1 thttpd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/thttpd.logrotate" thttpd
+
+ insinto /etc/thttpd
+ doins "${FILESDIR}"/thttpd.conf.sample
+
+ systemd_dounit "${FILESDIR}/${PN}.service"
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${ED}"${WEBROOT}/htdocs \
+ "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${ED}"${WEBROOT}/htdocs
+
+ keepdir ${WEBROOT}/htdocs
+
+ chown root:${THTTPD_GROUP} "${ED}/usr/sbin/makeweb" \
+ || die "Failed chown makeweb"
+ chmod 2751 "${ED}/usr/sbin/makeweb" \
+ || die "Failed chmod makeweb"
+ chmod 755 "${ED}/usr/share/doc/${PF}/htdocs.dist/cgi-bin/printenv" \
+ || die "Failed chmod printenv"
+}
diff --git a/www-servers/thttpd/thttpd-2.27.0.ebuild b/www-servers/thttpd/thttpd-2.27.0.ebuild
new file mode 100644
index 000000000000..507e1f56aa38
--- /dev/null
+++ b/www-servers/thttpd/thttpd-2.27.0.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic toolchain-funcs user
+
+if [[ ${PV} = 9999* ]]
+then
+ EGIT_REPO_URI="git://opensource.dyc.edu/s${PN}.git"
+ inherit git-2
+ KEYWORDS="ppc64 sparc"
+else
+ MY_P="s${P}"
+ S="${WORKDIR}/${MY_P}"
+ SRC_URI="http://opensource.dyc.edu/pub/sthttpd/${MY_P}.tar.gz"
+ KEYWORDS="amd64 arm ~hppa ~mips ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Fork of thttpd, a small, fast, multiplexing webserver"
+HOMEPAGE="http://opensource.dyc.edu/sthttpd"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+WEBROOT="/var/www/localhost"
+
+THTTPD_USER=thttpd
+THTTPD_GROUP=thttpd
+THTTPD_DOCROOT="${EPREFIX}${WEBROOT}/htdocs"
+
+DOCS=( README TODO )
+
+pkg_setup() {
+ ebegin "Creating thttpd user and group"
+ enewgroup ${THTTPD_GROUP}
+ enewuser ${THTTPD_USER} -1 -1 -1 ${THTTPD_GROUP}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/thttpd-renamed-htpasswd.patch
+ mv "${S}"/extras/{htpasswd.c,th_htpasswd.c} || die
+ eautoreconf -f -i
+}
+
+src_configure() {
+ econf WEBDIR=${THTTPD_DOCROOT}
+}
+
+src_install () {
+ default
+
+ newinitd "${FILESDIR}"/thttpd.init.1 thttpd
+ newconfd "${FILESDIR}"/thttpd.confd.1 thttpd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/thttpd.logrotate" thttpd
+
+ insinto /etc/thttpd
+ doins "${FILESDIR}"/thttpd.conf.sample
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${ED}"${WEBROOT}/htdocs \
+ "${ED}"/usr/share/doc/"${PF}"/htdocs.dist || die
+ mkdir "${ED}"${WEBROOT}/htdocs || die
+
+ keepdir ${WEBROOT}/htdocs
+
+ chown root:${THTTPD_GROUP} "${ED}/usr/sbin/makeweb" \
+ || die "Failed chown makeweb"
+ chmod 2751 "${ED}/usr/sbin/makeweb" \
+ || die "Failed chmod makeweb"
+ chmod 755 "${ED}/usr/share/doc/${PF}/htdocs.dist/cgi-bin/printenv" \
+ || die "Failed chmod printenv"
+}
diff --git a/www-servers/thttpd/thttpd-9999.ebuild b/www-servers/thttpd/thttpd-9999.ebuild
new file mode 100644
index 000000000000..afbafc0ee56a
--- /dev/null
+++ b/www-servers/thttpd/thttpd-9999.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic toolchain-funcs user
+
+if [[ ${PV} = 9999* ]]
+then
+ EGIT_REPO_URI="git://opensource.dyc.edu/s${PN}.git"
+ inherit git-2
+ KEYWORDS=""
+else
+ MY_P="s${P}"
+ S="${WORKDIR}/${MY_P}"
+ SRC_URI="http://opensource.dyc.edu/pub/sthttpd/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Fork of thttpd, a small, fast, multiplexing webserver"
+HOMEPAGE="http://opensource.dyc.edu/sthttpd"
+
+LICENSE="BSD GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+WEBROOT="/var/www/localhost"
+
+THTTPD_USER=thttpd
+THTTPD_GROUP=thttpd
+THTTPD_DOCROOT="${EPREFIX}${WEBROOT}/htdocs"
+
+DOCS=( README TODO )
+
+pkg_setup() {
+ ebegin "Creating thttpd user and group"
+ enewgroup ${THTTPD_GROUP}
+ enewuser ${THTTPD_USER} -1 -1 -1 ${THTTPD_GROUP}
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/thttpd-renamed-htpasswd.patch
+ mv "${S}"/extras/{htpasswd.c,th_htpasswd.c}
+ eautoreconf -f -i
+}
+
+src_configure() {
+ econf WEBDIR=${THTTPD_DOCROOT}
+}
+
+src_install () {
+ default
+
+ newinitd "${FILESDIR}"/thttpd.init.1 thttpd
+ newconfd "${FILESDIR}"/thttpd.confd.1 thttpd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/thttpd.logrotate" thttpd
+
+ insinto /etc/thttpd
+ doins "${FILESDIR}"/thttpd.conf.sample
+
+ #move htdocs to docdir, bug #429632
+ docompress -x /usr/share/doc/"${PF}"/htdocs.dist
+ mv "${ED}"${WEBROOT}/htdocs \
+ "${ED}"/usr/share/doc/"${PF}"/htdocs.dist
+ mkdir "${ED}"${WEBROOT}/htdocs
+
+ keepdir ${WEBROOT}/htdocs
+
+ chown root:${THTTPD_GROUP} "${ED}/usr/sbin/makeweb" \
+ || die "Failed chown makeweb"
+ chmod 2751 "${ED}/usr/sbin/makeweb" \
+ || die "Failed chmod makeweb"
+ chmod 755 "${ED}/usr/share/doc/${PF}/htdocs.dist/cgi-bin/printenv" \
+ || die "Failed chmod printenv"
+}
diff --git a/www-servers/tomcat/Manifest b/www-servers/tomcat/Manifest
new file mode 100644
index 000000000000..dafdb4ce8c6c
--- /dev/null
+++ b/www-servers/tomcat/Manifest
@@ -0,0 +1,3 @@
+DIST apache-tomcat-6.0.44-src.tar.gz 3447711 SHA256 c6f01526d58f2ba7b9da496e959d9e68cc49183006077704ab91c36ebebf5a4a SHA512 0d6a1539b28fa8ca3442557889d7d21cc523b18136f6998820ba13f41420536aba65ce78bac526002ee1dd86df3cbc80d9f043a3f765d7cf0b79e58e516030be WHIRLPOOL c65e704466191a0f98ec777e95dda889599ff6a545e7c013fd04bc0b72e0d0edf4491415f243d6a4de60cf76abe5c13ffbcc6d98f78b51490f7b7b43b24ecb97
+DIST apache-tomcat-7.0.59-src.tar.gz 4687344 SHA256 3a1dedda4019db87464fca3aeb4e800a538f0baee96d8b14c9d64967b0d2ea44 SHA512 acc322eee1446dd1bff72910ae9f40a62f88332ee69d6057b3c684e2abf8f28e6df6ab9505900f0b0cf7a5e2e0e80e64b0a790b3b78594ce595ce897706b4bcb WHIRLPOOL 4948964c1746e6ee912ac72c901ba271793610f402bf082455d104e2e8d6dbfa0bf5371d42d48d8ad7c826271fa60d989119a01e700497099022d0cf3564fdff
+DIST apache-tomcat-8.0.23-src.tar.gz 4868650 SHA256 6293713e78da9bb803060c8ddff982f8f7aef5a2e4b325340088493ce9957ba4 SHA512 cc83194b2847fc2db5448d548c7e65a1198cda02726b070f913a762d324152315886fba09532b879e26d15ec57e04057cc30b3a686b2a2307d6447d17f84e16c WHIRLPOOL b0559a4ef1b4c1f0683e4cce976d31db175d3c4f4d2b809b127e1074d49a6bf764366cc3e91f9a0818afd6de35e662a7aab89866dfd2e61673327c50535bff88
diff --git a/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch
new file mode 100644
index 000000000000..6517dee4d196
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-6.0.44-build.xml.patch
@@ -0,0 +1,31 @@
+--- build.xml.orig 2012-07-06 20:26:21.361299240 +0200
++++ build.xml 2012-07-06 20:26:56.085899911 +0200
+@@ -487,12 +487,14 @@
+
+ <target name="deploy" depends="build-only,build-docs,warn.dbcp">
+
++<!--
+ <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
+ file="${tomcat-native.tar.gz}" />
+ <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
+ file="${commons-daemon.native.src.tgz}" />
+
+ <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
++-->
+
+ <!-- Copy scripts -->
+ <copy todir="${tomcat.build}/bin">
+--- build.xml.orig 2012-07-06 20:31:31.387806167 +0200
++++ build.xml 2012-07-06 20:32:33.185315885 +0200
+@@ -646,9 +646,11 @@
+ </fileset>
+ </txt2html>
+
++<!--
+ <copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib"
+ failonerror="false"/>
+ <copy file="${jdt.jar}" todir="${tomcat.build}/lib" />
++-->
+
+ </target>
+
diff --git a/www-servers/tomcat/files/tomcat-7.0.59-build.xml.patch b/www-servers/tomcat/files/tomcat-7.0.59-build.xml.patch
new file mode 100644
index 000000000000..1de630fda393
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-7.0.59-build.xml.patch
@@ -0,0 +1,107 @@
+diff --git a/apache-tomcat-7.0.59-src/build.xml b/apache-tomcat-7.0.59-src/build.xml
+index 9c4cb10..5067f44 100644
+--- a/apache-tomcat-7.0.59-src/build.xml
++++ b/apache-tomcat-7.0.59-src/build.xml
+@@ -701,26 +701,32 @@
+ manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
+
+ <!-- Servlet 3.0 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${servlet-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.servlet-api"
+ manifest="${tomcat.manifests}/servlet-api.jar.manifest"
+ notice="${tomcat.manifests}/servlet-api.jar.notice"
+ license="${tomcat.manifests}/servlet-api.jar.license" />
++-->
+
+ <!-- JSP 2.2 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${jsp-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.jsp-api"
+ manifest="${tomcat.manifests}/jsp-api.jar.manifest"
+ notice="${tomcat.manifests}/jsp-api.jar.notice"
+ license="${tomcat.manifests}/jsp-api.jar.license" />
++-->
+
+ <!-- JSP 2.2 EL Implementation JAR File -->
++<!--
+ <jarIt jarfile="${el-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.el-api"
+ manifest="${tomcat.manifests}/el-api.jar.manifest" />
++-->
+
+ <!-- Bootstrap JAR File -->
+ <jarIt jarfile="${bootstrap.jar}"
+@@ -966,12 +972,14 @@
+ <target name="deploy" depends="package,build-docs,compile-webapp-examples"
+ description="Default. Builds a working Tomcat instance">
+
++<!--
+ <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
+ file="${tomcat-native.tar.gz}" />
+ <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
+ file="${commons-daemon.native.src.tgz}" />
+
+ <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
++-->
+
+ <!-- Copy scripts -->
+ <copy todir="${tomcat.build}/bin">
+@@ -1031,14 +1039,15 @@
+ <exclude name="${jdt.jar.filename}"/>
+ </fileset>
+ </delete>
++<!--
+ <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
+-
++-->
+ <!-- Add sources for examples -->
+ <antcall target="examples-sources" />
+-
++<!--
+ <copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib"
+ failonerror="false"/>
+-
++-->
+ <!-- build the jdbc-pool jar and source jar-->
+ <echo message="Building Tomcat JDBC pool libraries"/>
+ <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
+@@ -1630,7 +1639,7 @@
+
+ <target name="extras-webservices-prepare"
+ depends="extras-prepare"
+- description="Prepare to build web services extras package">
++ description="Prepare to build web services extras package" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
+@@ -2591,7 +2600,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
+ </target>
+
+ <target name="download-compile"
+- description="Download (and build) components necessary to compile" >
++ description="Download (and build) components necessary to compile" unless="noget">
+
+ <antcall target="downloadfile-2">
+ <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
+@@ -2648,7 +2657,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
+ </target>
+
+ <target name="download-test-compile"
+- description="Download additional components for the tests" >
++ description="Download additional components for the tests" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${junit.loc}"/>
+@@ -2676,7 +2685,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
+ </target>
+
+ <target name="download-dist"
+- description="Download additional components for a distribution" >
++ description="Download additional components for a distribution" unless="noget">
+
+ <antcall target="downloadzip-2">
+ <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
diff --git a/www-servers/tomcat/files/tomcat-8.0.22-build.xml.patch b/www-servers/tomcat/files/tomcat-8.0.22-build.xml.patch
new file mode 100644
index 000000000000..d7479598837b
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-8.0.22-build.xml.patch
@@ -0,0 +1,230 @@
+diff -Naur apache-tomcat-8.0.18-src-orig/build.xml apache-tomcat-8.0.18-src/build.xml
+--- apache-tomcat-8.0.18-src-orig/build.xml 2015-01-28 15:10:36.112146352 -0500
++++ apache-tomcat-8.0.18-src/build.xml 2015-02-19 18:08:37.971396016 -0500
+@@ -703,24 +703,29 @@
+ manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
+
+ <!-- Servlet 3.1 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${servlet-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.servlet-api"
+ manifest="${tomcat.manifests}/servlet-api.jar.manifest"
+ notice="${tomcat.manifests}/servlet-api.jar.notice"
+ license="${tomcat.manifests}/servlet-api.jar.license" />
+-
++-->
+ <!-- JSP 2.3 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${jsp-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.jsp-api"
+ manifest="${tomcat.manifests}/jsp-api.jar.manifest" />
++-->
+
+ <!-- EL 3.0 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${el-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.el-api"
+ manifest="${tomcat.manifests}/el-api.jar.manifest" />
++-->
+
+ <!-- WebSocket 1.1 API JAR File -->
+ <jarIt jarfile="${websocket-api.jar}"
+@@ -992,14 +997,14 @@
+
+ <target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
+ description="Default. Builds a working Tomcat instance">
+-
++<!--
+ <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
+ file="${tomcat-native.tar.gz}" />
+ <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
+ file="${commons-daemon.native.src.tgz}" />
+
+ <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
+-
++-->
+ <!-- Copy scripts -->
+ <copy todir="${tomcat.build}/bin">
+ <fileset dir="bin">
+@@ -1059,7 +1064,7 @@
+ <exclude name="${jdt.jar.filename}"/>
+ </fileset>
+ </delete>
+- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
+
+ <!-- Add sources for examples -->
+ <antcall target="examples-sources" />
+@@ -1093,7 +1098,7 @@
+ </javac>
+ </target>
+
+- <target name="build-tomcat-jdbc" depends="package">
++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
+ <!-- build the jdbc-pool jar and source jar-->
+ <echo message="Building Tomcat JDBC pool libraries"/>
+ <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
+@@ -1108,7 +1113,7 @@
+ <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
+ </target>
+
+- <target name="build-tomcat-jdbc-src">
++ <target name="build-tomcat-jdbc-src" unless="noget">
+ <!-- build the jdbc-pool source jar-->
+ <echo message="Building Tomcat JDBC pool src JAR"/>
+ <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
+@@ -1212,10 +1217,11 @@
+
+ <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
+ <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
++<!--
+ <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
+ failonerror="false"/>
+ <copy file="${jdt.jar}" todir="${tomcat.embed}" />
+-
++-->
+ <!-- Note the meta-inf below will work as long as there is only one JAR
+ that needs to add entries. If there is more than one a more complex
+ solution will be required. -->
+@@ -1519,7 +1525,7 @@
+
+ <target name="extras-commons-logging-prepare"
+ depends="extras-prepare"
+- description="Prepare to build web services extras package">
++ description="Prepare to build web services extras package" unless="noget">
+
+ <antcall target="downloadfile-2">
+ <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
+@@ -1658,7 +1664,7 @@
+
+ <target name="extras-webservices-prepare"
+ depends="extras-prepare"
+- description="Prepare to build web services extras package">
++ description="Prepare to build web services extras package" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
+@@ -2703,7 +2709,7 @@
+ </target>
+
+ <target name="download-compile"
+- description="Download (and build) components necessary to compile" >
++ description="Download (and build) components necessary to compile" unless="noget">
+
+ <antcall target="downloadfile-2">
+ <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
+@@ -2746,7 +2752,7 @@
+ </target>
+
+ <target name="download-test-compile"
+- description="Download additional components for the tests" >
++ description="Download additional components for the tests" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${junit.loc}"/>
+@@ -2792,7 +2798,7 @@
+ </target>
+
+ <target name="download-dist"
+- description="Download additional components for a distribution" >
++ description="Download additional components for a distribution" unless="noget">
+
+ <antcall target="downloadzip-2">
+ <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
+@@ -2818,18 +2824,18 @@
+
+ <!-- =============== Utility Targets to support downloads ================ -->
+
+- <target name="setproxy" if="${proxy.use}">
++ <target name="setproxy" if="${proxy.use}" unless="noget">
+ <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
+ proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
+ <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
+ </target>
+
+- <target name="testexist">
++ <target name="testexist" unless="noget">
+ <echo message="Testing for ${destfile}"/>
+ <available file="${destfile}" property="exist"/>
+ </target>
+
+- <target name="downloadgz" unless="exist" depends="testexist,setproxy">
++ <target name="downloadgz" unless="noget" depends="testexist,setproxy">
+ <!-- Download and extract the package -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2841,7 +2847,7 @@
+ <delete file="${temp.file}.tar.gz"/>
+ </target>
+
+- <target name="downloadgz-2" unless="exist" depends="testexist">
++ <target name="downloadgz-2" unless="noget" depends="testexist">
+ <!-- Download and extract the package from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2860,7 +2866,7 @@
+ <delete file="${temp.file}.tar.gz"/>
+ </target>
+
+- <target name="downloadzip" unless="exist" depends="testexist,setproxy">
++ <target name="downloadzip" unless="noget" depends="testexist,setproxy">
+ <!-- Download and extract the package -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2871,7 +2877,7 @@
+ <delete file="${temp.file}"/>
+ </target>
+
+- <target name="downloadzip-2" unless="exist" depends="testexist">
++ <target name="downloadzip-2" unless="noget" depends="testexist">
+ <!-- Download and extract the package from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2889,7 +2895,7 @@
+ <delete file="${temp.file}"/>
+ </target>
+
+- <target name="downloadfile" unless="exist" depends="testexist,setproxy">
++ <target name="downloadfile" unless="noget" depends="testexist,setproxy">
+ <!-- Download the file -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2899,7 +2905,7 @@
+ <move file="${temp.file}" tofile="${destfile}"/>
+ </target>
+
+- <target name="downloadfile-2" unless="exist" depends="testexist">
++ <target name="downloadfile-2" unless="noget" depends="testexist">
+ <!-- Download the file from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2922,7 +2928,7 @@
+ <move file="${temp.file}" tofile="${destfile}"/>
+ </target>
+
+- <target name="trydownload.check" depends="setproxy">
++ <target name="trydownload.check" depends="setproxy" unless="noget">
+ <condition property="trydownload.run">
+ <and>
+ <not>
+@@ -2933,7 +2939,7 @@
+ </condition>
+ </target>
+
+- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
+ <!-- Downloads a file if not yet downloaded and the source URL is available -->
+ <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
+ </target>
+@@ -2944,7 +2950,7 @@
+
+ <target name="ide-eclipse"
+ depends="download-compile, extras-webservices-prepare, download-test-compile"
+- description="Prepares the source tree to be built in Eclipse">
++ description="Prepares the source tree to be built in Eclipse" unless="noget">
+
+ <!-- Copy the sample project files into the root directory -->
+ <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
diff --git a/www-servers/tomcat/files/tomcat-8.0.23-build.xml.patch b/www-servers/tomcat/files/tomcat-8.0.23-build.xml.patch
new file mode 100644
index 000000000000..d7479598837b
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-8.0.23-build.xml.patch
@@ -0,0 +1,230 @@
+diff -Naur apache-tomcat-8.0.18-src-orig/build.xml apache-tomcat-8.0.18-src/build.xml
+--- apache-tomcat-8.0.18-src-orig/build.xml 2015-01-28 15:10:36.112146352 -0500
++++ apache-tomcat-8.0.18-src/build.xml 2015-02-19 18:08:37.971396016 -0500
+@@ -703,24 +703,29 @@
+ manifest="${tomcat.manifests}/annotations-api.jar.manifest" />
+
+ <!-- Servlet 3.1 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${servlet-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.servlet-api"
+ manifest="${tomcat.manifests}/servlet-api.jar.manifest"
+ notice="${tomcat.manifests}/servlet-api.jar.notice"
+ license="${tomcat.manifests}/servlet-api.jar.license" />
+-
++-->
+ <!-- JSP 2.3 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${jsp-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.jsp-api"
+ manifest="${tomcat.manifests}/jsp-api.jar.manifest" />
++-->
+
+ <!-- EL 3.0 Implementation JAR File -->
++<!--
+ <jarIt jarfile="${el-api.jar}"
+ filesDir="${tomcat.classes}"
+ filesId="files.el-api"
+ manifest="${tomcat.manifests}/el-api.jar.manifest" />
++-->
+
+ <!-- WebSocket 1.1 API JAR File -->
+ <jarIt jarfile="${websocket-api.jar}"
+@@ -992,14 +997,14 @@
+
+ <target name="deploy" depends="package,build-docs,build-tomcat-jdbc,compile-webapp-examples"
+ description="Default. Builds a working Tomcat instance">
+-
++<!--
+ <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz"
+ file="${tomcat-native.tar.gz}" />
+ <copy tofile="${tomcat.build}/bin/commons-daemon-native.tar.gz"
+ file="${commons-daemon.native.src.tgz}" />
+
+ <copy tofile="${tomcat.build}/bin/commons-daemon.jar" file="${commons-daemon.jar}" />
+-
++-->
+ <!-- Copy scripts -->
+ <copy todir="${tomcat.build}/bin">
+ <fileset dir="bin">
+@@ -1059,7 +1064,7 @@
+ <exclude name="${jdt.jar.filename}"/>
+ </fileset>
+ </delete>
+- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/>
++<!-- <copy file="${jdt.jar}" todir="${tomcat.build}/lib"/> -->
+
+ <!-- Add sources for examples -->
+ <antcall target="examples-sources" />
+@@ -1093,7 +1098,7 @@
+ </javac>
+ </target>
+
+- <target name="build-tomcat-jdbc" depends="package">
++ <target name="build-tomcat-jdbc" depends="package" unless="noget">
+ <!-- build the jdbc-pool jar and source jar-->
+ <echo message="Building Tomcat JDBC pool libraries"/>
+ <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
+@@ -1108,7 +1113,7 @@
+ <copy file="${tomcat-jdbc.jar}" todir="${tomcat.build}/lib"/>
+ </target>
+
+- <target name="build-tomcat-jdbc-src">
++ <target name="build-tomcat-jdbc-src" unless="noget">
+ <!-- build the jdbc-pool source jar-->
+ <echo message="Building Tomcat JDBC pool src JAR"/>
+ <ant antfile="${tomcat.jdbc.dir}/build.xml" dir="${tomcat.jdbc.dir}"
+@@ -1212,10 +1217,11 @@
+
+ <copy file="${basedir}/LICENSE" todir="${tomcat.embed}" />
+ <copy file="${basedir}/NOTICE" todir="${tomcat.embed}" />
++<!--
+ <copy file="${tomcat-dbcp.jar}" todir="${tomcat.embed}"
+ failonerror="false"/>
+ <copy file="${jdt.jar}" todir="${tomcat.embed}" />
+-
++-->
+ <!-- Note the meta-inf below will work as long as there is only one JAR
+ that needs to add entries. If there is more than one a more complex
+ solution will be required. -->
+@@ -1519,7 +1525,7 @@
+
+ <target name="extras-commons-logging-prepare"
+ depends="extras-prepare"
+- description="Prepare to build web services extras package">
++ description="Prepare to build web services extras package" unless="noget">
+
+ <antcall target="downloadfile-2">
+ <param name="sourcefile.1" value="${commons-logging-src.loc.1}"/>
+@@ -1658,7 +1664,7 @@
+
+ <target name="extras-webservices-prepare"
+ depends="extras-prepare"
+- description="Prepare to build web services extras package">
++ description="Prepare to build web services extras package" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${jaxrpc-lib.loc}"/>
+@@ -2703,7 +2709,7 @@
+ </target>
+
+ <target name="download-compile"
+- description="Download (and build) components necessary to compile" >
++ description="Download (and build) components necessary to compile" unless="noget">
+
+ <antcall target="downloadfile-2">
+ <param name="sourcefile.1" value="${tomcat-native.loc.1}"/>
+@@ -2746,7 +2752,7 @@
+ </target>
+
+ <target name="download-test-compile"
+- description="Download additional components for the tests" >
++ description="Download additional components for the tests" unless="noget">
+
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${junit.loc}"/>
+@@ -2792,7 +2798,7 @@
+ </target>
+
+ <target name="download-dist"
+- description="Download additional components for a distribution" >
++ description="Download additional components for a distribution" unless="noget">
+
+ <antcall target="downloadzip-2">
+ <param name="sourcefile.1" value="${tomcat-native.win.1}"/>
+@@ -2818,18 +2824,18 @@
+
+ <!-- =============== Utility Targets to support downloads ================ -->
+
+- <target name="setproxy" if="${proxy.use}">
++ <target name="setproxy" if="${proxy.use}" unless="noget">
+ <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
+ proxyuser="${proxy.user}" proxypassword="${proxy.password}" />
+ <echo message="Using ${proxy.host}:${proxy.port} to download ${sourcefile}"/>
+ </target>
+
+- <target name="testexist">
++ <target name="testexist" unless="noget">
+ <echo message="Testing for ${destfile}"/>
+ <available file="${destfile}" property="exist"/>
+ </target>
+
+- <target name="downloadgz" unless="exist" depends="testexist,setproxy">
++ <target name="downloadgz" unless="noget" depends="testexist,setproxy">
+ <!-- Download and extract the package -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2841,7 +2847,7 @@
+ <delete file="${temp.file}.tar.gz"/>
+ </target>
+
+- <target name="downloadgz-2" unless="exist" depends="testexist">
++ <target name="downloadgz-2" unless="noget" depends="testexist">
+ <!-- Download and extract the package from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2860,7 +2866,7 @@
+ <delete file="${temp.file}.tar.gz"/>
+ </target>
+
+- <target name="downloadzip" unless="exist" depends="testexist,setproxy">
++ <target name="downloadzip" unless="noget" depends="testexist,setproxy">
+ <!-- Download and extract the package -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2871,7 +2877,7 @@
+ <delete file="${temp.file}"/>
+ </target>
+
+- <target name="downloadzip-2" unless="exist" depends="testexist">
++ <target name="downloadzip-2" unless="noget" depends="testexist">
+ <!-- Download and extract the package from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2889,7 +2895,7 @@
+ <delete file="${temp.file}"/>
+ </target>
+
+- <target name="downloadfile" unless="exist" depends="testexist,setproxy">
++ <target name="downloadfile" unless="noget" depends="testexist,setproxy">
+ <!-- Download the file -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2899,7 +2905,7 @@
+ <move file="${temp.file}" tofile="${destfile}"/>
+ </target>
+
+- <target name="downloadfile-2" unless="exist" depends="testexist">
++ <target name="downloadfile-2" unless="noget" depends="testexist">
+ <!-- Download the file from the two alternative locations -->
+ <local name="temp.file"/>
+ <mkdir dir="${base.path}"/>
+@@ -2922,7 +2928,7 @@
+ <move file="${temp.file}" tofile="${destfile}"/>
+ </target>
+
+- <target name="trydownload.check" depends="setproxy">
++ <target name="trydownload.check" depends="setproxy" unless="noget">
+ <condition property="trydownload.run">
+ <and>
+ <not>
+@@ -2933,7 +2939,7 @@
+ </condition>
+ </target>
+
+- <target name="trydownload" if="trydownload.run" depends="trydownload.check">
++ <target name="trydownload" if="trydownload.run" depends="trydownload.check" unless="noget">
+ <!-- Downloads a file if not yet downloaded and the source URL is available -->
+ <get src="${sourcefile}" httpusecaches="${trydownload.httpusecaches}" dest="${destfile}" />
+ </target>
+@@ -2944,7 +2950,7 @@
+
+ <target name="ide-eclipse"
+ depends="download-compile, extras-webservices-prepare, download-test-compile"
+- description="Prepares the source tree to be built in Eclipse">
++ description="Prepares the source tree to be built in Eclipse" unless="noget">
+
+ <!-- Copy the sample project files into the root directory -->
+ <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
diff --git a/www-servers/tomcat/files/tomcat-instance-manager-r1.bash b/www-servers/tomcat/files/tomcat-instance-manager-r1.bash
new file mode 100644
index 000000000000..de5152198b3e
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-instance-manager-r1.bash
@@ -0,0 +1,240 @@
+#!/bin/bash
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author: Ralph Sennhauser <sera@gentoo.org>
+
+die() {
+ echo "${@}"
+ exit 1
+}
+
+usage() {
+ cat <<EOL
+Usage: ${BASH_SOURCE} <--create|--remove|--help> [--suffix s][--user u][--group g]
+
+ Options:
+ --help:
+ show this text.
+ --create:
+ create a new instance
+ --remove:
+ remove an existing instance.
+ --suffix SUFFIX:
+ a suffix for this instance. the suffix may not collide with an already
+ existing instance, defaults to empty.
+ --user USER:
+ the user for which to configure this instance for. The user needs to
+ exist already. defaults to tomcat.
+ --group GROUP:
+ the group for which to configure this instance for. The group needs to
+ exist already. defaults to tomcat.
+
+ Examples:
+ ${BASH_SOURCE} --create --suffix testing --user tacmot --group tacmot
+ ${BASH_SOURCE} --remove --suffix testing
+EOL
+}
+
+parse_argv() {
+ action="not specified"
+ instance_name="tomcat-@SLOT@"
+ instance_user="tomcat"
+ instance_group="tomcat"
+
+ while [[ -n $1 ]]; do
+ case $1 in
+ --help)
+ usage
+ exit 0;;
+ --suffix)
+ instance_name+="-$2"
+ shift; shift;;
+ --user)
+ instance_user="$2"
+ shift; shift;;
+ --group)
+ instance_group="$2"
+ shift; shift;;
+ --create)
+ action=create
+ shift;;
+ --remove)
+ action=remove
+ shift;;
+ --backup)
+ action=backup
+ shift;;
+ --restore)
+ action=restore
+ shift;;
+ --update)
+ action=update
+ shift;;
+ *)
+ echo "Invalid option '$1'"
+ usage
+ exit 2;;
+ esac
+ done
+
+ tomcat_home="/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-@SLOT@"
+ instance_base="/@GENTOO_PORTAGE_EPREFIX@var/lib/${instance_name}"
+ instance_conf="/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
+ instance_logs="/@GENTOO_PORTAGE_EPREFIX@var/log/${instance_name}"
+ instance_temp="/@GENTOO_PORTAGE_EPREFIX@var/tmp/${instance_name}"
+
+ all_targets=(
+ "${instance_base}"
+ "${instance_logs}"
+ "${instance_temp}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}"
+ )
+}
+
+test_can_deploy() {
+ local no_deploy target
+ for target in "${all_targets[@]}"; do
+ if [[ -e "${target}" ]]; then
+ echo "Error: '${target}' already exists."
+ no_deploy=yes
+ fi
+ done
+ if [[ -n "${no_deploy}" ]]; then
+ cat <<-EOL
+
+ To protect an existing installation no new instance was deployed. You can use
+ '${BASH_SOURCE} --remove'
+ to remove an existing instance first or run
+ '${BASH_SOURCE} --create --sufix <instance_suffix>'
+ to deploy an instance under a different name
+
+ EOL
+ usage
+ exit 1
+ fi
+
+ if ! getent passwd | cut -d: -f1 | grep -Fx "${instance_user}" > /dev/null; then
+ echo "Error: user '${instance_user}' doesn't exist."
+ exit 1
+ fi
+
+ if ! getent group | cut -d: -f1 | grep -Fx "${instance_group}" > /dev/null; then
+ echo "Error: group '${instance_group}' doesn't exist."
+ exit 1
+ fi
+}
+
+deploy_instance() {
+ test_can_deploy
+
+ mkdir -p "${instance_base}"/{work,webapps} || die
+ mkdir -p "${instance_logs}" || die
+ mkdir -p "${instance_temp}" || die
+
+ cp -r "${tomcat_home}"/webapps/ROOT "${instance_base}"/webapps || die
+
+ chown -R "${instance_user}":"${instance_group}" \
+ "${instance_base}" "${instance_logs}" "${instance_temp}" || die
+
+ find "${instance_base}"/webapps -type d -exec chmod 750 {} + || die
+ find "${instance_base}"/webapps -type f -exec chmod 640 {} + || die
+
+ # initial config #
+
+ cp -r "${tomcat_home}"/conf "${instance_conf}" || die
+
+ sed -i -e "s|\${catalina.base}/logs|${instance_logs}|" \
+ "${instance_conf}"/logging.properties || die
+ sed -i -e "s|directory=\"logs\"|directory=\"${instance_logs}\"|" \
+ "${instance_conf}"/server.xml || die
+
+ mkdir -p "${instance_conf}"/Catalina/localhost || die
+ cat > "${instance_conf}"/Catalina/localhost/host-manager.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/host-manager"
+ antiResourceLocking="false" privileged="true" />
+ EOF
+
+ cat > "${instance_conf}"/Catalina/localhost/manager.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/manager"
+ antiResourceLocking="false" privileged="true" />
+ EOF
+
+ if [[ -d "${tomcat_home}"/webapps/docs ]]; then
+ cat > "${instance_conf}"/Catalina/localhost/docs.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/docs" />
+ EOF
+ fi
+
+ if [[ -d "${tomcat_home}"/webapps/examples ]]; then
+ cat > "${instance_conf}"/Catalina/localhost/examples.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/examples" />
+ EOF
+ fi
+
+ chown -R "${instance_user}":"${instance_group}" "${instance_conf}" || die
+ find "${instance_conf}" -type d -exec chmod 750 {} + || die
+ find "${instance_conf}" -type f -exec chmod 640 {} + || die
+
+ # rc script #
+
+ cp "${tomcat_home}"/gentoo/tomcat.init \
+ "/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}" || die
+
+ sed -e "s|@INSTANCE_NAME@|${instance_name}|g" \
+ -e "s|@INSTANCE_USER@|${instance_user}|g" \
+ -e "s|@INSTANCE_GROUP@|${instance_group}|g" \
+ "${tomcat_home}"/gentoo/tomcat.conf \
+ > "/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}" || die
+
+ # some symlinks for tomcat and netbeans #
+
+ ln -s "${instance_conf}" "${instance_base}"/conf || die
+ ln -s "${instance_temp}" "${instance_base}"/temp || die
+
+ # a note to update the default configuration #
+
+ cat <<-EOL
+ Successfully created instance '${instance_name}'
+ It's strongly recommended for production systems to go carefully through the
+ configuration files at '${instance_conf}'.
+ The generated initial configuration is close to upstreams default which
+ favours the demo aspect over hardening.
+ EOL
+}
+
+remove_instance() {
+ echo "The following files will be removed permanently:"
+ local target; for target in "${all_targets[@]}"; do
+ find ${target}
+ done
+
+ echo "Type 'yes' to continue"
+ read
+ if [[ ${REPLY} == yes ]]; then
+ rm -rv "${all_targets[@]}"
+ else
+ echo "Aborting as requested ..."
+ fi
+}
+
+parse_argv "$@"
+
+if [[ ${action} == create ]]; then
+ deploy_instance
+elif [[ ${action} == remove ]]; then
+ remove_instance
+elif [[ ${action} == "not specified" ]]; then
+ echo "No action specified!"
+ usage
+ exit 1
+else
+ echo "${action} not yet implemented!"
+ usage
+ exit 1
+fi
diff --git a/www-servers/tomcat/files/tomcat-instance-manager.bash b/www-servers/tomcat/files/tomcat-instance-manager.bash
new file mode 100644
index 000000000000..fcdfebf21495
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat-instance-manager.bash
@@ -0,0 +1,240 @@
+#!/bin/bash
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Author: Ralph Sennhauser <sera@gentoo.org>
+
+die() {
+ echo "${@}"
+ exit 1
+}
+
+usage() {
+ cat <<EOL
+Usage: ${BASH_SOURCE} <--create|--remove|--help> [--suffix s][--user u][--group g]
+
+ Options:
+ --help:
+ show this text.
+ --create:
+ create a new instance
+ --remove:
+ remove an existing instance.
+ --suffix SUFFIX:
+ a suffix for this instance. the suffix may not collide with an already
+ existing instance, defaults to empty.
+ --user USER:
+ the user for which to configure this instance for. The user needs to
+ exist already. defaults to tomcat.
+ --group GROUP:
+ the group for which to configure this instance for. The group needs to
+ exist already. defaults to tomcat.
+
+ Examples:
+ ${BASH_SOURCE} --create --suffix testing --user tacmot --group tacmot
+ ${BASH_SOURCE} --remove --suffix testing
+EOL
+}
+
+parse_argv() {
+ action="not specified"
+ instance_name="tomcat-@SLOT@"
+ instance_user="tomcat"
+ instance_group="tomcat"
+
+ while [[ -n $1 ]]; do
+ case $1 in
+ --help)
+ usage
+ exit 0;;
+ --suffix)
+ instance_name+="-$2"
+ shift; shift;;
+ --user)
+ instance_user="$2"
+ shift; shift;;
+ --group)
+ instance_group="$2"
+ shift; shift;;
+ --create)
+ action=create
+ shift;;
+ --remove)
+ action=remove
+ shift;;
+ --backup)
+ action=backup
+ shift;;
+ --restore)
+ action=restore
+ shift;;
+ --update)
+ action=update
+ shift;;
+ *)
+ echo "Invalid option '$1'"
+ usage
+ exit 2;;
+ esac
+ done
+
+ tomcat_home="/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-@SLOT@"
+ instance_base="/@GENTOO_PORTAGE_EPREFIX@var/lib/${instance_name}"
+ instance_conf="/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
+ instance_logs="/@GENTOO_PORTAGE_EPREFIX@var/log/${instance_name}"
+ instance_temp="/@GENTOO_PORTAGE_EPREFIX@var/tmp/${instance_name}"
+
+ all_targets=(
+ "${instance_base}"
+ "${instance_logs}"
+ "${instance_temp}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}"
+ "/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}"
+ )
+}
+
+test_can_deploy() {
+ local no_deploy target
+ for target in "${all_targets[@]}"; do
+ if [[ -e "${target}" ]]; then
+ echo "Error: '${target}' already exists."
+ no_deploy=yes
+ fi
+ done
+ if [[ -n "${no_deploy}" ]]; then
+ cat <<-EOL
+
+ To protect an existing installation no new instance was deployed. You can use
+ '${BASH_SOURCE} --remove'
+ to remove an existing instance first or run
+ '${BASH_SOURCE} --create --sufix <instance_suffix>'
+ to deploy an instance under a different name
+
+ EOL
+ usage
+ exit 1
+ fi
+
+ if ! id --user "${instance_user}" >/dev/null 2>&1; then
+ echo "Error: user '${instance_user}' doesn't exist."
+ exit 1
+ fi
+
+ if ! id --group "${instance_group}" >/dev/null 2>&1; then
+ echo "Error: group '${instance_group}' doesn't exist."
+ exit 1
+ fi
+}
+
+deploy_instance() {
+ test_can_deploy
+
+ mkdir -p "${instance_base}"/{work,webapps} || die
+ mkdir -p "${instance_logs}" || die
+ mkdir -p "${instance_temp}" || die
+
+ cp -r "${tomcat_home}"/webapps/ROOT "${instance_base}"/webapps || die
+
+ chown -R "${instance_user}":"${instance_group}" \
+ "${instance_base}" "${instance_logs}" "${instance_temp}" || die
+
+ find "${instance_base}"/webapps -type d -exec chmod 750 {} + || die
+ find "${instance_base}"/webapps -type f -exec chmod 640 {} + || die
+
+ # initial config #
+
+ cp -r "${tomcat_home}"/conf "${instance_conf}" || die
+
+ sed -i -e "s|\${catalina.base}/logs|${instance_logs}|" \
+ "${instance_conf}"/logging.properties || die
+ sed -i -e "s|directory=\"logs\"|directory=\"${instance_logs}\"|" \
+ "${instance_conf}"/server.xml || die
+
+ mkdir -p "${instance_conf}"/Catalina/localhost || die
+ cat > "${instance_conf}"/Catalina/localhost/host-manager.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/host-manager"
+ antiResourceLocking="false" privileged="true" />
+ EOF
+
+ cat > "${instance_conf}"/Catalina/localhost/manager.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/manager"
+ antiResourceLocking="false" privileged="true" />
+ EOF
+
+ if [[ -d "${tomcat_home}"/webapps/docs ]]; then
+ cat > "${instance_conf}"/Catalina/localhost/docs.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/docs" />
+ EOF
+ fi
+
+ if [[ -d "${tomcat_home}"/webapps/examples ]]; then
+ cat > "${instance_conf}"/Catalina/localhost/examples.xml <<-'EOF'
+ <?xml version="1.0" encoding="UTF-8"?>
+ <Context docBase="${catalina.home}/webapps/examples" />
+ EOF
+ fi
+
+ chown -R "${instance_user}":"${instance_group}" "${instance_conf}" || die
+ find "${instance_conf}" -type d -exec chmod 750 {} + || die
+ find "${instance_conf}" -type f -exec chmod 640 {} + || die
+
+ # rc script #
+
+ cp "${tomcat_home}"/gentoo/tomcat.init \
+ "/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}" || die
+
+ sed -e "s|@INSTANCE_NAME@|${instance_name}|g" \
+ -e "s|@INSTANCE_USER@|${instance_user}|g" \
+ -e "s|@INSTANCE_GROUP@|${instance_group}|g" \
+ "${tomcat_home}"/gentoo/tomcat.conf \
+ > "/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}" || die
+
+ # some symlinks for tomcat and netbeans #
+
+ ln -s "${instance_conf}" "${instance_base}"/conf || die
+ ln -s "${instance_temp}" "${instance_base}"/temp || die
+
+ # a note to update the default configuration #
+
+ cat <<-EOL
+ Successfully created instance '${instance_name}'
+ It's strongly recommended for production systems to go carefully through the
+ configuration files at '${instance_conf}'.
+ The generated initial configuration is close to upstreams default which
+ favours the demo aspect over hardening.
+ EOL
+}
+
+remove_instance() {
+ echo "The following files will be removed permanently:"
+ local target; for target in "${all_targets[@]}"; do
+ find ${target}
+ done
+
+ echo "Type 'yes' to continue"
+ read
+ if [[ ${REPLY} == yes ]]; then
+ rm -rv "${all_targets[@]}"
+ else
+ echo "Aborting as requested ..."
+ fi
+}
+
+parse_argv "$@"
+
+if [[ ${action} == create ]]; then
+ deploy_instance
+elif [[ ${action} == remove ]]; then
+ remove_instance
+elif [[ ${action} == "not specified" ]]; then
+ echo "No action specified!"
+ usage
+ exit 1
+else
+ echo "${action} not yet implemented!"
+ usage
+ exit 1
+fi
diff --git a/www-servers/tomcat/files/tomcat.conf b/www-servers/tomcat/files/tomcat.conf
new file mode 100644
index 000000000000..a27f93342678
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat.conf
@@ -0,0 +1,49 @@
+# Set the handle of the JVM to use. If unset uses the system-vm.
+# run 'eselect java-vm list' to get possible values.
+#
+#TOMCAT_JVM="icedtea-7"
+
+# Additional options to pass to the JVM.
+# Example to set library path for tomcat-native:
+# JAVA_OPTS="-Djava.library.path=/usr/lib"
+#
+#JAVA_OPTS=""
+
+# Additional packages to put on the default classpath.
+# jakarta-jstl is needed for some of the examples.
+# Note: The extra jars listed here will be visible to webapps.
+# Example:
+# TOMCAT_EXTRA_JARS="jakarta-jstl,xerces-2"
+#
+#TOMCAT_EXTRA_JARS=""
+
+# User/Group of this instance.
+CATALINA_USER=@INSTANCE_USER@
+CATALINA_GROUP=@INSTANCE_GROUP@
+
+# Directory path location of temporary directory the JVM should
+# use (java.io.tmpdir).
+# Note: This directory must exist and be read/writable by tomcat.
+# See #246362 as an example where /var/tmp was deleted on shutdown.
+#
+#CATALINA_TMPDIR="/@GENTOO_PORTAGE_EPREFIX@var/tmp/@INSTANCE_NAME@"
+
+# TOMCAT STARTUP
+# debug Start Catalina in a debugger
+# -security debug Debug Catalina with a security manager
+# jpda start Start Catalina under JPDA debugger
+# start Start Catalina in a separate window
+# -security start Start in a separate window with security manager
+#
+#TOMCAT_START="start"
+
+# Java Platform Debugger Architecture (JPDA)
+# http://java.sun.com/products/jpda/
+# Override default JPDA address and transport for the "jpda start" command.
+#
+#JPDA_ADDRESS="8000"
+#JPDA_TRANSPORT="dt_socket"
+
+# Additional options to pass to catalina
+#
+#CATALINA_OPTS=""
diff --git a/www-servers/tomcat/files/tomcat.init b/www-servers/tomcat/files/tomcat.init
new file mode 100644
index 000000000000..1f806810ce22
--- /dev/null
+++ b/www-servers/tomcat/files/tomcat.init
@@ -0,0 +1,105 @@
+#!/@GENTOO_PORTAGE_EPREFIX@sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="forcestop"
+
+PIDFILE=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}.pid
+
+: ${CATALINA_HOME:=/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-@SLOT@}
+: ${CATALINA_BASE:=/@GENTOO_PORTAGE_EPREFIX@var/lib/${RC_SVCNAME}}
+: ${CATALINA_TMPDIR:=/@GENTOO_PORTAGE_EPREFIX@var/tmp/${RC_SVCNAME}}
+: ${CATALINA_USER:=tomcat}
+: ${CATALINA_GROUP:=tomcat}
+
+: ${TOMCAT_START:=start}
+
+: ${JPDA_TRANSPORT:="dt_socket"}
+: ${JPDA_ADDRESS:="8000"}
+: ${JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT},address=${JPDA_ADDRESS},server=y,suspend=n"}
+
+export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home`
+
+CLASSPATH=`java-config --classpath tomcat-@SLOT@${TOMCAT_EXTRA_JARS:+,${TOMCAT_EXTRA_JARS}}`
+export CLASSPATH="${CLASSPATH}${TOMCAT_EXTRA_CLASSPATH:+:${TOMCAT_EXTRA_CLASSPATH}}"
+
+depend() {
+ use dns logger net
+}
+
+start() {
+ ebegin "Starting ${RC_SVCNAME}"
+
+ if [ ! -e "${CATALINA_TMPDIR}" ]; then
+ eerror "CATALINA_TMPDIR does not exist. Unable to start tomcat."
+ eerror "Please see /@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${RC_SVCNAME} for more information."
+ eend 1
+ fi
+
+ cmd=java args=
+ if [ "${TOMCAT_START}" = "debug" ] || [ "${TOMCAT_START}" = "-security debug" ] ; then
+ cmd=jdb
+ args="${args} -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share"
+ fi
+ if [ "${TOMCAT_START}" = "-security debug" ] || [ "${TOMCAT_START}" = "-security start" ]; then
+ args="${args} -Djava.security.manager"
+ args="${args} -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy"
+ fi
+ if [ "${TOMCAT_START}" = "jpda start" ] ; then
+ args="${args} ${JPDA_OPTS}"
+ fi
+ if [ -r "${CATALINA_HOME}"/bin/tomcat-juli.jar ]; then
+ args="${args} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
+ -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties"
+ fi
+
+ start-stop-daemon --start \
+ --quiet --background \
+ --chdir "${CATALINA_TMPDIR}" \
+ --user ${CATALINA_USER}:${CATALINA_GROUP} \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec ${JAVA_HOME}/bin/${cmd} \
+ -- \
+ ${JAVA_OPTS} \
+ ${args} \
+ -Dcatalina.base="${CATALINA_BASE}" \
+ -Dcatalina.home="${CATALINA_HOME}" \
+ -Djava.io.tmpdir="${CATALINA_TMPDIR}" \
+ -classpath "${CLASSPATH}" \
+ org.apache.catalina.startup.Bootstrap \
+ ${CATALINA_OPTS} \
+ ${TOMCAT_START}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping '${RC_SVCNAME}'"
+
+ start-stop-daemon --stop \
+ --quiet --retry=60 \
+ --pidfile ${PIDFILE} \
+ --exec ${JAVA_HOME}/bin/java \
+ -- \
+ ${JAVA_OPTS} \
+ -classpath "${CLASSPATH}" \
+ ${CATALINA_OPTS} \
+ stop ${STD_OUT}
+
+ eend $?
+}
+
+forcestop() {
+ ebegin "Forcing '${RC_SVCNAME}' to stop"
+
+ start-stop-daemon --stop \
+ --quiet --retry=60 \
+ --pidfile ${PIDFILE} \
+ --signal=9
+
+ if service_started "${RC_SVCNAME}"; then
+ mark_service_stopped "${RC_SVCNAME}"
+ fi
+
+ eend $?
+}
diff --git a/www-servers/tomcat/metadata.xml b/www-servers/tomcat/metadata.xml
new file mode 100644
index 000000000000..6f8636c1d0e5
--- /dev/null
+++ b/www-servers/tomcat/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>java</herd>
+ <longdescription>
+ Tomcat is the servlet container that is used in the official Reference
+ Implementation for the Java Servlet and JavaServer Pages technologies.
+ The Java Servlet and JavaServer Pages specifications are developed by
+ Sun under the Java Community Process.
+ </longdescription>
+ <use>
+ <flag name='extra-webapps'>Build also the docs and examples webapp</flag>
+ <flag name="websockets">Builds websockets api and implementation (requires java 7)</flag>
+ </use>
+</pkgmetadata>
diff --git a/www-servers/tomcat/tomcat-6.0.44-r0.ebuild b/www-servers/tomcat/tomcat-6.0.44-r0.ebuild
new file mode 100644
index 000000000000..a771b6b4b629
--- /dev/null
+++ b/www-servers/tomcat/tomcat-6.0.44-r0.ebuild
@@ -0,0 +1,144 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+JAVA_PKG_IUSE="source test"
+
+inherit eutils java-pkg-2 java-ant-2 prefix user
+
+MY_P="apache-${P}-src"
+
+DESCRIPTION="Tomcat Servlet-2.5/JSP-2.1 Container"
+HOMEPAGE="http://tomcat.apache.org/"
+SRC_URI="mirror://apache/${PN}/tomcat-6/v${PV}/src/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="6"
+KEYWORDS="amd64 ppc ppc64 x86 ~x86-fbsd"
+IUSE="extra-webapps"
+
+RESTRICT="test"
+
+ECJ_SLOT="3.7"
+SAPI_SLOT="2.5"
+
+CDEPEND="dev-java/eclipse-ecj:${ECJ_SLOT}
+ dev-java/tomcat-servlet-api:${SAPI_SLOT}"
+RDEPEND="${CDEPEND}
+ >=virtual/jre-1.6
+ !<dev-java/tomcat-native-1.1.20"
+DEPEND="${CDEPEND}
+ >=virtual/jdk-1.6
+ >=dev-java/ant-core-1.8.1:0
+ test? (
+ dev-java/ant-junit:0
+ dev-java/junit:4
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup tomcat 265
+ enewuser tomcat 265 -1 /dev/null tomcat
+}
+
+java_prepare() {
+ find -name '*.jar' -exec rm -v {} + || die
+ epatch "${FILESDIR}/${P}-build.xml.patch"
+
+ # For use of catalina.sh in netbeans
+ sed -i -e "/^# ----- Execute The Requested Command/ a\
+ CLASSPATH=\`java-config --classpath ${PN}-${SLOT}\`" \
+ bin/catalina.sh || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+
+EANT_BUILD_TARGET="deploy"
+EANT_DOC_TARGET=""
+EANT_GENTOO_CLASSPATH="tomcat-servlet-api-${SAPI_SLOT},eclipse-ecj-${ECJ_SLOT}"
+EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
+EANT_NEEDS_TOOLS="true"
+EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
+
+# revision of the instance-manager script
+IM_REV="-r1"
+
+src_compile() {
+ EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
+ java-pkg-2_src_compile
+}
+
+EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
+
+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
+
+ # so we don't have to call java-config with --with-dependencies, which might
+ # bring in more jars than actually desired.
+ java-pkg_addcp "$(java-pkg_getjars eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT})"
+
+ dodoc RELEASE-NOTES RUNNING.txt
+ use source && java-pkg_dosrc java/*
+
+ ### Webapps ###
+
+ 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=$(echo ${RANDOM}|md5sum|cut -c 1-15)
+ sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
+
+ insinto "${dest}"
+ doins -r output/build/conf
+
+ ### rc ###
+
+ cp "${FILESDIR}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} "${T}" || die
+ eprefixify "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash}
+ sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} || die
+
+ insinto "${dest}"/gentoo
+ doins "${T}"/tomcat.conf
+ exeinto "${dest}"/gentoo
+ doexe "${T}"/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 (<6.0.36), 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 http://www.gentoo.org/proj/en/java/tomcat6-guide.xml for more information."
+}
diff --git a/www-servers/tomcat/tomcat-7.0.59-r2.ebuild b/www-servers/tomcat/tomcat-7.0.59-r2.ebuild
new file mode 100644
index 000000000000..e60877724903
--- /dev/null
+++ b/www-servers/tomcat/tomcat-7.0.59-r2.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils java-pkg-2 java-ant-2 prefix user
+
+MY_P="apache-${P}-src"
+
+DESCRIPTION="Tomcat Servlet-3.0/JSP-2.2 Container"
+HOMEPAGE="http://tomcat.apache.org/"
+SRC_URI="mirror://apache/${PN}/tomcat-7/v${PV}/src/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="7"
+KEYWORDS="amd64 ppc ppc64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="extra-webapps websockets"
+
+RESTRICT="test" # can we run them on a production system?
+
+ECJ_SLOT="4.4"
+SAPI_SLOT="3.0"
+
+COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
+ dev-java/tomcat-servlet-api:${SAPI_SLOT}"
+RDEPEND="${COMMON_DEP}
+ websockets? ( >=virtual/jre-1.6 )
+ !websockets? ( >=virtual/jre-1.6 )
+ !<dev-java/tomcat-native-1.1.24"
+DEPEND="${COMMON_DEP}
+ websockets? ( >=virtual/jdk-1.6 )
+ !websockets? ( >=virtual/jdk-1.6 )
+ >=dev-java/ant-core-1.8.1:0
+ test? (
+ dev-java/ant-junit:0
+ dev-java/junit:4
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup tomcat 265
+ enewuser tomcat 265 -1 /dev/null tomcat
+}
+
+java_prepare() {
+ find -type f -name '*.jar' -exec rm -frv {} + || die
+ epatch "${FILESDIR}/${P}-build.xml.patch"
+
+ # For use of catalina.sh in netbeans
+ sed -i -e "/^# ----- Execute The Requested Command/ a\
+ CLASSPATH=\`java-config --classpath ${PN}-${SLOT}\`" \
+ bin/catalina.sh || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+
+EANT_BUILD_TARGET="deploy"
+EANT_GENTOO_CLASSPATH="tomcat-servlet-api-${SAPI_SLOT},eclipse-ecj-${ECJ_SLOT}"
+EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
+EANT_NEEDS_TOOLS="true"
+EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
+
+# revision of the instance-manager script
+IM_REV="-r1"
+
+src_compile() {
+ EANT_EXTRA_ARGS+=" -Djava.7.home=${JAVA_HOME}"
+ EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
+ java-pkg-2_src_compile
+}
+
+EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
+
+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
+
+ # so we don't have to call java-config with --with-dependencies, which might
+ # bring in more jars then actually desired.
+ java-pkg_addcp "$(java-pkg_getjars eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT})"
+
+ dodoc RELEASE-NOTES RUNNING.txt
+ use doc && java-pkg_dojavadoc output/dist/webapps/docs/api
+ use source && java-pkg_dosrc java/*
+
+ ### Webapps ###
+
+ 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=$(echo ${RANDOM}|md5sum|cut -c 1-15)
+ sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
+
+ insinto "${dest}"
+ doins -r output/build/conf
+
+ ### rc ###
+
+ cp "${FILESDIR}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} "${T}" || die
+ eprefixify "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash}
+ sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} || die
+
+ insinto "${dest}"/gentoo
+ doins "${T}"/tomcat.conf
+ exeinto "${dest}"/gentoo
+ doexe "${T}"/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 http://www.gentoo.org/proj/en/java/tomcat6-guide.xml for more information."
+}
diff --git a/www-servers/tomcat/tomcat-8.0.23-r2.ebuild b/www-servers/tomcat/tomcat-8.0.23-r2.ebuild
new file mode 100644
index 000000000000..7d5fcd462a0b
--- /dev/null
+++ b/www-servers/tomcat/tomcat-8.0.23-r2.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+JAVA_PKG_IUSE="doc source test"
+
+inherit eutils java-pkg-2 java-ant-2 prefix user
+
+MY_P="apache-${P}-src"
+
+DESCRIPTION="Tomcat Servlet-3.1/JSP-2.3 Container"
+HOMEPAGE="http://tomcat.apache.org/"
+SRC_URI="mirror://apache/${PN}/tomcat-8/v${PV}/src/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="8"
+KEYWORDS="amd64 x86 ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="extra-webapps"
+
+RESTRICT="test" # can we run them on a production system?
+
+ECJ_SLOT="4.4"
+SAPI_SLOT="3.1"
+
+COMMON_DEP="dev-java/eclipse-ecj:${ECJ_SLOT}
+ dev-java/tomcat-servlet-api:${SAPI_SLOT}"
+RDEPEND="${COMMON_DEP}
+ !<dev-java/tomcat-native-1.1.24
+ >=virtual/jre-1.7"
+DEPEND="${COMMON_DEP}
+ >=virtual/jdk-1.7
+ >=dev-java/ant-core-1.8.1:0
+ test? (
+ dev-java/ant-junit:0
+ dev-java/junit:4
+ )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ java-pkg-2_pkg_setup
+ enewgroup tomcat 265
+ enewuser tomcat 265 -1 /dev/null tomcat
+}
+
+java_prepare() {
+ find -name '*.jar' -type f -delete -print || die
+
+ epatch "${FILESDIR}/${P}-build.xml.patch"
+
+ # For use of catalina.sh in netbeans
+ sed -i -e "/^# ----- Execute The Requested Command/ a\
+ CLASSPATH=\`java-config --classpath ${PN}-${SLOT}\`" \
+ bin/catalina.sh || die
+}
+
+JAVA_ANT_REWRITE_CLASSPATH="true"
+
+EANT_BUILD_TARGET="deploy"
+EANT_GENTOO_CLASSPATH="tomcat-servlet-api-${SAPI_SLOT},eclipse-ecj-${ECJ_SLOT}"
+EANT_GENTOO_CLASSPATH_EXTRA="${S}/output/classes"
+EANT_NEEDS_TOOLS="true"
+EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
+
+# revision of the instance-manager script
+IM_REV="-r1"
+
+src_compile() {
+ EANT_GENTOO_CLASSPATH_EXTRA+=":$(java-pkg_getjar --build-only ant-core ant.jar)"
+ java-pkg-2_src_compile
+}
+
+EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},junit-4"
+
+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
+
+ # so we don't have to call java-config with --with-dependencies, which might
+ # bring in more jars then actually desired.
+ java-pkg_addcp "$(java-pkg_getjars eclipse-ecj-${ECJ_SLOT},tomcat-servlet-api-${SAPI_SLOT})"
+
+ dodoc RELEASE-NOTES RUNNING.txt
+ use doc && java-pkg_dohtml -r output/dist/webapps/docs/api
+ use source && java-pkg_dosrc java/*
+
+ ### Webapps ###
+
+ 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=$(echo ${RANDOM}|md5sum|cut -c 1-15)
+ sed -i -e "s|SHUTDOWN|${randpw}|" output/build/conf/server.xml || die
+
+ insinto "${dest}"
+ doins -r output/build/conf
+
+ ### rc ###
+
+ cp "${FILESDIR}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} "${T}" || die
+ eprefixify "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash}
+ sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,.init,-instance-manager${IM_REV}.bash} || die
+
+ insinto "${dest}"/gentoo
+ doins "${T}"/tomcat.conf
+ exeinto "${dest}"/gentoo
+ doexe "${T}"/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 http://www.gentoo.org/proj/en/java/tomcat6-guide.xml for more information."
+}
diff --git a/www-servers/tornado/Manifest b/www-servers/tornado/Manifest
new file mode 100644
index 000000000000..b1626bbfe037
--- /dev/null
+++ b/www-servers/tornado/Manifest
@@ -0,0 +1,7 @@
+DIST tornado-3.1.1.tar.gz 374086 SHA256 345904bfe4a0ce5d687203f783986a73cfd7dc3a9957ee3342cd43d4e310fdc6 SHA512 13f17166153a89ecf1a16a08f0d15cd342f5de7ad964e669e015c2226e2c18297306f47ffc560164ec9f8080489a5fb81cbf6b41f89f12fe1745b0cd73524207 WHIRLPOOL 689f4ba4dc4d98ac7b7de33b15288aa90683bc529364b02c0d5d1c9090b47c5178ef520cdcc93ae94e8886278cc4a16100c167e33a05f406c9431f4a0888087b
+DIST tornado-4.0.1.tar.gz 314852 SHA256 ae058668b276b1ec7383cfc911323e6d27b3b47e38a12d3d3eaf6b6577b99901 SHA512 a4e0231e77ebbc2885bab648b292b842cb15c84d66a1972de18cb00fcc611eae2794b872f070ab7d5af32dd0c6c1773527fe1332bd382c1821e1f2d5d76808fb WHIRLPOOL eafd8c3cf60c2aacdbdc495f21d4e677cf77ce5ad5ce17d8e13b66b79bb1e416f9837d1b2dfbbe6d24b6447507b71270f1abe533e260e4a960477f974623045a
+DIST tornado-4.0.2.tar.gz 315841 SHA256 900c5124ebdb6598ca8e8a0c5888f41a5f14117952d5515258e3d20222b21bfa SHA512 93591068dc63af8d50a7925d528bc0cccdd705232c529b6162619fe28dddaf115e8a460b1842877d35160bd7ed480c1bd0bdbec57d1f359085bd1814e0c1c242 WHIRLPOOL e00484208ec70c55ca7a0bfb383a5f26928882ce547c274de8597312e539296c29edbbfdcece40c161bcfc71b5b74c42653625310a7c7cd5d2b244faa6027692
+DIST tornado-4.1.0.tar.gz 427424 SHA256 bf00fe845576a729f57e86dc3a7e767bf101e018eebbc86bf8c0148094409733 SHA512 bbe79aed51a29d4868557ad1ccea391a0c28b9702c40bdad21665a53796650884de8621c0f4333e2edeed268e0cf97a7807086b1513c63257a8bf02ef98d261f WHIRLPOOL 0231e010a021bd2cba13cee1c108abfe4850b7753655b0dd6edf22b72f04e7ba9a723fa434bd64aeae41f6c4c14fd189563e795c4843ed6255b1b7975287f306
+DIST tornado-4.2.0_beta1.tar.gz 433456 SHA256 216e505f14978143248030e62c275853272316fbd20f3447e40c7295898a2a8e SHA512 ebd5c2a7ef3d99e24821de685560e5810d8d0986bb394897cb9bdd799b221a5c6e314bedd589b6e374e4cae5425372e13b25b932a4c701820952f260f8bc46f7 WHIRLPOOL 6b1dfb9df5d24363fd85c2ab2864106d637c97268b4a58342481d292baf2856604ae61d99bded9e259e7d2ef12647169c18392a474246f09a16b17f2f20df315
+DIST tornado-4.2.1.tar.gz 434304 SHA256 a16fcdc4f76b184cb82f4f9eaeeacef6113b524b26a2cb331222e4a7fa6f2969 SHA512 5bb391b05c8574c8ae5e315b7617e1259ab80e993f1230db611c5beef8058517cc588daf75fac2e0f7969668715470b06ed183c9832b22081be265beb6967e30 WHIRLPOOL 5230055b1d10c32968c1f400e3d1fffbde1cbf9b4578ec42835cb202234d24daf6d4e621622a2fc884d3db8e5b3f64d6e62d17841bb9d71ab8ab91928cd0dfe3
+DIST tornado-4.2.tar.gz 433734 SHA256 e8b1207da67dbdceebfb291292b4ef1b547d6171525bec1b366853f923456a5f SHA512 b9f27cf544b0743bd08687c3cea2882528786d4bb1158b1f1b97b6e1b8c170396c07032802f6daafec3be9a21975f73292a321a160a17bad1d215e40f2e9244e WHIRLPOOL 76070b3c9bed55232a8b36f0bb45f398c142a04d5bb7c11e8cf152eec68eaa54804e9452a8042f01710cd45b8e2bfdfddbcfe911854a158a93f47e201ae89f20
diff --git a/www-servers/tornado/files/4.1.0-drop-intersphinx.patch b/www-servers/tornado/files/4.1.0-drop-intersphinx.patch
new file mode 100644
index 000000000000..e7da6fbefea2
--- /dev/null
+++ b/www-servers/tornado/files/4.1.0-drop-intersphinx.patch
@@ -0,0 +1,36 @@
+diff --git a/docs/Makefile b/docs/Makefile
+index a491685..ba4888f 100644
+--- a/docs/Makefile
++++ b/docs/Makefile
+@@ -1,7 +1,7 @@
+ .PHONY: all
+ all: sphinx
+
+-SPHINXOPTS=-n -W -d build/doctrees .
++SPHINXOPTS=-n -d build/doctrees .
+
+ .PHONY: sphinx
+ sphinx:
+diff --git a/docs/conf.py b/docs/conf.py
+index d9b4761..4c11038 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -15,7 +15,6 @@ extensions = [
+ "sphinx.ext.autodoc",
+ "sphinx.ext.coverage",
+ "sphinx.ext.extlinks",
+- "sphinx.ext.intersphinx",
+ "sphinx.ext.viewcode",
+ ]
+
+@@ -94,10 +93,6 @@ extlinks = {
+ 'tornado-%s.tar.g' % version),
+ }
+
+-intersphinx_mapping = {
+- 'python': ('http://python.readthedocs.org/en/latest/', None),
+- }
+-
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+ # On RTD we can't import sphinx_rtd_theme, but it will be applied by
diff --git a/www-servers/tornado/files/drop-intersphinx.patch b/www-servers/tornado/files/drop-intersphinx.patch
new file mode 100644
index 000000000000..7502dc53b820
--- /dev/null
+++ b/www-servers/tornado/files/drop-intersphinx.patch
@@ -0,0 +1,36 @@
+diff --git a/docs/Makefile b/docs/Makefile
+index 7001b80..ab2ffdd 100644
+--- a/docs/Makefile
++++ b/docs/Makefile
+@@ -3,7 +3,7 @@ all: sphinx
+
+ # No -W for doctests because that disallows tests with empty output.
+ SPHINX_DOCTEST_OPTS=-n -d build/doctress .
+-SPHINXOPTS=-n -W -d build/doctrees .
++SPHINXOPTS=-n -d build/doctrees .
+
+ .PHONY: sphinx
+ sphinx:
+diff --git a/docs/conf.py b/docs/conf.py
+index 368e4e8..85a276d 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -16,7 +16,6 @@ extensions = [
+ "sphinx.ext.coverage",
+ "sphinx.ext.doctest",
+ "sphinx.ext.extlinks",
+- "sphinx.ext.intersphinx",
+ "sphinx.ext.viewcode",
+ ]
+
+@@ -91,10 +90,6 @@ extlinks = {
+ 'tornado-%s.tar.g' % version),
+ }
+
+-intersphinx_mapping = {
+- 'python': ('https://docs.python.org/3.4/', None),
+- }
+-
+ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+ # On RTD we can't import sphinx_rtd_theme, but it will be applied by
diff --git a/www-servers/tornado/files/tornado-3.1.1-py2_6-tests-fix.patch b/www-servers/tornado/files/tornado-3.1.1-py2_6-tests-fix.patch
new file mode 100644
index 000000000000..ea18df2393ac
--- /dev/null
+++ b/www-servers/tornado/files/tornado-3.1.1-py2_6-tests-fix.patch
@@ -0,0 +1,31 @@
+diff --git a/tornado/test/twisted_test.py b/tornado/test/twisted_test.py
+index b8d9c6f..998282c 100644
+--- a/tornado/test/twisted_test.py
++++ b/tornado/test/twisted_test.py
+@@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function, with_statement
+ import os
+ import shutil
+ import signal
++import sys
+ import tempfile
+ import threading
+
+@@ -477,8 +478,6 @@ if have_twisted:
+ 'twisted.internet.test.test_fdset.ReactorFDSetTestsBuilder': [
+ "test_lostFileDescriptor", # incompatible with epoll and kqueue
+ ],
+- 'twisted.internet.test.test_process.ProcessTestsBuilder': [
+- ],
+ # Process tests appear to work on OSX 10.7, but not 10.6
+ #'twisted.internet.test.test_process.PTYProcessTestsBuilder': [
+ # 'test_systemCallUninterruptedByChildExit',
+@@ -519,6 +518,9 @@ if have_twisted:
+ ],
+ 'twisted.internet.test.test_unix.UNIXPortTestsBuilder': [],
+ }
++ if sys.version_info >= (2,7):
++ twisted_tests['twisted.internet.test.test_process.ProcessTestsBuilder'] = []
++
+ for test_name, blacklist in twisted_tests.items():
+ try:
+ test_class = import_object(test_name)
diff --git a/www-servers/tornado/files/unittest2-import-issue-1005.patch b/www-servers/tornado/files/unittest2-import-issue-1005.patch
new file mode 100644
index 000000000000..3ad5b9158c0a
--- /dev/null
+++ b/www-servers/tornado/files/unittest2-import-issue-1005.patch
@@ -0,0 +1,41 @@
+commit 79e29c62ce095984d0e9da5b7c5072eb9aa6e131
+Author: yac <yac@gentoo.org>
+Date: Sat Mar 8 00:32:09 2014 +0100
+
+ fixes #1005
+
+diff --git a/tornado/test/util.py b/tornado/test/util.py
+index 3604310..e4e37f0 100644
+--- a/tornado/test/util.py
++++ b/tornado/test/util.py
+@@ -3,6 +3,10 @@ from __future__ import absolute_import, division, print_function, with_statement
+ import os
+ import sys
+
++# Tornado's own test suite requires the updated unittest module
++# (either py27+ or unittest2) so tornado.test.util enforces
++# this requirement, but for other users of tornado.testing we want
++# to allow the older version if unitest2 is not available.
+ # Encapsulate the choice of unittest or unittest2 here.
+ # To be used as 'from tornado.test.util import unittest'.
+ if sys.version_info >= (2, 7):
+diff --git a/tornado/testing.py b/tornado/testing.py
+index 96fdd32..cd811d4 100644
+--- a/tornado/testing.py
++++ b/tornado/testing.py
+@@ -45,14 +45,7 @@ try:
+ except ImportError:
+ from io import StringIO # py3
+
+-# Tornado's own test suite requires the updated unittest module
+-# (either py27+ or unittest2) so tornado.test.util enforces
+-# this requirement, but for other users of tornado.testing we want
+-# to allow the older version if unitest2 is not available.
+-try:
+- import unittest2 as unittest
+-except ImportError:
+- import unittest
++from tornado.test.util import unittest
+
+ _next_port = 10000
+
diff --git a/www-servers/tornado/metadata.xml b/www-servers/tornado/metadata.xml
new file mode 100644
index 000000000000..62d0060337b8
--- /dev/null
+++ b/www-servers/tornado/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>python</herd>
+ <maintainer>
+ <email>alunduil@gentoo.org</email>
+ <name>Alex Brandt</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="pypi">tornado</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/tornado/tornado-3.1.1-r1.ebuild b/www-servers/tornado/tornado-3.1.1-r1.ebuild
new file mode 100644
index 000000000000..7ee36fa86598
--- /dev/null
+++ b/www-servers/tornado/tornado-3.1.1-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="Scalable, non-blocking web server and tools"
+HOMEPAGE="http://www.tornadoweb.org/ http://pypi.python.org/pypi/tornado"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="curl test"
+
+RDEPEND="curl? ( dev-python/pycurl[$(python_gen_usedep python2_7)] )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? (
+ dev-python/mock[${PYTHON_USEDEP}]
+ python_targets_python2_7? ( dev-python/twisted-names[python_targets_python2_7] )
+ )
+"
+
+REQUIRED_USE="curl? ( || ( $(python_gen_useflags python2_7) ) )"
+
+PATCHES=(
+ "${FILESDIR}/unittest2-import-issue-1005.patch"
+ "${FILESDIR}/${P}-py2_6-tests-fix.patch"
+)
+
+src_test() {
+ # The test server tries to bind at an unused port but suffers
+ # a race condition in it. Seems to be fixed already.
+ # https://github.com/facebook/tornado/blob/master/tornado/test/process_test.py#L64
+ local DISTUTILS_NO_PARALLEL_BUILD=1
+
+ distutils-r1_src_test
+}
+
+python_test() {
+ cd "${TMPDIR}" || die
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/tornado/tornado-3.1.1.ebuild b/www-servers/tornado/tornado-3.1.1.ebuild
new file mode 100644
index 000000000000..3fa643a873d0
--- /dev/null
+++ b/www-servers/tornado/tornado-3.1.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="Scalable, non-blocking web server and tools"
+HOMEPAGE="http://www.tornadoweb.org/ http://pypi.python.org/pypi/tornado"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 arm ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="curl"
+
+RDEPEND="curl? ( dev-python/pycurl[$(python_gen_usedep 'python2*')] )"
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]"
+
+REQUIRED_USE="curl? ( || ( $(python_gen_useflags python2*) ) )"
+
+src_test() {
+ # The test server tries to bind at an unused port but suffers
+ # a race condition in it. Seems to be fixed already.
+ # https://github.com/facebook/tornado/blob/master/tornado/test/process_test.py#L64
+ local DISTUTILS_NO_PARALLEL_BUILD=1
+
+ distutils-r1_src_test
+}
+
+python_test() {
+ cd "${TMPDIR}" || die
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/tornado/tornado-4.0.1.ebuild b/www-servers/tornado/tornado-4.0.1.ebuild
new file mode 100644
index 000000000000..0a552b40f6dc
--- /dev/null
+++ b/www-servers/tornado/tornado-4.0.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="Scalable, non-blocking web server and tools"
+HOMEPAGE="http://www.tornadoweb.org/ http://pypi.python.org/pypi/tornado"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ppc ppc64 x86 ~amd64-linux ~x86-linux"
+IUSE="curl test"
+
+RDEPEND="curl? ( $(python_gen_cond_dep 'dev-python/pycurl[${PYTHON_USEDEP}]' python2_7) )
+ dev-python/certifi[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' python2_7 pypy)"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( ${RDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' python2_7)
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ )"
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/tornado/tornado-4.0.2.ebuild b/www-servers/tornado/tornado-4.0.2.ebuild
new file mode 100644
index 000000000000..e87688f05e63
--- /dev/null
+++ b/www-servers/tornado/tornado-4.0.2.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit distutils-r1
+
+DESCRIPTION="Scalable, non-blocking web server and tools"
+HOMEPAGE="http://www.tornadoweb.org/ http://pypi.python.org/pypi/tornado"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="curl test"
+
+RDEPEND="curl? ( $(python_gen_cond_dep 'dev-python/pycurl[${PYTHON_USEDEP}]' python2_7) )
+ dev-python/certifi[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' python2_7 pypy)"
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( ${RDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' python2_7)
+ dev-python/service_identity[${PYTHON_USEDEP}]
+ )"
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
diff --git a/www-servers/tornado/tornado-4.1.0-r1.ebuild b/www-servers/tornado/tornado-4.1.0-r1.ebuild
new file mode 100644
index 000000000000..d89013523134
--- /dev/null
+++ b/www-servers/tornado/tornado-4.1.0-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 pypy )
+
+inherit distutils-r1 vcs-snapshot
+
+DESCRIPTION="Tornado is a Python web framework and asynchronous networking library, ... ."
+HOMEPAGE="http://www.tornadoweb.org/"
+SRC_URI="https://github.com/tornadoweb/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+CDEPEND="
+ $(python_gen_cond_dep 'dev-python/pycurl[${PYTHON_USEDEP}]' python2_7)
+ dev-python/certifi[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/asyncio[${PYTHON_USEDEP}]' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' python2_7 pypy)
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' python2_7)
+ $(python_gen_cond_dep 'dev-python/twisted-web[${PYTHON_USEDEP}]' python2_7)
+"
+# dev-python/twisted-* only supports python2_7 currently
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ test? (
+ ${CDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${PV}-drop-intersphinx.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs sphinx
+}
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+ use examples && local EXAMPLES=( demos/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/www-servers/tornado/tornado-4.1.0.ebuild b/www-servers/tornado/tornado-4.1.0.ebuild
new file mode 100644
index 000000000000..d480f5d72a14
--- /dev/null
+++ b/www-servers/tornado/tornado-4.1.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+
+inherit distutils-r1 vcs-snapshot
+
+DESCRIPTION="Tornado is a Python web framework and asynchronous networking library, ... ."
+HOMEPAGE="http://www.tornadoweb.org/"
+SRC_URI="https://github.com/tornadoweb/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="curl doc examples test"
+
+CDEPEND="
+ curl? ( dev-python/pycurl[${PYTHON_USEDEP}] )
+ dev-python/certifi[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/asyncio[${PYTHON_USEDEP}]' 'python3_3' )
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' python2_7 pypy)
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' python2_7)
+" # dev-python/twisted-names only supports python2_7 currently
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ test? (
+ ${CDEPEND}
+ dev-python/mock[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/${PV}-drop-intersphinx.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs sphinx
+}
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+ use examples && local EXAMPLES=( demos/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/www-servers/tornado/tornado-4.2.0_beta1.ebuild b/www-servers/tornado/tornado-4.2.0_beta1.ebuild
new file mode 100644
index 000000000000..d8de6ef0e316
--- /dev/null
+++ b/www-servers/tornado/tornado-4.2.0_beta1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+
+inherit distutils-r1 vcs-snapshot
+
+MY_PV=${PV/.0_beta/b}
+
+DESCRIPTION="Tornado is a Python web framework and asynchronous networking library, ... ."
+HOMEPAGE="http://www.tornadoweb.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${PN}-${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+CDEPEND="
+ dev-python/certifi[${PYTHON_USEDEP}]
+ >=dev-python/pycurl-7.18.2[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/asyncio[${PYTHON_USEDEP}]' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/futures[${PYTHON_USEDEP}]' 'python2_7 pypy')
+ $(python_gen_cond_dep 'dev-python/singledispatch[${PYTHON_USEDEP}]' 'python2_7 python3_3')
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/twisted-web[${PYTHON_USEDEP}]' 'python2_7')
+"
+# dev-python/twisted-* only supports python2_7 currently
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ test? (
+ ${CDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/drop-intersphinx.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs sphinx
+}
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+ use examples && local EXAMPLES=( demos/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/www-servers/tornado/tornado-4.2.1.ebuild b/www-servers/tornado/tornado-4.2.1.ebuild
new file mode 100644
index 000000000000..f22d4e245d45
--- /dev/null
+++ b/www-servers/tornado/tornado-4.2.1.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+
+inherit distutils-r1
+
+DESCRIPTION="Tornado is a Python web framework and asynchronous networking library, ... ."
+HOMEPAGE="http://www.tornadoweb.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+CDEPEND="
+ >=dev-python/pycurl-7.19.3.1[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/asyncio[${PYTHON_USEDEP}]' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/certifi[${PYTHON_USEDEP}]' 'python2_7' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/futures[${PYTHON_USEDEP}]' 'python2_7 pypy')
+ $(python_gen_cond_dep 'dev-python/singledispatch[${PYTHON_USEDEP}]' 'python2_7' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/twisted-web[${PYTHON_USEDEP}]' 'python2_7')
+"
+# dev-python/twisted-* only supports python2_7 currently
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ test? (
+ ${CDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/drop-intersphinx.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs sphinx
+}
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+ use examples && local EXAMPLES=( demos/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/www-servers/tornado/tornado-4.2.ebuild b/www-servers/tornado/tornado-4.2.ebuild
new file mode 100644
index 000000000000..d8de6ef0e316
--- /dev/null
+++ b/www-servers/tornado/tornado-4.2.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_3 python3_4 )
+
+inherit distutils-r1 vcs-snapshot
+
+MY_PV=${PV/.0_beta/b}
+
+DESCRIPTION="Tornado is a Python web framework and asynchronous networking library, ... ."
+HOMEPAGE="http://www.tornadoweb.org/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${PN}-${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="doc examples test"
+
+CDEPEND="
+ dev-python/certifi[${PYTHON_USEDEP}]
+ >=dev-python/pycurl-7.18.2[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/asyncio[${PYTHON_USEDEP}]' 'python3_3')
+ $(python_gen_cond_dep 'dev-python/backports-ssl-match-hostname[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/futures[${PYTHON_USEDEP}]' 'python2_7 pypy')
+ $(python_gen_cond_dep 'dev-python/singledispatch[${PYTHON_USEDEP}]' 'python2_7 python3_3')
+ $(python_gen_cond_dep 'dev-python/twisted-names[${PYTHON_USEDEP}]' 'python2_7')
+ $(python_gen_cond_dep 'dev-python/twisted-web[${PYTHON_USEDEP}]' 'python2_7')
+"
+# dev-python/twisted-* only supports python2_7 currently
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ doc? (
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
+ )
+ test? (
+ ${CDEPEND}
+ $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 pypy)
+ )
+"
+RDEPEND="${CDEPEND}"
+
+python_prepare_all() {
+ local PATCHES=(
+ "${FILESDIR}"/drop-intersphinx.patch
+ )
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ use doc && emake -C docs sphinx
+}
+
+python_test() {
+ "${PYTHON}" -m tornado.test.runtests || die "tests failed under ${EPYTHON}"
+}
+
+python_install_all() {
+ use doc && local HTML_DOCS=( docs/build/html/. )
+ use examples && local EXAMPLES=( demos/. )
+
+ distutils-r1_python_install_all
+}
diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
new file mode 100644
index 000000000000..d6eb89b09b80
--- /dev/null
+++ b/www-servers/uwsgi/Manifest
@@ -0,0 +1,2 @@
+DIST uwsgi-2.0.11.1.tar.gz 782091 SHA256 75a7d3138cfa9cd81a760c2f8a43f3d80961edc8e4f27043dc1412206c926287 SHA512 0978234bf1592b52f0e8718eb63de141e2aa9928e7efff3e4833f795ee66bcb14fa1a35a141d9b590d5fffc9fbc6bc8ed3c8095e04af27a34318f37dbac6117c WHIRLPOOL f830cf3cdbfda90dc65efbd01550644eb06e091fd91b6237f851efc71d2bcb1e811ad9e8db827abfeda76e041a5ef61711c84f0b3a93e041da598d349b788688
+DIST uwsgi-2.0.9.tar.gz 779244 SHA256 fe0489bca0a8b95653908be2297e35699fb9e992f728e382224587ee6b918295 SHA512 8afb6ca51aa2113e2c9fc0b90e11ce8c1aeddb38f41c7b0d5da6811d7ef93aa8b9e015abfd29b1ced35b0f6a00fd7285b8140b855fc3ee79804e2513e94a9fb5 WHIRLPOOL 362abe240b9a3f170409b850d9ae5186701b137159cd91d2e689b5f3d43dfe779f13d9e4554b60b82efd534a00751394a7982130912f7f106ac6e7c6dbde88d6
diff --git a/www-servers/uwsgi/files/1.1.2-threaded-php.patch b/www-servers/uwsgi/files/1.1.2-threaded-php.patch
new file mode 100644
index 000000000000..ed75ad9b2f16
--- /dev/null
+++ b/www-servers/uwsgi/files/1.1.2-threaded-php.patch
@@ -0,0 +1,40 @@
+diff -r a6dd30e36bc0 plugins/php/php_plugin.c
+--- a/plugins/php/php_plugin.c Fri Apr 20 16:27:00 2012 +0200
++++ b/plugins/php/php_plugin.c Sun Apr 22 11:54:49 2012 +0200
+@@ -116,7 +116,7 @@
+ }
+
+
+-static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers)
++static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+ {
+ sapi_header_struct *h;
+ zend_llist_position pos;
+@@ -237,7 +237,7 @@
+ }
+
+
+-static char *sapi_uwsgi_read_cookies(void)
++static char *sapi_uwsgi_read_cookies(TSRMLS_D)
+ {
+ uint16_t len = 0;
+ struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
+@@ -624,6 +624,10 @@
+ struct uwsgi_string_list *pset = uphp.set;
+ struct uwsgi_string_list *append_config = uphp.append_config;
+
++#ifdef ZTS
++ tsrm_startup(1, 1, 0, NULL);
++#endif
++
+ sapi_startup(&uwsgi_sapi_module);
+
+ // applying custom options
+@@ -721,6 +725,7 @@
+
+ zend_file_handle file_handle;
+
++ TSRMLS_FETCH(); // fetch the threading state in case PHP is built with threading
+ SG(server_context) = (void *) wsgi_req;
+
+ if (uwsgi_parse_vars(wsgi_req)) {
diff --git a/www-servers/uwsgi/files/1.2.3-pyerl.patch b/www-servers/uwsgi/files/1.2.3-pyerl.patch
new file mode 100644
index 000000000000..1d4794d8f6e1
--- /dev/null
+++ b/www-servers/uwsgi/files/1.2.3-pyerl.patch
@@ -0,0 +1,31 @@
+diff --git a/plugins/pyerl/pyerl.c b/plugins/pyerl/pyerl.c
+index a335f03..aee98e2 100644
+--- a/plugins/pyerl/pyerl.c
++++ b/plugins/pyerl/pyerl.c
+@@ -537,7 +537,7 @@ void pyerl_init() {
+ }
+
+ struct uwsgi_plugin pyerl_plugin = {
+-
++ .name = "pyerl",
+ .post_init = pyerl_init,
+ };
+
+diff --git a/plugins/pyerl/uwsgiplugin.py b/plugins/pyerl/uwsgiplugin.py
+index 161d722..ae9c68d 100644
+--- a/plugins/pyerl/uwsgiplugin.py
++++ b/plugins/pyerl/uwsgiplugin.py
+@@ -1,7 +1,12 @@
+ from distutils import sysconfig
++import os
+
+ NAME='pyerl'
+-CFLAGS = ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True)]
++
++ERLANGPATH = os.environ.get('UWSGICONFIG_ERLANGPATH', 'erl')
++includedir = os.popen(ERLANGPATH + " -noshell -noinput -eval \"io:format('~s~n', [code:lib_dir(erl_interface, include)])\" -s erlang halt").read().rstrip()
++
++CFLAGS = ['-I' + sysconfig.get_python_inc(), '-I' + sysconfig.get_python_inc(plat_specific=True), '-I' + includedir ]
+ LDFLAGS = []
+ LIBS = []
+
diff --git a/www-servers/uwsgi/files/42_mod_uwsgi-r1.conf b/www-servers/uwsgi/files/42_mod_uwsgi-r1.conf
new file mode 100644
index 000000000000..bcb383ee3abc
--- /dev/null
+++ b/www-servers/uwsgi/files/42_mod_uwsgi-r1.conf
@@ -0,0 +1,9 @@
+<IfDefine PROXY_UWSGI>
+ LoadModule uwsgi_module modules/mod_proxy_uwsgi.so
+</IfDefine>
+<IfDefine RUWSGI>
+ LoadModule uwsgi_module modules/mod_Ruwsgi.so
+</IfDefine>
+<IfDefine UWSGI>
+ LoadModule uwsgi_module modules/mod_uwsgi.so
+</IfDefine>
diff --git a/www-servers/uwsgi/files/42_mod_uwsgi-r2.conf b/www-servers/uwsgi/files/42_mod_uwsgi-r2.conf
new file mode 100644
index 000000000000..85ede87b037b
--- /dev/null
+++ b/www-servers/uwsgi/files/42_mod_uwsgi-r2.conf
@@ -0,0 +1,9 @@
+<IfDefine PROXY_UWSGI>
+ LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
+</IfDefine>
+<IfDefine RUWSGI>
+ LoadModule uwsgi_module modules/mod_Ruwsgi.so
+</IfDefine>
+<IfDefine UWSGI>
+ LoadModule uwsgi_module modules/mod_uwsgi.so
+</IfDefine>
diff --git a/www-servers/uwsgi/files/42_mod_uwsgi.conf b/www-servers/uwsgi/files/42_mod_uwsgi.conf
new file mode 100644
index 000000000000..a619baeafeeb
--- /dev/null
+++ b/www-servers/uwsgi/files/42_mod_uwsgi.conf
@@ -0,0 +1,7 @@
+<IfDefine UWSGI>
+ LoadModule uwsgi_module modules/mod_uwsgi.so
+</IfDefine>
+<IfDefine RUWSGI>
+ LoadModule uwsgi_module modules/mod_Ruwsgi.so
+</IfDefine>
+
diff --git a/www-servers/uwsgi/files/gentoo.buildconf b/www-servers/uwsgi/files/gentoo.buildconf
new file mode 100644
index 000000000000..e0c60bc6a5b8
--- /dev/null
+++ b/www-servers/uwsgi/files/gentoo.buildconf
@@ -0,0 +1,30 @@
+[uwsgi]
+xml = VAR_XML
+yaml = VAR_YAML
+json = VAR_JSON
+ssl = VAR_SSL
+pcre = VAR_PCRE
+zeromq = VAR_ZMQ
+routing = VAR_ROUTING
+debug = VAR_DEBUG
+unbit = false
+malloc_implementation = VAR_MALLOC
+extras =
+plugins = VAR_PLUGINS
+bin_name = uwsgi
+append_version =
+plugin_dir = VAR_PLUGIN_DIR
+plugin_build_dir = VAR_BUILD_DIR
+embedded_plugins = VAR_EMBEDDED
+as_shared_library = false
+
+locking = auto
+event = auto
+timer = auto
+filemonitor = auto
+
+blacklist =
+whitelist =
+
+embed_files =
+embed_config =
diff --git a/www-servers/uwsgi/files/uwsgi.confd-r1 b/www-servers/uwsgi/files/uwsgi.confd-r1
new file mode 100644
index 000000000000..3b0a005b8e63
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.confd-r1
@@ -0,0 +1,53 @@
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# YOU SHOULD ONLY MODIFY THIS FILE IF YOU USE THE UWSGI EMPEROR MODE!
+# IF YOU WANT TO RUN A SINGLE APP INSTANCE, CREATE A COPY AND MODIFY THAT INSTEAD!
+
+# Path (or name) of UNIX/TCP socket to bind to
+# Example : UWSGI_SOCKET=127.0.0.1:1234
+UWSGI_SOCKET=
+
+# Enable threads? (1 = yes, 0 = no). The default is 0
+#
+UWSGI_THREADS=0
+
+# The path to your uWSGI application.
+#
+UWSGI_PROGRAM=
+
+# The path to your uWSGI xml config file.
+#
+UWSGI_XML_CONFIG=
+
+# The number of child processes to spawn. The default is 1.
+#
+UWSGI_PROCESSES=1
+
+# The log file path. If empty, log only errors
+#
+UWSGI_LOG_FILE=
+
+# If you want to run your application inside a chroot then specify the
+# directory here. Leave this blank otherwise.
+#
+UWSGI_CHROOT=
+
+# If you want to run your application from a specific directiory specify
+# it here. Leave this blank otherwise.
+#
+UWSGI_DIR=
+
+# The user and group to run your application as. If you do not specify these,
+# the application will be run as root:root.
+#
+UWSGI_USER=
+
+# Run the uwsgi emperor which loads vassals dynamically from this PATH
+# see http://projects.unbit.it/uwsgi/wiki/Emperor
+# The advised Gentoo folder is /etc/uwsgi.d/
+UWSGI_EMPEROR_PATH=
+
+# Additional options you might want to pass to uWSGI
+#
+UWSGI_EXTRA_OPTIONS=
diff --git a/www-servers/uwsgi/files/uwsgi.confd-r3 b/www-servers/uwsgi/files/uwsgi.confd-r3
new file mode 100644
index 000000000000..fa0158029b1d
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.confd-r3
@@ -0,0 +1,63 @@
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# YOU SHOULD ONLY MODIFY THIS FILE IF YOU USE THE UWSGI EMPEROR MODE!
+# IF YOU WANT TO RUN A SINGLE APP INSTANCE, CREATE A COPY AND MODIFY THAT INSTEAD!
+
+# Path (or name) of UNIX/TCP socket to bind to
+# Example : UWSGI_SOCKET=127.0.0.1:1234
+UWSGI_SOCKET=
+
+# Enable threads? (1 = yes, 0 = no). The default is 0
+#
+UWSGI_THREADS=0
+
+# The path to your uWSGI application.
+#
+UWSGI_PROGRAM=
+
+# The path to your uWSGI xml config file.
+#
+UWSGI_XML_CONFIG=
+
+# The number of child processes to spawn. The default is 1.
+#
+UWSGI_PROCESSES=1
+
+# The log file path. If empty, log only errors
+#
+UWSGI_LOG_FILE=
+
+# If you want to run your application inside a chroot then specify the
+# directory here. Leave this blank otherwise.
+#
+UWSGI_CHROOT=
+
+# If you want to run your application from a specific directiory specify
+# it here. Leave this blank otherwise.
+#
+UWSGI_DIR=
+
+# The user to run your application as. If you do not specify these,
+# the application will be run as user root.
+#
+UWSGI_USER=
+
+# The group to run your application as. If you do not specify these,
+# the application will be run as group root.
+#
+UWSGI_GROUP=
+
+# Run the uwsgi emperor which loads vassals dynamically from this PATH
+# see http://projects.unbit.it/uwsgi/wiki/Emperor
+# The advised Gentoo folder is /etc/uwsgi.d/
+UWSGI_EMPEROR_PATH=
+
+# The group the emperor should run as. This is different from the UWSGI_GROUP
+# as you could want your apps share some sockets with other processes such as
+# www servers while preserving your emperor logs from being accessible by them.
+UWSGI_EMPEROR_GROUP=
+
+# Additional options you might want to pass to uWSGI
+#
+UWSGI_EXTRA_OPTIONS=
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r1 b/www-servers/uwsgi/files/uwsgi.initd-r1
new file mode 100644
index 000000000000..9b3af69f1b60
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r1
@@ -0,0 +1,138 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+PIDPATH=/var/run/uwsgi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${UWSGI_USER}":root "${PIDPATH}"
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} \
+ --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ "${SVCNAME}" == "uwsgi" ]; then
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ fi
+ else
+ start_app
+ eend $?
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r2 b/www-servers/uwsgi/files/uwsgi.initd-r2
new file mode 100644
index 000000000000..f535dd24b51a
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r2
@@ -0,0 +1,142 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+if [ "${SVCNAME}" == "uwsgi" ]; then
+ PIDPATH=/var/run/uwsgi
+else
+ PIDPATH="/var/run/uwsgi_${PROGNAME}"
+fi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${UWSGI_USER}":root "${PIDPATH}"
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} \
+ --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ "${SVCNAME}" == "uwsgi" ]; then
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ fi
+ else
+ start_app
+ eend $?
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r3 b/www-servers/uwsgi/files/uwsgi.initd-r3
new file mode 100644
index 000000000000..efa3150908ca
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r3
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+if [ "${SVCNAME}" == "uwsgi" ]; then
+ PIDPATH=/var/run/uwsgi
+else
+ PIDPATH="/var/run/uwsgi_${PROGNAME}"
+fi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${UWSGI_USER}":"${UWSGI_GROUP}" "${PIDPATH}"
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ --group ${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}} \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --group "${UWSGI_GROUP}" \
+ --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ "${SVCNAME}" == "uwsgi" ]; then
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ fi
+ else
+ start_app
+ eend $?
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r4 b/www-servers/uwsgi/files/uwsgi.initd-r4
new file mode 100644
index 000000000000..856fdb90e66b
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r4
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+if [ "${SVCNAME}" = "uwsgi" ]; then
+ PIDPATH=/var/run/uwsgi
+else
+ PIDPATH="/var/run/uwsgi_${PROGNAME}"
+fi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_pre() {
+ checkpath -d -m 0750 -o "${UWSGI_USER}":"${UWSGI_GROUP}" "${PIDPATH}"
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ --group ${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}} \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --group "${UWSGI_GROUP}" \
+ --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ if [ "${SVCNAME}" = "uwsgi" ]; then
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ else
+ start_app
+ eend $?
+ fi
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r5 b/www-servers/uwsgi/files/uwsgi.initd-r5
new file mode 100644
index 000000000000..d673daae6be1
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r5
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+if [ "${SVCNAME}" = "uwsgi" ]; then
+ PIDPATH=/var/run/uwsgi
+else
+ PIDPATH="/var/run/uwsgi_${PROGNAME}"
+fi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ checkpath -d -m 0750 -o "${UWSGI_USER}":"${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}}" "${PIDPATH}"
+
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ --group ${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}} \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ checkpath -d -m 0750 -o "${UWSGI_USER}":"${UWSGI_GROUP}" "${PIDPATH}"
+
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --group "${UWSGI_GROUP}" \
+ --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ if [ "${SVCNAME}" = "uwsgi" ]; then
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ else
+ start_app
+ eend $?
+ fi
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/files/uwsgi.initd-r6 b/www-servers/uwsgi/files/uwsgi.initd-r6
new file mode 100644
index 000000000000..ab550aabfaa5
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi.initd-r6
@@ -0,0 +1,144 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+PROGNAME=${SVCNAME#*.}
+
+UWSGI_EXEC=/usr/bin/uwsgi
+if [ "${SVCNAME}" = "uwsgi" ]; then
+ PIDPATH=/var/run/uwsgi
+else
+ PIDPATH="/var/run/uwsgi_${PROGNAME}"
+fi
+PIDFILE="${PIDPATH}/${PROGNAME}.pid"
+
+extra_started_commands="${opts} reload stats"
+
+depend() {
+ need net
+}
+
+start_emperor() {
+ local OPTIONS
+ OPTIONS="--daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ ebegin "Starting uWSGI emperor"
+ checkpath -d -m 0770 -o "${UWSGI_USER}":"${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}}" "${PIDPATH}"
+
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" \
+ --group ${UWSGI_EMPEROR_GROUP:-${UWSGI_GROUP}} \
+ -- --emperor "${UWSGI_EMPEROR_PATH}" ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start_app() {
+ local OPTIONS
+ OPTIONS="--master --daemonize"
+
+ if [ -n "${UWSGI_LOG_FILE}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+ else
+ OPTIONS="${OPTIONS} /dev/null --disable-logging"
+ fi
+
+ [ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+ [ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
+ [ -z "${UWSGI_GROUP}" ] && UWSGI_GROUP="root"
+
+ if [ -n "${UWSGI_EXTRA_OPTIONS}" ]; then
+ OPTIONS="${OPTIONS} ${UWSGI_EXTRA_OPTIONS}"
+ fi
+
+ if [ "${UWSGI_THREADS}" = "1" ]; then
+ OPTIONS="${OPTIONS} --enable-threads"
+ fi
+
+ if [ -n "${UWSGI_SOCKET}" ]; then
+ OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
+ fi
+
+ if [ -n "${UWSGI_PROCESSES}" ]; then
+ OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
+ fi
+
+ if [ -n "${UWSGI_CHROOT}" ]; then
+ OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
+ fi
+
+ if [ -n "${UWSGI_PROGRAM}" ]; then
+ OPTIONS="${OPTIONS} --fileserve-mode ${UWSGI_PROGRAM}"
+ fi
+
+ if [ -n "${UWSGI_XML_CONFIG}" ]; then
+ OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
+ fi
+
+ ebegin "Starting uWSGI application ${PROGNAME}"
+ checkpath -d -m 0750 -o "${UWSGI_USER}":"${UWSGI_GROUP}" "${PIDPATH}"
+
+ cd "${UWSGI_DIR}" && \
+ start-stop-daemon --start --user "${UWSGI_USER}" --group "${UWSGI_GROUP}" \
+ --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
+ return $?
+}
+
+start() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ start_emperor
+ eend $?
+ else
+ if [ "${SVCNAME}" = "uwsgi" ]; then
+ eerror "You are not supposed to run this script directly unless you"
+ eerror "want to run in Emperor mode. In that case please set the UWSGI_EMPEROR_PATH."
+ eerror "Otherwise create a symlink for the uwsgi application you want to run as well as"
+ eerror "a copy of the configuration file and modify it appropriately like so..."
+ eerror
+ eerror " ln -s uwsgi /etc/init.d/uwsgi.trac"
+ eerror " cp /etc/conf.d/uwsgi /etc/conf.d/uwsgi.trac"
+ eerror " nano /etc/conf.d/uwsgi.trac"
+ eerror
+ return 1
+ else
+ start_app
+ eend $?
+ fi
+ fi
+}
+
+stop() {
+ if [ -n "${UWSGI_EMPEROR_PATH}" ]; then
+ ebegin "Stopping uWSGI emperor"
+ else
+ ebegin "Stopping uWSGI application ${PROGNAME}"
+ fi
+ start-stop-daemon --stop --signal QUIT --pidfile "${PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading uWSGI"
+ start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
+ eend $?
+}
+
+stats() {
+ ebegin "Logging uWSGI statistics"
+ start-stop-daemon --signal USR1 --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/www-servers/uwsgi/metadata.xml b/www-servers/uwsgi/metadata.xml
new file mode 100644
index 000000000000..2113cc7d6bef
--- /dev/null
+++ b/www-servers/uwsgi/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>python</herd>
+ <maintainer>
+ <email>ultrabug@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="embedded">Embed plugins instead of building them as real plugins. When disabling this USE flag make sure you specify all used plugins in your uWSGI configuration. Note: Language plugins will always be built as real plugins.</flag>
+ <flag name="jemalloc">Use <pkg>dev-libs/jemalloc</pkg> instead of libc's malloc</flag>
+ <flag name="json">Support json as a configuration file format.</flag>
+ <flag name="python_asyncio">Use the EXPERIMENTAL asyncio (tulip) for python3.4 async request dispatching and as LoopEngine (see http://uwsgi-docs.readthedocs.org/en/latest/asyncio.html).</flag>
+ <flag name="python_gevent">Use <pkg>dev-python/gevent</pkg> for async request dispatching and as LoopEngine (see http://projects.unbit.it/uwsgi/wiki/Gevent).</flag>
+ <flag name="routing">Enable routing support</flag>
+ <flag name="yaml">Support yaml as a configuration file format.</flag>
+ <flag name="yajl">Use <pkg>dev-libs/yajl</pkg> instead of <pkg>dev-libs/jansson</pkg> for parsing JSON configuration files (if USe=json is set)</flag>
+ <flag name="zeromq">Enable logging and deployment via ZeroMQ.</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">unbit/uwsgi</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/www-servers/uwsgi/uwsgi-2.0.11.1.ebuild b/www-servers/uwsgi/uwsgi-2.0.11.1.ebuild
new file mode 100644
index 000000000000..0a15640ea746
--- /dev/null
+++ b/www-servers/uwsgi/uwsgi-2.0.11.1.ebuild
@@ -0,0 +1,376 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+RUBY_OPTIONAL="yes"
+USE_RUBY="ruby19 ruby20 ruby21"
+
+PHP_EXT_INI="no"
+PHP_EXT_NAME="dummy"
+PHP_EXT_OPTIONAL_USE="php"
+USE_PHP="php5-4 php5-5 php5-6" # deps must be registered separately below
+
+MY_P="${P/_/-}"
+
+inherit apache-module distutils-r1 eutils multilib pax-utils php-ext-source-r2 python-r1 ruby-ng versionator
+
+DESCRIPTION="uWSGI server for Python web applications"
+HOMEPAGE="http://projects.unbit.it/uwsgi/"
+SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+UWSGI_PLUGINS_STD=( ping cache carbon nagios rpc rrdtool
+ http ugreen signal syslog rsyslog
+ router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
+ {core,fast,raw,ssl}router
+ redislog mongodblog log{file,socket}
+ spooler cheaper_busyness symcall
+ transformation_{chunked,gzip,offload,tofile}
+ zergpool )
+UWSGI_PLUGINS_OPT=( alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
+ dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
+ geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
+ rados router_{access,radius,spnego,xmldir}
+ sqlite ssi stats_pusher_statsd
+ systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix )
+
+LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
+LANG_SUPPORT_EXTENDED=( lua php python python_asyncio python_gevent ruby )
+
+# plugins to be ignored (for now):
+# cheaper_backlog2: example plugin
+# coroae: TODO
+# cplusplus: partially example code, needs explicit class
+# dummy: no idea
+# example: example plugin
+# exception_log: example plugin
+# *go*: TODO
+# *java*: TODO
+# v8: TODO
+# matheval: TODO
+IUSE="apache2 +caps debug +embedded expat jemalloc json +pcre +routing +ssl +xml yajl yaml zeromq"
+
+for plugin in ${UWSGI_PLUGINS_STD[@]} ; do IUSE="${IUSE} +uwsgi_plugins_${plugin}" ; done
+for plugin in ${UWSGI_PLUGINS_OPT[@]} ; do IUSE="${IUSE} uwsgi_plugins_${plugin}" ; done
+IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
+
+REQUIRED_USE="|| ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
+ uwsgi_plugins_logcrypto? ( ssl )
+ uwsgi_plugins_sslrouter? ( ssl )
+ routing? ( pcre )
+ uwsgi_plugins_emperor_zeromq? ( zeromq )
+ uwsgi_plugins_router_xmldir? ( xml )
+ uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ python_asyncio? ( python_targets_python3_4 python_gevent )
+ python_gevent? ( python )
+ expat? ( xml )"
+
+# util-linux is required for libuuid when requesting zeromq support
+# Order:
+# 1. Unconditional
+# 2. General features
+# 3. Plugins
+# 4. Language/app support
+CDEPEND="sys-libs/zlib
+ caps? ( sys-libs/libcap )
+ json? ( !yajl? ( dev-libs/jansson )
+ yajl? ( dev-libs/yajl ) )
+ pcre? ( dev-libs/libpcre:3 )
+ ssl? ( dev-libs/openssl:= )
+ xml? ( !expat? ( dev-libs/libxml2 )
+ expat? ( dev-libs/expat ) )
+ yaml? ( dev-libs/libyaml )
+ zeromq? ( net-libs/zeromq sys-apps/util-linux )
+ uwsgi_plugins_alarm_curl? ( net-misc/curl )
+ uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
+ uwsgi_plugins_curl_cron? ( net-misc/curl )
+ uwsgi_plugins_emperor_pg? ( dev-db/postgresql:= )
+ uwsgi_plugins_geoip? ( dev-libs/geoip )
+ uwsgi_plugins_ldap? ( net-nds/openldap )
+ uwsgi_plugins_pam? ( virtual/pam )
+ uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
+ uwsgi_plugins_rados? ( sys-cluster/ceph )
+ uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
+ uwsgi_plugins_router_spnego? ( virtual/krb5 )
+ uwsgi_plugins_rsyslog? ( app-admin/rsyslog )
+ uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
+ uwsgi_plugins_webdav? ( dev-libs/libxml2 )
+ uwsgi_plugins_xslt? ( dev-libs/libxslt )
+ lua? ( dev-lang/lua:= )
+ mono? ( =dev-lang/mono-2* )
+ perl? ( dev-lang/perl:= )
+ php? (
+ php_targets_php5-4? ( dev-lang/php:5.4[embed] )
+ php_targets_php5-5? ( dev-lang/php:5.5[embed] )
+ )
+ python? ( ${PYTHON_DEPS} )
+ python_gevent? ( >=dev-python/gevent-1.0_beta2[$(python_gen_usedep 'python2*')] )
+ ruby? ( $(ruby_implementations_depend) )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
+
+want_apache2
+
+S="${WORKDIR}/${MY_P}"
+APXS2_S="${S}/apache2"
+APACHE2_MOD_CONF="42_mod_uwsgi-r2 42_mod_uwsgi"
+
+src_unpack() {
+ default
+}
+
+pkg_setup() {
+ python_setup
+ use ruby && ruby-ng_pkg_setup
+ depend.apache_pkg_setup
+}
+
+src_prepare() {
+ sed -i \
+ -e "s|'-O2', ||" \
+ -e "s|'-Werror', ||" \
+ -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
+ uwsgiconfig.py || die "sed failed"
+
+ sed -i \
+ -e "s|/lib|/$(get_libdir)|" \
+ plugins/php/uwsgiplugin.py || die "sed failed"
+}
+
+src_configure() {
+ local embedded_plugins=()
+ local plugins=()
+ local malloc_impl="libc"
+ local json="false"
+ local xml="false"
+
+ for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
+ use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
+ done
+ for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
+ use ${p} && plugins+=("${p}")
+ done
+
+ # do not embedded any plugins
+ if ! use embedded ; then
+ plugins=( ${plugins[@]} ${embedded_plugins[@]} )
+ embedded_plugins=()
+ fi
+
+ # flatten the arrays
+ plugins=${plugins[@]}
+ embedded_plugins=${embedded_plugins[@]}
+
+ # rename some of the use flags, language plugins are always real plugins
+ plugins="${plugins/perl/psgi}"
+ plugins="${plugins/sqlite/sqlite3}"
+ embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
+
+ # override defaults as requested by the user
+ if use xml; then
+ use expat && xml="expat" || xml="libxml2"
+ fi
+ if use json; then
+ use yajl && json="yajl" || json="jansson"
+ fi
+ use jemalloc && malloc_impl="jemalloc"
+
+ # prepare the buildconf for gentoo
+ cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
+ sed -i \
+ -e "s|VAR_XML|${xml}|" \
+ -e "s|VAR_YAML|$(usex yaml true false)|" \
+ -e "s|VAR_JSON|${json}|" \
+ -e "s|VAR_SSL|$(usex ssl true false)|" \
+ -e "s|VAR_PCRE|$(usex pcre true false)|" \
+ -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
+ -e "s|VAR_ROUTING|$(usex routing true false)|" \
+ -e "s|VAR_DEBUG|$(usex debug true false)|" \
+ -e "s|VAR_MALLOC|${malloc_impl}|" \
+ -e "s|VAR_PLUGINS|${plugins// /, }|" \
+ -e "s|VAR_PLUGIN_DIR|/usr/$(get_libdir)/uwsgi|" \
+ -e "s|VAR_BUILD_DIR|${T}/plugins|" \
+ -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
+ buildconf/gentoo.ini
+
+ use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+
+ if use uwsgi_plugins_emperor_pg ; then
+ PGPV="$(best_version dev-db/postgresql)"
+ PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-})"
+ sed -i \
+ -e "s|pg_config|pg_config${PGSLOT/.}|" \
+ plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
+ fi
+}
+
+each_ruby_compile() {
+ cd "${WORKDIR}/${MY_P}"
+
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
+}
+
+python_compile_plugins() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
+
+ if use python_asyncio ; then
+ if [ "${PYV}" == "34" ] ; then
+ ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
+ fi
+ fi
+
+ if use python_gevent ; then
+ ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
+ fi
+}
+
+python_install_symlinks() {
+ dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
+}
+
+src_compile() {
+ mkdir -p "${T}/plugins"
+
+ python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
+
+ if use lua ; then
+ # setting the name for the pkg-config file to lua, since we don't have
+ # slotted lua
+ UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
+ fi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_compile_plugins
+ fi
+
+ if use ruby ; then
+ ruby-ng_src_compile
+ fi
+
+ if use apache2 ; then
+ for m in proxy_uwsgi Ruwsgi uwsgi ; do
+ APXS2_ARGS="-c mod_${m}.c"
+ apache-module_src_compile
+ done
+ fi
+}
+
+src_install() {
+ dobin uwsgi
+ pax-mark m "${D}"/usr/bin/uwsgi
+
+ insinto /usr/$(get_libdir)/uwsgi
+ doins "${T}/plugins"/*.so
+
+ use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
+ use lua && dosym uwsgi /usr/bin/uwsgi_lua
+ use mono && dosym uwsgi /usr/bin/uwsgi_mono
+ use perl && dosym uwsgi /usr/bin/uwsgi_psgi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ dosym uwsgi /usr/bin/uwsgi_${s/.}
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_install_symlinks
+ python_foreach_impl python_domodule uwsgidecorators.py
+ fi
+
+ if use apache2; then
+ for m in proxy_uwsgi Ruwsgi uwsgi ; do
+ APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
+ apache-module_src_install
+ done
+ fi
+
+ newinitd "${FILESDIR}"/uwsgi.initd-r6 uwsgi
+ newconfd "${FILESDIR}"/uwsgi.confd-r3 uwsgi
+ keepdir /etc/"${PN}".d
+ use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
+}
+
+pkg_postinst() {
+ if use apache2 ; then
+ elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
+ elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
+ elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
+ elog "Therefore you can enable only one of them at a time."
+ elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
+ elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
+ elog "mod_proxy_uwsgi is a proxy module, considered stable and is now the recommended module."
+ fi
+
+ elog "Append the following options to the uwsgi call to load the respective language plugin:"
+ use cgi && elog " '--plugins cgi' for cgi"
+ use lua && elog " '--plugins lua' for lua"
+ use mono && elog " '--plugins mono' for mono"
+ use perl && elog " '--plugins psgi' for perl"
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ elog " '--plugins ${s/.}' for ${s}"
+ done
+ fi
+
+ python_pkg_postinst() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ elog " "
+ elog " '--plugins ${EPYV}' for ${EPYTHON}"
+ if use python_asyncio ; then
+ if [[ ${EPYV} == python34 ]] ; then
+ elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
+ else
+ elog " (asyncio is only supported in python3.4)"
+ fi
+ fi
+ if use python_gevent ; then
+ if [[ ${EPYTHON} == python2* ]] ; then
+ elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
+ else
+ elog " (gevent is currently not supported in ${EPYTHON})"
+ fi
+ fi
+ }
+
+ use python && python_foreach_impl python_pkg_postinst
+
+ if use ruby ; then
+ for ruby in $USE_RUBY; do
+ if use ruby_targets_${ruby} ; then
+ elog " '--plugins rack_${ruby/.}' for ${ruby}"
+ elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
+ elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
+ fi
+ done
+ fi
+}
diff --git a/www-servers/uwsgi/uwsgi-2.0.9.ebuild b/www-servers/uwsgi/uwsgi-2.0.9.ebuild
new file mode 100644
index 000000000000..08fc6640bbbe
--- /dev/null
+++ b/www-servers/uwsgi/uwsgi-2.0.9.ebuild
@@ -0,0 +1,376 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python2_7 python3_{3,4} )
+
+RUBY_OPTIONAL="yes"
+USE_RUBY="ruby19 ruby20"
+
+PHP_EXT_INI="no"
+PHP_EXT_NAME="dummy"
+PHP_EXT_OPTIONAL_USE="php"
+USE_PHP="php5-4 php5-5" # deps must be registered separately below
+
+MY_P="${P/_/-}"
+
+inherit apache-module distutils-r1 eutils multilib pax-utils php-ext-source-r2 python-r1 ruby-ng versionator
+
+DESCRIPTION="uWSGI server for Python web applications"
+HOMEPAGE="http://projects.unbit.it/uwsgi/"
+SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+
+UWSGI_PLUGINS_STD=( ping cache carbon nagios rpc rrdtool
+ http ugreen signal syslog rsyslog
+ router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
+ {core,fast,raw,ssl}router
+ redislog mongodblog log{file,socket}
+ spooler cheaper_busyness symcall
+ transformation_{chunked,gzip,offload,tofile}
+ zergpool )
+UWSGI_PLUGINS_OPT=( alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
+ dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
+ geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
+ rados router_{access,radius,spnego,xmldir}
+ sqlite ssi stats_pusher_statsd
+ systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix )
+
+LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
+LANG_SUPPORT_EXTENDED=( lua php python python_asyncio python_gevent ruby )
+
+# plugins to be ignored (for now):
+# cheaper_backlog2: example plugin
+# coroae: TODO
+# cplusplus: partially example code, needs explicit class
+# dummy: no idea
+# example: example plugin
+# exception_log: example plugin
+# *go*: TODO
+# *java*: TODO
+# v8: TODO
+# matheval: TODO
+IUSE="apache2 +caps debug +embedded expat jemalloc json +pcre +routing +ssl +xml yajl yaml zeromq"
+
+for plugin in ${UWSGI_PLUGINS_STD[@]} ; do IUSE="${IUSE} +uwsgi_plugins_${plugin}" ; done
+for plugin in ${UWSGI_PLUGINS_OPT[@]} ; do IUSE="${IUSE} uwsgi_plugins_${plugin}" ; done
+IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
+
+REQUIRED_USE="|| ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
+ uwsgi_plugins_logcrypto? ( ssl )
+ uwsgi_plugins_sslrouter? ( ssl )
+ routing? ( pcre )
+ uwsgi_plugins_emperor_zeromq? ( zeromq )
+ uwsgi_plugins_router_xmldir? ( xml )
+ uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ python_asyncio? ( python_targets_python3_4 python_gevent )
+ python_gevent? ( python )
+ expat? ( xml )"
+
+# util-linux is required for libuuid when requesting zeromq support
+# Order:
+# 1. Unconditional
+# 2. General features
+# 3. Plugins
+# 4. Language/app support
+CDEPEND="sys-libs/zlib
+ caps? ( sys-libs/libcap )
+ json? ( !yajl? ( dev-libs/jansson )
+ yajl? ( dev-libs/yajl ) )
+ pcre? ( dev-libs/libpcre:3 )
+ ssl? ( dev-libs/openssl:= )
+ xml? ( !expat? ( dev-libs/libxml2 )
+ expat? ( dev-libs/expat ) )
+ yaml? ( dev-libs/libyaml )
+ zeromq? ( net-libs/zeromq sys-apps/util-linux )
+ uwsgi_plugins_alarm_curl? ( net-misc/curl )
+ uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
+ uwsgi_plugins_curl_cron? ( net-misc/curl )
+ uwsgi_plugins_emperor_pg? ( dev-db/postgresql:= )
+ uwsgi_plugins_geoip? ( dev-libs/geoip )
+ uwsgi_plugins_ldap? ( net-nds/openldap )
+ uwsgi_plugins_pam? ( virtual/pam )
+ uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
+ uwsgi_plugins_rados? ( sys-cluster/ceph )
+ uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
+ uwsgi_plugins_router_spnego? ( virtual/krb5 )
+ uwsgi_plugins_rsyslog? ( app-admin/rsyslog )
+ uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
+ uwsgi_plugins_webdav? ( dev-libs/libxml2 )
+ uwsgi_plugins_xslt? ( dev-libs/libxslt )
+ lua? ( dev-lang/lua:= )
+ mono? ( =dev-lang/mono-2* )
+ perl? ( dev-lang/perl:= )
+ php? (
+ php_targets_php5-4? ( dev-lang/php:5.4[embed] )
+ php_targets_php5-5? ( dev-lang/php:5.5[embed] )
+ )
+ python? ( ${PYTHON_DEPS} )
+ python_gevent? ( >=dev-python/gevent-1.0_beta2[$(python_gen_usedep 'python2*')] )
+ ruby? ( $(ruby_implementations_depend) )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
+
+want_apache2
+
+S="${WORKDIR}/${MY_P}"
+APXS2_S="${S}/apache2"
+APACHE2_MOD_CONF="42_mod_uwsgi-r2 42_mod_uwsgi"
+
+src_unpack() {
+ default
+}
+
+pkg_setup() {
+ python_setup
+ use ruby && ruby-ng_pkg_setup
+ depend.apache_pkg_setup
+}
+
+src_prepare() {
+ sed -i \
+ -e "s|'-O2', ||" \
+ -e "s|'-Werror', ||" \
+ -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
+ uwsgiconfig.py || die "sed failed"
+
+ sed -i \
+ -e "s|/lib|/$(get_libdir)|" \
+ plugins/php/uwsgiplugin.py || die "sed failed"
+}
+
+src_configure() {
+ local embedded_plugins=()
+ local plugins=()
+ local malloc_impl="libc"
+ local json="false"
+ local xml="false"
+
+ for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
+ use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
+ done
+ for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
+ use ${p} && plugins+=("${p}")
+ done
+
+ # do not embedded any plugins
+ if ! use embedded ; then
+ plugins=( ${plugins[@]} ${embedded_plugins[@]} )
+ embedded_plugins=()
+ fi
+
+ # flatten the arrays
+ plugins=${plugins[@]}
+ embedded_plugins=${embedded_plugins[@]}
+
+ # rename some of the use flags, language plugins are always real plugins
+ plugins="${plugins/perl/psgi}"
+ plugins="${plugins/sqlite/sqlite3}"
+ embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
+
+ # override defaults as requested by the user
+ if use xml; then
+ use expat && xml="expat" || xml="libxml2"
+ fi
+ if use json; then
+ use yajl && json="yajl" || json="jansson"
+ fi
+ use jemalloc && malloc_impl="jemalloc"
+
+ # prepare the buildconf for gentoo
+ cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini
+ sed -i \
+ -e "s|VAR_XML|${xml}|" \
+ -e "s|VAR_YAML|$(usex yaml true false)|" \
+ -e "s|VAR_JSON|${json}|" \
+ -e "s|VAR_SSL|$(usex ssl true false)|" \
+ -e "s|VAR_PCRE|$(usex pcre true false)|" \
+ -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
+ -e "s|VAR_ROUTING|$(usex routing true false)|" \
+ -e "s|VAR_DEBUG|$(usex debug true false)|" \
+ -e "s|VAR_MALLOC|${malloc_impl}|" \
+ -e "s|VAR_PLUGINS|${plugins// /, }|" \
+ -e "s|VAR_PLUGIN_DIR|/usr/$(get_libdir)/uwsgi|" \
+ -e "s|VAR_BUILD_DIR|${T}/plugins|" \
+ -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
+ buildconf/gentoo.ini
+
+ use caps || sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ use zeromq || sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+
+ if use uwsgi_plugins_emperor_pg ; then
+ PGPV="$(best_version dev-db/postgresql)"
+ PGSLOT="$(get_version_component_range 1-2 ${PGPV##dev-db/postgresql-})"
+ sed -i \
+ -e "s|pg_config|pg_config${PGSLOT/.}|" \
+ plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
+ fi
+}
+
+each_ruby_compile() {
+ cd "${WORKDIR}/${MY_P}"
+
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
+}
+
+python_compile_plugins() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ ${PYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
+
+ if use python_asyncio ; then
+ if [ "${PYV}" == "34" ] ; then
+ ${PYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
+ fi
+ fi
+
+ if use python_gevent ; then
+ ${PYTHON} uwsgiconfig.py --plugin plugins/gevent gentoo gevent${PYV} || die "building plugin for gevent-support in ${EPYTHON} failed"
+ fi
+}
+
+python_install_symlinks() {
+ dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
+}
+
+src_compile() {
+ mkdir -p "${T}/plugins"
+
+ python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
+
+ if use lua ; then
+ # setting the name for the pkg-config file to lua, since we don't have
+ # slotted lua
+ UWSGICONFIG_LUAPC="lua" python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
+ fi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" python uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_compile_plugins
+ fi
+
+ if use ruby ; then
+ ruby-ng_src_compile
+ fi
+
+ if use apache2 ; then
+ for m in proxy_uwsgi Ruwsgi uwsgi ; do
+ APXS2_ARGS="-c mod_${m}.c"
+ apache-module_src_compile
+ done
+ fi
+}
+
+src_install() {
+ dobin uwsgi
+ pax-mark m "${D}"/usr/bin/uwsgi
+
+ insinto /usr/$(get_libdir)/uwsgi
+ doins "${T}/plugins"/*.so
+
+ use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
+ use lua && dosym uwsgi /usr/bin/uwsgi_lua
+ use mono && dosym uwsgi /usr/bin/uwsgi_mono
+ use perl && dosym uwsgi /usr/bin/uwsgi_psgi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ dosym uwsgi /usr/bin/uwsgi_${s/.}
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_install_symlinks
+ python_foreach_impl python_domodule uwsgidecorators.py
+ fi
+
+ if use apache2; then
+ for m in proxy_uwsgi Ruwsgi uwsgi ; do
+ APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
+ apache-module_src_install
+ done
+ fi
+
+ newinitd "${FILESDIR}"/uwsgi.initd-r5 uwsgi
+ newconfd "${FILESDIR}"/uwsgi.confd-r3 uwsgi
+ keepdir /etc/"${PN}".d
+ use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
+}
+
+pkg_postinst() {
+ if use apache2 ; then
+ elog "Three Apache modules have been installed: mod_proxy_uwsgi, mod_uwsgi and mod_Ruwsgi."
+ elog "You can enable them with -D PROXY_UWSGI, -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
+ elog "mod_uwsgi and mod_Ruwsgi have the same configuration interface and define the same symbols."
+ elog "Therefore you can enable only one of them at a time."
+ elog "mod_uwsgi is commercially supported by Unbit and stable but a bit hacky."
+ elog "mod_Ruwsgi is newer and more Apache-API friendly but not commercially supported."
+ elog "mod_proxy_uwsgi is a proxy module, considered stable and is now the recommended module."
+ fi
+
+ elog "Append the following options to the uwsgi call to load the respective language plugin:"
+ use cgi && elog " '--plugins cgi' for cgi"
+ use lua && elog " '--plugins lua' for lua"
+ use mono && elog " '--plugins mono' for mono"
+ use perl && elog " '--plugins psgi' for perl"
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ elog " '--plugins ${s/.}' for ${s}"
+ done
+ fi
+
+ python_pkg_postinst() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ elog " "
+ elog " '--plugins ${EPYV}' for ${EPYTHON}"
+ if use python_asyncio ; then
+ if [[ ${EPYV} == python34 ]] ; then
+ elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
+ else
+ elog " (asyncio is only supported in python3.4)"
+ fi
+ fi
+ if use python_gevent ; then
+ if [[ ${EPYTHON} == python2* ]] ; then
+ elog " '--plugins ${EPYV},gevent${PYV}' for gevent support in ${EPYTHON}"
+ else
+ elog " (gevent is currently not supported in ${EPYTHON})"
+ fi
+ fi
+ }
+
+ use python && python_foreach_impl python_pkg_postinst
+
+ if use ruby ; then
+ for ruby in $USE_RUBY; do
+ if use ruby_targets_${ruby} ; then
+ elog " '--plugins rack_${ruby/.}' for ${ruby}"
+ elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
+ elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
+ fi
+ done
+ fi
+}
diff --git a/www-servers/varnish/Manifest b/www-servers/varnish/Manifest
new file mode 100644
index 000000000000..e8df026f0b3f
--- /dev/null
+++ b/www-servers/varnish/Manifest
@@ -0,0 +1,7 @@
+DIST varnish-3.0.5.tar.gz 2116664 SHA256 302fd6afc771524ca3912f5d945ab197a55762385c012b2054df7d86bf7ae2b7 SHA512 0fe8a0f45ebe3b159fde811ac374ef8fb5be7712d8a61474778c57ddf4e7fb0404c7b28abeb614a16255a1c9ef0c780db44d03b1c8fbfee54adc49d92cbf733d WHIRLPOOL 5c33e510b5c511790a38451068e569ac62a5db4dc0c9aab99ef1509166674474c12dc5e0e9cdcde0245eb1b5c7b9947fed19a513114f363d468f2fbeff1c8d0d
+DIST varnish-3.0.6.tar.gz 2049810 SHA256 840ded8f25e7343117f6e3e2015759118f1d2db357ae8d7e02ea964e6fb680b7 SHA512 6dcbbf1407e72f9fe6c156a4074d9d42ce147d225cd3001b3240a22ed02e7adf2e900671f9f7e81cbd6b565b29ac65e0436c08c295763b5f7d48b6ab76a1c6b3 WHIRLPOOL 6254de1210f179c0e523cbdb7a1ecd36535cc50ee085d5093a7bc2285d666db45fa4fd130253ae6c94c09037b1225f0c89b5d73a2e0e51f0e5fda7d3e2e2d81d
+DIST varnish-3.0.7.tar.gz 2102037 SHA256 a27e9f11391617fab27cc6edc31d3c8681b8d6975f8c2cd07f6e081bc54c24ce SHA512 5fa9749305eb1a546ef4aae8a1797247fcc9098e1661453b9b87916da9fbc60d76bc0de9542ab17136e3da4b256c8a547aded2b4372dbbb54c44e93eff34a061 WHIRLPOOL 00ff6d16603ba4bf42608d55d769048f35c275a8ffa2b6860df6de2571d0481c39019d58d5b843f8a64492a5bf26caf9d841a023826d2fd2771ed8d35447a659
+DIST varnish-4.0.0.tar.gz 2372630 SHA256 4bbf73656be11687cbb8c7d4a7315786081687664b40a8ccbe67b36f8c0b1c17 SHA512 5eb3806f6c7c46438b6ebbe30c42f5a6afc53a9fa9e8f4b809c7d18b465712640950601be9873810a0f408865fba6ae9d18e46e4f22c89cc3a2e0c351753ac71 WHIRLPOOL 431dad47430a7b2a2eba3dd635eb487cb4d112a9ebdf6a3cb946b0bd8476653bded2d29128bcac1f98c6b3dfc3d7bc9c32f25ea76bccc9f427519f8dc36e2eb6
+DIST varnish-4.0.1.tar.gz 1877657 SHA256 49c3cebc89cb08fbc89d6680c1c8b42efc9313888172f3cdbdae7324b5c8f35b SHA512 e1ae846ff5b5e6ac0b694e8b197f9f7ec8c47677cbaaab6c0c490b6d5fa52f58f84fa3001bee8fe57451328cb809be0b5be55ddb41bd9c2444f23e0af582116b WHIRLPOOL 3013ae885a1eb6d44600b7c5513109a526cbed8f6bf687a81fa31111088713d68a9a059a67912966d7bed3b6404988c5fc785f02c91a63ea1f2a5037caf21e7b
+DIST varnish-4.0.2.tar.gz 1853668 SHA256 d9fb6a6eaf05bbb0c8eb5855556a4b092183b2c1a61281bfd73adf83a304555b SHA512 262bef5823f56c70fa9c7f24225b02b0218889c216143f63bb11db978ca7eddb174f605a5e48a4e774d88b20af5f5845bb2a6aef6fa3aaaf7cacd8c7c17cb82f WHIRLPOOL 35977069c6908a2fd731984585b447055730a288300de8709d83bec2df3677337535970c503b3b3d26635b0c747e7c387a423d93e776a755b8d8f0078c845696
+DIST varnish-4.0.3.tar.gz 1866760 SHA256 94b9a174097f47db2286acd2c35f235e49a2b7a9ddfdbd6eb7aa4da9ae8f8206 SHA512 db7bb141afd4617ac95573983dc30591b0eb9bc1af06df1094f2c1eeac539da936afb4a239d2f446d3c3a51b88a781b7f9f6d9a0b2028eaf0e7049ea2159d883 WHIRLPOOL 942456e19be427859283959dabe5522667519d36decbc598c8ee1e949767ea7435469393289d4373db6abac5275e50a95fc3799a837dc17740a490b4912bfe6f
diff --git a/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch b/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch
new file mode 100644
index 000000000000..93f3da3f878e
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.3-pthread-uclibc.patch
@@ -0,0 +1,35 @@
+Refine header check in bin/varnishd/mgt/mgt.h, mgt_main.c for uClibc
+
+Because of the difference in how uClibc and glibc stack their header
+files, stdio.h indirectly brings in PTHREAD_CANCELED from pthread.h
+on a uClibc system, whereas it does not on a glibc system. This happens
+in mgt.h and mgt_main.c. This patch refines the check in those files
+to take this fact into consideration.
+
+X-Gentoo-Bug-URL: https://bugs.gentoo.org/444294
+---
+
+diff --git a/bin/varnishd/mgt.h b/bin/varnishd/mgt.h
+index 905fbcc..5d3ab09 100644
+--- a/bin/varnishd/mgt.h
++++ b/bin/varnishd/mgt.h
+@@ -126,6 +126,6 @@ extern unsigned mgt_vcc_unsafe_path;
+ syslog(pri, fmt, __VA_ARGS__); \
+ } while (0)
+
+-#if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT)
++#if (defined(PTHREAD_CANCELED) && !defined(__UCLIBC__)) || defined(PTHREAD_MUTEX_DEFAULT)
+ #error "Keep pthreads out of in manager process"
+ #endif
+diff --git a/bin/varnishd/varnishd.c b/bin/varnishd/varnishd.c
+index 1b7f1e3..dce42d9 100644
+--- a/bin/varnishd/varnishd.c
++++ b/bin/varnishd/varnishd.c
+@@ -656,6 +656,6 @@ main(int argc, char * const *argv)
+ exit(exit_status);
+ }
+
+-#if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT)
++#if (defined(PTHREAD_CANCELED) && !defined(__UCLIBC__)) || defined(PTHREAD_MUTEX_DEFAULT)
+ #error "Keep pthreads out of in manager process"
+ #endif
diff --git a/www-servers/varnish/files/varnish-3.0.4-automagic.patch b/www-servers/varnish/files/varnish-3.0.4-automagic.patch
new file mode 100644
index 000000000000..6a517cc9efeb
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.4-automagic.patch
@@ -0,0 +1,94 @@
+diff -Naur varnish-3.0.4.orig/configure.ac varnish-3.0.4/configure.ac
+--- varnish-3.0.4.orig/configure.ac 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/configure.ac 2013-06-15 23:51:51.000000000 -0400
+@@ -87,15 +87,20 @@
+
+ save_LIBS="${LIBS}"
+ LIBS=""
+-AC_SEARCH_LIBS(initscr, [curses ncurses],
+- [have_curses=yes], [have_curses=no])
+-CURSES_LIBS="${LIBS}"
+-LIBS="${save_LIBS}"
+-AC_SUBST(CURSES_LIBS)
+-if test "$have_curses" = no; then
+- AC_MSG_WARN([curses not found; some tools will not be built])
+-fi
+-AC_CHECK_HEADERS([ncurses/curses.h curses.h])
++AC_ARG_WITH([tools], AS_HELP_STRING([--without-tools],
++ [Don't build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes (default: test)]))
++
++AS_IF([test "x$with_tools" != "xno"], [
++ AC_SEARCH_LIBS(initscr, [curses ncurses],
++ [have_curses=yes], [have_curses=no])
++ CURSES_LIBS="${LIBS}"
++ LIBS="${save_LIBS}"
++ AC_SUBST(CURSES_LIBS)
++ if test "$have_curses" = no; then
++ AC_MSG_ERROR([curses not found, required to build additional tools])
++ fi
++ AC_CHECK_HEADERS([ncurses/curses.h curses.h])
++])
+ AM_CONDITIONAL([HAVE_CURSES], [test x$have_curses = xyes])
+
+ save_LIBS="${LIBS}"
+@@ -266,7 +271,6 @@
+ CFLAGS="${save_CFLAGS}"
+
+ # Use jemalloc on Linux
+-JEMALLOC_SUBDIR=
+ JEMALLOC_LDADD=
+ AC_ARG_WITH([jemalloc],
+ [AS_HELP_STRING([--with-jemalloc],
+@@ -274,18 +278,13 @@
+ [],
+ [with_jemalloc=check])
+
+-case $target in
+- *-*-linux*)
+- if test "x$with_jemalloc" != xno; then
+- AC_CHECK_LIB([jemalloc], [malloc_conf],
++if test "x$with_jemalloc" != xno; then
++ AC_CHECK_LIB([jemalloc], [malloc_conf],
++ [JEMALLOC_LDADD="-ljemalloc"],
++ [AC_CHECK_LIB([jemalloc], [jmalloc_conf],
+ [JEMALLOC_LDADD="-ljemalloc"],
+- [AC_MSG_NOTICE([No system jemalloc found, using bundled version])
+- JEMALLOC_SUBDIR=libjemalloc
+- JEMALLOC_LDADD='$(top_builddir)/lib/libjemalloc/libjemalloc_mt.la'])
+- fi
+- ;;
+-esac
+-AC_SUBST(JEMALLOC_SUBDIR)
++ [AC_MSG_ERROR([No system jemalloc found])])])
++fi
+ AC_SUBST(JEMALLOC_LDADD)
+
+ # Userland slab allocator, available only on Solaris
+@@ -588,7 +587,6 @@
+ lib/libvcl/Makefile
+ lib/libvgz/Makefile
+ lib/libvmod_std/Makefile
+- lib/libjemalloc/Makefile
+ man/Makefile
+ redhat/Makefile
+ varnishapi.pc
+--- varnish-3.0.4.orig/lib/Makefile.am 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/lib/Makefile.am 2013-06-15 23:51:08.000000000 -0400
+@@ -6,14 +6,12 @@
+ libvarnishapi \
+ libvcl \
+ libvgz \
+- libvmod_std \
+- @JEMALLOC_SUBDIR@
++ libvmod_std
+
+-DIST_SUBDIRS = \
++DIST_SUBDIRS = \
+ libvarnishcompat \
+ libvarnish \
+ libvarnishapi \
+ libvcl \
+ libvgz \
+- libvmod_std \
+- libjemalloc
++ libvmod_std
diff --git a/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch b/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch
new file mode 100644
index 000000000000..0034c8071393
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.4-fix-automake-1.13.patch
@@ -0,0 +1,12 @@
+diff -Naur varnish-3.0.4.orig/configure.ac varnish-3.0.4/configure.ac
+--- varnish-3.0.4.orig/configure.ac 2013-06-14 04:39:32.000000000 -0400
++++ varnish-3.0.4/configure.ac 2013-06-21 08:48:32.000000000 -0400
+@@ -4,7 +4,7 @@
+ AC_REVISION([$Id: varnish-3.0.4-fix-automake-1.13.patch,v 1.1 2013/06/21 12:51:35 blueness Exp $])
+ AC_INIT([Varnish], [3.0.4], [varnish-dev@varnish-cache.org])
+ AC_CONFIG_SRCDIR(include/varnishapi.h)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ # save command line CFLAGS for use in VCC_CC (to pass through things like -m64)
+ OCFLAGS="$CFLAGS"
diff --git a/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch b/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch
new file mode 100644
index 000000000000..4c927e364a61
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.5-fix-python-path.patch
@@ -0,0 +1,9 @@
+diff -Naur varnish-3.0.5.orig/lib/libvmod_std/vmod.py varnish-3.0.5/lib/libvmod_std/vmod.py
+--- varnish-3.0.5.orig/lib/libvmod_std/vmod.py 2013-12-02 02:47:57.000000000 -0500
++++ varnish-3.0.5/lib/libvmod_std/vmod.py 2014-01-16 13:21:50.763238020 -0500
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python
+ #-
+ # Copyright (c) 2010-2011 Varnish Software AS
+ # All rights reserved.
diff --git a/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch b/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch
new file mode 100644
index 000000000000..479e007938ba
--- /dev/null
+++ b/www-servers/varnish/files/varnish-3.0.5-path-to-vmod_vcc.patch
@@ -0,0 +1,12 @@
+diff -Naur varnish-3.0.5.orig/lib/libvmod_std/vmod.py varnish-3.0.5/lib/libvmod_std/vmod.py
+--- varnish-3.0.5.orig/lib/libvmod_std/vmod.py 2014-01-16 13:33:02.983247069 -0500
++++ varnish-3.0.5/lib/libvmod_std/vmod.py 2014-01-16 13:42:36.848254794 -0500
+@@ -43,7 +43,7 @@
+ if len(sys.argv) == 2:
+ specfile = sys.argv[1]
+ else:
+- specfile = "vmod.vcc"
++ specfile = "/etc/varnish/vmod.vcc"
+
+ ctypes = {
+ 'IP': "struct sockaddr_storage *",
diff --git a/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch
new file mode 100644
index 000000000000..311f0fd7c956
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.0-fix-man-Makefile_am.patch
@@ -0,0 +1,14 @@
+diff -Naur varnish-4.0.0.orig/man/Makefile.am varnish-4.0.0/man/Makefile.am
+--- varnish-4.0.0.orig/man/Makefile.am 2014-04-12 18:25:35.435043191 -0400
++++ varnish-4.0.0/man/Makefile.am 2014-04-12 18:25:58.579043997 -0400
+@@ -84,8 +84,8 @@
+ $(top_srcdir)/doc/sphinx/include/varnishhist_synopsis.rst
+ ${RST2MAN} $(top_srcdir)/doc/sphinx/reference/varnishhist.rst $@
+
+-vmod_std.3: $(top_srcdir)/lib/libvmod_std/vmod_std.man.rst
++vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst
+ ${RST2MAN} $? $@
+
+-vmod_directors.3: $(top_srcdir)/lib/libvmod_directors/vmod_directors.man.rst
++vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst
+ ${RST2MAN} $? $@
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch
new file mode 100644
index 000000000000..57885c6488ea
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-doc-Makefile_am.patch
@@ -0,0 +1,14 @@
+diff -Naur varnish-4.0.1.orig/man/Makefile.am varnish-4.0.1/man/Makefile.am
+--- varnish-4.0.1.orig/man/Makefile.am 2014-06-23 09:43:06.000000000 -0400
++++ varnish-4.0.1/man/Makefile.am 2014-06-25 08:40:43.498765372 -0400
+@@ -86,8 +86,8 @@
+ $(top_srcdir)/doc/sphinx/include/varnishhist_synopsis.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishhist.rst $@
+
+-vmod_std.3: $(top_srcdir)/lib/libvmod_std/vmod_std.man.rst
++vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $? $@
+
+-vmod_directors.3: $(top_srcdir)/lib/libvmod_directors/vmod_directors.man.rst
++vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst
+ ${RST2MAN} $(RST2ANY_FLAGS) $? $@
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch b/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch
new file mode 100644
index 000000000000..c65fba2391e0
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-man-Makefile_am.patch
@@ -0,0 +1,19 @@
+diff -Naur varnish-4.0.1.orig/doc/sphinx/Makefile.am varnish-4.0.1/doc/sphinx/Makefile.am
+--- varnish-4.0.1.orig/doc/sphinx/Makefile.am 2014-06-23 09:43:06.000000000 -0400
++++ varnish-4.0.1/doc/sphinx/Makefile.am 2014-06-25 08:35:11.887750279 -0400
+@@ -144,11 +144,13 @@
+ BUILT_SOURCES += include/varnishhist_options.rst \
+ include/varnishhist_synopsis.rst
+
+-reference/vmod_std.generated.rst: $(top_srcdir)/lib/libvmod_std/vmod_std.rst
++reference/vmod_std.generated.rst: $(top_builddir)/lib/libvmod_std/vmod_std.rst
++ mkdir -p reference
+ cp $? $@
+ BUILT_SOURCES += reference/vmod_std.generated.rst
+
+-reference/vmod_directors.generated.rst: $(top_srcdir)/lib/libvmod_directors/vmod_directors.rst
++reference/vmod_directors.generated.rst: $(top_builddir)/lib/libvmod_directors/vmod_directors.rst
++ mkdir -p reference
+ cp $? $@
+ BUILT_SOURCES += reference/vmod_directors.generated.rst
+
diff --git a/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch b/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch
new file mode 100644
index 000000000000..ae327292fb7c
--- /dev/null
+++ b/www-servers/varnish/files/varnish-4.0.1-fix-warning.patch
@@ -0,0 +1,12 @@
+diff -Naur /root/varnish-4.0.1/lib/libvcc/vcc_expr.c varnish-4.0.1/lib/libvcc/vcc_expr.c
+--- /root/varnish-4.0.1/lib/libvcc/vcc_expr.c 2014-06-25 07:06:42.550508615 -0400
++++ varnish-4.0.1/lib/libvcc/vcc_expr.c 2014-06-23 09:43:06.000000000 -0400
+@@ -670,7 +670,7 @@
+ struct expr *e1, *e2;
+ const char *ip;
+ const struct symbol *sym;
+- double d;
++ double d = 0.0;
+
+ *e = NULL;
+ if (tl->t->tok == '(') {
diff --git a/www-servers/varnish/files/varnishd.confd-r1 b/www-servers/varnish/files/varnishd.confd-r1
new file mode 100644
index 000000000000..472b26f99426
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r1
@@ -0,0 +1,22 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+# Ignore the config file, /etc/varnish/default.vcl
+VARNISHD_OPTS="-a 127.0.0.1:8080 -b 127.0.0.1:80"
+
+# Alternatively, don't listen to a backend and use
+# the config file
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -f $CONFIGFILE"
+
+# arguments passed to varnishncsa
+# please see the varnishncsa man page for more options
+VARNISHNCSA_ARGS="-c -a -w /var/log/varnish/access.log"
+
+# We need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.confd-r2 b/www-servers/varnish/files/varnishd.confd-r2
new file mode 100644
index 000000000000..699bc8e57d69
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r2
@@ -0,0 +1,26 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+# Ignore the config file, /etc/varnish/default.vcl
+VARNISHD_OPTS="-a 127.0.0.1:8080 -b 127.0.0.1:80"
+
+# Alternatively, don't listen to a backend and use
+# the config file
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -f $CONFIGFILE"
+
+# Arguments passed to varnishncsa
+# Please see varnishncsa(1) for more options
+VARNISHNCSA_ARGS="-c -a -w /var/log/varnish/access.log"
+
+# Arguments passed to varnishncsa -F option
+# Please see varnishncsa(1) for more options
+# VARNISHNCSA_LOGFORMAT='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"'
+
+# We need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.confd-r3 b/www-servers/varnish/files/varnishd.confd-r3
new file mode 100644
index 000000000000..c05b8fb7521c
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.confd-r3
@@ -0,0 +1,22 @@
+# /etc/conf.d/varnishd
+
+VARNISHD="/usr/sbin/varnishd"
+VARNISHADM="/usr/bin/varnishadm"
+
+#CONFIGFILES="/etc/varnish/${SVCNAME}.vcl"
+CONFIGFILE="/etc/varnish/default.vcl"
+
+# Listen on 127.0.0.1:8080 and connect to backend 127.0.0.1:80
+#VARNISHD_OPTS="-a 127.0.0.1:8080 -a 127.0.0.1:8080"
+
+# Alternatively, don't listen to a backend
+VARNISHD_OPTS="-a 127.0.0.1:8080"
+
+
+# User/Group
+VARNISHD_OPTS="${VARNISHD_OPTS} -u varnish -g varnish"
+
+# You may need to increase the number of open files (-n)
+# and the maximum amount off locked memory (-l)
+# See bug #459142
+#rc_ulimit="-n 32786 -l 82000"
diff --git a/www-servers/varnish/files/varnishd.initd-r1 b/www-servers/varnish/files/varnishd.initd-r1
new file mode 100755
index 000000000000..54487ca6e9eb
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r1
@@ -0,0 +1,87 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting varnish"
+ start-stop-daemon --quiet --start --pidfile /var/run/varnishd.pid --exec ${VARNISHD} -- -P /var/run/varnishd.pid ${VARNISHD_OPTS} &> /dev/null
+ eend $?
+
+ if [ "${VARNISHNCSA_ARGS}" != "" ]; then
+ ebegin "Starting varnish logging"
+ start-stop-daemon --quiet --start --pidfile /var/run/varnishncsa.pid --exec /usr/bin/varnishncsa -- -D -P /var/run/varnishncsa.pid ${VARNISHNCSA_ARGS}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping varnish"
+ start-stop-daemon --quiet --stop --pidfile /var/run/varnishd.pid
+ eend $?
+
+ if [ -e /var/run/varnishncsa.pid ]; then
+ ebegin "Stopping varnish logging"
+ start-stop-daemon --quiet --stop --pidfile /var/run/varnishncsa.pid
+ eend $?
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.initd-r2 b/www-servers/varnish/files/varnishd.initd-r2
new file mode 100755
index 000000000000..055a9ec0405a
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r2
@@ -0,0 +1,94 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting varnish"
+ start-stop-daemon --quiet --start --pidfile /run/varnishd.pid \
+ --exec ${VARNISHD} -- \
+ -P /run/varnishd.pid \
+ ${VARNISHD_OPTS} &> /dev/null
+ eend $?
+
+ if [ "${VARNISHNCSA_ARGS}" != "" ]; then
+ ebegin "Starting varnish logging"
+ start-stop-daemon --quiet --start --pidfile /run/varnishncsa.pid \
+ --exec /usr/bin/varnishncsa -- \
+ -D -P /run/varnishncsa.pid \
+ ${VARNISHNCSA_ARGS} \
+ ${VARNISHNCSA_LOGFORMAT:+-F "${VARNISHNCSA_LOGFORMAT}"}
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Stopping varnish"
+ start-stop-daemon --quiet --stop --pidfile /run/varnishd.pid
+ eend $?
+
+ if [ -e /run/varnishncsa.pid ]; then
+ ebegin "Stopping varnish logging"
+ start-stop-daemon --quiet --stop --pidfile /run/varnishncsa.pid
+ eend $?
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.initd-r3 b/www-servers/varnish/files/varnishd.initd-r3
new file mode 100644
index 000000000000..4a7dcb9d0ad8
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.initd-r3
@@ -0,0 +1,78 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHD_PID=${VARNISHD_PID:-/run/${SVCNAME}.pid}
+CONFIGFILES="${CONFIGFILE:-/etc/varnish/default.vcl}"
+
+command="${VARNISHD:-/usr/sbin/varnishd}"
+command_args="-P ${VARNISHD_PID} -f ${CONFIGFILE} ${VARNISHD_OPTS}"
+pidfile="${VARNISHD_PID}"
+
+extra_commands="configtest"
+extra_started_commands="reload"
+
+description_configtest="Run syntax tests for configuration files."
+description_reload="Reloads the configuration."
+
+depend() {
+ need net
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+checkconfig() {
+ ${VARNISHD} -C -f ${CONFIGFILE} >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your setup:"
+ ${VARNISHD} -C -f ${CONFIGFILE}
+ fi
+
+ return $ret
+}
+
+start_pre() {
+ checkconfig || return 1
+}
+
+stop_pre() {
+ if [ "${RC_CMD}" = "restart" ]; then
+ checkconfig || return 1
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading varnish"
+
+ $VARNISHADM vcl.list >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot list configuration"
+ return 1
+ fi
+
+ new_config="reload_$(date +%FT%H:%M:%S)"
+ $VARNISHADM vcl.load $new_config $CONFIGFILE >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot load configuration"
+ return 1
+ fi
+
+ $VARNISHADM vcl.use $new_config >/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} cannot switch configuration"
+ return 1
+ fi
+
+ eend 0
+}
diff --git a/www-servers/varnish/files/varnishd.logrotate b/www-servers/varnish/files/varnishd.logrotate
new file mode 100644
index 000000000000..62ee60007a2d
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.logrotate
@@ -0,0 +1,9 @@
+/var/log/varnish/*.log {
+ weekly
+ rotate 10
+ copytruncate
+ delaycompress
+ compress
+ notifempty
+ missingok
+}
diff --git a/www-servers/varnish/files/varnishd.logrotate-r2 b/www-servers/varnish/files/varnishd.logrotate-r2
new file mode 100644
index 000000000000..e697e428f3dd
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.logrotate-r2
@@ -0,0 +1,31 @@
+/var/log/varnish/varnishncsa.log {
+ daily
+ rotate 31
+ copytruncate
+ dateext
+ dateyesterday
+ delaycompress
+ compress
+ notifempty
+ missingok
+
+ prerotate
+ /etc/init.d/varnishncsa -q status && /etc/init.d/varnishncsa -q flush
+ endscript
+}
+
+/var/log/varnish/varnishlog.log {
+ daily
+ rotate 31
+ copytruncate
+ dateext
+ dateyesterday
+ delaycompress
+ compress
+ notifempty
+ missingok
+
+ prerotate
+ /etc/init.d/varnishlog -q status && /etc/init.d/varnishlog -q flush
+ endscript
+}
diff --git a/www-servers/varnish/files/varnishd.service b/www-servers/varnish/files/varnishd.service
new file mode 100644
index 000000000000..a45f1e247839
--- /dev/null
+++ b/www-servers/varnish/files/varnishd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Varnish is a high-performance HTTP accelerator
+After=network.target
+
+[Service]
+Type=forking
+LimitNOFILE=32786
+LimitMEMLOCK=82000
+PIDFile=/var/run/varnishd.pid
+ExecStart=/usr/sbin/varnishd -a 0.0.0.0:80 -P /var/run/varnishd.pid
+
+#If you wish to use a config file, then use the following ExecStart line
+#ExecStart=/usr/sbin/varnishd -a 0.0.0.0:80 -f /etc/varnish/default.vcl -P /var/run/varnishd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/www-servers/varnish/files/varnishlog.confd b/www-servers/varnish/files/varnishlog.confd
new file mode 100644
index 000000000000..d7358b1dc898
--- /dev/null
+++ b/www-servers/varnish/files/varnishlog.confd
@@ -0,0 +1,3 @@
+# /etc/conf.d/varnishlog
+
+VARNISHLOG_OPTS="-a -w /var/log/varnish/varnishlog.log"
diff --git a/www-servers/varnish/files/varnishlog.initd b/www-servers/varnish/files/varnishlog.initd
new file mode 100644
index 000000000000..fae8297743fe
--- /dev/null
+++ b/www-servers/varnish/files/varnishlog.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHLOG_PID=${VARNISHLOG_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHLOG:-/usr/bin/varnishlog}"
+command_args="-D -P ${VARNISHLOG_PID} ${VARNISHLOG_OPTS}"
+pidfile="${VARNISHLOG_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHLOG_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHLOG_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/files/varnishncsa.confd b/www-servers/varnish/files/varnishncsa.confd
new file mode 100644
index 000000000000..f3112fdd532a
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.confd
@@ -0,0 +1,3 @@
+# /etc/conf.d/varnishncsa
+
+VARNISHNCSA_OPTS="-a -w /var/log/varnish/${SVCNAME}.log"
diff --git a/www-servers/varnish/files/varnishncsa.initd b/www-servers/varnish/files/varnishncsa.initd
new file mode 100644
index 000000000000..7b38397670d0
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
+command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
+pidfile="${VARNISHNCSA_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/files/varnishncsa.initd-r1 b/www-servers/varnish/files/varnishncsa.initd-r1
new file mode 100644
index 000000000000..e06a5945afb4
--- /dev/null
+++ b/www-servers/varnish/files/varnishncsa.initd-r1
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+VARNISHNCSA_PID=${VARNISHNCSA_PID:-/run/${SVCNAME}.pid}
+
+command="${VARNISHNCSA:-/usr/bin/varnishncsa}"
+command_args="-D -P ${VARNISHNCSA_PID} ${VARNISHNCSA_OPTS}"
+pidfile="${VARNISHNCSA_PID}"
+
+extra_started_commands="reload rotate flush"
+
+description_rotate="Rotate the log file"
+description_flush="Flush any outstanding transactions"
+
+# We need to make sure varnishd has started first, bug #524284
+start_pre() {
+ TIMEOUT=${TIMEOUT:-5}
+
+ local i=0
+ while [ $i -lt ${TIMEOUT} ]; do
+ echo status | varnishadm 2>/dev/null | grep -q "Child in state running"
+ test $? -eq 0 && break
+
+ sleep 1 && i=$(expr $i + 1)
+ done
+}
+
+rotate() {
+ ebegin "Rotating log file"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGHUP
+ eend $?
+}
+
+flush() {
+ ebegin "Flushing any outstanding transactions"
+ start-stop-daemon -p ${VARNISHNCSA_PID} -s SIGUSR1
+ eend $?
+}
+
+reload() {
+ flush
+ rotate
+}
diff --git a/www-servers/varnish/metadata.xml b/www-servers/varnish/metadata.xml
new file mode 100644
index 000000000000..a70395dd1163
--- /dev/null
+++ b/www-servers/varnish/metadata.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer>
+ <email>idl0r@gentoo.org</email>
+ <name>Christian Ruppert</name>
+ <description>Secondary maintainer</description>
+ </maintainer>
+ <use>
+ <flag name="tools">Build additional tools: varnishhist, varnishstat, varnishtop, varnishsizes</flag>
+ <flag name="jemalloc">Use dev-libs/jemalloc for allocations</flag>
+ </use>
+ <longdescription lang="en">
+ Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse Proxy)
+ is an application that stores (caches) documents that have been requested over
+ the HTTP protocol.
+ Based on certain criteria the next client requesting the document is either
+ given the cached document, or a "fresh" document requested from a backend
+ server. The purpose of this is to minimize the requests going to the backend
+ server(s) by serving the same document to potentially many users.
+
+ The goal of Varnish is to be a very fast, stable and effective light-weight HTTP
+ accelerator daemon, by using modern and effective technologies. Ease of
+ managment and good documentation is also a main goal of the project since the
+ lack of either one will render Varnish useless.
+ </longdescription>
+</pkgmetadata>
diff --git a/www-servers/varnish/varnish-3.0.5-r3.ebuild b/www-servers/varnish/varnish-3.0.5-r3.ebuild
new file mode 100644
index 000000000000..f1acfed37bce
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5-r3.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r1 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r1 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.5-r4.ebuild b/www-servers/varnish/varnish-3.0.5-r4.ebuild
new file mode 100644
index 000000000000..3dc57eb4af29
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5-r4.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.5.ebuild b/www-servers/varnish/varnish-3.0.5.ebuild
new file mode 100644
index 000000000000..151d66c75111
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.5.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools-utils eutils
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r1 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r1 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.6.ebuild b/www-servers/varnish/varnish-3.0.6.ebuild
new file mode 100644
index 000000000000..3bb22aa80824
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.6.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-3.0.7.ebuild b/www-servers/varnish/varnish-3.0.7.ebuild
new file mode 100644
index 000000000000..3dc57eb4af29
--- /dev/null
+++ b/www-servers/varnish/varnish-3.0.7.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit autotools-utils eutils systemd python-single-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~mips x86"
+IUSE="doc jemalloc jit static-libs +tools"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ tools? ( sys-libs/ncurses )"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.0.4-fix-automake-1.13.patch
+ "${FILESDIR}"/${PN}-3.0.4-automagic.patch
+ "${FILESDIR}"/${PN}-3.0.3-pthread-uclibc.patch
+ "${FILESDIR}"/${PN}-3.0.5-fix-python-path.patch
+ "${FILESDIR}"/${PN}-3.0.5-path-to-vmod_vcc.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ $(use_with tools)
+ --without-rst2man
+ --without-rst2html
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ newinitd "${FILESDIR}"/varnishd.initd-r2 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r2 varnishd
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/varnishd.logrotate" varnishd
+
+ dodir /var/log/varnish
+
+ use doc && dohtml -r "doc/sphinx/=build/html/"
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ python_doscript lib/libvmod_std/vmod.py
+ insinto /etc/varnish
+ doins lib/libvmod_std/vmod.vcc
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.0-r1.ebuild b/www-servers/varnish/varnish-4.0.0-r1.ebuild
new file mode 100644
index 000000000000..8f7b4e21c55b
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.0-r1.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.0-fix-man-Makefile_am.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.1-r1.ebuild b/www-servers/varnish/varnish-4.0.1-r1.ebuild
new file mode 100644
index 000000000000..8d7018d9e6e2
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.1-r1.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.1-fix-man-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-doc-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-warning.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.2.ebuild b/www-servers/varnish/varnish-4.0.2.ebuild
new file mode 100644
index 000000000000..8d7018d9e6e2
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.2.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.1-fix-man-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-doc-Makefile_am.patch
+ "${FILESDIR}"/${PN}-4.0.1-fix-warning.patch
+)
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/varnish/varnish-4.0.3.ebuild b/www-servers/varnish/varnish-4.0.3.ebuild
new file mode 100644
index 000000000000..9bf65e5b5e59
--- /dev/null
+++ b/www-servers/varnish/varnish-4.0.3.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy )
+
+inherit user autotools-utils eutils systemd python-r1
+
+DESCRIPTION="Varnish is a state-of-the-art, high-performance HTTP accelerator"
+HOMEPAGE="http://www.varnish-cache.org/"
+SRC_URI="http://repo.varnish-cache.org/source/${P}.tar.gz"
+
+LICENSE="BSD-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="jemalloc jit static-libs"
+
+CDEPEND="
+ || ( dev-libs/libedit sys-libs/readline )
+ dev-libs/libpcre[jit?]
+ jemalloc? ( dev-libs/jemalloc )
+ sys-libs/ncurses"
+
+#varnish compiles stuff at run time
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${CDEPEND}
+ sys-devel/gcc"
+
+DEPEND="
+ ${CDEPEND}
+ dev-python/docutils
+ virtual/pkgconfig"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RESTRICT="test" #315725
+
+DOCS=( README doc/changes.rst )
+
+AUTOTOOLS_AUTORECONF="yes"
+
+pkg_setup() {
+ ebegin "Creating varnish user and group"
+ enewgroup varnish 40
+ enewuser varnish 40 -1 /var/lib/varnish varnish
+ eend $?
+}
+
+src_prepare() {
+ # Remove bundled libjemalloc. We also fix
+ # automagic dep in our patches, bug #461638
+ rm -rf lib/libjemalloc
+
+ autotools-utils_src_prepare
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ $(use_enable jit pcre-jit )
+ $(use_with jemalloc)
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ autotools-utils_src_install
+
+ python_replicate_script "${D}/usr/share/varnish/vmodtool.py"
+
+ newinitd "${FILESDIR}"/varnishlog.initd varnishlog
+ newconfd "${FILESDIR}"/varnishlog.confd varnishlog
+
+ newinitd "${FILESDIR}"/varnishncsa.initd-r1 varnishncsa
+ newconfd "${FILESDIR}"/varnishncsa.confd varnishncsa
+
+ newinitd "${FILESDIR}"/varnishd.initd-r3 varnishd
+ newconfd "${FILESDIR}"/varnishd.confd-r3 varnishd
+
+ insinto /etc/logrotate.d/
+ newins "${FILESDIR}/varnishd.logrotate-r2" varnishd
+
+ diropts -m750
+
+ dodir /var/log/varnish/
+
+ systemd_dounit "${FILESDIR}/${PN}d.service"
+
+ insinto /etc/varnish/
+ doins lib/libvmod_std/vmod.vcc
+ doins etc/example.vcl
+
+ fowners root:varnish /etc/varnish/
+ fowners varnish:varnish /var/lib/varnish/
+ fperms 0750 /var/lib/varnish/ /etc/varnish/
+}
+
+pkg_postinst () {
+ elog "No demo-/sample-configfile is included in the distribution. Please"
+ elog "read the man-page for more info. A sample configuration proxying"
+ elog "localhost:8080 for localhost:80 is given in /etc/conf.d/varnishd."
+}
diff --git a/www-servers/webfs/Manifest b/www-servers/webfs/Manifest
new file mode 100644
index 000000000000..1c6359059546
--- /dev/null
+++ b/www-servers/webfs/Manifest
@@ -0,0 +1 @@
+DIST webfs-1.21.tar.gz 44249 SHA256 98c1cb93473df08e166e848e549f86402e94a2f727366925b1c54ab31064a62a SHA512 68b9b3163a21be8a549e395295b27dd8ce9b575183d6c36b05b98bdc310917cf2dc653ff73bdb78a8c063674a8e9480211ec5c28b8a676f9cee41fa962cfd473 WHIRLPOOL 6d5b1d079c98d2125b6a57d56f4c8fa7693c43bc20c1c29a1ff64db9c9217c85a13f9ae784eee2505b580260d72919970fa875d93c3d31d9c0d10d6307309d9e
diff --git a/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch b/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch
new file mode 100644
index 000000000000..26e225def360
--- /dev/null
+++ b/www-servers/webfs/files/webfs-1.21-CVE-2013-0347.patch
@@ -0,0 +1,15 @@
+--- ./webfsd.c
++++ ./webfsd.c
+@@ -918,8 +918,11 @@
+ } else {
+ if (NULL == (logfh = fopen(logfile,"a")))
+ xperror(LOG_WARNING,"open access log",NULL);
+- else
++ else {
+ close_on_exec(fileno(logfh));
++ if (0 != chmod(logfile,S_IRUSR|S_IWUSR))
++ xperror(LOG_WARNING,"chmod access log",NULL);
++ }
+ }
+ }
+
diff --git a/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch b/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch
new file mode 100644
index 000000000000..03f2f5c59816
--- /dev/null
+++ b/www-servers/webfs/files/webfs-1.21-Variables.mk-dont-strip-binaries-on-install.patch
@@ -0,0 +1,12 @@
+diff -Naur webfs-1.21.orig/mk/Variables.mk webfs-1.21/mk/Variables.mk
+--- webfs-1.21.orig/mk/Variables.mk 2009-02-03 01:14:18.000000000 +0100
++++ webfs-1.21/mk/Variables.mk 2009-02-03 01:16:01.000000000 +0100
+@@ -23,7 +23,7 @@
+ CXX ?= g++
+ MOC ?= $(if $(QTDIR),$(QTDIR)/bin/moc,moc)
+ INSTALL ?= install
+-INSTALL_BINARY := $(INSTALL) -s
++INSTALL_BINARY := $(INSTALL)
+ INSTALL_SCRIPT := $(INSTALL)
+ INSTALL_DATA := $(INSTALL) -m 644
+ INSTALL_DIR := $(INSTALL) -d
diff --git a/www-servers/webfs/files/webfs.confd b/www-servers/webfs/files/webfs.confd
new file mode 100644
index 000000000000..5c4de3ad9b74
--- /dev/null
+++ b/www-servers/webfs/files/webfs.confd
@@ -0,0 +1,27 @@
+# Configuration for webfsd init script
+
+WEBFS_PORT=80
+WEBFS_DOCROOT=/var/www/localhost/htdocs
+WEBFS_INDEX=index.html
+WEBFS_LOG=/var/log/webfsd.log
+
+# set server name
+#WEBFS_SERVNAME=
+
+# uncomment to chroot to specified dir
+#WEBFS_CHROOT="/var/www/localhost"
+
+# max allowed connections (defaults to 32)
+#WEBFS_MAXCONN=50
+
+# uncomment to enable directory listings
+#WEBFS_DIR_LIST=true
+
+# uncomment to enable SSL (you'll need to add -C <cert> -P <pass> to WEBFS_OPTS)
+#WEBFS_SSL=true
+
+# uncomment to enable ipv6
+#WEBFS_IPV6=true
+
+# Add any extra options here. See webfsd for more information.
+#WEBFS_OPTS=""
diff --git a/www-servers/webfs/files/webfs.initd-r1 b/www-servers/webfs/files/webfs.initd-r1
new file mode 100644
index 000000000000..1327756145aa
--- /dev/null
+++ b/www-servers/webfs/files/webfs.initd-r1
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need net
+}
+
+start() {
+ WEBFS_OPTS="-p ${WEBFS_PORT:-80} -f ${WEBFS_INDEX:-index.html} ${WEBFS_OPTS}"
+ [ -n "${WEBFS_DOCROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -r ${WEBFS_DOCROOT}"
+ [ -n "${WEBFS_CHROOT}" ] && WEBFS_OPTS="${WEBFS_OPTS} -R ${WEBFS_CHROOT}"
+ [ -n "${WEBFS_LOG}" ] && WEBFS_OPTS="${WEBFS_OPTS} -L ${WEBFS_LOG}"
+ [ -n "${WEBFS_MAXCONN}" ] && WEBFS_OPTS="${WEBFS_OPTS} -c ${WEBFS_MAXCONN}"
+ [ -n "${WEBFS_IPV6}" ] && WEBFS_OPTS="${WEBFS_OPTS} -6"
+ [ -n "${WEBFS_SSL}" ] && WEBFS_OPTS="${WEBFS_OPTS} -S"
+ [ -n "${WEBFS_SERVNAME}" ] && WEBFS_OPTS="${WEBFS_OPTS} -n ${WEBFS_SERVNAME}"
+ [ -n "${WEBFS_DIR_LIST}" ] || WEBFS_OPTS="${WEBFS_OPTS} -j"
+
+ ebegin "Starting webfsd"
+ start-stop-daemon --start --quiet --exec /usr/bin/webfsd -- ${WEBFS_OPTS}
+ eend $? "Failed to start webfsd"
+}
+
+stop() {
+ ebegin "Stopping webfsd"
+ start-stop-daemon --stop --quiet --exec /usr/bin/webfsd
+ eend $? "Failed to stop webfsd"
+}
diff --git a/www-servers/webfs/metadata.xml b/www-servers/webfs/metadata.xml
new file mode 100644
index 000000000000..a40624fba8f0
--- /dev/null
+++ b/www-servers/webfs/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>maintainer-needed@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/www-servers/webfs/webfs-1.21-r3.ebuild b/www-servers/webfs/webfs-1.21-r3.ebuild
new file mode 100644
index 000000000000..3b88eaed9af2
--- /dev/null
+++ b/www-servers/webfs/webfs-1.21-r3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils
+
+DESCRIPTION="Lightweight HTTP server for static content"
+SRC_URI="http://dl.bytesex.org/releases/${PN}/${P}.tar.gz"
+HOMEPAGE="http://linux.bytesex.org/misc/webfs.html"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86 ~arm-linux ~x86-linux"
+IUSE="ssl threads"
+
+DEPEND="ssl? ( dev-libs/openssl:0= )"
+
+RDEPEND="${DEPEND}
+ app-misc/mime-types"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-Variables.mk-dont-strip-binaries-on-install.patch"
+ epatch "${FILESDIR}/${P}-CVE-2013-0347.patch"
+ sed -e "s:/etc/mime.types:${EPREFIX}\\0:" -i GNUmakefile || die "sed failed"
+}
+
+src_compile() {
+ local myconf
+ use ssl || myconf="${myconf} USE_SSL=no"
+ use threads && myconf="${myconf} USE_THREADS=yes"
+
+ emake prefix="${EPREFIX}/usr" ${myconf}
+}
+
+src_install() {
+ local myconf
+ use ssl || myconf="${myconf} USE_SSL=no"
+ use threads && myconf="${myconf} USE_THREADS=yes"
+ einstall ${myconf} mandir="${ED}/usr/share/man"
+ newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ dodoc README
+}
+
+pkg_preinst() {
+ # Fix existing log permissions for bug #458892.
+ chmod 0600 "${EROOT}/var/log/webfsd.log" 2>/dev/null
+}