File: rules

package info (click to toggle)
pyscanfcs 0.3.6%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,440 kB
  • sloc: python: 2,676; makefile: 59; sh: 11
file content (71 lines) | stat: -rwxr-xr-x 2,490 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
69
70
71
#!/usr/bin/make -f

TEXDOC = PyScanFCS_doc.tex
DOCDIR = doc
BIBDOC = PyScanFCS_doc.aux
PDF = PyScanFCS_doc.pdf
# see https://wiki.debian.org/ReproducibleBuilds/TimestampsInPDFGeneratedByLaTeX
include /usr/share/dpkg/default.mk
DEB_DATE_RFC_3339 := $(shell date -u "--rfc-3339=seconds" --date="@$(SOURCE_DATE_EPOCH)")
PDFLATEX = pdflatex -synctex=1 -interaction=nonstopmode $(TEXDOC)
FAKETIME = faketime -f "$(DEB_DATE_RFC_3339)"

pkg := pyscanfcs
export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export PYBUILD_NAME=$(DEB_SOURCE)
export PYBUILD_INSTALL_ARGS_python3=--install-lib=/usr/lib/${PYBUILD_NAME}
export PYBUILD_TEST_PYTEST=1
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
        export PYBUILD_TEST_PYTEST=0
endif

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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .pytest_cache
	rm -f doc/PyScanFCS_doc.pdf doc/PyScanFCS_doc.synctex.gz doc/PyScanFCS_doc.pdf debian/pyscanfcs.xpm PyScanFCS_doc.pdf
	rm -f doc/PyScanFCS_doc.aux doc/PyScanFCS_doc.bbl doc/PyScanFCS_doc.blg doc/PyScanFCS_doc.log doc/PyScanFCS_doc.toc doc/PyScanFCS_doc_content.aux pyscanfcs/bin_pe.c

override_dh_clean:
	dh_clean
	rm -f pyscanfcs/_version_save.py

override_dh_auto_build:
	cd $(DOCDIR) && \
	$(FAKETIME) $(PDFLATEX) \
	$(FAKETIME) $(PDFLATEX) && \
	bibtex $(BIBDOC) && \
	$(FAKETIME) $(PDFLATEX) && \
	$(FAKETIME) $(PDFLATEX)
	rm -f $(PDF); ln -s $(DOCDIR)/$(PDF)
	convert -background "rgba(255,255,255,0)" -geometry 32x32 \
		$(DOCDIR)/Images/PyScanFCS_icon.svg debian/pyscanfcs.xpm
	dh_auto_build
	# Provide an usual interpreter.
	sed -i '1s@^#!/usr/bin/env python$$@#!/usr/bin/python3@' \
		pyscanfcs/_version_save.py \
		pyscanfcs/_version.py

override_dh_install:
	dh_numpy3
	dh_install
	mv $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin/pyscanfcs \
           $(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/$(DEB_SOURCE)/pyscanfcs_run
	cd $(CURDIR)/debian/$(DEB_SOURCE)/usr/bin/; \
        ln -s ../lib/$(DEB_SOURCE)/pyscanfcs_run pyscanfcs; cd -
	mv debian/pyscanfcs.xpm debian/$(DEB_SOURCE)/usr/share/pixmaps
	chmod -x debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples/misc/*

override_dh_compress:
	dh_compress -X$(PDF)

override_dh_installexamples:
	tar --sort=name \
            --mtime="@${SOURCE_DATE_EPOCH}" \
            --owner=root --group=root --numeric-owner \
            --mode=go=rX,u+rw,a-s \
            -cJf $(CURDIR)/debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/examples/tests.tar.xz  tests/
	dh_installexamples