aboutsummaryrefslogtreecommitdiffstats
path: root/main/uwsgi/APKBUILD
blob: 84c832f905bcf4e6275f2795714ee0bed53d4992 (plain) (blame)
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.1
pkgrel=1
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="e9ec5b2b296ce21b3787e0579d02bade  uwsgi-2.0.13.1.tar.gz
6b285debf97aac42f6c1289f3625017e  uwsgi.initd
3d6afe6a8c52556d1d6c52384fc38d9a  uwsgi.confd
98407f45c566a2c39a34b882e1ac9fe4  alpine.buildconf
87c16f6fe482c9b0eac0d33c51873f45  musl-fix-python.patch"
sha256sums="2eca0c2f12ab76f032154cd147f4d5957d3195a022678d59cb507f4995a48d7f  uwsgi-2.0.13.1.tar.gz
9463bd286fa3cae72e65037766c3fe2847d10f95c7e920de16b2046b971c3799  uwsgi.initd
4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb2ef150cacf8425c  uwsgi.confd
31fc9c17f17aa067c3b025a3f7a84c6102d24368afcbc237f3d58041083c0875  alpine.buildconf
3838e8e3926a1f6271bb5aa88d309837a3bcd06cd570c499b72ca549326c682e  musl-fix-python.patch"
sha512sums="f85ecc34cfa6c24476475996a16432f9ebd8563e4e9866392dbbf5beebec909b50634651d822bdad54bbae886c913c1502edbf04766bba94138330d46798046d  uwsgi-2.0.13.1.tar.gz
00a7e3ce888724716d1245eb7676062c5270098ea0429a12c82623db0806bb098872df7ebda38ad5ae796d8ac34d23f71d67af76ddce82f3669565ff034c1a2c  uwsgi.initd
9f00afb2aa574bbc59040f945475712b8c40da0c06eeb5699de5510aa116148e35ab0429fa891084cf0cd7868876d5a80e1601b7c85d0e2e9ea2a1f54cdde619  uwsgi.confd
f3cff00926929a5bb40afafb65fd5228582af35fbf524562282020c4c4ae9c659231b2381f4b3cceb18e8f3f6c888c21bdd8ed4ddcd81e92fbc6a0891800ce38  alpine.buildconf
de68b16b44e554a79c073c9befa10566796316dbf4c375b4d6b633d80b0282694cca233f0a70f3d6570584324f14276826bbeb8f38b550c00087a05f9ba9227f  musl-fix-python.patch"