File: rules

package info (click to toggle)
python-pymzml 2.5.2%2Brepack1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 27,792 kB
  • sloc: python: 6,495; pascal: 341; makefile: 233; sh: 30
file content (68 lines) | stat: -rwxr-xr-x 1,937 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
#! /usr/bin/make -f

export DH_VERBOSE = 1
export PYBUILD_NAME = pymzml

TMPDIR="debian/tmp"
DOCDIR="debian/doc"
SRCDIR=$(CURDIR)

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_compress:
	dh_compress -XpymzML.pdf -X.py -X.idx -X.mzml -X.mzML \
		-Xexample_scripts \
		-Xtests

override_dh_clean:
	dh_clean
	rm -rfv debian/source/include-binaries
	rm -rfv $(DOCDIR)

override_dh_install:
	dh_install
	# Remove the symbolic link.
	rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/example_scripts/pymzml
	#
	# Remove all the pyc files.
	rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/example_scripts/*.pyc
	#
	# Remove the license file
	rm -vf debian/python3-pymzml/usr/share/doc/python3-pymzml/COPYING.txt
	rm -vf debian/python3-pymzml-doc/usr/share/doc/python-pymzml-doc/COPYING.txt
	#
	# Make sure we list properly all the binary files that are made during
	# the documentation build in debian/source/include-binaries:
	sh debian/list-binary-files.sh
	#
	# Remove the exec bit from all the *.gz files.
	chmod a-x debian/python3-pymzml/usr/lib/python3.*/dist-packages/pymzml/obo/*.gz
	# Same for version.txt
	chmod a-x debian/python3-pymzml/usr/lib/python3.*/dist-packages/pymzml/version.txt

prepare_docs:
	cp -rpf docs docs-bkp && rm -rf docs/build

html_doc: prepare_docs
	cd docs && make html
	# Remove all the calls to external sites.
	sed -i 's/^<a class="reference external image-reference".*//' \
		docs/build/html/intro.html

pdf_doc: prepare_docs
	cd docs && make latex
	# Remove the calls to external sites.
	sed -i 's|\\sphinxhref{https\?://.*||' docs/build/latex/pymzML.tex
	# Finally, make the pdf documentation.		
	cd docs/build/latex && make

override_dh_auto_build-indep: html_doc pdf_doc
	cd $(SRCDIR) && \
	mkdir -p $(DOCDIR) && \
	rm -rf $(DOCDIR)/* && \
	cp -rpfv docs/build/html $(DOCDIR) && \
	cp -v docs/build/latex/pymzML.pdf $(DOCDIR) && \
	rm -rf docs && \
	mv docs-bkp docs