Skip to content

Commit

Permalink
addpkg: libx32-uwsgi 2.0.12-2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Jan 21, 2016
1 parent e3f1b5c commit 83cf618
Show file tree
Hide file tree
Showing 11 changed files with 295 additions and 0 deletions.
103 changes: 103 additions & 0 deletions libx32-uwsgi/PKGBUILD
@@ -0,0 +1,103 @@
# $Id: PKGBUILD 155634 2016-01-07 10:12:28Z svenstaro $
# Maintainer: Daniel Wallace <danielwallace at gtmanfred dot com>
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Valentin Hăloiu <vially.ichb+aur@gmail.com>
# Contributor: Angel Velasquez <angvp@archlinux.org>
# Contributor: Kevin Zuber <uKev@knet.eu>
# Contributor: Vsevolod Balashov <vsevolod@balashov.name>
# Contributor: David Runge <dave@sleepmap.de>

_pkgbasename=uwsgi
pkgbase=libx32-uwsgi
pkgname=(libx32-uwsgi
libx32-uwsgi-plugin-cgi
libx32-uwsgi-plugin-python
libx32-uwsgi-plugin-webdav)
pkgver=2.0.12
pkgrel=2.1
arch=(x86_64)
url="http://projects.unbit.it/$_pkgbasename"
license=(GPL2)
backup=('etc/uwsgi/emperor-x32.ini')
makedepends=(gcc-multilib-x32 libx32-python libx32-python-greenlet libx32-libxml2 libx32-libyaml
libx32-pcre libx32-openssl libx32-bzip2 libx32-pam
libx32-jansson libx32-systemd)
source=(http://projects.unbit.it/downloads/$_pkgbasename-$pkgver.tar.gz
archlinux.ini
uwsgi_at.service
uwsgi_at.socket
uwsgi_ruby20_compatibility.patch
uwsgi_trick_chroot.patch
emperor.ini
emperor.uwsgi.service
emperor.uwsgi.socket)

md5sums=('1451cab954bad0d7d7429e4d2c84b5df'
'e069992a7e9aa86534d89a333b1ec2d7'
'8f3231b89b2cdc3802c2b14fa70a6ba1'
'e4e20c976e476f5560dc24f0b16991f1'
'4d09535ce379c8acd76160f35d5d6b55'
'0c09a52fdb88f08c36a8b380f451ce6d'
'5fa14ddea9a3dae17b5be28468d47b80'
'f51c2e8f8c87a9c19b00b3bb79d6da50'
'f726795b7beb92bf9e62cab8fcbf8c8f')

prepare() {
cd $srcdir/$_pkgbasename-$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
}

build() {
pushd $srcdir/$_pkgbasename-$pkgver

python-x32 uwsgiconfig.py --build archlinux
python-x32 uwsgiconfig.py --plugin plugins/python archlinux python
python-x32 uwsgiconfig.py --plugin plugins/greenlet archlinux greenlet
python-x32 uwsgiconfig.py --plugin plugins/asyncio archlinux asyncio

#pushd $srcdir/$_pkgbasename-$pkgver/apache2
#/usr/bin/apxs -c mod_proxy_uwsgi.c
}

package_libx32-uwsgi() {
pkgdesc="A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C (x32 ABI)"
depends=(uwsgi libx32-libxml2 libx32-jansson libx32-libyaml libx32-systemd libx32-libcap libx32-pam libx32-util-linux libx32-openssl libx32-pcre)
install=uwsgi.install
cd $srcdir/$_pkgbasename-$pkgver
install -Dm755 uwsgi $pkgdir/usr/bin/uwsgi-x32
install -Dm644 $srcdir/uwsgi_at.service $pkgdir/usr/lib/systemd/system/uwsgi-x32@.service
install -Dm644 $srcdir/uwsgi_at.socket $pkgdir/usr/lib/systemd/system/uwsgi-x32@.socket
install -Dm644 $srcdir/emperor.uwsgi.service $pkgdir/usr/lib/systemd/system/emperor.uwsgi-x32.service
install -Dm644 $srcdir/emperor.uwsgi.socket $pkgdir/usr/lib/systemd/system/emperor.uwsgi-x32.socket
install -Dm644 $srcdir/emperor.ini $pkgdir/etc/uwsgi/emperor-x32.ini
}

package_libx32-uwsgi-plugin-cgi() {
depends=(libx32-uwsgi)
pkgdesc="CGI plugin (x32 ABI)"
install -Dm755 $_pkgbasename-$pkgver/cgi_plugin.so $pkgdir/usr/libx32/uwsgi/cgi_plugin.so
}

package_libx32-uwsgi-plugin-python() {
depends=(libx32-uwsgi libx32-python libx32-python-greenlet)
pkgdesc="Plugin for Python support (x32 ABI)"
install -Dm755 $_pkgbasename-$pkgver/python_plugin.so $pkgdir/usr/libx32/uwsgi/python_plugin.so
install -Dm755 $_pkgbasename-$pkgver/greenlet_plugin.so $pkgdir/usr/libx32/uwsgi/greenlet_plugin.so
install -Dm755 $_pkgbasename-$pkgver/asyncio_plugin.so $pkgdir/usr/libx32/uwsgi/asyncio_plugin.so
install -Dm644 $_pkgbasename-$pkgver/uwsgidecorators.py $pkgdir/usr/libx32/python3.5/site-packages/uwsgidecorators.py
python -m compileall $pkgdir/usr/libx32/python3.5/site-packages/
python -O -m compileall $pkgdir/usr/libx32/python3.5/site-packages/
}

