public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Tiziano Müller" <dev-zero@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/dev-zero:master commit in: www-servers/uwsgi/files/, www-servers/uwsgi/
Date: Mon, 23 Apr 2012 07:49:10 +0000 (UTC)	[thread overview]
Message-ID: <1335162987.1629c0e0f4bc9d7a84ce00760498b4dc74b7cf62.dev-zero@gentoo> (raw)

commit:     1629c0e0f4bc9d7a84ce00760498b4dc74b7cf62
Author:     Tiziano Müller <tm <AT> dev-zero <DOT> ch>
AuthorDate: Mon Apr 23 06:30:04 2012 +0000
Commit:     Tiziano Müller <dev-zero <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 06:36:27 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=dev/dev-zero.git;a=commit;h=1629c0e0

Pulled updates from Ultrabug. Build more plugins and add PHP support.

---
 www-servers/uwsgi/Manifest                         |   11 +-
 www-servers/uwsgi/files/1.1.2-threaded-php.patch   |   40 +++++
 www-servers/uwsgi/files/uwsgi.confd                |   34 ++--
 www-servers/uwsgi/files/uwsgi.initd                |  118 ++++++++-----
 www-servers/uwsgi/uwsgi-0.9.8.6.ebuild             |  186 --------------------
 .../{uwsgi-1.0.4.ebuild => uwsgi-1.1.2.ebuild}     |   65 ++++++--
 6 files changed, 194 insertions(+), 260 deletions(-)

diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
index afa2c38..40b070f 100644
--- a/www-servers/uwsgi/Manifest
+++ b/www-servers/uwsgi/Manifest
@@ -1,10 +1,9 @@
+AUX 1.1.2-threaded-php.patch 1098 RMD160 df45f3951fe9b75e2fbde10e5bcf8fa42f42c7eb SHA1 de05ded4b9a82392bb662a2cf2a05e8741fce641 SHA256 e5f03fcdf2ebf7d2867b21e640f2c44f23da169108b2ea964e96fea44152d49b
 AUX 42_mod_uwsgi.conf 159 RMD160 d3de5b69a9e292c731508b13a0bdbe234fac9db7 SHA1 24624a805c16778aaa4e24b74d2e8230ee381aec SHA256 b759712baa7b8abab2ffd56c3cbc970cb9189ef1efa3f3aa154a963dc67ba861
