File: rules

package info (click to toggle)
python-cogent 2023.2.12a1%2Bdfsg-2%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,416 kB
  • sloc: python: 89,165; makefile: 117; sh: 16
file content (56 lines) | stat: -rwxr-xr-x 1,612 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export LC_ALL=C.UTF-8
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

export PYBUILD_BEFORE_TEST=cp -r {dir}/tests/data {build_dir}
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS=-k 'not test_pickleable_member_roundtrip and not test_pickleable_roundtrip'
export PYBUILD_NAME=cogent3
ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf mipsel s390x mips64el))
export PYBUILD_DISABLE=test
endif

include /usr/share/dpkg/default.mk

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

override_dh_clean:
	#These files are rebuilt on-the-fly
	for f in `find -name '*.c'` ; do \
	    head -n 1 "$$f" | grep -q '^/\* Generated by Cython' && rm "$$f" ; \
	done
	rm -rf build build-stamp
	rm -rf doc/_build
	dh_clean

override_dh_auto_build:
	dh_auto_build
ifeq (,$(filter $(DEB_HOST_ARCH), armel mipsel))
	set -x; cd doc; PYTHONPATH=$(CURDIR) http_proxy='127.0.0.1:9' $(MAKE) html
	# remove superfluous files and dirs
	find doc/_build -name "*.doctree*" -delete
	rm -f doc/_build/html/_sources/COGENT_LICENSE.txt
	rm -f doc/_build/html/_static/jquery.js
	rm -f doc/_build/html/_static/underscore.js
	rm -rf doc/_build/html/_images/math/
endif

override_dh_shlibdeps:
	dh_shlibdeps
	dh_numpy3

override_dh_compress:
	dh_compress --exclude=.js --exclude=.fasta --exclude=.txt --exclude=.pdb

override_dh_installdocs:
	dh_installdocs
	rm -rf debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/html/_sources
	find debian -name doctrees -type d | xargs rm -rf

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3