5
5
# Uncomment this to turn on verbose mode.
8
include /usr/share/dpatch/dpatch.make
10
export DH_PYCENTRAL=nomove
10
PYTHON = /usr/bin/python2.3
14
PYTHON = /usr/bin/python
15
PYVER := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
18
BUILDHTML_RECURSE_DIRS := docs
15
23
$(PYTHON) setup.py build
16
$(PYTHON) setup_difflib.py build
17
24
$(PYTHON) setup_roman.py build
18
$(PYTHON) setup_textwrap.py build
19
PYTHONPATH=. $(PYTHON) tools/buildhtml.py --local --config=tools/docutils.conf . spec spec/rst spec/howto docs docs/rst
25
set -e && for dir in $(BUILDHTML_DIRS); do PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py --local --config=tools/docutils.conf $$dir --traceback; done
26
set -e && for dir in $(BUILDHTML_RECURSE_DIRS); do PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py --config=tools/docutils.conf $$dir --traceback; done
29
clean: clean-patched unpatch
26
35
$(PYTHON) setup.py clean --all
27
36
-find -name '*.py[co]' | xargs rm -f
38
find docs -name '*.html' -not -name 'quickref.html' -print0 | xargs -0 --no-run-if-empty rm
35
45
-mkdir -p $(d)/usr/bin
37
: # Install Python files
47
: # Install Python files - all to python-docutils first, then sort
48
: # out roman.py afterwards (it looks simpler to do it separately,
49
: # but currently distutils ends up copying both roman and docutils
50
: # to both directories if you do)
38
51
@mkdir -p debian/tmp
39
52
$(PYTHON) setup.py install \
40
--root debian/tmp --no-compile --install-lib /usr/lib/site-python
42
: # Install helper scripts
43
( cd tools; find . -name SCCS -prune -o -name CVS -prune -o -type d -print ) | \
44
while read f ; do mkdir -p $(d)/usr/share/$(p)/$$f ; done
45
( cd tools; find . -name SCCS -prune -o -name CVS -prune -o -name \*.pyc -o -type f -print ) | \
46
while read f ; do install -o root -m 644 tools/$$f $(d)/usr/share/$(p)/$$f ; done
53
--root debian/tmp --no-compile \
54
--install-lib /usr/share/pycentral/$(p)/site-packages \
55
--install-data /usr/share/pycentral/$(p)/site-packages \
57
$(PYTHON) setup_roman.py install \
58
--root debian/tmp --no-compile \
59
--install-lib /usr/share/pycentral/$(p)/site-packages \
60
--install-data /usr/share/pycentral/$(p)/site-packages \
62
install -d debian/tmp/usr/share/pycentral/python-roman/site-packages
63
mv debian/tmp/usr/share/pycentral/python-docutils/site-packages/roman.py \
64
debian/tmp/usr/share/pycentral/python-roman/site-packages/roman.py
48
66
# Emacs: move files to site-start directory
49
mkdir -p $(d)/usr/share/emacs/site-lisp
50
mv $(d)/usr/share/$(p)/editors/emacs/*.el $(d)/usr/share/emacs/site-lisp
51
rm -rf $(d)/usr/share/$(p)/editors
67
install -d $(d)/usr/share/emacs/site-lisp
68
install -m644 tools/editors/emacs/rst.el $(d)/usr/share/emacs/site-lisp/rst.el
53
70
# ... and have it autoload rst-mode
54
mkdir -p $(d)/etc/emacs/site-start.d/
71
install -d $(d)/etc/emacs/site-start.d/
55
72
install -m 644 debian/emacs-start.el \
56
73
$(d)/etc/emacs/site-start.d/50python-docutils.el
58
: # link scripts to canonical names in /usr/bin
59
-mkdir -p $(d)/usr/bin
61
ln -s ../share/python-docutils/html.py rest2html && \
62
ln -s ../share/python-docutils/docutils-xml.py rest2xml && \
63
ln -s ../share/python-docutils/pep.py pep2html && \
64
ln -s ../share/python-docutils/rst2latex.py rest2latex
75
: # give scripts canonical names in /usr/bin
76
cd debian/tmp/usr/bin && \
77
mv rst2newlatex.py rst2newlatex && \
78
mv rst2html.py rst2html && \
79
mv rst2xml.py rst2xml && \
80
mv rst2s5.py rst2s5 && \
81
mv rst2pseudoxml.py rst2pseudoxml && \
82
mv rstpep2html.py rstpep2html && \
83
mv rst2latex.py rst2latex
66
# make scripts starting with '#!' executable
67
find debian -mindepth 2 -type f ! -perm 755 | \
69
if head -1 $$i | grep -q '^#!'; then \
71
echo "made executable: $$i"; \
85
install tools/buildhtml.py debian/tmp/usr/bin/rst-buildhtml
75
87
: # Install documentation
76
88
rm -f $(d)/usr/share/doc/$(p)/COPYING[-.]*
77
( cd docs; find . -name SCCS -prune -o -type d -print ) | \
78
while read f ; do mkdir -p $(d)/usr/share/doc/$(p)/$$f ; done
79
( cd docs; find . -name SCCS -prune -o -type f -print ) | \
80
while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/$$f ; done
82
( cd spec; find . -name SCCS -prune -o -type d -print ) | \
83
while read f ; do mkdir -p $(d)/usr/share/doc/$(p)/$$f ; done
84
( cd spec; find . -name SCCS -prune -o -type f -print ) | \
85
while read f ; do install -o root -m 755 spec/$$f $(d)/usr/share/doc/$(p)/$$f ; done
89
set -e && ( cd docs; find . -name SCCS -prune -o -type d -print ) | \
90
while read f ; do install -d $(d)/usr/share/doc/$(p)/docs/$$f ; done
91
set -e && ( cd docs; find . -name SCCS -prune -o -type f -print ) | \
92
while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/docs/$$f ; done
87
94
# Build architecture-independent files here.
88
95
binary-indep: build install
91
98
# dh_installdebconf
93
dh_installdocs *.txt *.html
94
for d in spec spec/rst spec/howto docs docs/rst ; do \
95
install -d 755 $d/usr/share/doc/python-docutils/$$d ; \
96
install -m 644 $$d/*.txt $$d/*.html $d/usr/share/doc/python-docutils/$$d ; \
100
dh_installdocs *.txt *.html -XCOPYING
101
set -e && ( cd docs; find . -name SCCS -prune -o -type d -print ) | \
102
while read f ; do install -d $(d)/usr/share/doc/$(p)/docs/$$f ; done
103
set -e && ( cd docs; find . -name SCCS -prune -o -type f -print ) | \
104
while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/docs/$$f ; done
99
106
dh_movefiles -ppython-roman \
100
usr/lib/site-python/roman.py
102
mkdir -p debian/python2.1-textwrap/usr/lib/python2.1/site-packages
103
mkdir -p debian/python2.2-textwrap/usr/lib/python2.2/site-packages
104
cp -p debian/tmp/usr/lib/site-python/textwrap.py \
105
debian/python2.1-textwrap/usr/lib/python2.1/site-packages/.
106
mv debian/tmp/usr/lib/site-python/textwrap.py \
107
debian/python2.2-textwrap/usr/lib/python2.2/site-packages/.
109
mkdir -p debian/python2.1-difflib/usr/lib/python2.1/site-packages
110
mv debian/tmp/usr/lib/site-python/difflib.py \
111
debian/python2.1-difflib/usr/lib/python2.1/site-packages/.
107
usr/share/pycentral/python-roman
113
108
dh_movefiles -ppython-docutils \
114
usr/lib/site-python/docutils
109
usr/share/pycentral/python-docutils usr/bin
116
111
: # The license file for python-roman mentions the GPL
117
mkdir -p debian/python-roman/usr/share/lintian/overrides
118
cp -p debian/python-roman.override \
112
install -d debian/python-roman/usr/share/lintian/overrides
113
install -m644 debian/python-roman.override \
119
114
debian/python-roman/usr/share/lintian/overrides/python-roman
122
118
dh_installexamples
120
set -e && for x in rst2latex rst2newlatex rst2html rst2pseudoxml \
121
rst2s5 rstpep2html rst2xml rst-buildhtml; do \
122
ln -sf rst2html.1.gz $(d)/usr/share/man/man1/$$x.1.gz; \
124
124
dh_installchangelogs
125
dh_compress -X.py -X.dtd
125
dh_compress -X.py -X.dtd -X.html