File: rules

package info (click to toggle)
mod-wsgi 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,824 kB
  • sloc: ansic: 15,512; python: 3,697; makefile: 219; sh: 107
file content (52 lines) | stat: -rwxr-xr-x 1,719 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

PACKAGE=libapache2-mod-wsgi

APXS2=/usr/bin/apxs2
PY3VERS=$(shell py3versions -vs)
PY3DEFAULT=$(shell py3versions -dv)
PY3MIN=$(shell for VERSION in $(PY3VERS); do echo $$VERSION; done | sort --version-sort | head -1)
PY3MAX=$(shell for VERSION in $(PY3VERS); do echo $$VERSION; done | sort --version-sort | tail -1 | LANG=C awk '{print $$NF+0.01}')
pkgdir = $(CURDIR)/debian/$(PACKAGE)-py3

%:
	dh $@ --with autoreconf,apache2

override_dh_auto_configure:
	set -e ; for pyver in $(PY3VERS); do \
		mkdir -p build-$$pyver ;\
		find . -mindepth 1 -maxdepth 1 -name 'debian' -o -name 'build-*' -o -exec cp -r {} build-$$pyver \; ;\
		dh_auto_configure -Bbuild-$$pyver -- --with-apxs=$(APXS2) --with-python=/usr/bin/python$$pyver ;\
	done

override_dh_auto_build:
	set -e ; for pyver in $(PY3VERS); do \
		dh_auto_build -Bbuild-$$pyver ;\
		touch @ ;\
	done

override_dh_auto_install:
	set -e ; for pyver in $(PY3VERS); do \
		dh_auto_install -Bbuild-$$pyver -- DESTDIR=${pkgdir} ;\
		mv ${pkgdir}/usr/lib/apache2/modules/mod_wsgi.so ${pkgdir}/usr/lib/apache2/modules/mod_wsgi.so-$$pyver ;\
	done

override_dh_auto_clean:
	rm -rf build-*

override_dh_install:
	dh_install
	chmod 755 debian/$(PACKAGE)-py3/usr/share/python3/runtime.d/libapache2-mod-wsgi-py3.rtupdate

override_dh_link:
	dh_link -p $(PACKAGE)-py3 /usr/lib/apache2/modules/mod_wsgi.so-$(PY3DEFAULT) usr/lib/apache2/modules/mod_wsgi.so
	dh_link --remaining-packages

override_dh_gencontrol:
	# Generate dependencies manually as there are no public modules
	echo 'python3:Depends=python3 (>= $(PY3MIN)), python3 (<< $(PY3MAX))' \
	     >> $(CURDIR)/debian/$(PACKAGE)-py3.substvars
	dh_gencontrol

override_dh_auto_test:
	# deactivate tests