diff options
author | Alexys Jacob <ultrabug@gentoo.org> | 2014-11-05 11:07:04 +0000 |
---|---|---|
committer | Alexys Jacob <ultrabug@gentoo.org> | 2014-11-05 11:07:04 +0000 |
commit | 708aaa1d4311a669011cd68feb18f9ba00a3163d (patch) | |
tree | 11cf61a3d715831350c708396055be026bf33141 /www-servers | |
parent | Version bump (diff) | |
download | historical-708aaa1d4311a669011cd68feb18f9ba00a3163d.tar.gz historical-708aaa1d4311a669011cd68feb18f9ba00a3163d.tar.bz2 historical-708aaa1d4311a669011cd68feb18f9ba00a3163d.zip |
fix #528136, #527566
Package-Manager: portage-2.2.14/cvs/Linux x86_64
Manifest-Sign-Key: 0xB658FA13
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/uwsgi/ChangeLog | 9 | ||||
-rw-r--r-- | www-servers/uwsgi/Manifest | 10 | ||||
-rw-r--r-- | www-servers/uwsgi/files/uwsgi.initd-r4 | 144 | ||||
-rw-r--r-- | www-servers/uwsgi/uwsgi-2.0.8-r1.ebuild | 379 |
4 files changed, 537 insertions, 5 deletions
diff --git a/www-servers/uwsgi/ChangeLog b/www-servers/uwsgi/ChangeLog index f2618fd47628..5b8f4f2b0cdc 100644 --- a/www-servers/uwsgi/ChangeLog +++ b/www-servers/uwsgi/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for www-servers/uwsgi # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.65 2014/11/03 14:05:57 titanofold Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/ChangeLog,v 1.66 2014/11/05 11:06:56 ultrabug Exp $ + +*uwsgi-2.0.8-r1 (05 Nov 2014) + + 05 Nov 2014; Ultrabug <ultrabug@gentoo.org> +uwsgi-2.0.8-r1.ebuild, + +files/uwsgi.initd-r4: + init script enable emperor in app mode thx to Stefan Talpalaru fix #528136, + remove bashism thx to Philipp Riegger fix #527566 03 Nov 2014; Aaron W. Swenson <titanofold@gentoo.org> uwsgi-1.4.10-r1.ebuild, uwsgi-2.0.7-r1.ebuild, uwsgi-2.0.8.ebuild: diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest index 128591577575..cba629718f86 100644 --- a/www-servers/uwsgi/Manifest +++ b/www-servers/uwsgi/Manifest @@ -12,18 +12,20 @@ AUX uwsgi.confd-r3 1816 SHA256 4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb AUX uwsgi.initd-r1 3352 SHA256 857940e7c6c97c0e23db85015a47d295a102607100f0662ae69dc9c3c5bef14c SHA512 8c32618696be688001597d685f2a91eb6bbf65464889dd1ec30e40fe3cea2290cfe2cf0ec41dc3a2e35461781400f1a6fe881d666ab0771dde37a65b8ab873a8 WHIRLPOOL 954357c5c6c529a3b763cd5a09b0c7af2c738f7cba0823ddb80405fb5d31a06edc1677a13043fe1396ef0e9aef6142365cca223342bd10d090cddff7f15d0dad AUX uwsgi.initd-r2 3436 SHA256 1983e7346e50996ea9a34ac8f399b965596232bf7b9b38a98226562f11143463 SHA512 0eb9f844bacc3133615f4cd521adccb8830f58bd5b8c6d602e86191a7005157cc52fc5259654de79735f7ac4a41d0d2fd093f0dd08f62d3732efe482450b7590 WHIRLPOOL bbbf4cdb82710468caa6365536423e79ac13d0b81e393f50fed0be95bea5f73cc31ca19f99bdc0c6b54f7fdfea8175f6af6e8975b5c6b28828790dd2bf022921 AUX uwsgi.initd-r3 3614 SHA256 58b998b025e4a9df20ca917bc93e287f9a8cf02d278d513fa461f70e1d08f799 SHA512 ab9dc6277bd05821287f6f8beb3ac2504f0e41db38e11b4d2884ac026f14ac7bfaaca138f045afa712d4f2843f94de105bf0d43fad35d18679ac33b507cd187e WHIRLPOOL 7bf4b1d5263ddb3ea0e3c81fe4906debaa3a3ee0a59a177b4f12a24d883bcb2049dffa4b11d9564c1ce4324a23a67cd4e8110f1955c05287f53cbd4b4e75e7cc +AUX uwsgi.initd-r4 3612 SHA256 0ce63b2180bc359715596758ef1c636a51aca94e1147433cf5c077a1d5343622 SHA512 c58934a62d5ff8d3206b11cfbbc62d1881f14865a03fb949ebfe4955f29b5961fa87be96551382ae4fe902925dfc215409ec1b5e8360ac6806ed7b3f7b1705f8 WHIRLPOOL b7b8325330735a2a5a914131b70c3a7dc34f4c7cb2246923ebfc65acda8b9223109f64c5ba6feeb3ee5d1c1f2c0439e364fc3734ebbd29e0db37431398c776f6 DIST uwsgi-1.4.10.tar.gz 590892 SHA256 d4c30a6496d7d7be59f0264393649b9bd5ec58f72c4c3b79b8160b25c193c512 SHA512 26eb3e34595f0e85ae8f217ace8d326f966c605e00974621aa8b94fd83ef9fd711bdfa262c609a62a7f8d82a04431876769b546a1d1a0929de50ccd877a13e22 WHIRLPOOL 77d1a556c8af59a95eea75e8ae0af524c9aa768c1ecb7a396d43ca9cd6d215a96b83626882f8ab47cdc181ad1c5e62f18e508f43e97e8feb39bb5659fc6b2f37 DIST uwsgi-2.0.7.tar.gz 772385 SHA256 2938464d0277909854f55951cf7d114e0616efbd8dd0295da7da99e944cbc72a SHA512 5494fb03057aac57029b428f5a3b67cbdef2dc126cc8b6bb476c21a01afc3fb4c1f03af607aba7fc6dd49996373b8d01a79c34c2f2e763dc604961d265e58d4d WHIRLPOOL aeb33f94d0fe8c9db04074ffaada1aa304657080aa953b52d26349c6f7cdd7d5a9441ce11b37a74c26925db2f9d18ecda96a98789ed6a50d7f0d93b66bf6ecdf DIST uwsgi-2.0.8.tar.gz 775959 SHA256 ada2268480ef6a91e1aa18102344c6d5a409fe1672da9e835a0f213e2dd5bcbb SHA512 c68a23e6d5a427175a8defb17b8aae5720b5cdc8678253e03aa64e83dbe7b1731f16be328f5d8090f4ab500280d70808a0ccf23c5735a2f8086384c0f8128408 WHIRLPOOL 50147bccf83f965577d2739f4827146737f89ee4904be7ec23257cad196da6af48b9bed626010c290ffe6242922cf137e528377be4ea7e5944a198d305ffdbef EBUILD uwsgi-1.4.10-r1.ebuild 9540 SHA256 332246d74c44ccdc20367c17f4528ef69d337f15bc6063f27c976fd95dd9e62b SHA512 95537dcc4725f93bd4962668b51b25c7ecd53bb79c42dd7f9ec9d8dab42b649c4f417019a6ebb216b32aa919d173be73eebeb037c172c4a8813c7416f92aac9c WHIRLPOOL 96b5d3347f975ec3dddaa2ddd33534aaf4c33c39faaea5882271321cca254928a4151a886b32fa34bd373589bab67d9d25548302c5db21a67e47fb9ef580171c EBUILD uwsgi-2.0.7-r1.ebuild 11833 SHA256 b412c883f53282a6aa48a9318d9ea2289553f18b7a5f918c53f2113b565b4931 SHA512 e6cc6901ca9d8f950027629433386510156539a30b958f18ba7318291380533011530b997b8606124e25038ae49625a94f0c0d0e258b91f28dfb9f0fda80e634 WHIRLPOOL 0da250bf9afd4cac8e45e7e0d62578f9cb9cfee76b542158fbf40ff8d49141f21d0f636b4ab6e7a2989917a60306efbe7dbf0cbea0dc944598748128101ca820 +EBUILD uwsgi-2.0.8-r1.ebuild 11848 SHA256 ae0c42226e5f0ab3eb14d1b1a2912023f740cf7606d31415fe44623b8840898d SHA512 3f0b75a9059bf7e2740a7df55b83d987de8295e0baff2a357dae29e7a4272d32f46be10a0dc5c635b6d302f7ac7d2e0861dbfee2d655d1274acd0a1a3dc099f4 WHIRLPOOL 3a1f457491a525c37463ec26013e4afe2a9eec4830b1497793b4917e4f0ae78b200e341834fee12a6d605d74a6951f3b895c22aaa09a61bdecd9a7cebf564cdd EBUILD uwsgi-2.0.8.ebuild 11847 SHA256 05693c9926cdbe308b0df718ca0bc10db527deaf4498b23ec6c3d929c3f305f0 SHA512 65c50600ecc469018fbbfa873efc126199fafbf128650c7f6c00c85e12fbac6a65b14e3b3b8f89f04706511cac4dac09bd2e763ed58870ab8b517dbffc151427 WHIRLPOOL 70bf1a8259ebb8905f829e492e8dae1a622b93641f5ad07a2500d67b7c3c47779cf48e8793a6ed57c50e29191db054551fbc0e76594a8070daea13879e1afeae -MISC ChangeLog 11885 SHA256 050e193ceb8a9db77924055298c3327705306abe547d795508c92da8f8d51e2b SHA512 7d52d146764e2db9752c7ebc7f819e4f44b92230a06f58ff744d5c07cf46538716cf1cc4d8816edfc447402b2ba084211fdac84e23ea3840488d65abaa1c0586 WHIRLPOOL b79e2042806df11b9c66e6ca6fef59f8dcdfb6311eb4f2215691e298b2b8bc832d343d750e5cb123c60b3a3c341dd2e7061617e91ae0a4a10eaba518ed44332d +MISC ChangeLog 12140 SHA256 e4cc6acfa14acc279241b4ae4d0a32f5916ccf8bf839bb2e22c5ebb46ed7607e SHA512 1ef4b16567f99f8938eb25afd70b4c8ff1e48a18069b214e90e43db6bb8c44541b177812d1ce04943eb3676d9b61c13f81be872309468b91e27d99e4f0518006 WHIRLPOOL 05afff78a79c67c93c0524a0d1e05e504d4d4c6f9b02ec1a51a830648f41dc7f6ce0bff4877fc2fe4a5c1c15bf2496f3c6187369a6cb423a1fc003043371edd6 MISC metadata.xml 2594 SHA256 6e77fb15045b2feda8587315d54f7791c9c9af4b0e0f13d72a371646e32216e3 SHA512 89ac61cbfc089ff5452bc909f429431377c67aedc828098ffb33463a90f4a66524729a41fb83460df772218354d564529b7c3c206d3262c1025da1a6b1dd038a WHIRLPOOL 53c09c69fdc10762171891aeff5b731471cdd135ddb90896bfb2a2b1a0e1b841d6db97f9c217c44aed5c4e56d50f6eaff540646a2d05a7e8ce5f20bef9b326dd -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iF4EAREIAAYFAlRXi8gACgkQVxOqA9G7/aBsYAEAoPmTc8lXWVnA4z9yeIIRQFT3 -rmebjub/CwaxkQ1G1IsBAJLXHsLZVEJldggK4nm5FWcidNK9wjJBnZKeN/ZX5HRZ -=DU/3 +iF4EAREIAAYFAlRaBNUACgkQKiQSS7ZY+hM2WQEAzKTrgfOtmjnHnelT1/bIPOlR +8IJdFYpO6wxABRp1ls8A/AnM/nA2pDtCWnbPjTPvodCu63pQdStBJDEQUHel2hcv +=im+s -----END PGP SIGNATURE----- diff --git a/www-servers/uwsgi/files/uwsgi.initd-r4 b/www-servers/uwsgi/files/uwsgi.initd-r4 new file mode 100644 index 000000000000..6451e4feea5d --- /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 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/files/uwsgi.initd-r4,v 1.1 2014/11/05 11:06:56 ultrabug Exp $ + +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/uwsgi-2.0.8-r1.ebuild b/www-servers/uwsgi/uwsgi-2.0.8-r1.ebuild new file mode 100644 index 000000000000..1f75d9528e60 --- /dev/null +++ b/www-servers/uwsgi/uwsgi-2.0.8-r1.ebuild @@ -0,0 +1,379 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/uwsgi/uwsgi-2.0.8-r1.ebuild,v 1.1 2014/11/05 11:06:56 ultrabug Exp $ + +EAPI="5" + +PYTHON_COMPAT=( python2_7 python3_{2,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" # 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? ( virtual/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() { + epatch \ + "${FILESDIR}/1.1.2-threaded-php.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|/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 virtual/postgresql)" + PGSLOT="$(get_version_component_range 1-2 ${PGPV##virtual/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-r4 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 +} |