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
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
export DH_VERBOSE=1
export http_proxy=http://127.0.0.1:9/
PACKAGE2_NAME = python-patsy
PACKAGE3_NAME = python3-patsy
PACKAGE2_ROOT_DIR = debian/${PACKAGE2_NAME}
PACKAGE3_ROOT_DIR = debian/${PACKAGE3_NAME}
PYVERS = $(shell pyversions -vr)
PYVER = $(shell pyversions -vd)
PY3VERS = $(shell py3versions -vr)
PY3VER = $(shell py3versions -vd)
UVER := $(shell LC_ALL=C dpkg-parsechangelog | awk '/^Version:/{print $$2;}' | sed -e 's,-[^-]*$$,,g')
# Some unittests might need to be excluded for different Python versions
EXCLUDE_TESTS2 :=
EXCLUDE_TESTS3.2 :=
#--exclude "test_bootstrap_plot"
EXCLUDE_TESTS3.3 :=
#--exclude "test_(bootstrap_plot|quoting|cant_compare_tz_naive_w_aware|more_flexible_frame_multi_function|yahoo)"
# 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 '')
# Mega rule
%:
: # Explicit build system to avoid use of all-in-1 Makefile
dh $@ --buildsystem=python_distutils --with python2,python3
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: $(PYVERS:%=python-install%) $(PY3VERS:%=python-install%) \
${PYVERS:%=python-test%} ${PY3VERS:%=python-test%}
: # nothing more to do
override_dh_clean:
rm -rf build *.egg-info doc/_build
dh_clean
python-test%: python-install%
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
echo "backend : Agg" >| $(CURDIR)/build/matplotlibrc
: # Run unittests here against installed patsy
echo "$*" | grep -q '^3' && PY=3 || PY=$*; \
export PYTHONPATH=`/bin/ls -d $$PWD/debian/tmp/usr/lib/python$$PY/*/`; \
export MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \
mkdir -p build/tmp; cd build/tmp; \
python$* /usr/bin/nosetests -s -v $(EXCLUDE_TESTS$*) patsy;
else
: # Skip unittests due to nocheck
endif
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/$(PACKAGE2_ROOT_DIR)/usr/lib/python$(PYVER)/*`$(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
|