File: rules

package info (click to toggle)
cysignals 1.3.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 504 kB
  • sloc: ansic: 485; python: 442; makefile: 300; sh: 41
file content (145 lines) | stat: -rwxr-xr-x 4,636 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
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow

DEB_PKG_VERSION ?= $(shell dpkg-parsechangelog -S Version)

export ACLOCAL_PATH=m4

H2MFLAGS = \
	--manual="CySIgnals Cython package" \
	--source="CySIgnals (Debian $(DEB_PKG_VERSION))" \
	--version-string="cysignals-CSI - $(DEB_PKG_VERSION)" \
	--locale=C.UTF-8 \
	--no-info

default:
	@uscan --no-conf --dehs --report || true

%:
	dh $@ --with autoreconf --with python2  --with sphinxdoc --buildsystem=pybuild

override_dh_auto_configure-arch:
	$(call adhoc_dh_auto_configure_do,bare)
	$(call adhoc_dh_auto_configure_do,pari)

override_dh_auto_configure-indep:
	$(call adhoc_dh_auto_configure_do,bare)

override_dh_auto_build-arch:
	$(call adhoc_dh_auto_build_do,bare)
	$(call adhoc_dh_auto_build_do,pari)

override_dh_auto_build-indep:
	$(call adhoc_dh_auto_build_do,bare)

override_dh_auto_test-arch:
	$(call adhoc_dh_auto_test_do,bare)
	$(call adhoc_dh_auto_test_do,pari)

override_dh_auto_test-indep:
	$(call adhoc_dh_auto_test_do,bare)

DEB_INSTALLEXAMPLES_DOCTEST = $(CURDIR)/build/DEBIAN/examples/doctest
override_dh_prep-indep:
	help2man $(H2MFLAGS) -s 1 \
			-n "debugger information extractor for Python processes" \
			-o cysignals-CSI.1 \
		$(CURDIR)/debian/adhoc/wrappers/cysignals-CSI
	mkdir -p $(DEB_INSTALLEXAMPLES_DOCTEST)
	cp -p -t $(DEB_INSTALLEXAMPLES_DOCTEST) $(CURDIR)/src/cysignals/*.pyx

override_dh_auto_install-arch:
	$(call adhoc_dh_auto_install_do,bare)
	$(call adhoc_dh_auto_install_do,pari)

override_dh_auto_install-indep:
	$(call adhoc_dh_auto_install_do,bare)

## Shared Objects are actually managed by dh_python:
## so no ad hoc [sub]machinery is needed for them.
override_dh_install-arch:
	true

override_dh_install-indep:
	dh_install --package cysignals-tools --sourcedir=$(CURDIR)/debian/tmp/bare
	dh_install --indep --remaining-packages

override_dh_installdocs:
	dh_installdocs --all $(CURDIR)/debian/README.Debian

DEB_SPHINXDOC_DOCDIR=$(CURDIR)/debian/python-cysignals-doc/usr/share/doc/python-cysignals-doc
override_dh_sphinxdoc-indep:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	$(MAKE) -C docs latexpdf PAPER=a4 LATEXOPTS='-interaction batchmode'
	cp -p $(CURDIR)/docs/build/latex/cysignals.pdf $(DEB_SPHINXDOC_DOCDIR)
	PYTHONPATH=$(CURDIR) sphinx-build -b html $(CURDIR)/docs/source $(DEB_SPHINXDOC_DOCDIR)/html
	dh_sphinxdoc -O--buildsystem=pybuild
endif

override_dh_compress-indep:
	dh_compress -X.pdf -Xexamples

override_dh_auto_clean:
	$(MAKE) distclean

get-orig-source:
	uscan --no-conf --download-current-version --compression xz --verbose

.PHONY: build

##################################################################################
## ad hoc machinery

## parameter: flavour
adhoc_dh_auto_configure_do = \
	PYSETUP_CONFIGURE_FLAGS=$(PYSETUP_CONFIGURE_FLAGS_$(1)) \
	dh_auto_configure

## parameter: flavour
adhoc_dh_auto_build_do = \
	$(if $(wildcard $(CURDIR)/build/dh-stamp-auto_build-$(1)),, \
		PYSETUP_CONFIGURE_FLAGS=$(PYSETUP_CONFIGURE_FLAGS_$(1)) \
		dh_auto_build -- \
			--before-build "mkdir -v -p {build_dir}/../build-$(1)" \
			--after-build  "\
				mv -v {build_dir}/* {build_dir}/../build-$(1) && \
				echo PYBUILD_interpreter={interpreter} > $(CURDIR)/build/dh-test-auto_build-$(1).sh && \
				echo PYBUILD_build_dir={build_dir}/../build-$(1) >> $(CURDIR)/build/dh-test-auto_build-$(1).sh \
				" $(NEWLINE) \
		touch $(CURDIR)/build/dh-stamp-auto_build-$(1) $(NEWLINE) \
		)

#### parameter: flavour
adhoc_dh_auto_test_do = \
	$(if $(wildcard $(CURDIR)/build/dh-stamp-auto_test-$(1)),, \
	$(info FROZEN: \
		PYSETUP_CONFIGURE_FLAGS=$(PYSETUP_CONFIGURE_FLAGS_$(1)) \
		dh_auto_test -- \
			--before-test "rmdir {build_dir} && ln -vrsf {build_dir}/../build-$(1) {build_dir}" \
			--after-test  "rm -v {build_dir}" ) $(NEWLINE) \
		$(CURDIR)/debian/adhoc/tests/check-doctest $(1) $(NEWLINE) \
		$(CURDIR)/debian/adhoc/tests/check-example $(1) $(NEWLINE) \
		touch $(CURDIR)/build/dh-stamp-auto_test-$(1) $(NEWLINE) \
		)

## parameter: flavour
adhoc_dh_auto_install_do = \
	$(if $(wildcard $(CURDIR)/build/dh-stamp-auto_install-$(1)),, \
		PYSETUP_CONFIGURE_FLAGS=$(PYSETUP_CONFIGURE_FLAGS_$(1)) PYBUILD_DESTDIR=$(CURDIR)/debian/tmp/$(1) \
		dh_auto_install -- \
			--before-install "rmdir {build_dir} && ln -vrsf {build_dir}/../build-$(1) {build_dir}" \
			--after-install  "rm -v {build_dir}" $(NEWLINE) \
		touch $(CURDIR)/build/dh-stamp-auto_install-$(1) $(NEWLINE) \
		)

PYSETUP_CONFIGURE_FLAGS_bare = '--without-pari'
PYSETUP_CONFIGURE_FLAGS_pari = '--with-pari'


define NEWLINE


endef

##################################################################################