aboutsummaryrefslogtreecommitdiffstats
path: root/main/uwsgi/APKBUILD
blob: 2321cd6792dbcc8d35048b4bfcfda5fbc20aa8cb (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# 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.14
pkgrel=0
pkgdesc="uWSGI application container server"
url="http://projects.unbit.it/uwsgi/"
arch="all"
license="GPL2"
depends="mailcap"
install="uwsgi.pre-install"
pkgusers="uwsgi"
pkggroups="uwsgi"
makedepends="
	attr-dev
	curl-dev
	geoip-dev
	libcap-dev
	linux-headers
	linux-pam-dev
	libxml2-dev
	libxslt-dev
	lua5.2-dev
	paxmark
	pcre-dev
	postgresql-dev
	python
	python-dev
	python3-dev
	zeromq-dev
	zlib-dev
	"
source="http://projects.unbit.it/downloads/uwsgi-${pkgver}.tar.gz
	uwsgi.initd
	uwsgi.ini
	readme.emperor
	alpine.buildconf
	musl-fix-python.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

# Plugins for Python 2 or without compile dependency on Python.
# You may specify a custom name for so lib and subpackage after a colon.
_plugins="
	alarm_curl
	cache
	carbon
	cgi
	cheaper_backlog2
	cheaper_busyness
	corerouter
	curl_cron
	dumbloop
	dummy
	echo
	emperor_amqp
	emperor_pg
	emperor_zeromq
	fastrouter
	forkptyrouter
	geoip
	gevent
	graylog2
	http
	legion_cache_fetch
	logcrypto
	logfile
	logpipe
	logsocket
	logzmq
	lua
	msgpack
	nagios
	notfound
	pam
	ping
	pty
	python
	rawrouter
	redislog
	router_basicauth
	router_cache
	router_expires
	router_hash
	router_http
	router_memcached
	router_metrics
	router_radius
	router_redirect
	router_redis
	router_rewrite
	router_static
	router_uwsgi
	rpc
	rrdtool
	rsyslog
	signal
	spooler
	sslrouter
	stats_pusher_file
	stats_pusher_socket
	stats_pusher_statsd
	symcall
	syslog
	transformation_chunked
	transformation_gzip
	transformation_offload
	transformation_template
	transformation_tofile
	tuntap
	ugreen
	webdav
	xslt
	zabbix
	zergpool
	"
# Plugins for Python 3.
# You may specify a custom name for so lib and subpackage after a colon.
_plugins3="gevent:gevent3 python:python3"

subpackages=""
for _p in $_plugins $_plugins3; do
	subpackages="$subpackages uwsgi-${_p#*:}:_plugin"
done

_desc_gevent="uWSGI plugin for gevent (Python 2)"
_desc_gevent3="uWSGI plugin for gevent (Python 3)"
_desc_python="uWSGI plugin for Python 2"
_desc_python3="uWSGI plugin for Python 3"


prepare() {
	default_prepare || return 1
	cp "$srcdir"/alpine.buildconf buildconf/alpine.ini
}

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"

	local item
	for item in $_plugins; do
		_build python "$item" || return 1
	done
	for item in $_plugins3; do
		_build python3 "$item" || return 1
	done
}

_build() {
	local python="$1"
	local plugin="${2%:*}"
	local myname="${2#*:}"

	msg "Building $plugin plugin ($myname)"
	$python uwsgiconfig.py --plugin plugins/$plugin alpine $myname
}

package() {
	cd "$builddir"

	install -D uwsgi \
		"$pkgdir"/usr/sbin/uwsgi || return 1
	install -D "$srcdir"/readme.emperor \
		"$pkgdir"/etc/uwsgi/conf.d/readme.emperor || return 1
	install -D "$srcdir"/uwsgi.ini \
		"$pkgdir"/etc/uwsgi/uwsgi.ini || return 1
	install -Dm755 "$srcdir"/uwsgi.initd \
		"$pkgdir"/etc/init.d/uwsgi || return 1

	# Disable emutramp/mprotect, this is needed for luajit and cffi.
	paxmark -em "$pkgdir"/usr/sbin/uwsgi
}

_plugin() {
	local name="${subpkgname#$pkgname-}"
	local desc="$(eval "echo \$_desc_$name")"
	pkgdesc="${desc:-"uWSGI plugin $name"}"
	depends="uwsgi"

	cd "$builddir"
	install -D ${name}_plugin.so \
		"$subpkgdir"/usr/lib/uwsgi/${name}_plugin.so || return 1
}

md5sums="d4b2c7db274dc20be54a977c9b040b7e  uwsgi-2.0.14.tar.gz
808aa42f536b7d4dd9dd966b1f25d690  uwsgi.initd
a797ffed638ea797a16557d963598fb2  uwsgi.ini
cf4242f1a6cd8182a91d5c27dc688fe1  readme.emperor
98407f45c566a2c39a34b882e1ac9fe4  alpine.buildconf
87c16f6fe482c9b0eac0d33c51873f45  musl-fix-python.patch"
sha256sums="21b3d1ef926d835ff23576193a2c60d4c896d8e21567850cf0677a4764122887  uwsgi-2.0.14.tar.gz
319be0fdbce036351cdc4b60eac821400b5b2ba7dcfac246867dfde1e295fa74  uwsgi.initd
b9cc5a3590b95854eb563fbb84b3e0f54d25ea6d222585a1b40583a6913cc911  uwsgi.ini
bad9480a81d57baaef1d228713837f5dae81f93527c436aeb1ed5ed8dad58f54  readme.emperor
31fc9c17f17aa067c3b025a3f7a84c6102d24368afcbc237f3d58041083c0875  alpine.buildconf
3838e8e3926a1f6271bb5aa88d309837a3bcd06cd570c499b72ca549326c682e  musl-fix-python.patch"
sha512sums="cf557ba27cb1c28e784e8909043bca874cd56846aa9ebaf1ff229191ad20484e467147a6ea7cc629399d4afd6e4ac4479b2f6827729df04321eef4bf842b9e42  uwsgi-2.0.14.tar.gz
4e4bab0082ed22df37fb4081431f6b42d93ed76f279b61c8d4014a20e695c224082ad4bad35ca624cbb95cb787d43894daf09398f8102b556c7034ab0ba58e9b  uwsgi.initd
370202e143d0e041a2e36905346080d3ca592c9a74705a8c4e142a1307d22b921c10e673d683ca284ea27d184474ed86edd7723a6e590d35a562ad7cf6afa529  uwsgi.ini
2798c9d2e49e29292ffe6a5a29b866301c78d5f322fc5d07dfa9569efdaa5220237a5f6744652fbdd957be29311ddaff190541333f042cbf0e907dfa98ce3e2a  readme.emperor
f3cff00926929a5bb40afafb65fd5228582af35fbf524562282020c4c4ae9c659231b2381f4b3cceb18e8f3f6c888c21bdd8ed4ddcd81e92fbc6a0891800ce38  alpine.buildconf
de68b16b44e554a79c073c9befa10566796316dbf4c375b4d6b633d80b0282694cca233f0a70f3d6570584324f14276826bbeb8f38b550c00087a05f9ba9227f  musl-fix-python.patch"