File: rules

package info (click to toggle)
sqlalchemy 0.6.3-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,744 kB
  • ctags: 15,132
  • sloc: python: 93,431; ansic: 787; makefile: 137; xml: 17
file content (124 lines) | stat: -rwxr-xr-x 3,663 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
#!/usr/bin/make -f

#export DH_VERBOSE=1
p_name=python-sqlalchemy

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

-include /usr/share/python/python.mk
ifeq (,$(py_libdir))
   py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
endif

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 \
		$(PYVERS:%=install-python%) $(PYVERS:%=build-python%) \
		$(PYVERS:%=install-debug-python%) $(PYVERS:%=build-debug-python%)

build: build-stamp

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

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

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

build-docs:
	dh_testdir
	dh_installdirs -i
	cd doc/build && sphinx-build -N -q -E -b html . \
	 $(call pkgdir,2.X)-doc/usr/share/doc/${p_name}-doc/html/
	rm -rf $(call pkgdir,2.X)-doc/usr/share/doc/${p_name}-doc/html/.doctrees
	touch $@

install-docs: build-docs
	dh_testdir
	dh_installdirs -i
	
	dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/html/_sources \
	       	/usr/share/doc/${p_name}-doc/rst
	dh_link -p${p_name}-doc /usr/share/javascript/jquery/jquery.js \
		/usr/share/doc/${p_name}-doc/html/_static/jquery.js
	# link docs in python-sqlalchemy's dir
	dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/html \
		/usr/share/doc/${p_name}/html
	dh_link -p${p_name}-doc /usr/share/doc/${p_name}-doc/rst \
		/usr/share/doc/${p_name}/rst
	touch $@

install: build $(PYVERS:%=install-python%) $(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 $@
	
install-python3.1:
	# no extension for 3.1 yet...
	python3.1 ./setup.py install $(py_setup_install_args) \
		--root $(call pkgdir,3.1)

install-python2.5: build-python2.5
	# WTF? Why setuptools doesn't work with --skip-build in Python 2.5?
	python2.5 ./setup.py install \
		--root $(call pkgdir,2.5) $(py_setup_install_args)
	# ... and *removes* .so files?
	python2.5 ./setup.py --with-cextensions build_ext
	mkdir -p $(call pkgdir,2.5)-ext$(call py_libdir,2.5)/sqlalchemy
	mv $(CURDIR)/build/lib.*-2.5/sqlalchemy/*.so \
	 $(call pkgdir,2.5)-ext$(call py_libdir,2.5)/sqlalchemy/

binary-indep: build install install-docs
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i -p python-sqlalchemy-doc CHANGES
	dh_installchangelogs -i
	dh_installdocs -i
	dh_installexamples -i
	rm -rf $(call pkgdir,2.X)-doc/usr/share/doc/${p_name}-doc/doc/build \
	       $(call pkgdir,2.X)-doc/usr/share/doc/${p_name}-doc/examples/README
	rm -f $(call pkgdir,3.X)/usr/share/doc/python3-sqlalchemy/NEWS.Debian
	find $(CURDIR)/debian/ -name '*.py[co]' -delete
	dh_python2 -i
	dh_python3 -i
	dh_compress -i -X.py -X.js -X.html
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i -- -Z bzip2

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a
	dh_python2 -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 -- -Z bzip2

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary install get-orig-source