-AUX uwsgi.confd 1247 RMD160 f3cbb0ed1e83385e917949b7df1b8953792b9464 SHA1 2cba8d1990f0138f7bea113fec924b1656d53a8c SHA256 26c52f22137ffd44ef4c094ce9cf3b55f1c418f1602e0451462103a5117174a4
-AUX uwsgi.initd 2386 RMD160 a799175f2b94eb96dc19ff9b8b4d5c18a52cbd38 SHA1 ffa1870c2e14871764447bc97e6d7b9f24364a28 SHA256 d523238595e83b7f82001dea41ffa3298836fd0027859ed3e1bf4f84d75e1370
-DIST uwsgi-0.9.8.6.tar.gz 359620 RMD160 78b92fe3a9b272ca5a2704b0db7d1956b9149a0b SHA1 bb835c3c14310640b24ebdbcf0aa91e8ce8bd5a6 SHA256 14379c0055063dbfbc4ce9ba10dfd6eec827286a462300d98947174d9694d981
-DIST uwsgi-1.0.4.tar.gz 465762 RMD160 afc67a752fb0055cb87769219a60b9e8f09acfcc SHA1 ba2e249e962acbdc9a3e7c3c86b2ceb9019503f6 SHA256 3267c48fdfce41766a237eb696eaaa6ee8d90672b483dbfc746663ddc8383b8d
-EBUILD uwsgi-0.9.8.6.ebuild 4304 RMD160 ce533908cedae761db93ae26b811ae09e12847fc SHA1 29710c3c36fe5cffb34c180f9c6a48d7ace001e5 SHA256 5bf9203180bfa41622cad1f8c414b0a00af7b901e70017784f7648be43316b28
-EBUILD uwsgi-1.0.4.ebuild 5303 RMD160 657947aa39bb28ce8f2e4d8229617474c8431f50 SHA1 3a54351ee06a32fbc3b79f272a9b24bfea2313d4 SHA256 6968941db8836ddfb4bbcb1ba54c4f0f580bcc9f8ba0f52e149133c802465b5f
+AUX uwsgi.confd 1436 RMD160 27556a66bcd8f55e50bbce61110fdcc0a7b78b22 SHA1 a054d3d71fe333edc3a13c441051592a0db552e0 SHA256 2d87d90f643948e6d7f2a491196874d930122c37ff65949b089fdcba26916399
+AUX uwsgi.initd 3191 RMD160 dc665d3dc1325266c2fcee095503ae4e6b297980 SHA1 56396e9f7870a61e4084b524432972f349c09240 SHA256 4e2913b96e6fc88287879126727ae627e32fd5b51076aa8155af73359f1c97ca
+DIST uwsgi-1.1.2.tar.gz 497365 RMD160 4bb5f23db5b2ca0ae585dfde01dfc5bc1ea823c2 SHA1 b48ec35fcdd19c1786257958e34089c021655ba9 SHA256 0fc96217f83fed8cfaa340db2d09adb938b43edb1a963df8ede87f8d87b06e76
+EBUILD uwsgi-1.1.2.ebuild 6524 RMD160 afb8c1a773f22e2c957148b82ddb47b14fc2034a SHA1 5137ee230f82190623b3f10dec6e31f7f4b1d402 SHA256 09dc9f03b3e058063765b9fbb6f93df29da596d91f8d2a86d9a40e1d977c89bb
 EBUILD uwsgi-9999.ebuild 5244 RMD160 d4e039a853ae5e78b7a969c6cd3c14b2047a0caa SHA1 5463d445d460fa649cb1f90a2d16c170a0f7ddae SHA256 d0a9ddac405f57588009d4e6c87f08033cc405b60433aeb44b4f41bc153e99f4
 MISC ChangeLog 533 RMD160 cef38aefe63bc7d5ad4a767bc34b7f57a1be9b5a SHA1 80e5cd4bd06fa22b86e439e7260064260df14d37 SHA256 418abb3d30490aae32336efcb4c27ee96af8a09f1f9bbfc629384efe8c2363a9
 MISC metadata.xml 255 RMD160 07d553bdf9282f61c4e99ad3f7697a310946cf9d SHA1 533ddafc8a18d2110ccdbec4c99c48abbcd6e633 SHA256 e3eef1b3ebe3eea3ba74657f3a332c7427c1bd24a5609d2ff887f63901d9cd35

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 0000000..ed75ad9
--- /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/uwsgi.confd b/www-servers/uwsgi/files/uwsgi.confd
index e08f688..5d1fc5c 100644
--- a/www-servers/uwsgi/files/uwsgi.confd
+++ b/www-servers/uwsgi/files/uwsgi.confd
@@ -1,51 +1,53 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.confd,v 1.1 2011/05/31 19:49:07 maksbotan Exp $
 
-# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
+# 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
-#
-#UWSGI_SOCKET=127.0.0.1:1234
+# Example : UWSGI_SOCKET=127.0.0.1:1234
+UWSGI_SOCKET=
 
-# Enable threads?
+# Enable threads? (1 = yes, 0 = no). The default is 0
 #
-#UWSGI_THREADS=1
+UWSGI_THREADS=0
 
 # The path to your uWSGI application.
 #
-#UWSGI_PROGRAM=
+UWSGI_PROGRAM=
 
 # The path to your uWSGI xml config file.
 #
-#UWSGI_XML_CONFIG=
+UWSGI_XML_CONFIG=
 
 # The number of child processes to spawn. The default is 1.
 #
-#UWSGI_CHILDREN=1
+UWSGI_PROCESSES=1
 
