File: rules

package info (click to toggle)
python-docutils 0.5-2%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 5,664 kB
  • ctags: 3,475
  • sloc: python: 31,530; lisp: 3,348; sh: 1,966; makefile: 147
file content (159 lines) | stat: -rwxr-xr-x 5,783 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make

p	= python-docutils
d	= debian/$(p)
PYTHON	= /usr/bin/python
PYVER := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
DEB_UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')

BUILDHTML_DIRS := .
BUILDHTML_RECURSE_DIRS := docs

build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	$(PYTHON) setup.py build
	$(PYTHON) setup_roman.py build
	set -e && for dir in $(BUILDHTML_DIRS); do \
		PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py \
			--local --config=tools/docutils.conf $$dir \
			--traceback; \
	done
	set -e && for dir in $(BUILDHTML_RECURSE_DIRS); do \
		PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py \
			--config=tools/docutils.conf $$dir --traceback; \
	done
	touch build-stamp

clean: clean-patched unpatch

clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	$(PYTHON) setup.py clean --all
	-find -name '*.py[co]' | xargs rm -f
	rm -f *.html
	rm -f debian/*.1
	find docs -name '*.html' -not -name 'quickref.html' -print0 | \
		xargs -0 --no-run-if-empty rm
	-rm -rf docutils.egg-info
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_installdirs
	mkdir -p debian/tmp
	$(PYTHON) setup.py install \
	    --root debian/tmp --no-compile
	$(PYTHON) setup_roman.py install \
	    --root debian/tmp --no-compile
	: # share Egg dir between all versions
	mv debian/tmp/usr/lib/python$(PYVER)/site-packages/docutils-$(DEB_UPSTREAM_VERSION)-py$(PYVER).egg-info \
	   debian/tmp/usr/lib/python$(PYVER)/site-packages/docutils-$(DEB_UPSTREAM_VERSION).egg-info
	: # give scripts canonical names in /usr/bin
	cd debian/tmp/usr/bin && \
	mv rst2newlatex.py rst2newlatex && \
	mv rst2html.py rst2html && \
	mv rst2xml.py rst2xml && \
	mv rst2s5.py rst2s5 && \
	mv rst2pseudoxml.py rst2pseudoxml && \
	mv rstpep2html.py rstpep2html && \
	mv rst2latex.py rst2latex
	install tools/buildhtml.py debian/tmp/usr/bin/rst-buildhtml
	: # Make the man pages (we want to do this *after* renaming all the
	: # tools, because their executable name goes into the --help output)
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2html --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2html \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to XHTML' \
		debian/rsthelp2man.xsl - > debian/rst2html.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2xml --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2xml \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to XML' \
		debian/rsthelp2man.xsl - > debian/rst2xml.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2latex --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2latex \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to LaTeX (stable version)' \
		debian/rsthelp2man.xsl - > debian/rst2latex.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2newlatex --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2newlatex \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to LaTeX (experimental version)' \
		debian/rsthelp2man.xsl - > debian/rst2newlatex.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2pseudoxml --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2pseudoxml \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to pseudo-XML' \
		debian/rsthelp2man.xsl - > debian/rst2pseudoxml.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2s5 --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst2s5 \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST documents to S5 slides' \
		debian/rsthelp2man.xsl - > debian/rst2s5.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rstpep2html --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rstpep2html \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert reST Python Enhancement Proposals to HTML' \
		debian/rsthelp2man.xsl - > debian/rstpep2html.1
	PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst-buildhtml --help | \
	PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
	xsltproc \
		--stringparam name rst-buildhtml \
		--stringparam date "`date +'%B %Y'`" \
		--stringparam oneliner 'convert many reST documents to HTML' \
		debian/rsthelp2man.xsl - > debian/rst-buildhtml.1
	: # Install documentation
	rm -f $(d)/usr/share/doc/$(p)/COPYING[-.]*
	set -e && ( cd docs; find . -name SCCS -prune -o -type d -print ) | \
		while read f ; do install -d $(d)/usr/share/doc/$(p)/docs/$$f ; done
	set -e && ( cd docs; find . -name SCCS -prune -o -type f -print ) | \
		while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/docs/$$f ; done

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs *.txt *.html -XCOPYING
	dh_install -i
	dh_pycentral
	dh_installexamples
	dh_installman
	dh_installchangelogs
	dh_compress -X.py -X.dtd -X.html
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure