File: rules

package info (click to toggle)
mysql-utilities 1.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,652 kB
  • ctags: 4,666
  • sloc: python: 38,288; makefile: 25
file content (37 lines) | stat: -rwxr-xr-x 1,163 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
#!/usr/bin/make -f

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

LIB := $$(python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib")

%:
	dh $@ --with python2

override_dh_clean:
	dh_clean
	$(RM) -r build
	$(RM) -rf mysql/connector/
	find scripts -mindepth 1 -regex '[^.]*' -delete -printf 'removing %p\n'

TESTS=$(wildcard unit_tests/test*.py)
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Link mysql.connector directory in the build dir, as they share the same ns
	# we cd to / as otherwise we pick the local mysql/ dir
	ln -s $$(dirname $$(cd / ; python -c "import mysql.connector as p; print p.__file__" ; cd $(CURDIR))) $(CURDIR)/$(LIB)/mysql
	set -e \
	;for python in $(shell pyversions -r); do \
	    for test in $(TESTS); do \
	        echo -e "\n### $$python::$$test" ;\
	        PYTHONPATH="$(CURDIR)/$(LIB)" $$python $$test ;\
	    done \
	;done
	rm $(CURDIR)/$(LIB)/mysql/connector
endif

override_dh_installdocs:
	dh_installdocs README*

override_dh_python2:
	dh_python2 --no-guessing-deps