File: rules

package info (click to toggle)
sqlalchemy 1.3.22+ds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 16,916 kB
  • sloc: python: 263,220; ansic: 1,342; makefile: 255; xml: 17
file content (110 lines) | stat: -rwxr-xr-x 3,147 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
#!/usr/bin/make -f

#export DH_VERBOSE=1
pd=python-sqlalchemy-doc

PY3VERS=$(shell py3versions -vr '>= 3.0')
pkgdir = $(CURDIR)/debian/python$(if $(patsubst 3.%,,$(1)),,3)-sqlalchemy

include /usr/share/python3/python.mk
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk

clean:
	dh_testdir
	dh_testroot
	rm -rf $(CURDIR)/lib/SQLAlchemy.egg-info $(CURDIR)/build/
	find . -name '*\.py[co]' -delete
	dh_clean build-docs build-stamp install-docs \
		$(PY3VERS:%=install-python%) $(PY3VERS:%=build-python%) \
		$(PHONYY3VERS:%=install-debug-python%) $(PY3VERS:%=build-debug-python%)

build: build-arch

build-arch: $(PY3VERS:%=build-python%)

build-python%:
	python$* ./setup.py build
	touch $@

build-debug-python%:
	python$*-dbg setup.py build
	touch $@

build-indep: build-docs
build-docs:
	dh_testdir
	dh_installdirs -i
	cd doc/build && python3 -m sphinx -N -E -b html . \
	 ../../debian/${pd}/usr/share/doc/${pd}/html/
	rm -rf debian/${pd}/usr/share/doc/${pd}/html/.doctrees
	touch $@

install-docs: build-docs
	dh_testdir
	dh_installdirs -i
	
	cp -r doc/build/ debian/${pd}/usr/share/doc/${pd}/rst/
	cd debian/${pd}/usr/share/doc/${pd}/rst/\
		&& rm -f '*.py' '*.html' '*.png' \
	       	&& rm -rf texinputs/
	dh_link -p${pd} /usr/share/javascript/jquery/jquery.js \
		/usr/share/doc/${pd}/html/_static/jquery.js
	dh_link -p${pd} /usr/share/javascript/underscore/underscore.js \
		/usr/share/doc/${pd}/html/_static/underscore.js
	# link docs in python-sqlalchemy's dir
	dh_link -p${pd} /usr/share/doc/${pd}/html \
		/usr/share/doc/python3-sqlalchemy/html
	dh_link -p${pd} /usr/share/doc/${pd}/rst \
		/usr/share/doc/python3-sqlalchemy/rst
	touch $@

install: $(PY3VERS:%=install-python%)

install-python%: build
	python$* ./setup.py install --skip-build \
		--root $(call pkgdir,$*) $(py_setup_install_args)
	# move extensions to -ext binary package
	mkdir -p $(call pkgdir,$*)-ext$(call py_libdir,$*)/sqlalchemy
	mv $(call pkgdir,$*)$(call py_libdir,$*)/sqlalchemy/*so \
	   $(call pkgdir,$*)-ext$(call py_libdir,$*)/sqlalchemy/
	touch $@

binary-indep: build install install-docs
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i -p python-sqlalchemy-doc -X doc/changelog -X CHANGES
	dh_installchangelogs -i -N python-sqlalchemy-doc -X doc/changelog -X CHANGES
	dh_installdocs -i
	dh_installexamples -i
	rm -rf debian/${pd}/usr/share/doc/${pd}/doc/build \
	       debian/${pd}/usr/share/doc/${pd}/examples/README
	rm -f debian/python3-sqlalchemy/usr/share/doc/python3-sqlalchemy/NEWS.Debian
	find $(CURDIR)/debian/${pd}/usr/share/doc//${pd}/examples -name __pycache__ | xargs -r rm -rf
	dh_python3 -i
	dh_compress -i -X.py -X.js -X.html -X.inv -Xrst
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a -X doc/changelog -X CHANGES
	dh_installdocs -a
	dh_python3 -a
	dh_makeshlibs -a
	dh_strip -a
	dh_compress -a -X.py
	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 clean binary-indep binary-arch binary install