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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
# auth_token middleware now requires access to HOME, otherwise
# test suite cause FTBFS. See (LP: #1031022)
export HOME="$(CURDIR)/debian/tests/"
# This is to avoid git clone of keystoneclient when running unit tests.
# See https://review.openstack.org/122768/
export KSCTEST_PATH=/usr/lib/python2.7/dist-packages/keystoneclient
include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --buildsystem=python_distutils --with python2,sphinxdoc,systemd
override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
@echo "===> Running tests"
mkdir -p $(CURDIR)/keystone/tests/tmp
patch -p1 -R <debian/patches/fixes-default-connection.patch
set -e ; set -x ; for i in 2.7 ; do \
PYMAJOR=`echo $$i | cut -d'.' -f1` ; \
echo "===> Testing with python$$i (python$$PYMAJOR)" ; \
rm -rf .testrepository ; \
testr-python$$PYMAJOR init ; \
TEMP_REZ=`mktemp -t` ; \
PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit --parallel 'keystone\.tests\.unit.*' | tee $$TEMP_REZ | subunit2pyunit ; \
cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \
rm -f $$TEMP_REZ ; \
testr-python$$PYMAJOR slowest ; \
done
patch -p1 <debian/patches/fixes-default-connection.patch
endif
override_dh_auto_build:
dh_auto_build
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func keystone.config
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func keystone.postinst
override_dh_sphinxdoc:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=. sphinx-build -b html doc/source $(CURDIR)/debian/keystone-doc/usr/share/doc/keystone-doc/html
dh_sphinxdoc -O--buildsystem=python_distutils
endif
override_dh_installman:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
PYTHONPATH=. sphinx-build -b man doc/source doc/build/man
dh_installman -O--buildsystem=python_distutils
endif
override_dh_install:
rm -rf $(CURDIR)/debian/tmp/usr/etc
dh_install --fail-missing
rm -rf debian/python-keystone/usr/lib/python*/*/doc
rm -rf debian/python-keystone/usr/lib/python*/*/tools
rm -rf debian/python-keystone/usr/lib/python*/*/examples
install -D -m 0600 $(CURDIR)/debian/logging.conf $(CURDIR)/debian/keystone/etc/keystone/logging.conf
mkdir -p $(CURDIR)/debian/keystone/usr/share/keystone
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python2.7/dist-packages oslo-config-generator --output-file $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf \
--wrap-width 79 \
--namespace keystone \
--namespace keystone.notifications \
--namespace oslo.cache \
--namespace oslo.log \
--namespace oslo.messaging \
--namespace oslo.policy \
--namespace oslo.db \
--namespace oslo.middleware \
--namespace osprofiler
pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf catalog template_file /etc/keystone/default_catalog.templates
pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf DEFAULT log_dir /var/log/keystone
pkgos-fix-config-default $(CURDIR)/debian/keystone/usr/share/keystone/keystone.conf DEFAULT log_file keystone.log
install -D -m 0644 httpd/keystone.py $(CURDIR)/debian/python-keystone/usr/share/keystone/wsgi.py
dh_python2 /usr/share/keystone
install -D -m 0644 debian/keystone.apparmor $(CURDIR)/debian/keystone/etc/apparmor.d/usr.bin.keystone-all
dh_apparmor --profile-name=usr.bin.keystone-all
override_dh_clean:
rm -rf $(CURDIR)/build $(CURDIR)/keystone.egg-info $(CURDIR)/.cache
rm -rf $(CURDIR)/keystone/test/keystone.sql.log $(CURDIR)/keystone/test/keystone.ldap.log
rm -rf $(CURDIR)/doc/build
# NOTE(adam_g) The following stuff is built in /doc/source. Safe for now, but
# should be fixed upstream or updated here post-essex
rm -rf $(CURDIR)/doc/source/keystone*.rst
rm -rf $(CURDIR)/doc/source/modules.rst
rm -rf $(CURDIR)/doc/source/sourcecode $(CURDIR)/doc/source/api
rm -rf $(CURDIR)/admin.log $(CURDIR)/keystone-legacy-auth.log
rm -f $(CURDIR)/debian/keystone.config $(CURDIR)/debian/keystone.postinst
find $(CURDIR)/keystone/tests -name '*.db' -delete
rm -rf $(CURDIR)/vendor
rm -f $(CURDIR)/debian/tests/testing.db
rm -f $(CURDIR)/debian/keystone.keystone*.init $(CURDIR)/debian/keystone.keystone*.service $(CURDIR)/debian/keystone.keystone*.upstart
dh_clean
#override_dh_installmenu:
# dh_installinit --name=keystone-admin
# dh_installinit --name=keystone-public
|