~ubuntu-branches/ubuntu/karmic/python-docutils/karmic

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): martin f. krafft
  • Date: 2006-07-10 11:45:05 UTC
  • mfrom: (2.1.4 edgy)
  • Revision ID: james.westby@ubuntu.com-20060710114505-otkhqcslevewxmz5
Tags: 0.4-3
Added build dependency on python-central (closes: #377580).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# Uncomment this to turn on verbose mode.
6
6
#export DH_VERBOSE=1
7
7
 
 
8
include /usr/share/dpatch/dpatch.make
 
9
 
 
10
export DH_PYCENTRAL=nomove
 
11
 
8
12
p       = python-docutils
9
13
d       = debian/$(p)
10
 
PYTHON  = /usr/bin/python2.3
 
14
PYTHON  = /usr/bin/python
 
15
PYVER := $(shell $(PYTHON) -c 'import sys; print sys.version[:3]')
 
16
 
 
17
BUILDHTML_DIRS := .
 
18
BUILDHTML_RECURSE_DIRS := docs
11
19
 
12
20
build: build-stamp
13
 
build-stamp:
 
21
build-stamp: patch
14
22
        dh_testdir
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
20
27
        touch build-stamp
21
28
 
22
 
clean:
 
29
clean: clean-patched unpatch
 
30
 
 
31
clean-patched:
23
32
        dh_testdir
24
33
        dh_testroot
25
34
        rm -f build-stamp
26
35
        $(PYTHON) setup.py clean --all
27
36
        -find -name '*.py[co]' | xargs rm -f
 
37
        rm -f *.html
 
38
        find docs -name '*.html' -not -name 'quickref.html' -print0 | xargs -0 --no-run-if-empty rm
28
39
        dh_clean
29
40
 
30
41
install: build
31
42
        dh_testdir
32
43
        dh_testroot
33
 
        dh_clean -k
34
44
        dh_installdirs
35
45
        -mkdir -p $(d)/usr/bin
36
 
        
37
 
        : # Install Python files
 
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)
38
51
        @mkdir -p debian/tmp
39
52
        $(PYTHON) setup.py install \
40
 
            --root debian/tmp --no-compile  --install-lib /usr/lib/site-python
41
 
 
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 \
 
56
 
 
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
47
65
 
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
52
69
 
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
57
74
 
58
 
        : # link scripts to canonical names in /usr/bin
59
 
        -mkdir -p $(d)/usr/bin
60
 
        cd $(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
65
84
 
66
 
        # make scripts starting with '#!' executable
67
 
        find debian -mindepth 2 -type f ! -perm 755 | \
68
 
        while read i ; do \
69
 
          if head -1 $$i | grep -q '^#!'; then \
70
 
            chmod 755 $$i; \
71
 
            echo "made executable: $$i"; \
72
 
          fi; \
73
 
        done
 
85
        install tools/buildhtml.py debian/tmp/usr/bin/rst-buildhtml
74
86
 
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
81
 
 
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
86
93
 
87
94
# Build architecture-independent files here.
88
95
binary-indep: build install
90
97
        dh_testroot
91
98
#       dh_installdebconf
92
99
 
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 ; \
97
 
        done
 
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
98
105
 
99
106
        dh_movefiles -ppython-roman \
100
 
                usr/lib/site-python/roman.py
101
 
 
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/.
108
 
 
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/.
112
 
 
 
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
115
110
 
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
120
115
 
 
116
        dh_pycentral
121
117
        dh_python
122
118
        dh_installexamples
123
119
        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
124
        dh_installchangelogs
125
 
        dh_compress -X.py -X.dtd
 
125
        dh_compress -X.py -X.dtd -X.html
126
126
        dh_fixperms
127
127
        dh_installdeb
128
128
        dh_gencontrol