~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): Matthias Urlichs
  • Date: 2004-05-18 08:36:50 UTC
  • Revision ID: james.westby@ubuntu.com-20040518083650-ife8gdsk0s95m8k1
Tags: 0.3.3-1
* New Upstream release.
  - Closes: #249246
* De-right-aligned the Closes: entries in the changelog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# Sample debian/rules that uses debhelper.
 
3
# GNU copyright 1997 to 1999 by Joey Hess.
 
4
 
 
5
# Uncomment this to turn on verbose mode.
 
6
#export DH_VERBOSE=1
 
7
 
 
8
p       = python-docutils
 
9
d       = debian/$(p)
 
10
PYTHON  = /usr/bin/python2.3
 
11
 
 
12
build: build-stamp
 
13
build-stamp:
 
14
        dh_testdir
 
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
 
20
        touch build-stamp
 
21
 
 
22
clean:
 
23
        dh_testdir
 
24
        dh_testroot
 
25
        rm -f build-stamp
 
26
        $(PYTHON) setup.py clean --all
 
27
        -find -name '*.py[co]' | xargs rm -f
 
28
        dh_clean
 
29
 
 
30
install: build
 
31
        dh_testdir
 
32
        dh_testroot
 
33
        dh_clean -k
 
34
        dh_installdirs
 
35
        -mkdir -p $(d)/usr/bin
 
36
        
 
37
        : # Install Python files
 
38
        @mkdir -p debian/tmp
 
39
        $(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
 
47
 
 
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
 
52
 
 
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
 
57
 
 
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
 
65
 
 
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
 
74
 
 
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
 
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
 
86
 
 
87
# Build architecture-independent files here.
 
88
binary-indep: build install
 
89
        dh_testdir
 
90
        dh_testroot
 
91
#       dh_installdebconf
 
92
 
 
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
 
98
 
 
99
        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
 
 
113
        dh_movefiles -ppython-docutils \
 
114
                usr/lib/site-python/docutils
 
115
 
 
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
 
120
 
 
121
        dh_python
 
122
        dh_installexamples
 
123
        dh_installman
 
124
        dh_installchangelogs
 
125
        dh_compress -X.py -X.dtd
 
126
        dh_fixperms
 
127
        dh_installdeb
 
128
        dh_gencontrol
 
129
        dh_md5sums
 
130
        dh_builddeb
 
131
 
 
132
# Build architecture-dependent files here.
 
133
binary-arch: build install
 
134
# We have nothing to do by default.
 
135
 
 
136
binary: binary-indep binary-arch
 
137
.PHONY: build clean binary-indep binary-arch binary install configure