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
|
#!/usr/bin/make -f
PYTHONS:=$(shell pyversions -vr)
PYTHON3S:=$(shell py3versions -vr)
export PACKAGE_VERSION=$(shell dpkg-parsechangelog | grep Version: | cut -d' ' -f2 | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//' -e 's/~/.0/' | head -n 1)
PYTHON3:=$(shell py3versions -r)
py3sdo=set -ex; $(foreach py, $(PYTHON3), $(py) $(1);)
UPSTREAM_GIT := https://github.com/Julian/jsonschema.git
-include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --with python2,python3
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
nosetests -v
nosetests3 -v
endif
override_dh_auto_build:
echo $$PACKAGE_VERSION | sed s/\\./-/g >version.txt
dh_auto_build
$(call py3sdo, setup.py build)
override_dh_auto_install:
set -e ; for pyvers in $(PYTHONS); do \
python$$pyvers setup.py install --install-layout=deb \
--root $(CURDIR)/debian/python-jsonschema; \
done
set -e ; for pyvers in $(PYTHON3S); do \
python$$pyvers setup.py install --install-layout=deb \
--root $(CURDIR)/debian/python3-jsonschema; \
done
rm -f $(CURDIR)/debian/python*/usr/lib/python*/dist-packages/*.pth
mv $(CURDIR)/debian/python-jsonschema/usr/bin/jsonschema $(CURDIR)/debian/python-jsonschema/usr/bin/python2-jsonschema
mv $(CURDIR)/debian/python3-jsonschema/usr/bin/jsonschema $(CURDIR)/debian/python3-jsonschema/usr/bin/python3-jsonschema
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
override_dh_auto_clean:
echo $$PACKAGE_VERSION | sed s/\\./-/g >version.txt
#http_proxy=127.0.0.1:9 https_proxy=127.0.0.1:9 dh_auto_clean
rm -rf build version.txt
rm -rf __pycache__
|