diff options
author | Tiziano Müller <dev-zero@gentoo.org> | 2012-05-15 06:45:08 +0000 |
---|---|---|
committer | Tiziano Müller <dev-zero@gentoo.org> | 2012-05-15 06:45:08 +0000 |
commit | 3ea167472ad1d95d5a23b4257bd6713743dbae04 (patch) | |
tree | 486f318d45a243b70abe7827ca6a7746e7c3919e /www-servers | |
parent | Backport upstream patch to fix bug #415601 by Baptiste Wicht. (diff) | |
download | historical-3ea167472ad1d95d5a23b4257bd6713743dbae04.tar.gz historical-3ea167472ad1d95d5a23b4257bd6713743dbae04.tar.bz2 historical-3ea167472ad1d95d5a23b4257bd6713743dbae04.zip |
Version bump (bug #415127), in collaboration with Ultrabug: no magic deps anymore, added support for perl, ruby, lua, erlang, php and general cgi.
Package-Manager: portage-2.1.10.56/cvs/Linux x86_64
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/uwsgi/ChangeLog | 11 | ||||
-rw-r--r-- | www-servers/uwsgi/Manifest | 21 | ||||
-rw-r--r-- | www-servers/uwsgi/files/1.1.2-threaded-php.patch | 40 | ||||
-rw-r--r-- | www-servers/uwsgi/files/1.2.3-pyerl.patch | 31 | ||||
-rw-r--r-- | www-servers/uwsgi/files/42_mod_uwsgi-r1.conf | 9 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi.confd-r1 | 53 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi.initd-r1 | 135 | ||||
-rw-r--r-- | www-servers/uwsgi/metadata.xml | 12 | ||||
-rw-r--r-- | www-servers/uwsgi/uwsgi-1.2.3.ebuild | 300 |
9 files changed, 609 insertions, 3 deletions
diff --git a/www-servers/uwsgi/ChangeLog b/www-servers/uwsgi/ChangeLog index d093d774975e..d05112ad7fc1 100644 --- a/www-servers/uwsgi/ChangeLog +++ b/www-servers/uwsgi/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for www-servers/uwsgi # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.10 2012/02/25 04:26:07 patrick Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.11 2012/05/15 06:45:08 dev-zero Exp $ + +*uwsgi-1.2.3 (15 May 2012) + + 15 May 2012; Tiziano Müller <dev-zero@gentoo.org> + +files/1.1.2-threaded-php.patch, +files/1.2.3-pyerl.patch, + +uwsgi-1.2.3.ebuild, +files/42_mod_uwsgi-r1.conf, +files/uwsgi.confd-r1, + +files/uwsgi.initd-r1, metadata.xml: + Version bump (bug #415127), in collaboration with Ultrabug: no magic deps + anymore, added support for perl, ruby, lua, erlang, php and general cgi. 25 Feb 2012; Patrick Lauer <patrick@gentoo.org> uwsgi-0.9.7.2.ebuild, uwsgi-0.9.8.ebuild, uwsgi-1.0.2.1.ebuild: diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest index 1741af250538..3d25f8c96b55 100644 --- a/www-servers/uwsgi/Manifest +++ b/www-servers/uwsgi/Manifest @@ -1,3 +1,9 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX 1.1.2-threaded-php.patch 1098 RMD160 df45f3951fe9b75e2fbde10e5bcf8fa42f42c7eb SHA1 de05ded4b9a82392bb662a2cf2a05e8741fce641 SHA256 e5f03fcdf2ebf7d2867b21e640f2c44f23da169108b2ea964e96fea44152d49b +AUX 1.2.3-pyerl.patch 1015 RMD160 d3cd337fa83e8e837cdf9840fab1c9ed9503341f SHA1 aff381165927b8ed4fd0df86031fd07bec946a8c SHA256 1da74cb8d108f46c4faa39548f73de2f74849dde81d1012b71c7c91ab939596b +AUX 42_mod_uwsgi-r1.conf 248 RMD160 78c86c462d2484b7d3b1e7219863aeb74147bc41 SHA1 b8f7c888447d4ca30ce803b81f9bfd35a95d7d34 SHA256 40ef0a3916eba8f1a87828911571e9d8bf838f38f050d67df1662aca11ba6c91 AUX 42_mod_uwsgi.conf 159 RMD160 d3de5b69a9e292c731508b13a0bdbe234fac9db7 SHA1 24624a805c16778aaa4e24b74d2e8230ee381aec SHA256 b759712baa7b8abab2ffd56c3cbc970cb9189ef1efa3f3aa154a963dc67ba861 AUX uwsgi-0.9.5-fix_uwsgiconfig.py_indentation.patch 1202 RMD160 9c32ba693bd7bbdd6fae90c5b43118b8e0f882bc SHA1 cab74b61086c39e9f77e217b88361197c0069b98 SHA256 3903cf208ba14578aaf5cb95306191b97ed0b973047cad02321d4416d03a47f5 AUX uwsgi-0.9.5-respect_flags.patch 3985 RMD160 1787075a4decad7376e1772231a65e0ef5737537 SHA1 456031bc53a80ca5423a149b7c8013c3bb9338fe SHA256 5af3f880b7104b5fb4c8612d92fab9074b1d5ecc556aeea0775a82a82c4be80e @@ -6,12 +12,23 @@ AUX uwsgi-0.9.7.2-no-werror.patch 722 RMD160 0337d5ca8db56047fa2cd3a39aecd5761d7 AUX uwsgi-0.9.8-no-werror.patch 624 RMD160 ef3ebbfff1c6b4a49297e780b5eb5545786f8173 SHA1 a4e0923cb5ebaab19cee5b4495b1625f54c7510b SHA256 8650fe560d25d9b6facf8034bb5edfedc8aa74f22a716da702d2b97a1d298998 AUX uwsgi-1.0.2.1-no-werror.patch 567 RMD160 c246bd927f5dbe12552cfaa0aeafdd81f4b83e69 SHA1 d217ac9fb34ef7d5fd4151ea2b45e9aff42284c4 SHA256 64ee1684a12ea64b6b6892209c77863061a54cc752156131c6fc55f7f8785153 AUX uwsgi.confd 1116 RMD160 e13ddecb06cf4efaf75216ec657db99a4abbbddf SHA1 9df38c84bc2d612803629a6a2e6bd9a3a5568d33 SHA256 3c238b934f8db9eae87f77dc3d131499e442526d5e45438b5461c0d7590b772f +AUX uwsgi.confd-r1 1438 RMD160 b75f46a290f6f3710a1547aa0192180f3d440592 SHA1 874d0c89c7116694c3afa15949bf0613ecbcf7a2 SHA256 baa1522d488523daf67d3d480f9aa5076ae3252ab2731f4c25ef564caba8cfd2 AUX uwsgi.initd 2861 RMD160 9b33ea58fd404f18a80b06721c59e9e1aa5bce1f SHA1 de7046a94d28c53c6fca11d46b03a2631863b218 SHA256 8891e4bebb324a1663aaf994715243346ea9ed2bf73a1296be5646542d77b10e +AUX uwsgi.initd-r1 3302 RMD160 fda20075196ba206f9adbef5dcc3840dcf3dd036 SHA1 32f4cad560d42b8742e71f2b3169832294b20882 SHA256 abd50ba8e2ddb94ba365c5cccdf9a42d1972532757cc47f819dc89b62007bdcc DIST uwsgi-0.9.7.2.tar.gz 306218 RMD160 a6f0a548d6db46230946ec0a33395d5f5b119a58 SHA1 e279c2c597d349d9cf463bc4d226db7123c43342 SHA256 6eccf3c7ead324c6af9a6196f0d4faf4c8472ca3b728a01a0070b472b0784bba DIST uwsgi-0.9.8.tar.gz 335000 RMD160 424e9ec7c4bd24e2db256c92f84c0a3881ec3aaa SHA1 2ab2fd822fc966efe32c6be5a97efd7299d0cd01 SHA256 63a33006ea93f87aa24aaffda9e8b3bfc2d598b1d7bc4d9cd13c587f25500899 DIST uwsgi-1.0.2.1.tar.gz 465250 RMD160 e882e19ea072af06cb477c9fe5d580f3a5127d27 SHA1 b383b2d3d9d2b8fa3fef9d5449d151dde89e5ead SHA256 78280b57a970db7842e4481f8b00f13d011f27b340c869dc1ad28d564d716439 +DIST uwsgi-1.2.3.tar.gz 512385 RMD160 816a2970b1ba57a25fe0e12fde2ebb49092408c1 SHA1 337d2144fae8982c97a91830287e84b84974ad10 SHA256 1f9f6047468272708241780597014ed00d93919a384e81b30e65167fb2c2e129 EBUILD uwsgi-0.9.7.2.ebuild 1888 RMD160 16f57da2f2976e5ec8b2222945d584fe730924e3 SHA1 33f1c6620baa2998ad08b0c99d81e398bf412ed3 SHA256 ce8aaddc6934c7a378c9489f22d57e56112d352f8eb4f2061c4317a8bcec9f8e EBUILD uwsgi-0.9.8.ebuild 1886 RMD160 bb225d80a1399b5bcff842863d3ed346c2222595 SHA1 31ebf86b9eb91c0986ae18954278a8b770c64f88 SHA256 9ffd7fb4dc39ff59b1336c5e1a0f631b80c68401cff37bd368fdd3c93bd32581 EBUILD uwsgi-1.0.2.1.ebuild 1891 RMD160 f8867961f4962fedab8d4a44b34bd3e5a5e1f9bf SHA1 b3700e8a83567180a1225ef53504cf3f66248346 SHA256 1078d427a2cd4abe8a7ed4a5ec4a477fea989c2b75e20d5a27128032359c61d5 -MISC ChangeLog 2311 RMD160 e4fc000537d5c40b9bc999dc78b1e43182e9ee94 SHA1 45a7b0d65dc43ae130a446f412fb58af7603f3df SHA256 7718a9d456309b0b4f28ce00a5080e4c75f750a27cb06b6f8bca52dc26706624 -MISC metadata.xml 290 RMD160 a9e04892214d9e8cb88985adb7506a150d312f05 SHA1 daa73f3541b07308076a75af935f87888a806770 SHA256 b368eecfcb4b38a7f0b6e4cee3ebf76ad4d53f30c0b344bfeaf6584b17ad488a +EBUILD uwsgi-1.2.3.ebuild 8277 RMD160 86ddc0714296a3de90b47e5dad9add61f4521e13 SHA1 4b8de2b2e6a5f3ffe06f289de36622c50ae4bc13 SHA256 f7580e7738fd85f05d6329e121ae0333f53f8e21804ec7207ab41bef00aa09b4 +MISC ChangeLog 2720 RMD160 e65e5ba8a52b545fe8e2d456d63437e1d44e10a9 SHA1 717e2fb5a79f6933abab0cd52104cc9fee689514 SHA256 166b4035ef1c53896ae1b137b14eeacb91e91493109960b90ce4678008fa7b8a +MISC metadata.xml 1471 RMD160 c702fa97db160c9316c869f6a854142bcfd4215e SHA1 6aa5fe692c713fb1a561fa59fae84d5543e73ae5 SHA256 45a8b9649b82ea94771665d5ee8737552b7eedee2967dc828b34783085c24963 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.19 (GNU/Linux) + +iEYEARECAAYFAk+x+38ACgkQGwVqY66cHjDmrgCbBdNBtHs7Dtud8NOJRR11gYGJ +2awAnj34s3WckTMXfno1FREtn4J6TvFv +=RnQG +-----END PGP SIGNATURE----- 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/uwsgi.confd-r1 b/www-servers/uwsgi/files/uwsgi.confd-r1 new file mode 100644 index 000000000000..193ca589ea5c --- /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 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd-r1,v 1.1 2012/05/15 06:45:08 dev-zero Exp $ + +# 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.initd-r1 b/www-servers/uwsgi/files/uwsgi.initd-r1 new file mode 100644 index 000000000000..db44890fa968 --- /dev/null +++ b/www-servers/uwsgi/files/uwsgi.initd-r1 @@ -0,0 +1,135 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd-r1,v 1.1 2012/05/15 06:45:08 dev-zero Exp $ + +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_emperor() { + local OPTIONS + OPTIONS="--emperor ${UWSGI_EMPEROR_PATH} --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}" \ + -- ${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} --file ${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() { + mkdir -p "${PIDPATH}" + + 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 " `basename "${EDITOR}"` /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/metadata.xml b/www-servers/uwsgi/metadata.xml index 30792c895c17..17879e900564 100644 --- a/www-servers/uwsgi/metadata.xml +++ b/www-servers/uwsgi/metadata.xml @@ -8,4 +8,16 @@ <maintainer> <email>sterkrig@home.se</email> </maintainer> + <use> + <flag name='carbon'>Enable support for sending statistics to a carbon server (see http://projects.unbit.it/uwsgi/wiki/Carbon).</flag> + <flag name='erlang'>Let the uWSGI server as as an Erlang C-Node and exchange messages and rpc with Erlang nodes. Together with the USE=python this enables erlang support in python (see the mappings table in http://projects.unbit.it/uwsgi/wiki/ErlangIntegration).</flag> + <flag name='graylog2'>Enable logging to graylog2 (see http://graylog2.org/).</flag> + <flag name='json'>Support json as a configuration file format.</flag> + <flag name='nagios'>Add nagios-friendly logging output (see http://projects.unbit.it/uwsgi/wiki/Nagios).</flag> + <flag name='rrdtool'>Enable support for writing requests data in RRD files.</flag> + <flag name='rsyslog'>Support direct logging to a <pkg>app-admin/rsyslog</pkg> socket (without going through the syslog interface).</flag> + <flag name='spooler'>Build a plugin which gives a spooler (see http://projects.unbit.it/uwsgi/wiki/Spooler).</flag> + <flag name='yaml'>Support yaml as a configuration file format.</flag> + <flag name='zeromq'>Enable logging and deployment via ZeroMQ.</flag> + </use> </pkgmetadata> diff --git a/www-servers/uwsgi/uwsgi-1.2.3.ebuild b/www-servers/uwsgi/uwsgi-1.2.3.ebuild new file mode 100644 index 000000000000..91387919b83d --- /dev/null +++ b/www-servers/uwsgi/uwsgi-1.2.3.ebuild @@ -0,0 +1,300 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-1.2.3.ebuild,v 1.1 2012/05/15 06:45:08 dev-zero Exp $ + +EAPI="4" +PYTHON_DEPEND="python? 2:2.4:2.7 3:3.1:3.2" +PYTHON_MODNAME="uwsgidecorators" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="*-jython 2.7-pypy-*" +USE_RUBY="ruby18 ree18 ruby19" +RUBY_OPTIONAL="yes" +PHP_EXT_NAME="dummy" +PHP_EXT_INI="no" +USE_PHP="php5-3 php5-4" # deps must be registered separately below +PHP_EXT_OPTIONAL_USE="php" + +MY_P="${P/_/-}" + +inherit apache-module eutils python multilib pax-utils php-ext-source-r2 ruby-ng + +DESCRIPTION="uWSGI server for Python web applications" +HOMEPAGE="http://projects.unbit.it/uwsgi/" +SRC_URI="http://projects.unbit.it/downloads/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="apache2 +caps +carbon cgi debug erlang graylog2 json ldap lua +nagios perl +pcre php python rrdtool rsyslog ruby spooler sqlite syslog +xml yaml zeromq" +REQUIRED_USE="|| ( cgi erlang lua perl php python ruby )" + +# util-linux is required for libuuid when requesting zeromq support +CDEPEND="caps? ( sys-libs/libcap ) + json? ( dev-libs/jansson ) + erlang? ( dev-lang/erlang ) + graylog2? ( sys-libs/zlib ) + ldap? ( net-nds/openldap ) + lua? ( dev-lang/lua ) + pcre? ( dev-libs/libpcre ) + perl? ( dev-lang/perl ) + php? ( + php_targets_php5-3? ( dev-lang/php:5.3[embed] ) + php_targets_php5-4? ( dev-lang/php:5.4[embed] ) + ) + ruby? ( $(ruby_implementations_depend) ) + sqlite? ( dev-db/sqlite:3 ) + rsyslog? ( app-admin/rsyslog ) + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) + zeromq? ( net-libs/zeromq sys-apps/util-linux )" +DEPEND="${CDEPEND} + dev-util/pkgconfig" +RDEPEND="${CDEPEND} + rrdtool? ( net-analyzer/rrdtool )" + +S="${WORKDIR}/${MY_P}" +APXS2_S="${S}/apache2" +APACHE2_MOD_CONF="42_mod_uwsgi-r1 42_mod_uwsgi" + +want_apache2_2 + +use_true_false() { + if use $1 ; then + echo "true" + else + echo "false" + fi +} + +src_unpack() { + default +} + +pkg_setup() { + depend.apache_pkg_setup + python_pkg_setup +} + +src_prepare() { + epatch \ + "${FILESDIR}/1.1.2-threaded-php.patch" \ + "${FILESDIR}/${PV}-pyerl.patch" + + 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|python\([0-9].[0-9]\)-config|python-config-\1|' \ + plugins/python/uwsgiplugin.py || die "sed failed" + + sed -i \ + -e "s|/lib|/$(get_libdir)|" \ + plugins/php/uwsgiplugin.py || die "sed failed" +} + +src_configure() { + local plugins="" + use carbon && plugins+=", carbon" + use graylog2 && plugins+=", graylog2" + use nagios && plugins+=", nagios" + use rrdtool && plugins+=", rrdtool" + use rsyslog && plugins+=", rsyslog" + use syslog && plugins+=", syslog" + + cat > "buildconf/gentoo.ini" << EOF +[uwsgi] +xml = $(use_true_false xml) +ini = true +yaml = $(use_true_false yaml) +json = $(use_true_false json) +sqlite3 = $(use_true_false sqlite) +zeromq = $(use_true_false zeromq) +snmp = true +sctp = false +spooler = true +embedded = true +udp = true +multicast = true +threading = true +sendfile = true +minterpreters = true +async = true +evdis = false +ldap = $(use_true_false ldap) +pcre = $(use_true_false pcre) +debug = $(use_true_false debug) +unbit = false +xml_implementation = libxml2 +yaml_implementation = libyaml +malloc_implementation = libc +plugins = +bin_name = uwsgi +append_version = +plugin_dir = /usr/$(get_libdir)/uwsgi +plugin_build_dir = ${T}/plugins +embedded_plugins = ping, cache, rpc, fastrouter, http, ugreen, signal, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, redislog ${plugins} +as_shared_library = false + +locking = auto +event = auto +timer = auto +filemonitor = auto + +embed_files = + +embed_config = +[python] +paste = true +web3 = true +EOF + 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" +} + +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" + + if [[ "${RUBY}" == *ruby19 ]] ; then + UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/fiber gentoo || die "building fiber plugin for ${RUBY} failed" + fi +} + +install_python_lib() { + insinto $(python_get_sitedir) + doins uwsgidecorators.py +} + +src_compile() { + python uwsgiconfig.py --build gentoo || die "building uwsgi failed" + + mkdir -p "${T}/plugins" + + if use erlang ; then + python uwsgiconfig.py --plugin plugins/erlang gentoo || die "building plugin for erlang failed" + fi + + if use lua ; then + python uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed" + fi + + if use perl ; then + python uwsgiconfig.py --plugin plugins/psgi gentoo || die "building plugin for perl 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 + for a in ${PYTHON_ABIS} ; do + python${a} uwsgiconfig.py --plugin plugins/python gentoo python${a/.} || die "building plugin for python-${a} failed" + if use erlang ; then + python${a} uwsgiconfig.py --plugin plugins/pyerl gentoo pyerl${a/.} || die "building plugin for erlang-support in python failed" + fi + done + fi + + if use ruby ; then + ruby-ng_src_compile + fi + + if use spooler ; then + python uwsgiconfig.py --plugin plugins/spooler gentoo || die "building plugin for spooler failed" + fi + + if use cgi ; then + python uwsgiconfig.py --plugin plugins/cgi gentoo || die "building plugin for cgi failed" + 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 erlang && dosym uwsgi /usr/bin/uwsgi_erlang + use lua && dosym uwsgi /usr/bin/uwsgi_lua + 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_execute_function install_python_lib + for a in ${PYTHON_ABIS} ; do + dosym uwsgi /usr/bin/uwsgi_python${a/.} + done + 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-r1 uwsgi + newconfd "${FILESDIR}"/uwsgi.confd-r1 uwsgi + keepdir /etc/"${PN}".d + use 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 the newest and not considered ready for production yet." + fi + + elog "Append the following options to the uwsgi call to load the respective language plugin:" + use cgi && elog " '--plugins cgi' for cgi" + use erlang && elog " '--plugins erlang' for erlang" + use lua && elog " '--plugins lua' for lua" + 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 + + if use python ; then + for a in ${PYTHON_ABIS} ; do + elog " '--plugins python${a/.}' for python-${a}" + use erlang && elog " '--plugins python${a/.},erlang,pyerl${a/.}' for erlang support in python-${a}" + done + fi + + if use ruby ; then + for ruby in $USE_RUBY; do + use ruby_targets_${ruby} && elog " '--plugins rack_${ruby/.}' for ${ruby}" + if [[ "${ruby}" == *ruby19 ]] ; then + elog " '--plugins fibre' for ruby-1.9 fibres" + fi + done + fi +} |