File: rules

package info (click to toggle)
pyzbar 0.1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 248 kB
  • sloc: python: 794; makefile: 12
file content (27 lines) | stat: -rwxr-xr-x 1,231 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
#!/usr/bin/make -f

export PYBUILD_NAME=pyzbar
# The upstream project by default installs two files into /usr/bin:
# - read_zbar, which is a thin wrapper calling the main function of
#   /usr/lib/python3/dist-packages/pyzbar/scripts/read_zbar.py
# - read_zbar.py which is basically a copy of
#   /usr/lib/python3/dist-packages/pyzbar/scripts/read_zbar.py
#   The only difference being a different shebang
# Removed the tests/ directory because I would argue they are only useful
# for the build. If the tests passed during build time I don't see any
# reason to include them for the user
export PYBUILD_AFTER_INSTALL=rm '{destdir}/usr/bin/read_zbar.py' ;\
	rm -rf '{destdir}/{install_dir}/pyzbar/tests'

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

# Generate manpage with help2man
override_dh_installman:
	mkdir -p debian/python3-pyzbar/usr/share/man/man1
# Set PYTHONPATH so that the wrapper script read_zbar can find the installed modules
	PYTHONPATH=debian/python3-pyzbar/usr/lib/$(shell py3versions -d)/dist-packages \
		help2man --no-info --name "Command line utility for reading barcodes and QR-codes" \
		--section=1 \
		debian/python3-pyzbar/usr/bin/read_zbar > \
		debian/python3-pyzbar/usr/share/man/man1/read_zbar.1