2
# Sample debian/rules that uses debhelper.
3
# GNU copyright 1997 to 1999 by Joey Hess.
5
# Uncomment this to turn on verbose mode.
10
PYTHON = /usr/bin/python2.3
15
$(PYTHON) setup.py build
16
$(PYTHON) setup_difflib.py build
17
$(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
26
$(PYTHON) setup.py clean --all
27
-find -name '*.py[co]' | xargs rm -f
35
-mkdir -p $(d)/usr/bin
37
: # Install Python files
39
$(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
48
# 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
53
# ... and have it autoload rst-mode
54
mkdir -p $(d)/etc/emacs/site-start.d/
55
install -m 644 debian/emacs-start.el \
56
$(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
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"; \
75
: # Install documentation
76
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
87
# Build architecture-independent files here.
88
binary-indep: build install
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 ; \
99
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/.
113
dh_movefiles -ppython-docutils \
114
usr/lib/site-python/docutils
116
: # 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 \
119
debian/python-roman/usr/share/lintian/overrides/python-roman
125
dh_compress -X.py -X.dtd
132
# Build architecture-dependent files here.
133
binary-arch: build install
134
# We have nothing to do by default.
136
binary: binary-indep binary-arch
137
.PHONY: build clean binary-indep binary-arch binary install configure