File: rules

package info (click to toggle)
uwsgi-plugin-python 0.0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 88 kB
  • sloc: sh: 58; makefile: 55
file content (74 lines) | stat: -rwxr-xr-x 2,264 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

# Fuse uWSGI and our package versions, flattened to native format
UWSGI_VERSION = $(shell dpkg-query --show --showformat '$${Version}' uwsgi-src)
OUR_BINARY_VERSION = $(subst -,+,$(UWSGI_VERSION))+$(DEB_VERSION)

PYTHON3S = $(shell py3versions -r 2> /dev/null)
PYTHON3DEFAULTDOTLESS = $(subst .,,$(shell py3versions -d 2> /dev/null))
PYTHON3SDOTLESS = python3 $(patsubst python3.%,python3%,$(PYTHON3S))

UWSGI_SRCPLUGINS = asyncio tornado

# resolve supported architectures for arch-varying build-dependencies
# (in maintainer mode only: uses network and messes with control file)
ifneq (,$(DEB_MAINTAINER_MODE))
$(shell sh debian/pkgarchs.sh python3-greenlet > debian/ARCHS_greenlet)
endif
$(eval ARCHS_greenlet := $(shell cat debian/ARCHS_greenlet))
ifneq (,$(DEB_MAINTAINER_MODE))
clean: debian/control
debian/control::
	perl -sgpi \
	 -e 's/^# autogenerated:.+\n\s+\S*$$pat.*\[\K[^\]\n]*/$$list/gm;' \
	 -e 's/^Package:.*$$pat.*\n# autogenerated:.+\nArchitecture:\s+\K[^\n]*/$$list/gm;' \
	 -- -pat='(greenlet|gevent)' -list='$(ARCHS_greenlet)' \
	 -- $@
endif
ifneq (,$(filter $(DEB_HOST_ARCH), $(ARCHS_greenlet)))
UWSGI_SRCPLUGINS += greenlet gevent
endif

PLUGINS = $(PYTHON3SDOTLESS) \
		$(foreach srcplugin, $(UWSGI_SRCPLUGINS), \
				$(foreach py3, $(PYTHON3SDOTLESS), \
						$(srcplugin)_$(py3) \
				) \
		)

PLUGINBUILDER = uwsgi --build-plugin

%:
	dh $@

%_plugin.so:
	PYTHON=python3.$(lastword $(subst _python3, ,$*)) $(PLUGINBUILDER) \
		"/usr/src/uwsgi/plugins/$(firstword $(subst _, ,$*)) $*"

%_python3_plugin.so:
	ln -s $*_$(PYTHON3DEFAULTDOTLESS)_plugin.so $@

python3%_plugin.so:
	PYTHON=python3.$* $(PLUGINBUILDER) "/usr/src/uwsgi/plugins/python python3$*"

python3_plugin.so:
	ln -s $(PYTHON3DEFAULTDOTLESS)_plugin.so $@

.PHONY: plugins
plugins: $(addsuffix _plugin.so, $(PLUGINS))

override_dh_auto_build: plugins
	help2man \
		--name 'fast (pure C), self-healing, developer-friendly WSGI server' \
		--section 1 \
		--no-info \
		--version-string="$(UWSGI_VERSION)" \
		debian/uwsgi_python3 \
		> debian/uwsgi_python3.1
	cp -a /usr/src/uwsgi/uwsgidecorators.py $(CURDIR)

override_dh_gencontrol:
	dh_gencontrol -- -v$(OUR_BINARY_VERSION)