File: rules

package info (click to toggle)
python-cryptography 38.0.4-3%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,968 kB
  • sloc: python: 51,022; ansic: 608; java: 319; makefile: 162
file content (56 lines) | stat: -rwxr-xr-x 1,552 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

export DH_VERBOSE = 1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/rustc/architecture.mk
export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE

export CARGO=/usr/share/cargo/bin/cargo
export CARGO_HOME=$(shell pwd)/debian/cargo_home
export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM)

export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow

export PYBUILD_NAME=cryptography
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS={dir}/tests/
export PYBUILD_BEFORE_TEST=cp -R {dir}/src/${PYBUILD_NAME}.egg-info {build_dir}
export PYBUILD_AFTER_TEST=rm -r {build_dir}/.hypothesis

%:
	dh $@ --buildsystem=pybuild


override_dh_auto_clean:
	dh_auto_clean
	rm -rf src/rust/target
	rm -rf debian/cargo_registry


override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=./src python3 -m sphinx -b html -N docs/ \
		   $(CURDIR)/debian/python-cryptography-doc/usr/share/doc/python-cryptography-doc/html
	dh_sphinxdoc
endif


override_dh_auto_configure:
	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
	mkdir -p src/rust/target/release
	ln -sf ../$(DEB_HOST_RUST_TYPE)/release/libcryptography_rust.so src/rust/target/release/libcryptography_rust.so
	rm -f src/rust/Cargo.lock
	dh_auto_configure


override_dh_dwz:
	dh_dwz --no-dwz-multifile


override_dh_python3:
	# We patch it out of .dist-info to avoid pkg_resources complaining (#1026537)
	dh_python3 --depends=cffi