Include searchindex.js in python-pysqlite2-doc package (closes: #678050)
[joel/debian/python-pysqlite2.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE = 1
5
6 PYVERS = $(shell pyversions -r)
7
8 build: build-arch build-indep
9 build-arch: build-stamp
10 build-indep: build-stamp
11
12 build-stamp: $(PYVERS:%=build-ext-%-stamp) $(PYVERS:%=dbg-build-ext-%-stamp)
13         touch $@
14
15 build-ext-%-stamp:
16         dh_testdir
17         $* setup.py build
18         touch $@
19
20 dbg-build-ext-%-stamp:
21         dh_testdir
22         $*-dbg setup.py build -g
23         touch $@
24
25 clean:
26         dh_testdir
27         dh_testroot
28         rm -f build*stamp dbg-build*stamp
29         rm -rf build
30         find . -name '*.pyc' | xargs rm -f
31         dh_clean
32
33 install: build install-prereq $(PYVERS:%=install-ext-%) $(PYVERS:%=dbg-install-ext-%)
34
35 install-prereq:
36         dh_testdir
37         dh_testroot
38         dh_prep
39         dh_installdirs
40
41 install-ext-%:
42         $* setup.py install --root=$(CURDIR)/debian/python-pysqlite2 --install-layout=deb
43         rm -rf debian/python-pysqlite2/usr/pysqlite2-doc
44         rm -rf debian/python-pysqlite2/usr/bin
45         find debian -type d -wholename '*pysqlite2/test' | xargs rm -rf
46         find debian/python-pysqlite2 -name '*.pyc' | xargs rm -f
47
48 dbg-install-ext-%:
49         $*-dbg setup.py install --root=$(CURDIR)/debian/python-pysqlite2-dbg --install-layout=deb
50         find debian/python-*-dbg ! -type d ! -name '*.so' | xargs rm -f
51         find debian/python-*-dbg -depth -empty -exec rmdir {} \;
52
53 # Build architecture-independent files here.
54 binary-indep:
55         dh_testdir
56         dh_testroot
57         dh_prep
58         dh_installdirs -i usr/share/doc/python-pysqlite2-doc/html
59
60         python setup.py build_docs
61         dh_installdocs -i build/doc/*
62         cd debian/python-pysqlite2-doc/usr/share/doc/python-pysqlite2-doc && \
63                 mv *.html *.js *.inv _static _sources html; \
64                 ln -sf ../../../../javascript/jquery/jquery.js html/_static/jquery.js
65
66         dh_installchangelogs -i
67         dh_compress -i -Xjson -Xtxt -Xjs
68         dh_fixperms -i
69         dh_installdeb -i
70         dh_shlibdeps -i
71         dh_gencontrol -i
72         dh_md5sums -i
73         dh_builddeb -i
74
75 # Build architecture-dependent files here.
76 binary-arch: build install
77         dh_testdir -a
78         dh_testroot -a
79
80         dh_installdocs -a
81         dh_python2 -a
82         dh_installchangelogs -a
83         dh_strip -ppython-pysqlite2 --dbg-package=python-pysqlite2-dbg
84         rm -rf debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg
85         ln -s python-pysqlite2 debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg
86         dh_compress -a
87         dh_fixperms -a
88         dh_installdeb -a
89         dh_shlibdeps -a
90         dh_gencontrol -a
91         dh_md5sums -a
92         dh_builddeb -a
93
94 binary: binary-indep binary-arch
95
96 .PHONY: build build-arch build-indep
97 .PHONY: clean
98 .PHONY: install install-prereq
99 .PHONY: binary-indep binary-arch binary