File: rules

package info (click to toggle)
recommonmark 0.4.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 400 kB
  • ctags: 121
  • sloc: python: 563; makefile: 82; sh: 24
file content (56 lines) | stat: -rwxr-xr-x 1,912 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
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

DEB_PKG_VERSION ?= $(shell dpkg-parsechangelog -S Version)

DEB_CM2ANYTHING_LISTOF_ANYTHING = latex xetex html pseudoxml xml man

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

export PYBUILD_DESTDIR = debian/tmp/PY{version.major}DEB

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 python2,python3 --buildsystem=pybuild

override_dh_install:
	dh_install --package=python-recommonmark  --sourcedir=debian/tmp/PY2DEB
	dh_install --package=python3-recommonmark --sourcedir=debian/tmp/PY3DEB
	dh_install --remaining-packages

override_dh_compress-indep:
	dh_compress -Xexamples

get-orig-source:
	uscan --no-conf --download-current-version --compression xz --verbose

##################################################################################
## 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/python{version.major}/cm2$(1)

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