File: rules

package info (click to toggle)
python-docutils 0.3.7-2sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,872 kB
  • ctags: 2,908
  • sloc: python: 27,538; lisp: 641; makefile: 102
file content (136 lines) | stat: -rwxr-xr-x 4,453 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

p	= python-docutils
d	= debian/$(p)
PYTHON	= /usr/bin/python

build: build-stamp
build-stamp:
	dh_testdir
	$(PYTHON) setup.py build
	$(PYTHON) setup_difflib.py build
	$(PYTHON) setup_roman.py build
	$(PYTHON) setup_textwrap.py build
	PYTHONPATH=.:extras $(PYTHON) tools/buildhtml.py --local --config=tools/docutils.conf . spec spec/rst spec/howto docs docs/rst
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	$(PYTHON) setup.py clean --all
	-find -name '*.py[co]' | xargs rm -f
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	-mkdir -p $(d)/usr/bin

	: # Install Python files
	@mkdir -p debian/tmp
	$(PYTHON) setup.py install \
	    --root debian/tmp --no-compile  --install-lib /usr/lib/site-python

	: # Install helper scripts
	( cd tools; find . -name SCCS -prune -o -name CVS -prune -o -type d -print ) | \
		while read f ; do mkdir -p $(d)/usr/share/$(p)/$$f ; done
	( cd tools; find . -name SCCS -prune -o -name CVS -prune -o -name \*.pyc -o -type f -print ) | \
		while read f ; do install -o root -m 644 tools/$$f $(d)/usr/share/$(p)/$$f ; done

	# Emacs: move files to site-start directory
	mkdir -p $(d)/usr/share/emacs/site-lisp
	mv $(d)/usr/share/$(p)/editors/emacs/*.el $(d)/usr/share/emacs/site-lisp
	rm -rf $(d)/usr/share/$(p)/editors

	# ... and have it autoload rst-mode
	mkdir -p $(d)/etc/emacs/site-start.d/
	install -m 644 debian/emacs-start.el \
		$(d)/etc/emacs/site-start.d/50python-docutils.el

	: # link scripts to canonical names in /usr/bin
	-mkdir -p $(d)/usr/bin
	cd $(d)/usr/bin && \
	ln -s ../share/python-docutils/rst2html.py rest2html && \
	ln -s ../share/python-docutils/rst2xml.py rest2xml && \
	ln -s ../share/python-docutils/pep.py pep2html && \
	ln -s ../share/python-docutils/rst2latex.py rest2latex && \
	ln -s ../share/python-docutils/rst2html.py rst2html && \
	ln -s ../share/python-docutils/rst2xml.py rst2xml && \
	ln -s ../share/python-docutils/pep.py pep && \
	ln -s ../share/python-docutils/rst2latex.py rst2latex

	# make scripts starting with '#!' executable
	find debian -mindepth 2 -type f ! -perm 755 | \
	while read i ; do \
	  if head -1 $$i | grep -q '^#!'; then \
	    chmod 755 $$i; \
	    echo "made executable: $$i"; \
	  fi; \
	done

	: # Install documentation
	rm -f $(d)/usr/share/doc/$(p)/COPYING[-.]*
	( cd docs; find . -name SCCS -prune -o -type d -print ) | \
		while read f ; do mkdir -p $(d)/usr/share/doc/$(p)/$$f ; done
	( cd docs; find . -name SCCS -prune -o -type f -print ) | \
		while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/$$f ; done

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
#	dh_installdebconf

	dh_installdocs *.txt *.html
	( cd docs; find . -name SCCS -prune -o -type d -print ) | \
		while read f ; do mkdir -p $(d)/usr/share/doc/$(p)/$$f ; done
	( cd docs; find . -name SCCS -prune -o -type f -print ) | \
		while read f ; do install -o root -m 755 docs/$$f $(d)/usr/share/doc/$(p)/$$f ; done

	dh_movefiles -ppython-roman \
		usr/lib/site-python/roman.py

	mkdir -p debian/python2.1-textwrap/usr/lib/python2.1/site-packages
	mkdir -p debian/python2.2-textwrap/usr/lib/python2.2/site-packages
	cp -p debian/tmp/usr/lib/site-python/textwrap.py \
		debian/python2.1-textwrap/usr/lib/python2.1/site-packages/.
	mv debian/tmp/usr/lib/site-python/textwrap.py \
		debian/python2.2-textwrap/usr/lib/python2.2/site-packages/.

	mkdir -p debian/python2.1-difflib/usr/lib/python2.1/site-packages
	mv debian/tmp/usr/lib/site-python/difflib.py \
		debian/python2.1-difflib/usr/lib/python2.1/site-packages/.

	dh_movefiles -ppython-docutils \
		usr/lib/site-python/docutils

	: # The license file for python-roman mentions the GPL
	mkdir -p debian/python-roman/usr/share/lintian/overrides
	cp -p debian/python-roman.override \
		debian/python-roman/usr/share/lintian/overrides/python-roman

	dh_python
	dh_installexamples
	dh_installman
	dh_installchangelogs
	dh_compress -X.py -X.dtd -X.html
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure