0 | 0 |
#!/usr/bin/make -f
|
1 | |
|
2 | |
PYTHONS:=$(shell pyversions -vr)
|
3 | |
PYTHON3S:=$(shell py3versions -vr)
|
4 | 1 |
|
5 | 2 |
UPSTREAM_GIT := https://github.com/openstack/castellan.git
|
6 | 3 |
include /usr/share/openstack-pkg-tools/pkgos.make
|
7 | |
export OSLO_PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)
|
8 | 4 |
|
9 | 5 |
%:
|
10 | 6 |
dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc
|
11 | 7 |
|
12 | 8 |
override_dh_auto_install:
|
13 | |
set -e ; for pyvers in $(PYTHONS); do \
|
14 | |
python$$pyvers setup.py install --install-layout=deb \
|
15 | |
--root $(CURDIR)/debian/python-castellan; \
|
16 | |
done
|
17 | |
set -e ; for pyvers in $(PYTHON3S); do \
|
18 | |
python$$pyvers setup.py install --install-layout=deb \
|
19 | |
--root $(CURDIR)/debian/python3-castellan; \
|
20 | |
done
|
21 | |
rm -rf $(CURDIR)/debian/python*-castellan/usr/lib/python*/dist-packages/*.pth
|
|
9 |
pkgos-dh_auto_install
|
22 | 10 |
|
23 | 11 |
mkdir -p $(CURDIR)/debian/python-castellan/etc/castellan
|
24 | 12 |
PYTHONPATH=. oslo-config-generator --output-file $(CURDIR)/debian/python-castellan/etc/castellan/castellan.conf \
|
|
27 | 15 |
|
28 | 16 |
override_dh_auto_test:
|
29 | 17 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
|
30 | |
@echo "===> Running tests"
|
31 | |
set -e ; set -x ; for i in 2.7 $(PYTHON3S) ; do \
|
32 | |
PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
|
33 | |
echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
|
34 | |
rm -rf .testrepository ; \
|
35 | |
testr-python$$PYMAJOR init ; \
|
36 | |
TEMP_REZ=`mktemp -t` ; \
|
37 | |
OS_TEST_PATH=castellan/tests/unit PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit 'castellan\.tests\.unit.*' | tee $$TEMP_REZ | subunit2pyunit ; \
|
38 | |
cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
|
39 | |
rm -f $$TEMP_REZ ; \
|
40 | |
testr-python$$PYMAJOR slowest ; \
|
41 | |
done
|
|
18 |
pkgos-dh_auto_test 'castellan\.tests\.unit.*'
|
42 | 19 |
endif
|
43 | |
|
44 | 20 |
|
45 | 21 |
override_dh_sphinxdoc:
|
46 | 22 |
sphinx-build -b html doc/source debian/python-castellan-doc/usr/share/doc/python-castellan-doc/html
|
47 | 23 |
dh_sphinxdoc -O--buildsystem=python_distutils
|
48 | |
|
49 | 24 |
|
50 | 25 |
override_dh_clean:
|
51 | 26 |
dh_clean -O--buildsystem=python_distutils
|