aboutsummaryrefslogtreecommitdiffstats
path: root/testing/uwsgi/APKBUILD
blob: 6c74451b6f5f390575441e23b7fa6f656e2a459c (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
100
101
102
103
104
105
# Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=uwsgi
pkgver=2.0
pkgrel=0
pkgdesc="uWSGI application container server"
url=http://projects.unbit.it/uwsgi/
arch=all
license=GPL-2
makedepends="linux-headers lua5.2-dev python python-dev zeromq-dev paxctl
	pcre-dev"
source="http://projects.unbit.it/downloads/uwsgi-${pkgver}.tar.gz
	uwsgi.initd uwsgi.confd
	0001-core-socket-common-socket-creation-function-for-bind.patch
	0002-core-socket-move-socket-buffer-size-setting-to-creat.patch
	0003-core-socket-move-listen-queue-size-checking-to-creat.patch
	0004-core-socket-move-SO_REUSEADDR-setting-to-create_serv.patch
	0005-option-for-closing-server-sockets-when-spawning.patch
	"

_plugins="lua python router_uwsgi"
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
}

build() {
	cd "$_builddir"
	export CFLAGS=-D_GNU_SOURCE

	msg "building core"
	python uwsgiconfig.py --build core || return 1

	export UWSGICONFIG_LUAPC="lua5.2"
	for i in $_plugins; do
		msg "building $i plugin"
		python uwsgiconfig.py --plugin plugins/$i core || 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
	paxctl -czxm "$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="e4ab884be53a18c40975da1f9f14ef3d  uwsgi-2.0.tar.gz
8a8be061d7b5f3108a0f16813da68389  uwsgi.initd
3d6afe6a8c52556d1d6c52384fc38d9a  uwsgi.confd
cc169ef121e428c85551c470640220b4  0001-core-socket-common-socket-creation-function-for-bind.patch
e4a8c9ff5826b752c046cf1e35190a6f  0002-core-socket-move-socket-buffer-size-setting-to-creat.patch
fa18c76cca3020fee9ce6cb3cebe6ef3  0003-core-socket-move-listen-queue-size-checking-to-creat.patch
9c381a6ed3ca0efad0a1640bdd19793e  0004-core-socket-move-SO_REUSEADDR-setting-to-create_serv.patch
b5d18b3642a6b671f4a8e7531fbb0670  0005-option-for-closing-server-sockets-when-spawning.patch"
sha256sums="297073c85dc7a6b104f6367778cf7604bedd685a977b320b36dd46b0b11a8af0  uwsgi-2.0.tar.gz
58b998b025e4a9df20ca917bc93e287f9a8cf02d278d513fa461f70e1d08f799  uwsgi.initd
4cb047e311aecd0f498da1d6a4c0947dd6dc7cc98575d54cb2ef150cacf8425c  uwsgi.confd
b986e7d72ad246bdff01c18129e9e12cde88fe4c53aacd6550c6ab32a16dcc1b  0001-core-socket-common-socket-creation-function-for-bind.patch
445a145f48d79b808d0d2664d23fb9c8bcb5836cc00967e03387e8698681074b  0002-core-socket-move-socket-buffer-size-setting-to-creat.patch
96d782e52b9edf835c6aa71c4ffc79e90f20022cf16dc2f0f9bf628a4aefd2fe  0003-core-socket-move-listen-queue-size-checking-to-creat.patch
63c3775d20cd1905bda1c086132fa10a0b70e9c80513f854d09342c071f5b3cd  0004-core-socket-move-SO_REUSEADDR-setting-to-create_serv.patch
135927e845ea5405cb11894f9a2989ac425db9a3b4242f7d1a916c47a163cb7a  0005-option-for-closing-server-sockets-when-spawning.patch"
sha512sums="ee4b3602749b5b0352717001a6ea3d252c80f2d0d0b8ac0c21b3fbb49df7ff911f4211a1cb6f23afe1716f1b3a6f856236b6cd48a0f82d618a6d52dbf13f13b3  uwsgi-2.0.tar.gz
ab9dc6277bd05821287f6f8beb3ac2504f0e41db38e11b4d2884ac026f14ac7bfaaca138f045afa712d4f2843f94de105bf0d43fad35d18679ac33b507cd187e  uwsgi.initd
9f00afb2aa574bbc59040f945475712b8c40da0c06eeb5699de5510aa116148e35ab0429fa891084cf0cd7868876d5a80e1601b7c85d0e2e9ea2a1f54cdde619  uwsgi.confd
50828a048384aa5e71832e135f295cc44b39887c4adc22c273328726a10803c914da1d113d6dfbcd54058ed46ce9affd24219de4e21f91f8bb383926ffa29cc1  0001-core-socket-common-socket-creation-function-for-bind.patch
41662a2f92b38788b3b7f4057ba5ec645dc448ca804c00b762997badd3652209a5edb853b2cbc43e5ed3a78e956c57c66c5f648406f0b775d018c84c756b69a2  0002-core-socket-move-socket-buffer-size-setting-to-creat.patch
112e5702d89ed9a9bcbf1ae69f68faf14f50837f787c9dc219fa16c8e55c94db2e668c735cb5220bcb1c7349b1b4da0479d72e2dfe1609c7ad38418e7b49106f  0003-core-socket-move-listen-queue-size-checking-to-creat.patch
4ea108f19174b00146f9948b7c9e3272299c7e2cbfaf339753866971e94d8ccf6ba914d2a6d5064f32a33424b97099aac97c31bee3b5eba64bee7bd321c2a8ad  0004-core-socket-move-SO_REUSEADDR-setting-to-create_serv.patch
d04869f43bd91c8117698f4ff9f775766afef7b9849b757dc43357a247e09d903b6b6561391d86bfcfda75f84c7924f5b5df7f5091c32dac0ce15634f69c4659  0005-option-for-closing-server-sockets-when-spawning.patch"