File: rules

package info (click to toggle)
patsy 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,448 kB
  • sloc: python: 9,525; javascript: 204; makefile: 110
file content (60 lines) | stat: -rwxr-xr-x 1,920 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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

export DH_VERBOSE=1
export http_proxy=http://127.0.0.1:9/

PACKAGE3_NAME = python3-patsy
PACKAGE3_ROOT_DIR = debian/${PACKAGE3_NAME}

PY3VERS = $(shell py3versions -vr)
PY3VER = $(shell py3versions -vd)

# MPLVER := $(shell dpkg -l python-matplotlib | awk '/^ii/{print $$3;}' || echo 0)
# $(shell dpkg --compare-versions $(MPLVER) lt 1.0 && echo '|test_hist|test_plot|test_boxplot|test_corr_rank' || echo '')
IPYTHONVER := $(shell dpkg -l ipython | awk '/^ii/{print $$3;}' || echo 0)
IPYTHONPATH=$(shell dpkg --compare-versions $(IPYTHONVER) lt 1.0 && echo ':/usr/share/pyshared/IPython1X/' || echo '')

export PYBUILD_BEFORE_TEST = cp -r {dir}/patsy {build_dir}

# Mega rule
%:
	: # Explicit build system to avoid use of all-in-1 Makefile
	dh $@ --buildsystem=pybuild

python-build%:
	python$* setup.py build

override_dh_auto_build: $(PY3VERS:%=python-build%)
	dh_auto_build

python-install%:
	python$* setup.py install --root=$(CURDIR)/debian/tmp \
		--force --install-layout=deb

override_dh_auto_install: $(PY3VERS:%=python-install%)
	: # nothing more to do

override_dh_clean:
	rm -rf doc/_build doc/savefig
	dh_clean

override_dh_installdocs:
	: # Build Documentation using installed patsy
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
ifneq (,$(findstring -a,$(DH_INTERNAL_OPTIONS)))
	: # not building documentation in -a
else
	export PYTHONPATH=`/bin/ls -d $$PWD/$(PACKAGE3_ROOT_DIR)/usr/lib/python$(PY3VER)/*`$(IPYTHONPATH); \
	export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \
	 make -C doc html
	: # Use jquery from Debian package, so prune shipped one
	-rm doc/_build/html/_static/jquery.js
	-rm doc/_build/html/_static/underscore.js
	dh_installdocs
endif
endif

## immediately useable documentation and exemplar scripts/data
override_dh_compress:
	dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -Xobjects.inv