#!/usr/bin/make -f include /usr/share/openstack-pkg-tools/pkgos.make %: dh $@ --buildsystem=pybuild --with python3,sphinxdoc override_dh_auto_clean: find . -iname '*.pyc' -delete rm -f debian/cloudkitty-common.config debian/cloudkitty-common.postinst rm -f debian/cloudkitty-api.config debian/cloudkitty-api.postinst debian/cloudkitty-common.postrm rm -f debian/*.init debian/*.upstart debian/*.service debian/*.templates rm -rf build *.egg-info $(CURDIR)/debian/po find . -iname '*.pyc' -delete for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done cp $(CURDIR)/debian/cloudkitty.conf.sample doc/source/_static/cloudkitty.conf.sample override_dh_auto_build: /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cloudkitty-common.config /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cloudkitty-common.postinst /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cloudkitty-api.config /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func cloudkitty-api.postinst /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm cloudkitty-common.postrm pkgos-merge-templates cloudkitty-api cloudkitty endpoint pkgos-merge-templates cloudkitty-common cloudkitty db rabbit ksat override_dh_auto_install: echo "Do nothing..." override_dh_auto_test: echo "Do nothing..." override_dh_install: for i in $(PYTHON3S) ; do \ python$$i setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp ; \ done # Patch to find metrics.yml from curdir instead of /etc # This is needed for both tests and generating cloudkitty.conf patch -p1 <$(CURDIR)/debian/cloudkitty.collector.__init__.py.patch cp cloudkitty/collector/__init__.py $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/cloudkitty/collector ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) pkgos-dh_auto_test --no-py2 'cloudkitty\.tests(?!(.*collectors\.test_prometheus.*|.*storage\.v1\.test_hybrid_storage.*|.*test_hacking\.HackingTestCase\.test_logging_with_tuple_argument.*|.*storage\.v1\.test_storage\.StorageTotalTest\.test_get_total_without_filter_but_timestamp.*))' endif mkdir -p $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \ --output-file $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf \ --namespace cloudkitty.common.config \ --namespace oslo.concurrency \ --namespace oslo.db \ --namespace oslo.log \ --namespace oslo.messaging \ --namespace oslo.middleware.http_proxy_to_wsgi \ --namespace oslo.middleware.cors \ --namespace oslo.policy \ --namespace keystonemiddleware.auth_token pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf keystone_authtoken cloudkitty # Unpatch for production patch -p1 -R <$(CURDIR)/debian/cloudkitty.collector.__init__.py.patch cp cloudkitty/collector/__init__.py $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/cloudkitty/collector # Set everything to use [keystone_authtoken] by default, otherwise it points to a non-working config pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf ceilometer_collector auth_section keystone_authtoken pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf gnocchi_collector auth_section keystone_authtoken pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf keystone_fetcher auth_section keystone_authtoken # Set correct value for metrics.yml after we've patched it: pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf collect metrics_conf /etc/cloudkitty/metrics.yml # Set the lock_path pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf oslo_concurrency lock_path /var/lock/cloudkitty # Fixed default backend pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf fetcher backend keystone # Fixed using /etc/cloudkitty/policy.d pkgos-fix-config-default $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/cloudkitty.conf oslo_policy policy_dirs /etc/cloudkitty/policy.d mkdir -p $(CURDIR)/debian/cloudkitty-common/etc/cloudkitty/policy.d PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \ --output-file $(CURDIR)/debian/cloudkitty-common/etc/cloudkitty/policy.d/00_default_policy.yaml \ --format yaml \ --namespace cloudkitty for i in api_paste.ini metrics.yml ; do \ install -D -m 0664 etc/cloudkitty/$$i $(CURDIR)/debian/cloudkitty-common/usr/share/cloudkitty-common/$$i ; \ done dh_install dh_missing --fail-missing # Generate all config files override_dh_sphinxdoc: ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) # Warning: building doc fails. set -e ; set -x ; if ! PYTHON=python3 python3 -m sphinx $(SPHINXOPTS) -b html doc/source $(CURDIR)/debian/cloudkitty-doc/usr/share/doc/cloudkitty-doc/html ; then \ cat /tmp/sphinx-err*.log ; \ exit 1 ; \ fi rm -rf $(CURDIR)/debian/cloudkitty-doc/usr/share/doc/cloudkitty-doc/html/.doctrees if [ -e $(CURDIR)/debian/cloudkitty-doc/usr/share/doc/cloudkitty-doc/html/_static ] ; then \ touch $(CURDIR)/debian/cloudkitty-doc/usr/share/doc/cloudkitty-doc/html/_static/toggle.js ; \ fi dh_sphinxdoc endif override_dh_installman: ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) echo "No man pages for now" # sphinx-build $(SPHINXOPTS) -b man doc/source doc/build/man # dh_installman endif override_dh_python3: dh_python3 --shebang=/usr/bin/python3