File: rules

package info (click to toggle)
python-pysqlite2 2.7.0-1
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 796 kB
  • ctags: 1,034
  • sloc: ansic: 5,116; python: 3,340; makefile: 170; sh: 2
file content (107 lines) | stat: -rwxr-xr-x 2,837 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
#!/usr/bin/make -f

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

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

PYVERS = $(shell pyversions -r)

LAST_CHANGE = $(shell dpkg-parsechangelog -S Date)
BUILD_DATE  = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)")
SPHINXOPTS := -D html_last_updated_fmt=\"$(BUILD_DATE)\"

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp: $(PYVERS:%=build-ext-%-stamp) $(PYVERS:%=dbg-build-ext-%-stamp)
	touch $@

build-ext-%-stamp:
	dh_testdir
	$* setup.py build
	touch $@

dbg-build-ext-%-stamp:
	dh_testdir
	$*-dbg setup.py build -g
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build*stamp dbg-build*stamp
	rm -rf build
	find . -name '*.pyc' | xargs rm -f
	dh_clean

install: build install-prereq $(PYVERS:%=install-ext-%) $(PYVERS:%=dbg-install-ext-%)

install-prereq:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

install-ext-%:
	$* setup.py install --root=$(CURDIR)/debian/python-pysqlite2 --install-layout=deb
	rm -rf debian/python-pysqlite2/usr/pysqlite2-doc
	rm -rf debian/python-pysqlite2/usr/bin
	find debian -type d -wholename '*pysqlite2/test' | xargs rm -rf
	find debian/python-pysqlite2 -name '*.pyc' | xargs rm -f

dbg-install-ext-%:
	$*-dbg setup.py install --root=$(CURDIR)/debian/python-pysqlite2-dbg --install-layout=deb
	find debian/python-*-dbg ! -type d ! -name '*.so' | xargs rm -f
	find debian/python-*-dbg -depth -empty -exec rmdir {} \;

# Build architecture-independent files here.
binary-indep:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -i usr/share/doc/python-pysqlite2-doc/html

	python setup.py build_docs --sphinxopts="$(SPHINXOPTS)"
	dh_installdocs -i build/doc/*
	cd debian/python-pysqlite2-doc/usr/share/doc/python-pysqlite2-doc && \
		mv *.html *.js *.inv _static _sources html && \
		ln -sf ../../../../javascript/jquery/jquery.js html/_static/jquery.js && \
		ln -sf ../../../../javascript/underscore/underscore.js html/_static/underscore.js

	dh_installchangelogs -i
	dh_compress -i -Xjson -Xtxt -Xjs
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a

	dh_installdocs -a
	dh_python2 -a
	dh_installchangelogs -a
	dh_strip -ppython-pysqlite2 --dbg-package=python-pysqlite2-dbg
	rm -rf debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg
	ln -s python-pysqlite2 debian/python-pysqlite2-dbg/usr/share/doc/python-pysqlite2-dbg
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

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