File: rules

package info (click to toggle)
python-libdiscid 1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 664 kB
  • ctags: 1,016
  • sloc: python: 576; ansic: 104; makefile: 33; sh: 14
file content (51 lines) | stat: -rwxr-xr-x 1,278 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
#!/usr/bin/make -f

# Get the supported Python 2 versions
PYVERS=$(shell pyversions -vr)
# Get the default Python 2 version
PYVERSD=$(shell pyversions -vd)
# Get the supported Python 3 versions
PY3VERS=$(shell py3versions -vr)

%:
	dh $@ --with=python2,python3

override_dh_auto_clean:
	rm -rf build

build-%-stamp:
	python$(*) setup.py build
	touch $@

override_dh_auto_build-arch: \
	$(PYVERS:%=build-%-stamp) $(PYVERS:%=build-%-dbg-stamp) \
	$(PY3VERS:%=build-%-stamp) $(PY3VERS:%=build-%-dbg-stamp)

override_dh_auto_build-indep: build-$(PYVERSD)-stamp
	python$(PYVERSD) setup.py build_sphinx

install-%-stamp:
	python$(*) setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp
	touch $@

override_dh_auto_install-arch: \
	$(PYVERS:%=install-%-stamp) $(PYVERS:%=install-%-dbg-stamp) \
	$(PY3VERS:%=install-%-stamp) $(PY3VERS:%=install-%-dbg-stamp)

test-%-stamp:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	python$(*) setup.py test
endif
	touch $@

override_dh_auto_test-arch: \
	$(PYVERS:%=test-%-stamp) $(PYVERS:%=test-%-dbg-stamp) \
	$(PY3VERS:%=test-%-stamp) $(PY3VERS:%=test-%-dbg-stamp)

# no install and test for indep
override_dh_auto_install-indep override_dh_auto_test-indep:

override_dh_installdocs-indep:
	dh_installdocs -i
	dh_sphinxdoc -i