package_libx32-uwsgi-plugin-webdav() {
depends=(libx32-uwsgi)
pkgdesc="Plugin for webdav support (x32 ABI)"
install -Dm755 $_pkgbasename-$pkgver/webdav_plugin.so $pkgdir/usr/libx32/uwsgi/webdav_plugin.so
}

5 changes: 5 additions & 0 deletions libx32-uwsgi/archlinux.ini
@@ -0,0 +1,5 @@
[uwsgi]
plugin_dir = /usr/libx32/uwsgi
plugins = cgi, webdav
main_plugin = systemd_logger,pam
inherit = base
4 changes: 4 additions & 0 deletions libx32-uwsgi/emperor.ini
@@ -0,0 +1,4 @@
[uwsgi]
emperor = /etc/uwsgi/vassals
uid = http
gid = http
16 changes: 16 additions & 0 deletions libx32-uwsgi/emperor.uwsgi.service
@@ -0,0 +1,16 @@
[Unit]
Description=uWSGI Emperor (x32 ABI)
After=syslog.target

[Service]
ExecStart=/usr/bin/uwsgi-x32 --ini /etc/uwsgi/emperor-x32.ini
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -INT $MAINPID
Restart=always
Type=notify
StandardError=syslog
NotifyAccess=all
KillSignal=SIGQUIT

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions libx32-uwsgi/emperor.uwsgi.socket
@@ -0,0 +1,9 @@
[Unit]
Description=Socket for uWSGI Emperor (x32 ABI)

[Socket]
# Change this to your uwsgi application port or unix socket location
ListenStream=/run/uwsgi/emperor-x32.sock

[Install]
WantedBy=sockets.target
9 changes: 9 additions & 0 deletions libx32-uwsgi/uwsgi.install
@@ -0,0 +1,9 @@
post_update(){
echo "To use uwsgi-x32@.socket and uwsgi-x32@.service:"
echo "\tAll you need to do is put the name of your .ini file after the @ sign"
echo "\tYou can use either the .socket or .service, but if you use the .socket"
echo "\tuwsgi@<sameinifile>.service won't be started until the first time your http"
echo "\tserver touches the socket. You will also not need to specify the socket in"
echo "\tthe .ini file or in the .service file. Systemd will handle listening to"
echo "\tthe socket for you."
}
16 changes: 16 additions & 0 deletions libx32-uwsgi/uwsgi_at.service
@@ -0,0 +1,16 @@
[Unit]
Description=uWSGI service unit (x32 ABI)
After=syslog.target

[Service]
ExecStart=/usr/bin/uwsgi-x32 --ini /etc/uwsgi/%I.ini
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/bin/kill -INT $MAINPID
Restart=always
Type=notify
StandardError=syslog
NotifyAccess=all
KillSignal=SIGQUIT

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions libx32-uwsgi/uwsgi_at.socket
@@ -0,0 +1,9 @@
[Unit]
Description=Socket for uWSGI %I (x32 ABI)

[Socket]
# Change this to your uwsgi application port or unix socket location
ListenStream=/run/uwsgi/%I.sock

[Install]
WantedBy=sockets.target
66 changes: 66 additions & 0 deletions libx32-uwsgi/uwsgi_fix_rpath.patch
@@ -0,0 +1,66 @@
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()

42 changes: 42 additions & 0 deletions libx32-uwsgi/uwsgi_ruby20_compatibility.patch
@@ -0,0 +1,42 @@
diff --git a/plugins/rack/uwsgiplugin.py b/plugins/rack/uwsgiplugin.py
index 2375bc9..b908417 100644
--- a/plugins/rack/uwsgiplugin.py
+++ b/plugins/rack/uwsgiplugin.py
@@ -10,13 +10,14 @@ except:
rbconfig = 'Config'

version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
-v = version.split('.')

GCC_LIST = ['rack_plugin', 'rack_api']

-if (v[0] == '1' and v[1] == '9') or v[0] >= '2':
+if version >= '1.9':
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
CFLAGS.append('-DRUBY19')
+ if version >= '2.0':
+ CFLAGS.append('-DRUBY20')
CFLAGS.append('-Wno-unused-parameter')
rbconfig = 'RbConfig'
else:
diff --git a/plugins/ruby19/uwsgiplugin.py b/plugins/ruby19/uwsgiplugin.py
index 4f35984..156018f 100644
--- a/plugins/ruby19/uwsgiplugin.py
+++ b/plugins/ruby19/uwsgiplugin.py
@@ -10,13 +10,14 @@ except:
rbconfig = 'Config'

version = os.popen(RUBYPATH + " -e \"print RUBY_VERSION\"").read().rstrip()
-v = version.split('.')

GCC_LIST = ['../rack/rack_plugin', '../rack/rack_api']

-if v[0] == '1' and v[1] == '9':
+if version >= '1.9':
CFLAGS = os.popen(RUBYPATH + " -e \"require 'rbconfig';print RbConfig::CONFIG['CFLAGS']\"").read().rstrip().split()
CFLAGS.append('-DRUBY19')
+ if version >= '2.0':
+ CFLAGS.append('-DRUBY20')
CFLAGS.append('-Wno-unused-parameter')
rbconfig = 'RbConfig'
else:
16 changes: 16 additions & 0 deletions libx32-uwsgi/uwsgi_trick_chroot.patch
@@ -0,0 +1,16 @@
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_dir') + '/' + name + '_plugin'
- else:
- plugin_dest = name + '_plugin'
+ plugin_dest = name + '_plugin'

shared_flag = '-shared'

0 comments on commit 83cf618

Please sign in to comment.