~ubuntu-branches/ubuntu/jaunty/python-docutils/jaunty

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Simon McVittie
  • Date: 2008-07-24 10:39:53 UTC
  • mfrom: (1.1.4 upstream) (3.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080724103953-8gh4uezg17g9ysgy
Tags: 0.5-2
* Upload docutils 0.5 to unstable
* Update rst.el to upstream Subversion r5596, which apparently fixes
  all its performance problems (17_speed_up_rst_el.dpatch, closes: #474941)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
include /usr/share/dpatch/dpatch.make
9
9
 
10
 
export DH_PYCENTRAL=nomove
11
 
 
12
10
p       = python-docutils
13
11
d       = debian/$(p)
14
12
PYTHON  = /usr/bin/python
15
13
PYVER := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
 
14
DEB_UPSTREAM_VERSION := $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
16
15
 
17
16
BUILDHTML_DIRS := .
18
17
BUILDHTML_RECURSE_DIRS := docs
19
18
 
20
19
build: build-stamp
21
 
build-stamp: patch
 
20
build-stamp: patch-stamp
22
21
        dh_testdir
23
22
        $(PYTHON) setup.py build
24
23
        $(PYTHON) setup_roman.py build
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
 
24
        set -e && for dir in $(BUILDHTML_DIRS); do \
 
25
                PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py \
 
26
                        --local --config=tools/docutils.conf $$dir \
 
27
                        --traceback; \
 
28
        done
 
29
        set -e && for dir in $(BUILDHTML_RECURSE_DIRS); do \
 
30
                PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py \
 
31
                        --config=tools/docutils.conf $$dir --traceback; \
 
32
        done
27
33
        touch build-stamp
28
34
 
29
35
clean: clean-patched unpatch
35
41
        $(PYTHON) setup.py clean --all
36
42
        -find -name '*.py[co]' | xargs rm -f
37
43
        rm -f *.html
38
 
        find docs -name '*.html' -not -name 'quickref.html' -print0 | xargs -0 --no-run-if-empty rm
 
44
        rm -f debian/*.1
 
45
        find docs -name '*.html' -not -name 'quickref.html' -print0 | \
 
46
                xargs -0 --no-run-if-empty rm
 
47
        -rm -rf docutils.egg-info
39
48
        dh_clean
40
49
 
41
50
install: build
42
51
        dh_testdir
43
52
        dh_testroot
44
53
        dh_installdirs
45
 
        -mkdir -p $(d)/usr/bin
46
 
 
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)
51
 
        @mkdir -p debian/tmp
 
54
        mkdir -p debian/tmp
52
55
        $(PYTHON) setup.py install \
53
 
            --root debian/tmp --no-compile \
54
 
                --install-lib /usr/share/pycentral/$(p)/site-packages \
55
 
                --install-data /usr/share/pycentral/$(p)/site-packages \
56
 
 
 
56
            --root debian/tmp --no-compile
57
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 \
61
 
 
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
65
 
 
66
 
        # Emacs: move files to site-start directory
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
69
 
 
70
 
        # ... and have it autoload rst-mode
71
 
        install -d $(d)/etc/emacs/site-start.d/
72
 
        install -m 644 debian/emacs-start.el \
73
 
                $(d)/etc/emacs/site-start.d/50python-docutils.el
74
 
 
 
58
            --root debian/tmp --no-compile
 
59
        : # share Egg dir between all versions
 
60
        mv debian/tmp/usr/lib/python$(PYVER)/site-packages/docutils-$(DEB_UPSTREAM_VERSION)-py$(PYVER).egg-info \
 
61
           debian/tmp/usr/lib/python$(PYVER)/site-packages/docutils-$(DEB_UPSTREAM_VERSION).egg-info
75
62
        : # give scripts canonical names in /usr/bin
76
63
        cd debian/tmp/usr/bin && \
77
64
        mv rst2newlatex.py rst2newlatex && \
81
68
        mv rst2pseudoxml.py rst2pseudoxml && \
82
69
        mv rstpep2html.py rstpep2html && \
83
70
        mv rst2latex.py rst2latex
84
 
 
85
71
        install tools/buildhtml.py debian/tmp/usr/bin/rst-buildhtml
86
 
 
 
72
        : # Make the man pages (we want to do this *after* renaming all the
 
73
        : # tools, because their executable name goes into the --help output)
 
74
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2html --help | \
 
75
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
76
        xsltproc \
 
77
                --stringparam name rst2html \
 
78
                --stringparam date "`date +'%B %Y'`" \
 
79
                --stringparam oneliner 'convert reST documents to XHTML' \
 
80
                debian/rsthelp2man.xsl - > debian/rst2html.1
 
81
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2xml --help | \
 
82
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
83
        xsltproc \
 
84
                --stringparam name rst2xml \
 
85
                --stringparam date "`date +'%B %Y'`" \
 
86
                --stringparam oneliner 'convert reST documents to XML' \
 
87
                debian/rsthelp2man.xsl - > debian/rst2xml.1
 
88
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2latex --help | \
 
89
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
90
        xsltproc \
 
91
                --stringparam name rst2latex \
 
92
                --stringparam date "`date +'%B %Y'`" \
 
93
                --stringparam oneliner 'convert reST documents to LaTeX (stable version)' \
 
94
                debian/rsthelp2man.xsl - > debian/rst2latex.1
 
95
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2newlatex --help | \
 
96
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
97
        xsltproc \
 
98
                --stringparam name rst2newlatex \
 
99
                --stringparam date "`date +'%B %Y'`" \
 
100
                --stringparam oneliner 'convert reST documents to LaTeX (experimental version)' \
 
101
                debian/rsthelp2man.xsl - > debian/rst2newlatex.1
 
102
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2pseudoxml --help | \
 
103
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
104
        xsltproc \
 
105
                --stringparam name rst2pseudoxml \
 
106
                --stringparam date "`date +'%B %Y'`" \
 
107
                --stringparam oneliner 'convert reST documents to pseudo-XML' \
 
108
                debian/rsthelp2man.xsl - > debian/rst2pseudoxml.1
 
109
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst2s5 --help | \
 
110
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
111
        xsltproc \
 
112
                --stringparam name rst2s5 \
 
113
                --stringparam date "`date +'%B %Y'`" \
 
114
                --stringparam oneliner 'convert reST documents to S5 slides' \
 
115
                debian/rsthelp2man.xsl - > debian/rst2s5.1
 
116
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rstpep2html --help | \
 
117
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
118
        xsltproc \
 
119
                --stringparam name rstpep2html \
 
120
                --stringparam date "`date +'%B %Y'`" \
 
121
                --stringparam oneliner 'convert reST Python Enhancement Proposals to HTML' \
 
122
                debian/rsthelp2man.xsl - > debian/rstpep2html.1
 
123
        PYTHONPATH=.:extras $(PYTHON) debian/tmp/usr/bin/rst-buildhtml --help | \
 
124
        PYTHONPATH=.:extras $(PYTHON) tools/rst2xml.py | \
 
125
        xsltproc \
 
126
                --stringparam name rst-buildhtml \
 
127
                --stringparam date "`date +'%B %Y'`" \
 
128
                --stringparam oneliner 'convert many reST documents to HTML' \
 
129
                debian/rsthelp2man.xsl - > debian/rst-buildhtml.1
87
130
        : # Install documentation
88
131
        rm -f $(d)/usr/share/doc/$(p)/COPYING[-.]*
89
132
        set -e && ( cd docs; find . -name SCCS -prune -o -type d -print ) | \
95
138
binary-indep: build install
96
139
        dh_testdir
97
140
        dh_testroot
98
 
#       dh_installdebconf
99
 
 
100
141
        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
105
 
 
106
 
        dh_movefiles -ppython-roman \
107
 
                usr/share/pycentral/python-roman
108
 
        dh_movefiles -ppython-docutils \
109
 
                usr/share/pycentral/python-docutils usr/bin
110
 
 
111
 
        : # The license file for python-roman mentions the GPL
112
 
        install -d debian/python-roman/usr/share/lintian/overrides
113
 
        install -m644 debian/python-roman.override \
114
 
                debian/python-roman/usr/share/lintian/overrides/python-roman
115
 
 
 
142
        dh_install -i
116
143
        dh_pycentral
117
 
        dh_python
118
144
        dh_installexamples
119
145
        dh_installman
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; \
123
 
        done
124
146
        dh_installchangelogs
125
147
        dh_compress -X.py -X.dtd -X.html
126
148
        dh_fixperms