pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/py-uwsgi Update to 2.0 (python-3.x compatible) bas...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/724663cd5a9b
branches:  trunk
changeset: 629563:724663cd5a9b
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Thu Jan 23 14:47:05 2014 +0000

description:
Update to 2.0 (python-3.x compatible) based on the wip package by othyro.

Changes:
uWSGI 2.0

Changelog [20131230] Important changes

Dynamic options have been definitely removed as well as the
broken_plugins directory Bugfixes and improvements

    improved log rotation do not rely on unix signals to print
    request status during harakiri added magic vars for uid and
    gid various Lua fixes a tons of coverity-governed bugfixes made
    by Riccardo Magliocchetti

New features --attach-daemon2

this is a keyval based option for configuring external daemons.

Updated docs are: :doc:`AttachingDaemons` Linux setns() support

One of the biggest improvements in uWSGI 1.9-2.0 has been the total
support for Linux namespaces.

This last patch adds support for the setns() syscall.

This syscall allows a process to "attach" to a running namespace.

uWSGI instances can exposes their namespaces file descriptors
(basically they are the files in /proc/self/ns) via a unix socket.

External instances connects to that unix socket and automatically
enters the mapped namespace.

to spawn an instance in "namespace server mode", you use the
--setns-socket <addr> option

uwsgi --setns-socket /var/run/ns.socket --unshare net,ipc,uts ...

to attach you simply use --setns <addr>

uwsgi --setns /var/run/ns.socket ...

Updated docs: :doc:`Namespaces` "private" hooks

When uWSGI runs your hooks, it verbosely print the whole hook action
line. This could be a security problem in some scenario (for example
when you run initial phases as root user but allows unprivileged
access to logs).

Prefixing your action with a '!' will suppress full logging:

[uwsgi] hook-asap = !exec:my_secret_command

Support for yajl library (JSON parser)

Til now uWSGI only supported jansson as the json parser required
for managing .js config files.

You can now use the yajl library (available in centos) as alternative
JSON parser (will be automatically detected) Perl spooler support

The perl/PSGI plugin can now be used as a spooler server:

uwsgi::spooler(sub {
     my $args = shift; print Dumper($args); return -2; });

The client part is still missing as we need to fix some internal
api problem.

Expect it in 2.0.1 ;) Gateways can drop privileges

Gateways (like http router, sslrouter, rawrouter, forkptyrouter
...) can now drop privileges independently by the master.

Currently only the http/https/spdy router exposes the new option
(--http-uid/--http-gid) Subscriptions-governed SNI contexts

The subscription subsystem now supports 3 additional keys (you can
set them with the --subscribe2 option):

sni_key

sni_cert

sni_ca

all of the takes a path to the relevant ssl files.

diffstat:

 www/py-uwsgi/Makefile                     |   30 +++++--
 www/py-uwsgi/PLIST                        |   53 ++++++++++++++-
 www/py-uwsgi/distinfo                     |   15 +--
 www/py-uwsgi/options.mk                   |   75 ++++++++++++++++++++
 www/py-uwsgi/patches/patch-base.ini       |   20 ++++-
 www/py-uwsgi/patches/patch-logging.c      |   27 -------
 www/py-uwsgi/patches/patch-uwsgi.h        |   16 ++-
 www/py-uwsgi/patches/patch-uwsgiconfig.py |  109 +++++++++--------------------
 8 files changed, 213 insertions(+), 132 deletions(-)

diffs (truncated from 424 to 300 lines):

diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/Makefile
--- a/www/py-uwsgi/Makefile     Thu Jan 23 14:38:51 2014 +0000
+++ b/www/py-uwsgi/Makefile     Thu Jan 23 14:47:05 2014 +0000
@@ -1,23 +1,33 @@
-# $NetBSD: Makefile,v 1.19 2014/01/04 13:56:01 rodent Exp $
+# $NetBSD: Makefile,v 1.20 2014/01/23 14:47:05 wiz Exp $
 
-DISTNAME=      uwsgi-1.4.10
+DISTNAME=      uwsgi-2.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
-CATEGORIES=    python www
+CATEGORIES=    www python
 MASTER_SITES=  http://projects.unbit.it/downloads/
 
