File: rules

package info (click to toggle)
bzr-builddeb 2.8.11
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 1,172 kB
  • sloc: python: 12,741; makefile: 41; sh: 3
file content (40 lines) | stat: -rwxr-xr-x 1,013 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PYVERS=$(shell pyversions -vr)

doc_dir=doc/user_manual/
rst_docs=$(wildcard $(addsuffix /*.rst, $(doc_dir)))
html_docs=$(patsubst %.rst, %.html, $(rst_docs))

%:
	dh $* --with python2 --buildsystem=python_distutils

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
SELFTEST_CONCURRENCY = BZR_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
SELFTEST_PARALLEL = --parallel=fork
else
SELFTEST_CONCURRENCY =
SELFTEST_PARALLEL =
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(SELFTEST_CONCURRENCY) BZR_PLUGINS_AT=builddeb@$(CURDIR) python$* /usr/bin/bzr selftest \
	    $(SELFTEST_PARALLEL) -v -s bp.builddeb
endif

%.html: %.rst
	rst2html --stylesheet-path=$(doc_dir)/user_manual.css $< > $@

override_dh_auto_build-indep: $(html_docs)
	rst2html README > README.html

override_dh_auto_clean:
	dh_auto_clean
	rm -f $(html_docs)
	rm -f README.html