diff --git a/www/py-bjoern/Makefile b/www/py-bjoern/Makefile index 0cc3f07d023b..0b159df3541e 100644 --- a/www/py-bjoern/Makefile +++ b/www/py-bjoern/Makefile @@ -1,31 +1,26 @@ -# New ports collection makefile for: py-bjoern -# Date created: 2011-10-23 -# Whom: Olivier Duchateau -# +# Created by: Olivier Duchateau # $FreeBSD$ # PORTNAME= bjoern -PORTVERSION= 1.2 +PORTVERSION= 1.3.1 CATEGORIES= www python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} -MAINTAINER= duchateau.olivier@gmail.com -COMMENT= A screamingly fast Python WSGI server +MAINTAINER= olivierd@FreeBSD.org +COMMENT= Fast Python WSGI server LICENSE= BSD -LICENSE_FILE= ${WRKSRC}/LICENSE -LIB_DEPENDS= ev.4:${PORTSDIR}/devel/libev +LIB_DEPENDS= ev:${PORTSDIR}/devel/libev USE_PYTHON= 2.6+ USE_PYDISTUTILS= yes +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib -lc + PLIST_FILES= %%PYTHON_SITELIBDIR%%/${PORTNAME}.so -post-patch: - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ - ${WRKSRC}/setup.py - .include diff --git a/www/py-bjoern/distinfo b/www/py-bjoern/distinfo index 471b2202a83b..8ad42b90c49d 100644 --- a/www/py-bjoern/distinfo +++ b/www/py-bjoern/distinfo @@ -1,2 +1,2 @@ -SHA256 (bjoern-1.2.tar.gz) = 9a4cf18fbcab49a0b53e98c9b1837df311af1ec58f711fcf91172b83e07b1e20 -SIZE (bjoern-1.2.tar.gz) = 22811 +SHA256 (bjoern-1.3.1.tar.gz) = e21391c1f52c088554bf62ce54f8af2889412d41f44847ecf05495b6d0a6dd6e +SIZE (bjoern-1.3.1.tar.gz) = 25811 diff --git a/www/py-bjoern/files/patch-bjoern__portable_sendfile.c b/www/py-bjoern/files/patch-bjoern__portable_sendfile.c new file mode 100644 index 000000000000..7600d2066609 --- /dev/null +++ b/www/py-bjoern/files/patch-bjoern__portable_sendfile.c @@ -0,0 +1,44 @@ +See sendfile(2) + +--- ./bjoern/portable_sendfile.c.orig 2012-07-23 14:46:30.000000000 +0000 ++++ ./bjoern/portable_sendfile.c 2013-06-02 18:17:34.000000000 +0000 +@@ -2,13 +2,16 @@ + + #define SENDFILE_CHUNK_SIZE 16*1024 + ++#if defined(__APPLE__) || defined(__FreeBSD__) ++ ++ #include ++ #include ++ #include ++ + #ifdef __APPLE__ + + /* OS X */ + +- #include +- #include +- + ssize_t portable_sendfile(int out_fd, int in_fd) { + off_t len = SENDFILE_CHUNK_SIZE; + if(sendfile(in_fd, out_fd, 0, &len, NULL, 0) == -1) +@@ -18,6 +21,19 @@ + + #else + ++ /* FreeBSD */ ++ ++ ssize_t portable_sendfile(int out_fd, int in_fd) { ++ off_t len = SENDFILE_CHUNK_SIZE; ++ if(sendfile(in_fd, out_fd, 0, SENDFILE_CHUNK_SIZE, NULL, &len, 0) == -1) ++ return -1; ++ return len; ++ } ++ ++#endif ++ ++#else ++ + /* Linux */ + + #include diff --git a/www/py-bjoern/files/patch-bjoern_server.c b/www/py-bjoern/files/patch-bjoern_server.c deleted file mode 100644 index f59720229611..000000000000 --- a/www/py-bjoern/files/patch-bjoern_server.c +++ /dev/null @@ -1,32 +0,0 @@ ---- bjoern/server.c.orig 2011-03-23 19:02:58.000000000 +0100 -+++ bjoern/server.c 2011-12-17 22:10:03.000000000 +0100 -@@ -1,11 +1,17 @@ --#include - #include - #include - #include - #ifdef WANT_SIGINT_HANDLING - # include - #endif -+#if defined(__FreeBSD__) -+#include -+#include -+#include -+#elif defined(__linux__) -+#include - #include -+#endif - #include - #include "common.h" - #include "wsgi.h" -@@ -294,7 +300,9 @@ - Py_ssize_t bytes_sent = sendfile( - request->client_fd, - request->current_chunk_p, /* current_chunk_p stores the file fd */ -- NULL, SENDFILE_CHUNK_SIZE -+ NULL, SENDFILE_CHUNK_SIZE, -+ NULL, NULL, -+ SF_NODISKIO - ); - if(bytes_sent == -1) - return handle_nonzero_errno(request); diff --git a/www/py-bjoern/files/patch-setup.py b/www/py-bjoern/files/patch-setup.py deleted file mode 100644 index 11035fcccc5d..000000000000 --- a/www/py-bjoern/files/patch-setup.py +++ /dev/null @@ -1,14 +0,0 @@ ---- setup.py.orig 2011-04-23 23:23:14.000000000 +0200 -+++ setup.py 2011-10-23 17:12:46.000000000 +0200 -@@ -8,8 +8,9 @@ - bjoern_extension = Extension( - 'bjoern', - sources = SOURCE_FILES, -- libraries = ['ev'], -- include_dirs = ['http-parser'], -+ library_dirs = ['%%LOCALBASE%%/lib'], -+ libraries = ['c', 'ev'], -+ include_dirs = ['/usr/include', '%%LOCALBASE%%/include', 'http-parser'], - define_macros = [('WANT_SENDFILE', '1'), - ('WANT_SIGINT_HANDLING', '1')], - extra_compile_args = ['-std=c99', '-fno-strict-aliasing', '-Wall', diff --git a/www/py-bjoern/pkg-descr b/www/py-bjoern/pkg-descr index d88190c57748..de7c1f15dfa1 100644 --- a/www/py-bjoern/pkg-descr +++ b/www/py-bjoern/pkg-descr @@ -2,4 +2,4 @@ bjoern, is a fast and ultra-lightweight asynchronous HTTP/1.1 WSGI server. It uses Marc Lehmann's hight performance libev event loop and Ryan Dahl's http-parser. -WWW: https://github.com/jonashaag/bjoern +WWW: https://github.com/jonashaag/bjoern