aboutsummaryrefslogtreecommitdiffstats
path: root/main/uwsgi/APKBUILD
blob: 85fca0d3e1f19c5dab48c26a5a4b1f2451f2fa67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=uwsgi
pkgver=2.0.13
pkgrel=0
pkgdesc="uWSGI application container server"
url=http://projects.unbit.it/uwsgi/
arch=all
license=GPL2
depends=mailcap
makedepends="linux-headers lua5.2-dev python python-dev zeromq-dev paxmark
	pcre-dev"
source="http://projects.unbit.it/downloads/uwsgi-${pkgver}.tar.gz
	uwsgi.initd uwsgi.confd
	alpine.buildconf

	musl-fix-python.patch
	"

_plugins="lua python router_uwsgi cgi"
subpackages=""
for _p in $_plugins ; do
	subpackages="$subpackages uwsgi-$_p:_$_p"
done

_builddir=$srcdir/$pkgname-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	cp "$srcdir"/alpine.buildconf buildconf/alpine.ini || return 1
}

build() {
	cd "$_builddir"

	msg "building core"
	# ccache seems to trigger some weird bug on musl
	CC="gcc" python uwsgiconfig.py --build alpine || return 1

	export UWSGICONFIG_LUAPC="lua5.2"
	for i in ${_plugins}; do
		msg "building $i plugin"
		python uwsgiconfig.py --plugin plugins/$i alpine || return 1
	done
}

package() {
	cd "$_builddir"

	local bindir=$pkgdir/usr/sbin
	install -d "$bindir"
	install uwsgi "$bindir"

	local libdir=$pkgdir/usr/lib/uwsgi
	install -d "$libdir"
	install *_plugin.so "$libdir"

	install -Dm755 "$srcdir"/uwsgi.initd \
		"$pkgdir"/etc/init.d/uwsgi || return 1
	install -Dm644 "$srcdir"/uwsgi.confd \
		"$pkgdir"/etc/conf.d/uwsgi || return 1

	# disable emutramp/mprotect, this is needed for luajit and cffi
	paxmark -em "$bindir"/uwsgi
}

_plugin() {
	depends=uwsgi
	mkdir -p "$subpkgdir"/usr/lib/uwsgi
	mv "$pkgdir/usr/lib/uwsgi/$1_plugin.so" "$subpkgdir/usr/lib/uwsgi" || return 1
}

for _p in $_plugins; do
	eval "_$_p() { _plugin $_p; }"
done

md5sums="5c2e93fc01796a26e418144064a3e396  uwsgi-2.0.13.tar.gz
23b476a8ad6aab93b162e8eeec50c859  uwsgi.initd
3d6afe6a8c52556d1d6c52384fc38d9a  uwsgi.confd
98407f45c566a2c39a34b882e1ac9fe4  alpine.buildconf
87c16f6fe482c9b0eac0d33c51873f45  musl-fix-python.patch"
sha256sums="038ba9c21ad71ab02a5b966b95ee8627af0aa4966e066865f7063a0ab1c0305e  uwsgi-2.0.13.tar.gz
df99bc13609a526432afaeb16661086c73f49394e069a19ccb7423bbd025168f  uwsgi.initd
4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb2ef150cacf8425c  uwsgi.confd
31fc9c17f17aa067c3b025a3f7a84c6102d24368afcbc237f3d58041083c0875  alpine.buildconf
3838e8e3926a1f6271bb5aa88d309837a3bcd06cd570c499b72ca549326c682e  musl-fix-python.patch"
sha512sums="f43b4b2219109ac444436d35a336c58a1b9038f964bf59e0db485193820d35a6c365e40562b459e7e0fc5bfdbfde56996f50632fad1461fb6f1e8a83501d35ba  uwsgi-2.0.13.tar.gz
5d8eadba7c6ee17f86c3dbb6b7c98131ecf9db173156e3196909550954dd09be2191285f46fd4e558f0c47a0cbe7831cde71d3d4c63862d11b819660cc418131  uwsgi.initd
9f00afb2aa574bbc59040f945475712b8c40da0c06eeb5699de5510aa116148e35ab0429fa891084cf0cd7868876d5a80e1601b7c85d0e2e9ea2a1f54cdde619  uwsgi.confd
f3cff00926929a5bb40afafb65fd5228582af35fbf524562282020c4c4ae9c659231b2381f4b3cceb18e8f3f6c888c21bdd8ed4ddcd81e92fbc6a0891800ce38  alpine.buildconf
de68b16b44e554a79c073c9befa10566796316dbf4c375b4d6b633d80b0282694cca233f0a70f3d6570584324f14276826bbeb8f38b550c00087a05f9ba9227f  musl-fix-python.patch"