File: rules

package info (click to toggle)
recommonmark 0.4.0+ds-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 388 kB
  • sloc: python: 563; makefile: 82; sh: 21
file content (54 lines) | stat: -rwxr-xr-x 1,883 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
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

DEB_CM2ANYTHING_LISTOF_ANYTHING = latex xetex html pseudoxml xml man

H2MFLAGS = \
	--manual="recommonmark Python package" \
	--source="recommonmark (Debian $(DEB_VERSION))" \
	--version-string="$(DEB_VERSION)" \
	--no-info

export PYBUILD_AFTER_INSTALL = \
	mkdir -p {destdir}/usr/share/man/man1 ;\
	$(foreach ANYTHING,$(DEB_CM2ANYTHING_LISTOF_ANYTHING), \
		$(call adhoc_pybuild_after_install_h2m_do,$(ANYTHING)) ;\
		)

default:
	@uscan --no-conf --dehs --report || true

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

override_dh_compress-indep:
	dh_compress -Xexamples

override_dh_installdocs:
	dh_installdocs -ppython-recommonmark-doc --doc-main-package=python3-recommonmark
	dh_installdocs --remaining-packages

override_dh_installexamples:
	dh_installexamples -ppython-recommonmark-doc --doc-main-package=python3-recommonmark
	dh_installexamples --remaining-packages

##################################################################################
## ad hoc machinery

cm2latex_DESCRIPTION =     "convert CommonMark file to LaTeX source"
cm2xetex_DESCRIPTION =     "convert CommonMark file to XeTeX source"
cm2html_DESCRIPTION =      "convert CommonMark file to HTML document"
cm2pseudoxml_DESCRIPTION = "convert CommonMark file to pseudo-XML document"
cm2xml_DESCRIPTION =       "convert CommonMark file to XML document"
cm2man_DESCRIPTION =       "convert CommonMark file to man page"

## parameter: ANYTHING
adhoc_pybuild_after_install_h2m_do = \
	LC_ALL=C PYTHONPATH={build_dir}:. help2man $(H2MFLAGS) -s 1 \
			-I debian/man/cm2a.h2m \
			-n $(cm2$(1)_DESCRIPTION) \
			-o {destdir}/usr/share/man/man1/cm2$(1).1 \
		debian/adhoc/wrappers/cm2$(1) ; \
	sed -i -e 's|possibile|possible|g' {destdir}/usr/share/man/man1/cm2$(1).1

##################################################################################