-# The log file path. If empty logging is disabled
+# The log file path. If empty, log only errors
 #
-#UWSGI_LOG_FILE=
+UWSGI_LOG_FILE=
 
 # If you want to run your application inside a chroot then specify the
 # directory here. Leave this blank otherwise.
 #
-#UWSGI_CHROOT=
+UWSGI_CHROOT=
 
 # If you want to run your application from a specific directiory specify
 # it here. Leave this blank otherwise.
 #
-# UWSGI_DIR=
+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=
+UWSGI_USER=
 
-# Run the uwsgi emperor which loads vassals dynamically
+# Run the uwsgi emperor which loads vassals dynamically from this PATH
 # see http://projects.unbit.it/uwsgi/wiki/Emperor
-#UWSGI_EMPEROR=
+# The advised Gentoo folder is /etc/uwsgi.d/
+UWSGI_EMPEROR_PATH=
 
 # Additional options you might want to pass to uWSGI
 #
-#UWSGI_EXTRA_OPTIONS=
+UWSGI_EXTRA_OPTIONS=

diff --git a/www-servers/uwsgi/files/uwsgi.initd b/www-servers/uwsgi/files/uwsgi.initd
index bb3ba6d..5b6335a 100644
--- a/www-servers/uwsgi/files/uwsgi.initd
+++ b/www-servers/uwsgi/files/uwsgi.initd
@@ -9,37 +9,53 @@ UWSGI_EXEC=/usr/bin/uwsgi
 PIDPATH=/var/run/uwsgi
 PIDFILE="${PIDPATH}/${PROGNAME}.pid"
 
-opts="${opts} reload"
+extra_started_commands="${opts} reload stats"
 
 depend() {
 	need net
 }
 