-MAINTAINER=    joerg%NetBSD.org@localhost
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=      http://projects.unbit.it/uwsgi
 COMMENT=       Feature-rich WSGI server
-LICENSE=       gnu-gpl-v2
+LICENSE=       gnu-gpl-v2 # with linking exception
 
-USE_LANGUAGES=         c
+USE_LANGUAGES= c
+USE_TOOLS+=    pkg-config
 
-PLIST_SUBST+=          PYVERSSUFFIX=${PYVERSSUFFIX}
+PLIST_SUBST+=  PYVERSSUFFIX=${PYVERSSUFFIX}
 EGG_NAME=      ${DISTNAME:S/uwsgi/uWSGI/}
 
-post-install:
-       mv ${DESTDIR}${PREFIX}/bin/uwsgi ${DESTDIR}${PREFIX}/bin/uwsgi-${PYVERSSUFFIX}
+.include "options.mk"
+
+INSTALL_ENV+=          UWSGI_INCLUDES=${PREFIX}/include
+INSTALL_ENV+=          UWSGI_PROFILE_OVERRIDE="${UWSGI_DEBUG}${UWSGI_JSON}${UWSGI_PCRE}${UWSGI_SSL}${UWSGI_UUID}${UWSGI_XML}${UWSGI_YAML}"
+INSTALLATION_DIRS+=    share/examples/py-uwsgi
 
+post-install:
+       ${MV} ${DESTDIR}${PREFIX}/bin/uwsgi ${DESTDIR}${PREFIX}/bin/uwsgi-${PYVERSSUFFIX}
+       ${INSTALL_DATA} ${WRKSRC}/examples/* \
+               ${DESTDIR}${PREFIX}/share/examples/py-uwsgi
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
 .include "../../lang/python/egg.mk"
-.include "../../textproc/libxml2/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/PLIST
--- a/www/py-uwsgi/PLIST        Thu Jan 23 14:38:51 2014 +0000
+++ b/www/py-uwsgi/PLIST        Thu Jan 23 14:47:05 2014 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2012/10/16 07:41:51 wiz Exp $
+@comment $NetBSD: PLIST,v 1.4 2014/01/23 14:47:05 wiz Exp $
 bin/uwsgi-${PYVERSSUFFIX}
 ${PYSITELIB}/${EGG_INFODIR}/PKG-INFO
 ${PYSITELIB}/${EGG_INFODIR}/SOURCES.txt
@@ -7,3 +7,54 @@
 ${PYSITELIB}/uwsgidecorators.py
 ${PYSITELIB}/uwsgidecorators.pyc
 ${PYSITELIB}/uwsgidecorators.pyo
+share/examples/py-uwsgi/bootstrap.py
+share/examples/py-uwsgi/bootstrap2.py
+share/examples/py-uwsgi/bootstrap3.py
+share/examples/py-uwsgi/bootstrap4.py
+share/examples/py-uwsgi/bootstrap5.py
+share/examples/py-uwsgi/config.lua
+share/examples/py-uwsgi/config.ru
+share/examples/py-uwsgi/config17.ru
+share/examples/py-uwsgi/config2.lua
+share/examples/py-uwsgi/config2.ru
+share/examples/py-uwsgi/config30.ru
+share/examples/py-uwsgi/corostream.pl
+share/examples/py-uwsgi/debug.ini
+share/examples/py-uwsgi/fibers.ru
+share/examples/py-uwsgi/fibers.yml
+share/examples/py-uwsgi/flaskpost.py
+share/examples/py-uwsgi/heavytest.ini
+share/examples/py-uwsgi/heavytest.py
+share/examples/py-uwsgi/info_uwsgi.php
+share/examples/py-uwsgi/logic.ini
+share/examples/py-uwsgi/mega.xml
+share/examples/py-uwsgi/mjpeg_stream.py
+share/examples/py-uwsgi/mojoapp.pl
+share/examples/py-uwsgi/multi.ini
+share/examples/py-uwsgi/multi.xml
+share/examples/py-uwsgi/multiapp.py
+share/examples/py-uwsgi/protected.ini
+share/examples/py-uwsgi/router.lua
+share/examples/py-uwsgi/simple_app.py
+share/examples/py-uwsgi/simple_app_wsgi2.py
+share/examples/py-uwsgi/simple_logger.py
+share/examples/py-uwsgi/sites.xml
+share/examples/py-uwsgi/sputnik.ws
+share/examples/py-uwsgi/staticfilesnmp.py
+share/examples/py-uwsgi/taskqueue.py
+share/examples/py-uwsgi/uwsgi.xml
+share/examples/py-uwsgi/uwsgirouter.py
+share/examples/py-uwsgi/uwsgirouter2.py
+share/examples/py-uwsgi/uwsgirouter3.py
+share/examples/py-uwsgi/uwsgirouter4.py
+share/examples/py-uwsgi/uwsgirouter5.py
+share/examples/py-uwsgi/uwsgistatus.py
+share/examples/py-uwsgi/welcome.ini
+share/examples/py-uwsgi/welcome.py
+share/examples/py-uwsgi/welcome3.py
+share/examples/py-uwsgi/werkzeug.js
+share/examples/py-uwsgi/werkzeug.yml
+share/examples/py-uwsgi/werkzeug_strict.yml
+share/examples/py-uwsgi/xmlindex-html.xsl
+share/examples/py-uwsgi/xmlindex.ini
+share/examples/py-uwsgi/zmqgevent.ini
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/distinfo
--- a/www/py-uwsgi/distinfo     Thu Jan 23 14:38:51 2014 +0000
+++ b/www/py-uwsgi/distinfo     Thu Jan 23 14:47:05 2014 +0000
@@ -1,9 +1,8 @@
-$NetBSD: distinfo,v 1.14 2014/01/05 03:46:11 rodent Exp $
+$NetBSD: distinfo,v 1.15 2014/01/23 14:47:05 wiz Exp $
 
-SHA1 (uwsgi-1.4.10.tar.gz) = cc903eeacce6bc9adf76d20a89510e24b9c0364c
-RMD160 (uwsgi-1.4.10.tar.gz) = fc7b03d6e5d52751f8872a5aeb4f4a27fd94e887
-Size (uwsgi-1.4.10.tar.gz) = 590892 bytes
-SHA1 (patch-base.ini) = 20cf4008c9d6f443869147d49fb1c83128d78a17
-SHA1 (patch-logging.c) = 3ba8a94c68951e7ce4c76ee34a99755a23ccd53c
-SHA1 (patch-uwsgi.h) = 1e72e42be6ab7663c3e6123c33236f5f20832563
-SHA1 (patch-uwsgiconfig.py) = ea708ac89516dfc3ca0615937856bed68369b1c0
+SHA1 (uwsgi-2.0.tar.gz) = 6a210d25ab66b5726850fe0c80793ede55f02bcf
+RMD160 (uwsgi-2.0.tar.gz) = d42e8d630e08696247de75ec208de6c57a918ca8
+Size (uwsgi-2.0.tar.gz) = 744221 bytes
+SHA1 (patch-base.ini) = f1b61f8323a7be92ebae5c87b8a32b3109145036
+SHA1 (patch-uwsgi.h) = 911aa69e7973b92c726fa293748ae6a875b45353
+SHA1 (patch-uwsgiconfig.py) = 712bed7b8c114f1c9c457660151137fa469f0cb5
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/py-uwsgi/options.mk   Thu Jan 23 14:47:05 2014 +0000
@@ -0,0 +1,75 @@
+# $NetBSD: options.mk,v 1.1 2014/01/23 14:47:05 wiz Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.py-uwsgi
+PKG_SUPPORTED_OPTIONS= debug openssl pcre uuid yaml zlib
+PKG_SUGGESTED_OPTIONS+=        libxml2 openssl zlib
+
+PKG_OPTIONS_OPTIONAL_GROUPS+=  json xml
+PKG_OPTIONS_GROUP.json=                jansson yajl
+PKG_OPTIONS_GROUP.xml=         expat libxml2
+
+.include "../../mk/bsd.options.mk"
+
+UWSGI_DEBUG=                   debug=false;
+.if !empty(PKG_OPTIONS:Mdebug)
+UWSGI_DEBUG=                   debug=true;
+.endif
+
+UWSGI_XML=                     xml=auto;
+.if !empty(PKG_OPTIONS:Mexpat)
+.include "../../textproc/expat/buildlink3.mk"
+UWSGI_XML=                     xml=expat;
+.elif !empty(PKG_OPTIONS:Mlibxml2)
+.include "../../textproc/libxml2/buildlink3.mk"
+UWSGI_XML=                     xml=libxml2;
+.else
+UWSGI_XML=                     xml=false;
+.endif
+
+UWSGI_JSON=                    json=auto;
+.if !empty(PKG_OPTIONS:Mjansson)
+.include "../../textproc/jansson/buildlink3.mk"
+UWSGI_JSON=                    json=jansson;
+.elif !empty(PKG_OPTIONS:Myajl)
+.include "../../devel/yajl/buildlink3.mk"
+UWSGI_JSON=                    json=yajl;
+BROKEN=                The yajl option requires a yajl.pc file which that package doesn't have.
+.else
+UWSGI_JSON=                    json=false;
+.endif
+
+UWSGI_SSL=                     ssl=auto;
+.if !empty(PKG_OPTIONS:Mopenssl)
+.include "../../security/openssl/buildlink3.mk"
+UWSGI_SSL=                     ssl=true;
+.else
+UWSGI_SSL=                     ssl=false;
+.endif
+
+UWSGI_PCRE=                    pcre=auto;
+.if !empty(PKG_OPTIONS:Mpcre)
+.include "../../devel/pcre/buildlink3.mk"
+UWSGI_PCRE=                    pcre=true;
+.else
+UWSGI_PCRE=                    pcre=false;
+.endif
+
+UWSGI_UUID=                    uuid=auto;
+.if !empty(PKG_OPTIONS:Muuid)
+.include "../../devel/libuuid/buildlink3.mk"
+UWSGI_UUID=                    uuid=true;
+.else
+UWSGI_UUID=                    uuid=false;
+.endif
+
+UWSGI_YAML=                    yaml=auto
+.if !empty(PKG_OPTIONS:Myaml)
+.include "../../textproc/libyaml/buildlink3.mk"
+UWSGI_YAML=                    yaml=true
+.else
+UWSGI_YAML=                    yaml=false
+.endif
+
+.if !empty(PKG_OPTIONS:Mzlib)
+.include "../../devel/zlib/buildlink3.mk"
+.endif
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/patches/patch-base.ini
--- a/www/py-uwsgi/patches/patch-base.ini       Thu Jan 23 14:38:51 2014 +0000
+++ b/www/py-uwsgi/patches/patch-base.ini       Thu Jan 23 14:47:05 2014 +0000
@@ -1,13 +1,23 @@
-$NetBSD: patch-base.ini,v 1.2 2014/01/04 13:56:01 rodent Exp $
+$NetBSD: patch-base.ini,v 1.3 2014/01/23 14:47:05 wiz Exp $
+
+Build CGI plugin too. Add directive for uuid detection.
 
---- buildconf/base.ini.orig    2013-08-23 12:51:18.000000000 +0000
+--- buildconf/base.ini.orig    2013-12-30 08:44:59.000000000 +0000
 +++ buildconf/base.ini
-@@ -29,7 +29,7 @@ plugins =
+@@ -4,6 +4,7 @@ yaml = true
+ json = auto
+ ssl = auto
+ pcre = auto
++uuid = auto
+ routing = auto
+ debug = false
+ unbit = false
+@@ -13,7 +14,7 @@ plugins =
  bin_name = uwsgi
  append_version =
  plugin_dir = .
--embedded_plugins = %(main_plugin)s, ping, cache, nagios, rrdtool, carbon, rpc, corerouter, fastrouter, http, ugreen, signal, syslog, rsyslog, logsocket, router_uwsgi, router_redirect, 
router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter
-+embedded_plugins = %(main_plugin)s, cgi, ping, cache, nagios, rrdtool, carbon, rpc, corerouter, fastrouter, http, ugreen, signal, syslog, rsyslog, logsocket, router_uwsgi, router_redirect, 
router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter
+-embedded_plugins = %(main_plugin)s, ping, cache, nagios, rrdtool, carbon, rpc, corerouter, fastrouter, http, ugreen, signal, syslog, rsyslog, logsocket, router_uwsgi, router_redirect, 
router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter, router_static, sslrouter, spooler, cheaper_busyness, symcall, transformation_tofile, 
transformation_gzip, transformation_chunked, transformation_offload, router_memcached, router_redis, router_hash, router_expires, router_metrics, transformation_template, stats_pusher_socket
++embedded_plugins = %(main_plugin)s, cgi, ping, cache, nagios, rrdtool, carbon, rpc, corerouter, fastrouter, http, ugreen, signal, syslog, rsyslog, logsocket, router_uwsgi, router_redirect, 
router_basicauth, zergpool, redislog, mongodblog, router_rewrite, router_http, logfile, router_cache, rawrouter, router_static, sslrouter, spooler, cheaper_busyness, symcall, transformation_tofile, 
transformation_gzip, transformation_chunked, transformation_offload, router_memcached, router_redis, router_hash, router_expires, router_metrics, transformation_template, stats_pusher_socket
  as_shared_library = false
  
  locking = auto
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/patches/patch-logging.c
--- a/www/py-uwsgi/patches/patch-logging.c      Thu Jan 23 14:38:51 2014 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-$NetBSD: patch-logging.c,v 1.3 2014/01/04 13:56:01 rodent Exp $
-
---- core/logging.c.orig        2013-08-23 12:51:18.000000000 +0000
-+++ core/logging.c
-@@ -306,7 +306,7 @@ void uwsgi_setup_log_master(void) {
-                       int is_id = 1;
-                       int i;
-                       for (i = 0; i < (space - name); i++) {
--                              if (!isalnum(name[i])) {
-+                              if (!isalnum((int) name[i])) {
-                                       is_id = 0;
-                                       break;
-                               }
-@@ -695,8 +695,13 @@ void get_memusage(uint64_t * rss, uint64
-               struct kinfo_proc *kproc;
-               kproc = kvm_getprocs(kv, KERN_PROC_PID, uwsgi.mypid, &cnt);
-               if (kproc && cnt > 0) {
-+#if defined(__FreeBSD__)
-                       *vsz = kproc->ki_size;
-                       *rss = kproc->ki_rssize * uwsgi.page_size;
-+#elif defined(__DragonFly__)
-+                      *vsz = kproc->kp_vm_map_size;
-+                      *rss = kproc->kp_vm_rssize * uwsgi.page_size;
-+#endif
-               }
- #elif defined(UWSGI_NEW_OPENBSD)
-               struct kinfo_proc *kproc;
diff -r e948dd0312c4 -r 724663cd5a9b www/py-uwsgi/patches/patch-uwsgi.h
--- a/www/py-uwsgi/patches/patch-uwsgi.h        Thu Jan 23 14:38:51 2014 +0000
+++ b/www/py-uwsgi/patches/patch-uwsgi.h        Thu Jan 23 14:47:05 2014 +0000
@@ -1,14 +1,16 @@
-$NetBSD: patch-uwsgi.h,v 1.4 2014/01/04 13:56:01 rodent Exp $
+$NetBSD: patch-uwsgi.h,v 1.5 2014/01/23 14:47:05 wiz Exp $
 
---- uwsgi.h.orig       2013-08-23 12:51:18.000000000 +0000
+Avoid clash with sys/user.h inclusion in logging.c on DragonFly BSD.
+
+--- uwsgi.h.orig       2013-12-30 08:44:59.000000000 +0000
 +++ uwsgi.h
-@@ -278,6 +278,10 @@ extern int pivot_root(const char *new_ro
- #include <sys/devpoll.h>
- #elif defined(__HAIKU__)
+@@ -323,6 +323,10 @@ extern int pivot_root(const char *new_ro
+ #elif defined(__CYGWIN__)
+ #elif defined(__HURD__)
  #else
-+#ifdef __DragonFly__
++#if defined(__DragonFly__)
 +/* avoid clash with sys/user.h inclusion in logging.c */
-+#define _KERNEL_STRUCTURES 
++#define _KERNEL_STRUCTURES
 +#endif /* __DragonFly__ */
  #include <sys/event.h>
  #endif



Home | Main Index | Thread Index | Old Index