mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-02-16 23:57:11 +00:00
community/uwsgi to 2.0.19.1-10
This commit is contained in:
parent
ad7199cb89
commit
61bed561be
7 changed files with 812 additions and 198 deletions
|
@ -1,5 +1,6 @@
|
|||
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
|
||||
# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||
# Maintainer: David Runge <dvzrv@archlinux.org>
|
||||
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
|
||||
# Contributor: Valentin Hăloiu <vially.ichb+aur@gmail.com>
|
||||
# Contributor: Angel Velasquez <angvp@archlinux.org>
|
||||
# Contributor: Kevin Zuber <uKev@knet.eu>
|
||||
|
@ -11,166 +12,230 @@
|
|||
# - dropped mono plugin
|
||||
|
||||
pkgbase=uwsgi
|
||||
pkgname=(uwsgi
|
||||
uwsgi-plugin-rack
|
||||
uwsgi-plugin-psgi
|
||||
uwsgi-plugin-cgi
|
||||
uwsgi-plugin-python
|
||||
uwsgi-plugin-php
|
||||
uwsgi-plugin-lua51
|
||||
uwsgi-plugin-jvm
|
||||
uwsgi-plugin-webdav
|
||||
uwsgi-plugin-zabbix
|
||||
uwsgi-plugin-notfound)
|
||||
pkgname=(
|
||||
uwsgi
|
||||
uwsgi-plugin-rack
|
||||
uwsgi-plugin-psgi
|
||||
uwsgi-plugin-cgi
|
||||
uwsgi-plugin-python
|
||||
uwsgi-plugin-php
|
||||
uwsgi-plugin-php7
|
||||
uwsgi-plugin-lua51
|
||||
uwsgi-plugin-jvm
|
||||
uwsgi-plugin-webdav
|
||||
uwsgi-plugin-zabbix
|
||||
uwsgi-plugin-notfound
|
||||
)
|
||||
pkgver=2.0.19.1
|
||||
pkgrel=8
|
||||
pkgrel=10
|
||||
pkgdesc="A full stack for building hosting services"
|
||||
arch=(x86_64)
|
||||
url="http://projects.unbit.it/$pkgbase"
|
||||
url="https://uwsgi-docs.readthedocs.io/en/latest/"
|
||||
license=(GPL2)
|
||||
backup=('etc/uwsgi/emperor.ini')
|
||||
conflicts=(python-$pkgbase)
|
||||
makedepends=(gcc python ruby python-greenlet php7-embed curl libxml2 libyaml
|
||||
perl lua51 pcre libedit openssl bzip2 gmp pam java-environment=7
|
||||
jansson classpath python-gevent systemd)
|
||||
optdepends=('systemd: daemon scripts')
|
||||
source=("https://projects.unbit.it/downloads/$pkgbase-$pkgver.tar.gz"
|
||||
uwsgiplugin.py::https://raw.githubusercontent.com/unbit/uwsgi/9787f6882c2475aa9873e400988160b17dd04545/plugins/systemd_logger/uwsgiplugin.py
|
||||
archlinux.ini
|
||||
tmpfilesd
|
||||
uwsgi_at.service
|
||||
uwsgi_at.socket
|
||||
uwsgi_ruby20_compatibility.patch
|
||||
uwsgi_trick_chroot.patch
|
||||
emperor.ini
|
||||
emperor.uwsgi.service
|
||||
emperor.uwsgi.socket
|
||||
uwsgi.logrotate
|
||||
uwsgi.sysusers)
|
||||
makedepends=(
|
||||
classpath
|
||||
jansson
|
||||
java-environment=7
|
||||
libxcrypt
|
||||
libxml2
|
||||
lua51
|
||||
openssl
|
||||
pam
|
||||
pcre
|
||||
perl
|
||||
php-embed
|
||||
php7-embed
|
||||
python
|
||||
python-gevent
|
||||
python-greenlet
|
||||
ruby
|
||||
systemd
|
||||
util-linux
|
||||
zlib
|
||||
)
|
||||
source=(
|
||||
"https://projects.unbit.it/downloads/$pkgbase-$pkgver.tar.gz"
|
||||
archlinux.ini
|
||||
emperor.ini
|
||||
emperor.uwsgi.service
|
||||
emperor.uwsgi.socket
|
||||
uwsgi_at.service
|
||||
uwsgi_at.socket
|
||||
uwsgi.logrotate
|
||||
uwsgi.sysusers
|
||||
uwsgi.tmpfiles
|
||||
"${pkgbase}-1.9.13-ruby2.0.patch"
|
||||
"${pkgbase}-2.0.19.1-php8.patch"
|
||||
)
|
||||
sha512sums=('e18359c5ea3606d5de7fb3a0074d777e1c4b41f51f4b1a21f1446f32253058d7924286d9ed8a159d4c6e6c0ea64df7fc3c70b2933c3433b9a9cce39737e702bf'
|
||||
'68eef703de39cb336915e1e9c36b11c65c2d46482407b0234ca245df0e052952abb7dd85b0a1cd4507c78356a3b7a55424524b3aa0997b559b51e7b20eab5e16'
|
||||
'acfe9fb089d1905c3d736dbeaaef7eb1848b4ce8d1f585de653086cf7f90c166a1e493d0b62ba030a4bcf2eca9c919e0d6deea2ea1c0bcb8533d7cb040d2f67c'
|
||||
'4def9dcd06cfc2c6ce554add9d9545a01f3bb2681f0a2a6fc4ba68f91011111803a955cc41b5e70832ca448b196109368fdf874e81b7ec0edee4b51f864e16f7'
|
||||
'29e51d3f441bd8af23c9378bca6cb38376bbbf31bb3b07f318a04ea5620cf25d35d7799ba4a8ecff12634dccd903eef27a6957b932370706e35549f8fbcd2455'
|
||||
'fb51a4d102a1bc7d9f7d4c4f310ee65076bcfbc94b47e2dafdf9b20e99a661c5f938185dcf698437d81409376f0276b966f09b13c8a29462c48612df43c3f3ef'
|
||||
'162ca1be96282b32e8e6be919b6315bfd08954c491056958985bf99e7f5bdad3511665f059329d6cb6ef5d222f9aa11d4dc43c72e6a963ab941ada959fe8d964'
|
||||
'bc30f8ec69abd14fb96ada5b36cf65811a7a63ee27e224fcb6ceabe9935c1f17379cd872149a17da3d590b8ff60fbe7f77140d777aaf06e25e83388f897f611d'
|
||||
'f2be78fb77938ced8a4edb2899e4ee532bfc48cdc04b26a18c69e618bde869b19b546d1bf60decc5dc95de09de81a5bdd4f071501ce5c5d735eac158a995d5ed'
|
||||
'd54c84838ddb2f389e115ebb81aa2583705c9e330f020e6583b496f9c271ed236b6820c2a065f2b55a79adbf13e262b9ff2428124a8044b8fa20ca29ca4930ac'
|
||||
'068ada6281fdeb504fed7e47dae2729d047ed810bb596e5268c1821ad275cd32110e801e93e7ba0ee2d92dbc39e1954180cf43d88d2990d42b802ceb54b50a9e'
|
||||
'592c85270f43b37e9c51aae126533830515b96fff9fcae969ee865fe173bd0550c7729530d5ff1e44ffee43cd5c78c96688ce091c677a4196379e24983c0180e'
|
||||
'29e51d3f441bd8af23c9378bca6cb38376bbbf31bb3b07f318a04ea5620cf25d35d7799ba4a8ecff12634dccd903eef27a6957b932370706e35549f8fbcd2455'
|
||||
'fb51a4d102a1bc7d9f7d4c4f310ee65076bcfbc94b47e2dafdf9b20e99a661c5f938185dcf698437d81409376f0276b966f09b13c8a29462c48612df43c3f3ef'
|
||||
'937878372aa1556f6ba62ad7148d1681288c94d6cff609368a9e861dd4d4524330006a08ae5993441f7d3101170e3a0a681a4c8b3c2c13b364b8b1f81cf25117'
|
||||
'9e9eab08199cf08810ec95b0697cd8817226986d1e3aeb54845c0140ea5887360580348f295060c0558fb2d6aaed26fec929ea36b28cfeaf2b3588ce40fec3df')
|
||||
'9e9eab08199cf08810ec95b0697cd8817226986d1e3aeb54845c0140ea5887360580348f295060c0558fb2d6aaed26fec929ea36b28cfeaf2b3588ce40fec3df'
|
||||
'4def9dcd06cfc2c6ce554add9d9545a01f3bb2681f0a2a6fc4ba68f91011111803a955cc41b5e70832ca448b196109368fdf874e81b7ec0edee4b51f864e16f7'
|
||||
'162ca1be96282b32e8e6be919b6315bfd08954c491056958985bf99e7f5bdad3511665f059329d6cb6ef5d222f9aa11d4dc43c72e6a963ab941ada959fe8d964'
|
||||
'91b9548bb24eb4fff86ff867121edab92b531db04dacf5402b9bd8849632edfbfa0878e244bf5d243f34dcd5ee0df0ad136c888a4f27984dd6a96fd7b5e0959e')
|
||||
b2sums=('3f13da44081e85dfee01c827593656c0d1074a0217ca5fde5424ff36e0ae529d506f65a2bca658bd7df0a07520cae21cf8ce72ec85c767ec73304afd8a70b89e'
|
||||
'4a1e79fd4d450de11079b305f1b82660c6632ca6a2f15e641ab1a404a3b867c2439aa6031cc95956ff75ac21960f8734d7b1bec28330fecbfe95af3023ec8a32'
|
||||
'835a1036422e9821cd52ffdf5a6053bdd59fc700d473600bda60b6730746f6c0750c30c85f4139d3ea81c6b6dd10d6849f9406decee3179861c51aca90da6161'
|
||||
'80aa3c4d3f0310f5029ac01690d2ba718d8c86fa49cd1b4f3fc1bd5ae9eadaed6562bf0a48a0fd611e92f100a8594e08fb4bae58e25765fc2eb648cdf1c60b35'
|
||||
'b6838c0c91811d4b677bf0f558134c69015708c308ef7080df328f12b0b0d58ae6cdebe277c29b6d11c20cfeb0847a4934e3a8924323e57ed661d6e9f6656a34'
|
||||
'6587282d48c53cff862951503c560fd3bfe2fbfe18d56af7b5fbf8299b2b99125101a866005ef1fbabe6af9640c200c5121949b3723865d8597a948ed3d650e8'
|
||||
'24c61581bb922f8065a6ea73164ca5d0b6c63ab4ca7c265660b2ec257b69ff9dd4b0349572ff20f54950961b4286c77da36c1d2778698c80943cfd6ed6531b10'
|
||||
'a8b7d003f66ed5c5b1b60d57c05339af3dcdcf346eab52760810086e17f6936dd29ed7fd26281657bc86ac6721c989cbfbaa8e81f97111c807bcd06baece3bf2'
|
||||
'82e03ea95995cfa78abc4d930bd0c250f22788d9ca4dc0921cfbb44a965c0f851cbcc7a855e36ec6e6aa5bf33fbd313b4fe68a2f1c4b7935c2b297be25895324'
|
||||
'9759827f7619358383bf0e68c955522c0054620f742f5122a59888fadfc0bc20bd587eab7a77bc73e8ee4d20cf8f02625c07f241462e8ab9c08f5af509daaef3'
|
||||
'0068763ca5a2f1b60782f53070cbff8cf930e1463d9199b156b02413026bcdb3d923bffcbba063a26d620b8e734bdbd26a4c22776532546ad8c8e5c0c73bd7d6'
|
||||
'1f070c1720381f08af2009d075aec17f08820820abf9f89eab1ce557610d51e3d5b9669467a0e4e8a484133fa49f6b90e48d174befb95da38a9d32aaf4674f87')
|
||||
|
||||
prepare() {
|
||||
cd $pkgbase-$pkgver
|
||||
cp "$srcdir"/archlinux.ini buildconf/archlinux.ini
|
||||
for patch in uwsgi_ruby20_compatibility.patch uwsgi_trick_chroot.patch; do
|
||||
patch -Np1 -i "$srcdir"/$patch
|
||||
done
|
||||
rm -rf plugins/ruby
|
||||
mv plugins/ruby{19,}
|
||||
sed -i 's:\(ruby\)19:\1:' plugins/ruby/uwsgiplugin.py
|
||||
local _patch
|
||||
|
||||
sed -i 's/--cflags mono-2/--cflags mono-2 glib-2.0/g' plugins/mono/uwsgiplugin.py
|
||||
cd "$pkgbase-$pkgver"
|
||||
|
||||
cp "$srcdir"/uwsgiplugin.py plugins/systemd_logger/uwsgiplugin.py
|
||||
for _patch in ../*.patch; do
|
||||
printf "Applying patch %s...\n" "${_patch}"
|
||||
patch -Np1 -i "${_patch}"
|
||||
done
|
||||
|
||||
# fix default lua pkgconfig name
|
||||
sed -e 's/lua5.1/lua51/' \
|
||||
-i plugins/lua/uwsgiplugin.py
|
||||
# move ruby plugin to new location and fix its name
|
||||
mv plugins/ruby{19,}
|
||||
sed -e 's/ruby19/ruby/' \
|
||||
-i plugins/ruby/uwsgiplugin.py
|
||||
# duplicate the php plugin, so that we can modify it (and leave the php7
|
||||
# version unmodified)
|
||||
cp -av plugins/php{,7}
|
||||
# remove the explicit lib version from the linking stage of the PHP plugin as
|
||||
# we do not provide /usr/lib/libphp8.so
|
||||
sed -e "s/ + php_version//" \
|
||||
-i plugins/php/uwsgiplugin.py
|
||||
# copy our custom build profile into place
|
||||
cp -v ../archlinux.ini buildconf/
|
||||
}
|
||||
|
||||
build() {
|
||||
pushd "$srcdir"/$pkgbase-$pkgver
|
||||
|
||||
export UWSGICONFIG_LUAPC='lua51'
|
||||
export UWSGICONFIG_PHPPATH='/usr/bin/php-config7'
|
||||
|
||||
python uwsgiconfig.py --build archlinux
|
||||
python uwsgiconfig.py --plugin plugins/python archlinux python
|
||||
python uwsgiconfig.py --plugin plugins/greenlet archlinux greenlet
|
||||
python uwsgiconfig.py --plugin plugins/gevent archlinux gevent
|
||||
python uwsgiconfig.py --plugin plugins/asyncio archlinux asyncio
|
||||
python uwsgiconfig.py --plugin plugins/zabbix archlinux zabbix
|
||||
python uwsgiconfig.py --plugin plugins/notfound archlinux notfound
|
||||
cd "$pkgbase-$pkgver"
|
||||
python uwsgiconfig.py --verbose --build archlinux
|
||||
# build php7 plugin separately and override php-config in use
|
||||
UWSGICONFIG_PHPPATH='php-config7' \
|
||||
python uwsgiconfig.py --verbose --plugin plugins/php7 archlinux php7
|
||||
}
|
||||
|
||||
package_uwsgi() {
|
||||
pkgdesc="A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C"
|
||||
depends=(libxml2 jansson libsystemd libcap pam pcre)
|
||||
install=uwsgi.install
|
||||
cd "$srcdir"/$pkgbase-$pkgver
|
||||
install -Dm755 uwsgi "$pkgdir"/usr/bin/uwsgi
|
||||
install -Dm644 "$srcdir"/uwsgi_at.service "$pkgdir"/usr/lib/systemd/system/uwsgi@.service
|
||||
install -Dm644 "$srcdir"/uwsgi_at.socket "$pkgdir"/usr/lib/systemd/system/uwsgi@.socket
|
||||
install -Dm644 "$srcdir"/emperor.uwsgi.service "$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.service
|
||||
install -Dm644 "$srcdir"/emperor.uwsgi.socket "$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.socket
|
||||
install -Dm644 "$srcdir"/emperor.ini "$pkgdir"/etc/uwsgi/emperor.ini
|
||||
install -Dm644 "$srcdir"/tmpfilesd "$pkgdir"/usr/lib/tmpfiles.d/uwsgi.conf
|
||||
install -Dm644 "$srcdir"/uwsgi.logrotate "$pkgdir"/etc/logrotate.d/uwsgi
|
||||
install -Dm644 "$srcdir"/uwsgi.sysusers "$pkgdir"/usr/lib/sysusers.d/uwsgi.conf
|
||||
depends=('glibc' 'jansson' 'libcap.so' 'libcrypt.so' 'libpam.so' 'libxml2'
|
||||
'libsystemd.so' 'libuuid.so' 'openssl' 'pcre' 'zlib')
|
||||
backup=('etc/uwsgi/emperor.ini')
|
||||
install=uwsgi.install
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 "${pkgbase}" -t "$pkgdir/usr/bin/"
|
||||
install -vDm 644 ../uwsgi_at.service "$pkgdir"/usr/lib/systemd/system/uwsgi@.service
|
||||
install -vDm 644 ../uwsgi_at.socket "$pkgdir"/usr/lib/systemd/system/uwsgi@.socket
|
||||
install -vDm 644 ../emperor.uwsgi.service "$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.service
|
||||
install -vDm 644 ../emperor.uwsgi.socket "$pkgdir"/usr/lib/systemd/system/emperor.uwsgi.socket
|
||||
install -vDm 644 ../emperor.ini -t "$pkgdir"/etc/uwsgi/
|
||||
install -vDm 644 ../uwsgi.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/uwsgi.conf
|
||||
install -vDm 644 ../uwsgi.logrotate "$pkgdir"/etc/logrotate.d/uwsgi
|
||||
install -vDm 644 ../uwsgi.sysusers "$pkgdir"/usr/lib/sysusers.d/uwsgi.conf
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-cgi() {
|
||||
depends=(uwsgi)
|
||||
pkgdesc="CGI plugin"
|
||||
install -Dm755 $pkgbase-$pkgver/cgi_plugin.so "$pkgdir"/usr/lib/uwsgi/cgi_plugin.so
|
||||
pkgdesc+=" (CGI plugin)"
|
||||
depends=('glibc' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 cgi_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-rack() {
|
||||
depends=(uwsgi ruby)
|
||||
pkgdesc="Ruby rack plugin"
|
||||
install -Dm755 $pkgbase-$pkgver/rack_plugin.so "$pkgdir"/usr/lib/uwsgi/rack_plugin.so
|
||||
install -Dm755 $pkgbase-$pkgver/fiber_plugin.so "$pkgdir"/usr/lib/uwsgi/fiber_plugin.so
|
||||
install -Dm755 $pkgbase-$pkgver/rbthreads_plugin.so "$pkgdir"/usr/lib/uwsgi/rbthreads_plugin.so
|
||||
depends=('glibc' 'ruby' 'uwsgi')
|
||||
pkgdesc="Ruby rack plugin"
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 {rack,fiber,rbthreads}_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-psgi() {
|
||||
depends=(uwsgi perl)
|
||||
pkgdesc="Perl psgi plugin"
|
||||
install -Dm755 $pkgbase-$pkgver/psgi_plugin.so "$pkgdir"/usr/lib/uwsgi/psgi_plugin.so
|
||||
pkgdesc+=" (Perl psgi plugin)"
|
||||
depends=('glibc' 'perl' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 psgi_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-python() {
|
||||
depends=(uwsgi python python-greenlet)
|
||||
pkgdesc="Plugin for Python support"
|
||||
install -Dm755 $pkgbase-$pkgver/python_plugin.so "$pkgdir"/usr/lib/uwsgi/python_plugin.so
|
||||
install -Dm755 $pkgbase-$pkgver/greenlet_plugin.so "$pkgdir"/usr/lib/uwsgi/greenlet_plugin.so
|
||||
install -Dm755 $pkgbase-$pkgver/gevent_plugin.so "$pkgdir"/usr/lib/uwsgi/gevent_plugin.so
|
||||
install -Dm755 $pkgbase-$pkgver/asyncio_plugin.so "$pkgdir"/usr/lib/uwsgi/asyncio_plugin.so
|
||||
install -Dm644 $pkgbase-$pkgver/uwsgidecorators.py "$pkgdir"/usr/lib/python3.9/site-packages/uwsgidecorators.py
|
||||
python -m compileall "$pkgdir"/usr/lib/python3.9/site-packages/
|
||||
python -O -m compileall "$pkgdir"/usr/lib/python3.9/site-packages/
|
||||
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
|
||||
|
||||
pkgdesc+=" (Python plugin)"
|
||||
depends=('glibc' 'python' 'python-gevent' 'python-greenlet' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 {asyncio,gevent,greenlet,python}_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
install -vDm 644 uwsgidecorators.py -t "${pkgdir}${site_packages}"
|
||||
python -m compileall "${pkgdir}${site_packages}"
|
||||
python -O -m compileall "${pkgdir}${site_packages}"
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-lua51() {
|
||||
depends=(uwsgi lua51)
|
||||
pkgdesc="Plugin for Lua support"
|
||||
install -Dm755 $pkgbase-$pkgver/lua_plugin.so "$pkgdir"/usr/lib/uwsgi/lua_plugin.so
|
||||
pkgdesc+=" (LUA plugin)"
|
||||
depends=('glibc' 'lua51' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 lua_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-php() {
|
||||
depends=(uwsgi php7-embed libyaml jansson)
|
||||
pkgdesc="Plugin for PHP support"
|
||||
install -Dm755 $pkgbase-$pkgver/php_plugin.so "$pkgdir"/usr/lib/uwsgi/php_plugin.so
|
||||
pkgdesc+=" (PHP plugin)"
|
||||
depends=('glibc' 'php-embed' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 php_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-php7() {
|
||||
pkgdesc+=" (PHP7 plugin)"
|
||||
depends=('glibc' 'php7-embed' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 php7_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-jvm() {
|
||||
depends=(uwsgi java-environment=7 classpath)
|
||||
pkgdesc="Plugin for Jvm support"
|
||||
install -Dm644 $pkgbase-$pkgver/plugins/jvm/uwsgi.jar "$pkgdir"/usr/share/java/uwsgi.jar
|
||||
install -Dm755 $pkgbase-$pkgver/jvm_plugin.so "$pkgdir"/usr/lib/uwsgi/jvm_plugin.so
|
||||
pkgdesc+=" (JVM plugin)"
|
||||
depends=('classpath' 'glibc' 'uwsgi' 'java-environment=7')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 jvm_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
install -vDm 644 plugins/jvm/uwsgi.jar -t "$pkgdir"/usr/share/java/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-webdav() {
|
||||
depends=(uwsgi)
|
||||
pkgdesc="Plugin for webdav support"
|
||||
install -Dm755 $pkgbase-$pkgver/webdav_plugin.so "$pkgdir"/usr/lib/uwsgi/webdav_plugin.so
|
||||
pkgdesc+=" (WebDav plugin)"
|
||||
depends=('glibc' 'libxml2' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 webdav_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-zabbix() {
|
||||
depends=(uwsgi)
|
||||
pkgdesc="Plugin for zabbix support"
|
||||
install -Dm755 $pkgbase-$pkgver/zabbix_plugin.so "$pkgdir"/usr/lib/uwsgi/zabbix_plugin.so
|
||||
pkgdesc+=" (zabbix plugin)"
|
||||
depends=('glibc' 'uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 zabbix_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
||||
package_uwsgi-plugin-notfound() {
|
||||
depends=(uwsgi)
|
||||
pkgdesc="Plugin for notfound support"
|
||||
install -Dm755 $pkgbase-$pkgver/notfound_plugin.so "$pkgdir"/usr/lib/uwsgi/notfound_plugin.so
|
||||
pkgdesc+=" (notfound plugin)"
|
||||
depends=('uwsgi')
|
||||
|
||||
cd "$pkgbase-$pkgver"
|
||||
install -vDm 755 notfound_plugin.so -t "$pkgdir"/usr/lib/uwsgi/
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
[uwsgi]
|
||||
plugin_build_dir = .
|
||||
plugin_dir = /usr/lib/uwsgi
|
||||
plugins = rack, rbthreads, fiber, psgi, lua, php, jvm, cgi, webdav
|
||||
plugins = asyncio, cgi, fiber, gevent, greenlet, jvm, php, lua, mono, notfound, psgi, pypy, python, rack, rbthreads, webdav, zabbix
|
||||
main_plugin = systemd_logger,pam
|
||||
inherit = base
|
||||
|
|
630
community/uwsgi/uwsgi-2.0.19.1-php8.patch
Normal file
630
community/uwsgi/uwsgi-2.0.19.1-php8.patch
Normal file
|
@ -0,0 +1,630 @@
|
|||
diff --git c/plugins/php/common.h w/plugins/php/common.h
|
||||
index 9bf1c069..061b0b59 100644
|
||||
--- c/plugins/php/common.h
|
||||
+++ w/plugins/php/common.h
|
||||
@@ -3,11 +3,6 @@
|
||||
#include "php_main.h"
|
||||
#include "php_variables.h"
|
||||
|
||||
-#if (PHP_MAJOR_VERSION < 7)
|
||||
-#include "ext/standard/php_smart_str.h"
|
||||
-#else
|
||||
-#define UWSGI_PHP7
|
||||
-#endif
|
||||
#include "ext/standard/info.h"
|
||||
|
||||
#include "ext/session/php_session.h"
|
||||
diff --git c/plugins/php/php_plugin.c w/plugins/php/php_plugin.c
|
||||
index 5cec7805..717d6317 100644
|
||||
--- c/plugins/php/php_plugin.c
|
||||
+++ w/plugins/php/php_plugin.c
|
||||
@@ -4,6 +4,11 @@ extern struct uwsgi_server uwsgi;
|
||||
|
||||
static sapi_module_struct uwsgi_sapi_module;
|
||||
|
||||
+static int uwsgi_php_init(void);
|
||||
+
|
||||
+typedef size_t php_strlen_size;
|
||||
+typedef zend_long php_long_size;
|
||||
+
|
||||
struct uwsgi_php {
|
||||
struct uwsgi_string_list *allowed_docroot;
|
||||
struct uwsgi_string_list *allowed_ext;
|
||||
@@ -17,7 +22,6 @@ struct uwsgi_php {
|
||||
struct uwsgi_string_list *vars;
|
||||
struct uwsgi_string_list *constants;
|
||||
char *docroot;
|
||||
- size_t docroot_len;
|
||||
char *app;
|
||||
char *app_qs;
|
||||
char *fallback;
|
||||
@@ -32,7 +36,10 @@ struct uwsgi_php {
|
||||
struct uwsgi_string_list *exec_after;
|
||||
|
||||
char *sapi_name;
|
||||
+
|
||||
+ int sapi_initialized;
|
||||
HashTable user_config_cache;
|
||||
+ struct uwsgi_dyn_dict *mountpoint;
|
||||
} uphp;
|
||||
|
||||
void uwsgi_opt_php_ini(char *opt, char *value, void *foobar) {
|
||||
@@ -40,6 +47,10 @@ void uwsgi_opt_php_ini(char *opt, char *value, void *foobar) {
|
||||
uwsgi_sapi_module.php_ini_ignore = 1;
|
||||
}
|
||||
|
||||
+void uwsgi_opt_early_php(char *opt, char *value, void *foobar) {
|
||||
+ uwsgi_php_init();
|
||||
+}
|
||||
+
|
||||
struct uwsgi_option uwsgi_php_options[] = {
|
||||
|
||||
{"php-ini", required_argument, 0, "set php.ini path", uwsgi_opt_php_ini, NULL, 0},
|
||||
@@ -69,15 +80,15 @@ struct uwsgi_option uwsgi_php_options[] = {
|
||||
{"php-exec-after", required_argument, 0, "run specified php code after the requested script", uwsgi_opt_add_string_list, &uphp.exec_after, 0},
|
||||
{"php-exec-end", required_argument, 0, "run specified php code after the requested script", uwsgi_opt_add_string_list, &uphp.exec_after, 0},
|
||||
{"php-sapi-name", required_argument, 0, "hack the sapi name (required for enabling zend opcode cache)", uwsgi_opt_set_str, &uphp.sapi_name, 0},
|
||||
+
|
||||
+ {"early-php", no_argument, 0, "initialize an early perl interpreter shared by all loaders", uwsgi_opt_early_php, NULL, UWSGI_OPT_IMMEDIATE},
|
||||
+ {"early-php-sapi-name", required_argument, 0, "hack the sapi name (required for enabling zend opcode cache)", uwsgi_opt_set_str, &uphp.sapi_name, UWSGI_OPT_IMMEDIATE},
|
||||
+ {"php-mount", required_argument, 0, "add a php mountpoint", uwsgi_opt_add_dyn_dict, &uphp.mountpoint, 0},
|
||||
UWSGI_END_OF_OPTIONS
|
||||
};
|
||||
|
||||
|
||||
-#ifdef UWSGI_PHP7
|
||||
-static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length TSRMLS_DC)
|
||||
-#else
|
||||
-static int sapi_uwsgi_ub_write(const char *str, uint str_length TSRMLS_DC)
|
||||
-#endif
|
||||
+static size_t sapi_uwsgi_ub_write(const char *str, size_t str_length)
|
||||
{
|
||||
struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
|
||||
|
||||
@@ -89,7 +100,7 @@ static int sapi_uwsgi_ub_write(const char *str, uint str_length TSRMLS_DC)
|
||||
return str_length;
|
||||
}
|
||||
|
||||
-static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
|
||||
+static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers)
|
||||
{
|
||||
sapi_header_struct *h;
|
||||
zend_llist_position pos;
|
||||
@@ -123,11 +134,7 @@ static int sapi_uwsgi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
|
||||
return SAPI_HEADER_SENT_SUCCESSFULLY;
|
||||
}
|
||||
|
||||
-#ifdef UWSGI_PHP7
|
||||
-static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes TSRMLS_DC)
|
||||
-#else
|
||||
-static int sapi_uwsgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
|
||||
-#endif
|
||||
+static size_t sapi_uwsgi_read_post(char *buffer, size_t count_bytes)
|
||||
{
|
||||
uint read_bytes = 0;
|
||||
|
||||
@@ -151,7 +158,7 @@ static int sapi_uwsgi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
|
||||
}
|
||||
|
||||
|
||||
-static char *sapi_uwsgi_read_cookies(TSRMLS_D)
|
||||
+static char *sapi_uwsgi_read_cookies()
|
||||
{
|
||||
uint16_t len = 0;
|
||||
struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
|
||||
@@ -164,55 +171,55 @@ static char *sapi_uwsgi_read_cookies(TSRMLS_D)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-static void sapi_uwsgi_register_variables(zval *track_vars_array TSRMLS_DC)
|
||||
+static void sapi_uwsgi_register_variables(zval *track_vars_array)
|
||||
{
|
||||
int i;
|
||||
struct wsgi_request *wsgi_req = (struct wsgi_request *) SG(server_context);
|
||||
- php_import_environment_variables(track_vars_array TSRMLS_CC);
|
||||
+ php_import_environment_variables(track_vars_array);
|
||||
|
||||
if (uphp.server_software) {
|
||||
if (!uphp.server_software_len) uphp.server_software_len = strlen(uphp.server_software);
|
||||
- php_register_variable_safe("SERVER_SOFTWARE", uphp.server_software, uphp.server_software_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("SERVER_SOFTWARE", uphp.server_software, uphp.server_software_len, track_vars_array);
|
||||
}
|
||||
else {
|
||||
- php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("SERVER_SOFTWARE", "uWSGI", 5, track_vars_array);
|
||||
}
|
||||
|
||||
for (i = 0; i < wsgi_req->var_cnt; i += 2) {
|
||||
php_register_variable_safe( estrndup(wsgi_req->hvec[i].iov_base, wsgi_req->hvec[i].iov_len),
|
||||
wsgi_req->hvec[i + 1].iov_base, wsgi_req->hvec[i + 1].iov_len,
|
||||
- track_vars_array TSRMLS_CC);
|
||||
+ track_vars_array);
|
||||
}
|
||||
|
||||
- php_register_variable_safe("PATH_INFO", wsgi_req->path_info, wsgi_req->path_info_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("PATH_INFO", wsgi_req->path_info, wsgi_req->path_info_len, track_vars_array);
|
||||
if (wsgi_req->query_string_len > 0) {
|
||||
- php_register_variable_safe("QUERY_STRING", wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("QUERY_STRING", wsgi_req->query_string, wsgi_req->query_string_len, track_vars_array);
|
||||
}
|
||||
|
||||
- php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
|
||||
- php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, wsgi_req->file_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("SCRIPT_NAME", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array);
|
||||
+ php_register_variable_safe("SCRIPT_FILENAME", wsgi_req->file, wsgi_req->file_len, track_vars_array);
|
||||
|
||||
- php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, wsgi_req->document_root_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("DOCUMENT_ROOT", wsgi_req->document_root, wsgi_req->document_root_len, track_vars_array);
|
||||
|
||||
if (wsgi_req->path_info_len) {
|
||||
char *path_translated = ecalloc(1, wsgi_req->file_len + wsgi_req->path_info_len + 1);
|
||||
|
||||
memcpy(path_translated, wsgi_req->file, wsgi_req->file_len);
|
||||
memcpy(path_translated + wsgi_req->file_len, wsgi_req->path_info, wsgi_req->path_info_len);
|
||||
- php_register_variable_safe("PATH_TRANSLATED", path_translated, wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("PATH_TRANSLATED", path_translated, wsgi_req->file_len + wsgi_req->path_info_len , track_vars_array);
|
||||
}
|
||||
else {
|
||||
- php_register_variable_safe("PATH_TRANSLATED", "", 0, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("PATH_TRANSLATED", "", 0, track_vars_array);
|
||||
}
|
||||
|
||||
- php_register_variable_safe("PHP_SELF", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array TSRMLS_CC);
|
||||
+ php_register_variable_safe("PHP_SELF", wsgi_req->script_name, wsgi_req->script_name_len, track_vars_array);
|
||||
|
||||
struct uwsgi_string_list *usl = uphp.vars;
|
||||
while(usl) {
|
||||
char *equal = strchr(usl->value, '=');
|
||||
if (equal) {
|
||||
php_register_variable_safe( estrndup(usl->value, equal-usl->value),
|
||||
- equal+1, strlen(equal+1), track_vars_array TSRMLS_CC);
|
||||
+ equal+1, strlen(equal+1), track_vars_array);
|
||||
}
|
||||
usl = usl->next;
|
||||
}
|
||||
@@ -253,10 +260,7 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) {
|
||||
char *name = usl->value;
|
||||
char *strval = equal + 1;
|
||||
equal = NULL;
|
||||
-#ifndef UWSGI_PHP7
|
||||
- name_len = name_len + 1;
|
||||
-#endif
|
||||
- zend_register_string_constant(name, name_len, strval, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
|
||||
+ zend_register_string_constant(name, name_len, strval, CONST_CS | CONST_PERSISTENT, module_number);
|
||||
}
|
||||
usl = usl->next;
|
||||
}
|
||||
@@ -264,11 +268,7 @@ PHP_MINIT_FUNCTION(uwsgi_php_minit) {
|
||||
}
|
||||
|
||||
PHP_FUNCTION(uwsgi_version) {
|
||||
-#ifdef UWSGI_PHP7
|
||||
RETURN_STRING(UWSGI_VERSION);
|
||||
-#else
|
||||
- RETURN_STRING(UWSGI_VERSION, 1);
|
||||
-#endif
|
||||
}
|
||||
|
||||
PHP_FUNCTION(uwsgi_worker_id) {
|
||||
@@ -285,11 +285,11 @@ PHP_FUNCTION(uwsgi_masterpid) {
|
||||
PHP_FUNCTION(uwsgi_cache_exists) {
|
||||
|
||||
char *key = NULL;
|
||||
- int keylen = 0;
|
||||
+ php_strlen_size keylen = 0;
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -303,9 +303,9 @@ PHP_FUNCTION(uwsgi_cache_exists) {
|
||||
PHP_FUNCTION(uwsgi_cache_clear) {
|
||||
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -318,13 +318,13 @@ PHP_FUNCTION(uwsgi_cache_clear) {
|
||||
|
||||
|
||||
PHP_FUNCTION(uwsgi_cache_del) {
|
||||
-
|
||||
+
|
||||
char *key = NULL;
|
||||
- int keylen = 0;
|
||||
+ php_strlen_size keylen = 0;
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -338,15 +338,15 @@ PHP_FUNCTION(uwsgi_cache_del) {
|
||||
PHP_FUNCTION(uwsgi_cache_get) {
|
||||
|
||||
char *key = NULL;
|
||||
- int keylen = 0;
|
||||
+ php_strlen_size keylen = 0;
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
uint64_t valsize;
|
||||
|
||||
if (!uwsgi.caches)
|
||||
RETURN_NULL();
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -354,28 +354,24 @@ PHP_FUNCTION(uwsgi_cache_get) {
|
||||
if (value) {
|
||||
char *ret = estrndup(value, valsize);
|
||||
free(value);
|
||||
-#ifdef UWSGI_PHP7
|
||||
RETURN_STRING(ret);
|
||||
-#else
|
||||
- RETURN_STRING(ret, 0);
|
||||
-#endif
|
||||
}
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
PHP_FUNCTION(uwsgi_cache_set) {
|
||||
char *key = NULL;
|
||||
- int keylen;
|
||||
+ php_strlen_size keylen = 0;
|
||||
char *value = NULL;
|
||||
- int vallen;
|
||||
- uint64_t expires = 0;
|
||||
+ php_strlen_size vallen = 0;
|
||||
+ php_long_size expires = 0;
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
|
||||
if (!uwsgi.caches)
|
||||
RETURN_NULL();
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -388,17 +384,17 @@ PHP_FUNCTION(uwsgi_cache_set) {
|
||||
|
||||
PHP_FUNCTION(uwsgi_cache_update) {
|
||||
char *key = NULL;
|
||||
- int keylen;
|
||||
+ php_strlen_size keylen = 0;
|
||||
char *value = NULL;
|
||||
- int vallen;
|
||||
- uint64_t expires = 0;
|
||||
+ php_strlen_size vallen = 0;
|
||||
+ php_long_size expires = 0;
|
||||
char *cache = NULL;
|
||||
- int cachelen = 0;
|
||||
+ php_strlen_size cachelen = 0;
|
||||
|
||||
if (!uwsgi.caches)
|
||||
RETURN_NULL();
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -423,7 +419,7 @@ PHP_FUNCTION(uwsgi_rpc) {
|
||||
uint16_t argvs[256];
|
||||
uint64_t size = 0;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &varargs, &num_args) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &varargs, &num_args) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -462,11 +458,7 @@ PHP_FUNCTION(uwsgi_rpc) {
|
||||
// here we do not free varargs for performance reasons
|
||||
char *ret = estrndup(response, size);
|
||||
free(response);
|
||||
-#ifdef UWSGI_PHP7
|
||||
RETURN_STRING(ret);
|
||||
-#else
|
||||
- RETURN_STRING(ret, 0);
|
||||
-#endif
|
||||
}
|
||||
|
||||
clear:
|
||||
@@ -481,7 +473,7 @@ PHP_FUNCTION(uwsgi_setprocname) {
|
||||
char *name;
|
||||
int name_len;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -495,7 +487,7 @@ PHP_FUNCTION(uwsgi_signal) {
|
||||
long long_signum;
|
||||
uint8_t signum = 0;
|
||||
|
||||
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &long_signum) == FAILURE) {
|
||||
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &long_signum) == FAILURE) {
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
@@ -629,10 +621,12 @@ static int php_uwsgi_startup(sapi_module_struct *sapi_module)
|
||||
}
|
||||
}
|
||||
|
||||
-#if ((PHP_MAJOR_VERSION >= 7) && (PHP_MINOR_VERSION >= 1))
|
||||
+#if (PHP_MAJOR_VERSION >= 8)
|
||||
+static void sapi_uwsgi_log_message(const char *message, int syslog_type_int) {
|
||||
+#elif ((PHP_MAJOR_VERSION == 7) && (PHP_MINOR_VERSION >= 1))
|
||||
static void sapi_uwsgi_log_message(char *message, int syslog_type_int) {
|
||||
#else
|
||||
-static void sapi_uwsgi_log_message(char *message TSRMLS_DC) {
|
||||
+static void sapi_uwsgi_log_message(char *message) {
|
||||
#endif
|
||||
uwsgi_log("%s\n", message);
|
||||
}
|
||||
@@ -668,16 +662,32 @@ static sapi_module_struct uwsgi_sapi_module = {
|
||||
STANDARD_SAPI_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
-int uwsgi_php_init(void) {
|
||||
+static void uwsgi_php_init_mount(struct uwsgi_dyn_dict *mount_dict) {
|
||||
+ struct uwsgi_dyn_dict *udd = mount_dict;
|
||||
+ while (udd) {
|
||||
+ char *orig_dest = udd->value;
|
||||
+ udd->value = uwsgi_expand_path(udd->value, udd->vallen, NULL);
|
||||
+ udd->vallen = strlen(udd->value);
|
||||
+ if (!udd->value) {
|
||||
+ uwsgi_log("Unable to expand php mountpoint to %s\n", orig_dest);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ udd = udd->next;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int uwsgi_php_init(void) {
|
||||
|
||||
struct uwsgi_string_list *pset = uphp.set;
|
||||
struct uwsgi_string_list *append_config = uphp.append_config;
|
||||
|
||||
+ if (!uphp.sapi_initialized) {
|
||||
#ifdef ZTS
|
||||
- tsrm_startup(1, 1, 0, NULL);
|
||||
+ tsrm_startup(1, 1, 0, NULL);
|
||||
#endif
|
||||
-
|
||||
- sapi_startup(&uwsgi_sapi_module);
|
||||
+ sapi_startup(&uwsgi_sapi_module);
|
||||
+ uphp.sapi_initialized = 1;
|
||||
+ }
|
||||
|
||||
// applying custom options
|
||||
while(append_config) {
|
||||
@@ -705,13 +715,14 @@ int uwsgi_php_init(void) {
|
||||
uwsgi_log("unable to set php docroot to %s\n", orig_docroot);
|
||||
exit(1);
|
||||
}
|
||||
- uwsgi_log("PHP document root set to %s\n", uphp.docroot);
|
||||
- uphp.docroot_len = strlen(uphp.docroot);
|
||||
}
|
||||
|
||||
+ uwsgi_php_init_mount(uphp.mountpoint);
|
||||
+
|
||||
if (uphp.sapi_name) {
|
||||
uwsgi_sapi_module.name = uphp.sapi_name;
|
||||
}
|
||||
+
|
||||
uwsgi_sapi_module.startup(&uwsgi_sapi_module);
|
||||
uwsgi_log("PHP %s initialized\n", PHP_VERSION);
|
||||
|
||||
@@ -776,6 +787,33 @@ int uwsgi_php_walk(struct wsgi_request *wsgi_req, char *full_path, char *docroot
|
||||
|
||||
}
|
||||
|
||||
+static char *uwsgi_php_get_mount(char *path_info, uint16_t path_info_len, struct uwsgi_dyn_dict *mount_dict, int *discard_base) {
|
||||
+ int best_found = 0;
|
||||
+ struct uwsgi_dyn_dict *udd = mount_dict, *chosen = NULL;
|
||||
+
|
||||
+ while (udd) {
|
||||
+ if (mount_dict->vallen) {
|
||||
+ if (!uwsgi_starts_with(path_info, path_info_len, udd->key, udd->keylen)) {
|
||||
+ if (udd->keylen > best_found) {
|
||||
+ best_found = udd->keylen;
|
||||
+ chosen = udd;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ udd = udd->next;
|
||||
+ }
|
||||
+
|
||||
+ if (chosen) {
|
||||
+ *discard_base = chosen->keylen;
|
||||
+ if (chosen->key[chosen->keylen-1] == '/') {
|
||||
+ *discard_base = *discard_base - 1;
|
||||
+ }
|
||||
+ return chosen->value;
|
||||
+ } else {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
|
||||
int uwsgi_php_request(struct wsgi_request *wsgi_req) {
|
||||
|
||||
@@ -788,10 +826,6 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
|
||||
|
||||
zend_file_handle file_handle;
|
||||
|
||||
-#ifdef ZTS
|
||||
- TSRMLS_FETCH();
|
||||
-#endif
|
||||
-
|
||||
SG(server_context) = (void *) wsgi_req;
|
||||
|
||||
if (uwsgi_parse_vars(wsgi_req)) {
|
||||
@@ -801,7 +835,15 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
|
||||
char *orig_path_info = wsgi_req->path_info;
|
||||
uint16_t orig_path_info_len = wsgi_req->path_info_len;
|
||||
|
||||
- if (uphp.docroot) {
|
||||
+ int discard_base = 0;
|
||||
+
|
||||
+ char *mount_docroot = uwsgi_php_get_mount(wsgi_req->path_info, wsgi_req->path_info_len, uphp.mountpoint, &discard_base);
|
||||
+
|
||||
+ if (mount_docroot) {
|
||||
+ wsgi_req->document_root = mount_docroot;
|
||||
+ wsgi_req->path_info = wsgi_req->path_info+discard_base;
|
||||
+ wsgi_req->path_info_len = wsgi_req->path_info_len-discard_base;
|
||||
+ } else if (uphp.docroot) {
|
||||
wsgi_req->document_root = uphp.docroot;
|
||||
}
|
||||
// fallback to cwd
|
||||
@@ -833,7 +875,8 @@ int uwsgi_php_request(struct wsgi_request *wsgi_req) {
|
||||
}
|
||||
#endif
|
||||
|
||||
- strcpy(real_filename, uphp.app);
|
||||
+ strncpy(real_filename, uphp.app, PATH_MAX);
|
||||
+ real_filename[PATH_MAX-1] = '\0';
|
||||
if (wsgi_req->path_info_len == 1 && wsgi_req->path_info[0] == '/') {
|
||||
goto appready;
|
||||
}
|
||||
@@ -926,7 +969,6 @@ oldstyle:
|
||||
free(filename);
|
||||
real_filename_len = strlen(real_filename);
|
||||
|
||||
- // first check for valid doc roots
|
||||
if (uphp.allowed_docroot) {
|
||||
struct uwsgi_string_list *usl = uphp.allowed_docroot;
|
||||
while(usl) {
|
||||
@@ -939,16 +981,6 @@ oldstyle:
|
||||
uwsgi_log("PHP security error: %s is not under an allowed docroot\n", real_filename);
|
||||
return -1;
|
||||
}
|
||||
- // then for default docroot (if any)
|
||||
- else if (uphp.docroot)
|
||||
- {
|
||||
- if (!uwsgi_starts_with(real_filename, real_filename_len, uphp.docroot, uphp.docroot_len)) {
|
||||
- goto secure;
|
||||
- }
|
||||
- uwsgi_403(wsgi_req);
|
||||
- uwsgi_log("PHP security error: %s is not under the default docroot\n", real_filename);
|
||||
- return -1;
|
||||
- }
|
||||
|
||||
secure:
|
||||
|
||||
@@ -1065,7 +1097,7 @@ secure3:
|
||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||
file_handle.filename = real_filename;
|
||||
|
||||
- if (php_request_startup(TSRMLS_C) == FAILURE) {
|
||||
+ if (php_request_startup() == FAILURE) {
|
||||
uwsgi_500(wsgi_req);
|
||||
return -1;
|
||||
}
|
||||
@@ -1073,13 +1105,13 @@ secure3:
|
||||
struct uwsgi_string_list *usl=NULL;
|
||||
|
||||
uwsgi_foreach(usl, uphp.exec_before) {
|
||||
- if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec before", 1 TSRMLS_CC) == FAILURE) goto end;
|
||||
+ if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec before", 1) == FAILURE) goto end;
|
||||
}
|
||||
|
||||
- php_execute_script(&file_handle TSRMLS_CC);
|
||||
+ php_execute_script(&file_handle);
|
||||
|
||||
uwsgi_foreach(usl, uphp.exec_after) {
|
||||
- if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec after", 1 TSRMLS_CC) == FAILURE) goto end;
|
||||
+ if (zend_eval_string_ex(usl->value, NULL, "uWSGI php exec after", 1) == FAILURE) goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
diff --git c/plugins/php/session.c w/plugins/php/session.c
|
||||
index 2312b6b9..cce06985 100644
|
||||
--- c/plugins/php/session.c
|
||||
+++ w/plugins/php/session.c
|
||||
@@ -12,34 +12,20 @@ PS_CLOSE_FUNC(uwsgi) {
|
||||
PS_READ_FUNC(uwsgi) {
|
||||
char *cache = PS_GET_MOD_DATA();
|
||||
uint64_t valsize = 0;
|
||||
-#ifdef UWSGI_PHP7
|
||||
char *value = uwsgi_cache_magic_get(key->val, key->len , &valsize, NULL, cache);
|
||||
-#else
|
||||
- char *value = uwsgi_cache_magic_get((char *)key, strlen((char *)key), &valsize, NULL, cache);
|
||||
-#endif
|
||||
- if (!value) return FAILURE;
|
||||
-#ifdef UWSGI_PHP7
|
||||
+ if (!value) {
|
||||
+ *val = STR_EMPTY_ALLOC();
|
||||
+ return SUCCESS;
|
||||
+ }
|
||||
*val = zend_string_init(value, valsize, 0);
|
||||
-#else
|
||||
- char *new_val = emalloc(valsize);
|
||||
- memcpy(new_val, value, valsize);
|
||||
- free(value);
|
||||
- *val = new_val;
|
||||
- *vallen = valsize;
|
||||
-#endif
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
PS_WRITE_FUNC(uwsgi) {
|
||||
char *cache = PS_GET_MOD_DATA();
|
||||
-#ifdef UWSGI_PHP7
|
||||
if (val->len == 0) return SUCCESS;
|
||||
if (!uwsgi_cache_magic_set(key->val, key->len, val->val, val->len, 0, UWSGI_CACHE_FLAG_UPDATE, cache)) {
|
||||
-#else
|
||||
- if (vallen == 0) return SUCCESS;
|
||||
- if (!uwsgi_cache_magic_set((char *)key, strlen(key), (char *)val, vallen, 0, UWSGI_CACHE_FLAG_UPDATE, cache)) {
|
||||
-#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE;
|
||||
@@ -47,11 +33,10 @@ PS_WRITE_FUNC(uwsgi) {
|
||||
|
||||
PS_DESTROY_FUNC(uwsgi) {
|
||||
char *cache = PS_GET_MOD_DATA();
|
||||
-#ifdef UWSGI_PHP7
|
||||
+ if (!uwsgi_cache_magic_exists(key->val, key->len, cache))
|
||||
+ return SUCCESS;
|
||||
+
|
||||
if (!uwsgi_cache_magic_del(key->val, key->len, cache)) {
|
||||
-#else
|
||||
- if (!uwsgi_cache_magic_del((char *)key, strlen(key), cache)) {
|
||||
-#endif
|
||||
return SUCCESS;
|
||||
}
|
||||
return FAILURE;
|
||||
diff --git c/plugins/php/uwsgiplugin.py w/plugins/php/uwsgiplugin.py
|
||||
index d930c44e..8657eb70 100644
|
||||
--- c/plugins/php/uwsgiplugin.py
|
||||
+++ w/plugins/php/uwsgiplugin.py
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
-NAME='php'
|
||||
+NAME = 'php'
|
||||
|
||||
ld_run_path = None
|
||||
PHPPATH = 'php-config'
|
|
@ -1,66 +0,0 @@
|
|||
diff --git a/plugins/jvm/uwsgiplugin.py b/plugins/jvm/uwsgiplugin.py
|
||||
index ac7eb3e..0911288 100644
|
||||
--- a/plugins/jvm/uwsgiplugin.py
|
||||
+++ b/plugins/jvm/uwsgiplugin.py
|
||||
@@ -59,11 +59,6 @@ if "-framework JavaVM" in JVM_LIBPATH:
|
||||
|
||||
GCC_LIST = ['jvm_plugin']
|
||||
|
||||
-if 'LD_RUN_PATH' in os.environ:
|
||||
- os.environ['LD_RUN_PATH'] += ':' + JVM_LIBPATH[0][2:]
|
||||
-else:
|
||||
- os.environ['LD_RUN_PATH'] = JVM_LIBPATH[0][2:]
|
||||
-
|
||||
def post_build(config):
|
||||
if os.system("javac %s/plugins/jvm/uwsgi.java" % os.getcwd()) != 0:
|
||||
os._exit(1)
|
||||
diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py
|
||||
index fb9e5bb..fd12c91 100644
|
||||
--- a/plugins/php/uwsgiplugin.py
|
||||
+++ b/plugins/php/uwsgiplugin.py
|
||||
@@ -22,7 +22,6 @@ CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip(), '-Wno-error=sign-co
|
||||
LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split()
|
||||
if ld_run_path:
|
||||
LDFLAGS.append('-L%s' % ld_run_path)
|
||||
- os.environ['LD_RUN_PATH'] = ld_run_path
|
||||
|
||||
LIBS = [os.popen(PHPPATH + ' --libs').read().rstrip(), '-lphp5']
|
||||
|
||||
diff --git a/plugins/python/uwsgiplugin.py b/plugins/python/uwsgiplugin.py
|
||||
index c4f03e1..8d4b2e0 100644
|
||||
--- a/plugins/python/uwsgiplugin.py
|
||||
+++ b/plugins/python/uwsgiplugin.py
|
||||
@@ -45,10 +45,8 @@ if not 'UWSGI_PYTHON_NOLIB' in os.environ:
|
||||
else:
|
||||
try:
|
||||
LDFLAGS.append("-L%s" % sysconfig.get_config_var('LIBDIR'))
|
||||
- os.environ['LD_RUN_PATH'] = "%s" % (sysconfig.get_config_var('LIBDIR'))
|
||||
except:
|
||||
LDFLAGS.append("-L%s/lib" % sysconfig.PREFIX)
|
||||
- os.environ['LD_RUN_PATH'] = "%s/lib" % sysconfig.PREFIX
|
||||
|
||||
LIBS.append('-lpython%s' % get_python_version())
|
||||
else:
|
||||
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
|
||||
index 8dee214..2375bc9 100644
|
||||
--- a/plugins/rack/uwsgiplugin.py
|
||||
+++ b/plugins/rack/uwsgiplugin.py
|
||||
@@ -44,7 +44,6 @@ LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LIBS']\""
|
||||
|
||||
if has_shared == 'yes':
|
||||
LDFLAGS.append('-L' + libpath )
|
||||
- os.environ['LD_RUN_PATH'] = libpath
|
||||
LIBS.append(os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip())
|
||||
else:
|
||||
GCC_LIST.append("%s/%s" % (libpath, os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LIBRUBY_A']\"" % rbconfig).read().rstrip()))
|
||||
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
|
||||
index ecea48d..4f35984 100644
|
||||
--- a/plugins/ruby19/uwsgiplugin.py
|
||||
+++ b/plugins/ruby19/uwsgiplugin.py
|
||||
@@ -40,6 +40,5 @@ LDFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['LDFLAG
|
||||
|
||||
libpath = os.popen(RUBYPATH + " -e \"require 'rbconfig';print %s::CONFIG['libdir']\"" % rbconfig).read().rstrip()
|
||||
LDFLAGS.append('-L' + libpath )
|
||||
-os.environ['LD_RUN_PATH'] = libpath
|
||||
LIBS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print '-l' + %s::CONFIG['RUBY_SO_NAME']\"" % rbconfig).read().rstrip().split()
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
diff --git a/uwsgiconfig.py b/uwsgiconfig.py
|
||||
index e447123..4d55f2c 100644
|
||||
--- a/uwsgiconfig.py
|
||||
+++ b/uwsgiconfig.py
|
||||
@@ -1129,10 +1129,7 @@ def build_plugin(path, uc, cflags, ldflags, libs, name = None):
|
||||
except:
|
||||
pass
|
||||
|
||||
- if uc:
|
||||
- plugin_dest = uc.get('plugin_build_dir', uc.get('plugin_dir')) + '/' + name + '_plugin'
|
||||
- else:
|
||||
- plugin_dest = name + '_plugin'
|
||||
+ plugin_dest = name + '_plugin'
|
||||
|
||||
shared_flag = '-shared'
|
||||
|
Loading…
Reference in a new issue