-start() {
-    mkdir -p "/var/run/uwsgi"
-
+start_emperor() {
 	local OPTIONS
+	OPTIONS="--emperor ${UWSGI_EMPEROR_PATH} --daemonize"
 
-	if [ "${SVCNAME}" = "uwsgi" ]; then
-		eerror "You are not supposed to run this script directly. Create a symlink"
-		eerror "for the uwsgi 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 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
+	if [ -n "${UWSGI_LOG_FILE}" ]; then
+		OPTIONS="${OPTIONS} ${UWSGI_LOG_FILE}"
+	else
+		OPTIONS="${OPTIONS} /dev/null --disable-logging"
 	fi
 
-	OPTIONS="--daemonize"
+	[ -z "${UWSGI_DIR}" ] && UWSGI_DIR="/"
+	[ -z "${UWSGI_USER}" ] && UWSGI_USER="root"
 
-	if [ -n "$UWSGI_LOG_FILE" ]; then
-		OPTIONS="${OPTIONS} $UWSGI_LOG_FILE"
+	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
@@ -48,49 +64,71 @@ start() {
 		OPTIONS="${OPTIONS} --socket ${UWSGI_SOCKET}"
 	fi
 
-	if [ -n "${UWSGI_CHILDREN}" ]; then
-		OPTIONS="${OPTIONS} --processes ${UWSGI_CHILDREN}"
+	if [ -n "${UWSGI_PROCESSES}" ]; then
+		OPTIONS="${OPTIONS} --processes ${UWSGI_PROCESSES}"
 	fi
 
 	if [ -n "${UWSGI_CHROOT}" ]; then
 		OPTIONS="${OPTIONS} --chroot ${UWSGI_CHROOT}"
 	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 [ -n "${UWSGI_PROGRAM}" ]; then
-		OPTIONS="${OPTIONS} --wsgi-file ${UWSGI_PROGRAM}"
+		OPTIONS="${OPTIONS} --file ${UWSGI_PROGRAM}"
 	fi
 
 	if [ -n "${UWSGI_XML_CONFIG}" ]; then
 		OPTIONS="${OPTIONS} --xmlconfig ${UWSGI_XML_CONFIG}"
 	fi
 
-    if [ -n "${UWSGI_EMPEROR}" ] ; then
-        OPTIONS="${OPTIONS} --emperor ${UWSGI_EMPEROR}"
-    else
-        OPTIONS="${OPTIONS} --master"
-    fi
-
 	ebegin "Starting uWSGI application ${PROGNAME}"
 	cd "${UWSGI_DIR}" && \
-	start-stop-daemon --start --user "${UWSGI_USER}" --exec "${UWSGI_EXEC}" -- ${OPTIONS} --pidfile "${PIDFILE}"
-	eend $?
+	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. Create a symlink"
+			eerror "for the uwsgi 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 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() {
-	ebegin "Stopping uWSGI application ${PROGNAME}"
-	start-stop-daemon --stop --pidfile "${PIDFILE}" --signal 3
+	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() {
-    elog "Reloading uWSGI"
-    start-stop-daemon --signal HUP --pidfile "${PIDFILE}"
-    eend $?
+	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/uwsgi-0.9.8.6.ebuild b/www-servers/uwsgi/uwsgi-0.9.8.6.ebuild
deleted file mode 100644
index 04fd42a..0000000
--- a/www-servers/uwsgi/uwsgi-0.9.8.6.ebuild
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI="4"
-PYTHON_DEPEND="python? 2:2.4:2.7 3:3.1:3.2"
-SUPPORT_PYTHON_ABIS="1"
-
-inherit apache-module python multilib
-
-DESCRIPTION="uWSGI server for Python web applications"
-HOMEPAGE="http://projects.unbit.it/uwsgi/"
-SRC_URI="http://projects.unbit.it/downloads/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="apache2 debug json ldap lua +nagios +pcre perl python rrdtool sqlite +xml yaml zeromq"
-
-CDEPEND="json? ( dev-libs/jansson )
-	ldap? ( net-nds/openldap )
-	lua? ( dev-lang/lua )
-	pcre? ( dev-libs/libpcre )
-	perl? ( dev-lang/perl )
-	sqlite? ( dev-db/sqlite:3 )
-	xml? ( dev-libs/libxml2 )
-	yaml? ( dev-libs/libyaml )
-	zeromq? ( net-libs/zeromq )"
-DEPEND="${CDEPEND}
-	dev-util/pkgconfig"
-RDEPEND="${CDEPEND}
-	rrdtool? ( net-analyzer/rrdtool )"
-
-APXS2_S="${S}/apache2"
-APACHE2_MOD_CONF="42_mod_${PN}"
-want_apache2_2
-
-use_true_false() {
-	if use $1 ; then
-		echo "true"
-	else
-		echo "false"
-	fi
-}
-
-pkg_setup() {
-	depend.apache_pkg_setup
-	python_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|python\([0-9].[0-9]\)-config|python-config-\1|' \
-		plugins/python??/uwsgiplugin.py || die "sed failed"
-}
-
-src_configure() {
-	local plugins=""
-	use nagios && plugins+=", nagios"
-	use rrdtool && plugins+=", rrdtool"
-
-	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, ${plugins:1}
-as_shared_library = false
-
-locking = auto
-event = auto
-timer = auto
-filemonitor = auto
-
-embed_files =
-
-embed_config =
-
-[python]
-paste = true
-web3 = true
-
-EOF
-}
-
-src_compile() {
-	python uwsgiconfig.py --build gentoo || die "building uwsgi failed"
-
-	mkdir -p "${T}/plugins"
-
-	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/perl gentoo || die "building plugin for perl failed"
-	fi
-
-	if use python ; then
-		for a in ${PYTHON_ABIS} ; do
-			python uwsgiconfig.py --plugin plugins/python${a/.} gentoo || die "building plugin for python-${a} failed"
-		done
-	fi
-
-	if use apache2 ; then
-		for m in Ruwsgi uwsgi ; do
-			APXS2_ARGS="-c mod_${m}.c"
-			apache-module_src_compile
-		done
-	fi
-}
-
-src_install() {
-	dobin uwsgi
-
-	insinto /usr/$(get_libdir)/uwsgi
-	doins "${T}/plugins"/*.so
-
-	use lua && dosym uwsgi /usr/bin/uwsgi_lua
-
-	use perl && dosym uwsgi /usr/bin/uwsgi_perl
-
-	if use python ; then
-		for a in ${PYTHON_ABIS} ; do
-			dosym uwsgi /usr/bin/uwsgi_python${a/.}
-		done
-	fi
-
-	if use apache2; then
-		for m in Ruwsgi uwsgi ; do
-			APACHE2_MOD_FILE="${APXS2_S}/.libs/mod_${m}.so"
-			apache-module_src_install
-		done
-	fi
-
-	newinitd "${FILESDIR}"/uwsgi.initd uwsgi
-	newconfd "${FILESDIR}"/uwsgi.confd uwsgi
-}
-
-pkg_postinst() {
-	if use apache2 ; then
-		elog "Two Apache modules have been installed: mod_uwsgi and mod_Ruwsgi."
-		elog "You can enable them with -DUWSGI or -DRUWSGI in /etc/conf.d/apache2."
-		elog "Both 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."
-	fi
-
-	if use lua || use perl || use python; then
-		elog "The lua, perl and python modules are built as plugins."
-		elog "Use '--plugins lua', '--plugins psgi' or '--plugins python27' to load them."
-	fi
-}

diff --git a/www-servers/uwsgi/uwsgi-1.0.4.ebuild b/www-servers/uwsgi/uwsgi-1.1.2.ebuild
similarity index 70%
rename from www-servers/uwsgi/uwsgi-1.0.4.ebuild
rename to www-servers/uwsgi/uwsgi-1.1.2.ebuild
index ad2a719..982c9ac 100644
--- a/www-servers/uwsgi/uwsgi-1.0.4.ebuild
+++ b/www-servers/uwsgi/uwsgi-1.1.2.ebuild
@@ -1,16 +1,21 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Header: $
 
 EAPI="4"
 PYTHON_DEPEND="python? 2:2.4:2.7 3:3.1:3.2"
+PYTHON_MODNAME="uwsgidecorators"
 SUPPORT_PYTHON_ABIS="1"
 USE_RUBY="ruby18 ree18 ruby19"
 RUBY_OPTIONAL="yes"
+PHP_EXT_NAME="dummy"
+PHP_EXT_INI="no"
+USE_PHP="php5-3 php5-4"
+PHP_EXT_OPTIONAL_USE="php"
 
 MY_P="${P/_/-}"
 
-inherit apache-module python multilib ruby-ng
+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/"
@@ -19,17 +24,20 @@ SRC_URI="http://projects.unbit.it/downloads/${MY_P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE="apache2 +caps +carbon debug json ldap lua +nagios +pcre perl python ruby rrdtool sqlite +uuid +xml yaml zeromq"
+IUSE="apache2 +caps +carbon debug graylog2 json ldap lua +nagios perl +pcre php python rrdtool rsyslog ruby spooler sqlite syslog +uuid +xml yaml zeromq"
+REQUIRED_USE="|| ( lua perl php python ruby )"
 
-CDEPEND="uuid? ( sys-apps/util-linux )
-	caps? ( sys-libs/libcap )
+CDEPEND="caps? ( sys-libs/libcap )
 	json? ( dev-libs/jansson )
+	graylog2? ( sys-libs/zlib )
 	ldap? ( net-nds/openldap )
 	lua? ( dev-lang/lua )
 	pcre? ( dev-libs/libpcre )
 	perl? ( dev-lang/perl )
 	ruby? ( $(ruby_implementations_depend) )
 	sqlite? ( dev-db/sqlite:3 )
+	rsyslog? ( app-admin/rsyslog )
+	uuid? ( sys-apps/util-linux )
 	xml? ( dev-libs/libxml2 )
 	yaml? ( dev-libs/libyaml )
 	zeromq? ( net-libs/zeromq )"
@@ -62,6 +70,8 @@ pkg_setup() {
 }
 
 src_prepare() {
+	epatch "${FILESDIR}/${PV}-threaded-php.patch"
+
 	sed -i \
 		-e "s|'-O2', ||" \
 		-e "s|'-Werror', ||" \
@@ -70,14 +80,21 @@ src_prepare() {
 
 	sed -i \
 		-e 's|python\([0-9].[0-9]\)-config|python-config-\1|' \
-		plugins/python??/uwsgiplugin.py || die "sed failed"
+		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]
@@ -110,7 +127,7 @@ 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, ${plugins:1}
+embedded_plugins =  ping, cache, rpc, fastrouter, http, ugreen, signal, logsocket, router_uwsgi, router_redirect, router_basicauth, zergpool, ${plugins:1}
 as_shared_library = false
 
 locking = auto
@@ -118,7 +135,7 @@ event = auto
 timer = auto
 filemonitor = auto
 
-embed_files =
+embed_files = 
 
 embed_config =
 [python]
@@ -132,14 +149,18 @@ EOF
 each_ruby_compile() {
 	cd "${WORKDIR}/${MY_P}"
 
-	sed -i -e "s|^NAME=.*|NAME='rack_${RUBY##*/}'|" plugins/rack/uwsgiplugin.py || die "sed failed"
-	UWSGICONFIG_RUBYPATH="${RUBY}" python uwsgiconfig.py --plugin plugins/rack gentoo || die "building plugin for ${RUBY} failed"
+	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/ruby19 gentoo || die "building plugin for ${RUBY} failed"
+		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"
 
@@ -153,9 +174,15 @@ src_compile() {
 		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 uwsgiconfig.py --plugin plugins/python${a/.} gentoo || die "building plugin for python-${a} failed"
+			python${a} uwsgiconfig.py --plugin plugins/python gentoo python${a/.} || die "building plugin for python-${a} failed"
 		done
 	fi
 
@@ -163,6 +190,10 @@ src_compile() {
 		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 apache2 ; then
 		for m in Ruwsgi uwsgi ; do
 			APXS2_ARGS="-c mod_${m}.c"
@@ -173,6 +204,7 @@ src_compile() {
 
 src_install() {
 	dobin uwsgi
+	pax-mark m "${D}"/usr/bin/uwsgi
 
 	insinto /usr/$(get_libdir)/uwsgi
 	doins "${T}/plugins"/*.so
@@ -181,7 +213,14 @@ src_install() {
 
 	use perl && dosym uwsgi /usr/bin/uwsgi_perl
 
+	if use php ; then
+		for a in ${PYTHON_ABIS} ; 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
@@ -196,6 +235,8 @@ src_install() {
 
 	newinitd "${FILESDIR}"/uwsgi.initd uwsgi
 	newconfd "${FILESDIR}"/uwsgi.confd uwsgi
+	keepdir /etc/"${PN}".d
+	use spooler && keepdir /var/spool/"${PN}"
 }
 
 pkg_postinst() {



             reply	other threads:[~2012-04-23  7:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  7:49 Tiziano Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-29 18:52 [gentoo-commits] dev/dev-zero:master commit in: www-servers/uwsgi/files/, www-servers/uwsgi/ Tiziano Müller
2011-11-21 10:56 Tiziano Müller
2011-08-09 13:09 Tiziano Müller
2011-08-09 10:02 Tiziano Müller
2011-08-02  9:42 Tiziano Müller
2011-07-31 13:48 Tiziano Müller
2011-07-31 13:41 Tiziano Müller
2011-07-31 13:27 Tiziano Müller
2011-07-31 13:23 Tiziano Müller
2011-07-31 13:23 Tiziano Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335162987.1629c0e0f4bc9d7a84ce00760498b4dc74b7cf62.dev-zero@gentoo \
    --to=dev-zero@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox