File: rules

package info (click to toggle)
python-mistletoe 0.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 632 kB
  • sloc: python: 3,442; sh: 71; makefile: 45
file content (28 lines) | stat: -rwxr-xr-x 815 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
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

destdir = debian/python3-mistletoe
cmd = mistletoe
python3path = $(destdir)/usr/lib/$(shell py3versions -d)/dist-packages

# generate manpage with help2man from --help option of python script
_mkman = PYTHONPATH=$(python3path) \
 help2man $(if $3,--name "$(strip $3)") --no-info --output $2 $1 \
 || { PYTHONPATH=$(python3path) $1 --help; false; }

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	python3 -m unittest --verbose test
endif

# * generate manpage
override_dh_auto_install:
	dh_auto_install
	$(call _mkman, $(destdir)/usr/bin/$(cmd), debian/$(cmd).1, \
		turn Markdown into HTML in pure Python)
	find $(destdir)/usr/lib -name '*.pyc' -delete
	find $(destdir)/usr/lib -type d -empty -delete

%:
	dh $@ --buildsystem=pybuild