#!/usr/bin/make -f include /usr/share/openstack-pkg-tools/pkgos.make %: dh $@ --buildsystem=python_distutils --with python3,sphinxdoc override_dh_auto_clean: rm -f debian/*.init debian/*.service debian/*.upstart rm -rf build rm -rf barbican.sqlite debian/po debian/barbican-api.templates debian/barbican-common.templates rm -f debian/barbican-api.postinst debian/barbican-api.config debian/barbican-common.postinst debian/barbican-common.config debian/barbican-common.postrm find $(CURDIR) -type f -iname '*.pyc' -delete || true find $(CURDIR) -type d -iname __pycache__ -exec rm -rf {} \; || true rm -rf *.egg-info rm -f doc/source/_static/barbican.conf.sample doc/source/_static/barbican.policy.yaml.sample override_dh_auto_build: /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func barbican-api.postinst /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func barbican-api.config /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func barbican-common.postinst /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func barbican-common.config /usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm barbican-common.postrm pkgos-merge-templates barbican-api barbican endpoint pkgos-merge-templates barbican-common barbican db rabbit ksat override_dh_auto_test: echo "Do nothing..." override_dh_auto_install: echo "Do nothing..." override_dh_install: for i in $(PYTHON3S) ; do \ python$$i setup.py install --root=debian/tmp --install-layout=deb ; \ done # test_should_raise_with_unsigned_pkcs10_data see #1011703 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) # This needs further setup. Let's disable it for now: # barbican.tests.queue.test_keystone_listener.WhenUsingNotificationTask.* pkgos-dh_auto_test --no-py2 'barbican\.tests\.(?!(.*common.test_utils\.WhenTestingAcceptEncodingGetter\.test_get_correct_fullname_for_class.*|.*common\.test_utils\.WhenTestingGenerateFullClassnameForInstance\.test_returns_qualified_name.*|.*plugin\.interface\.test_certificate_manager\.WhenTestingCertificateEventPluginManager\.test_get_plugin_by_name.*|.*plugin\.interface\.test_certificate_manager\.WhenTestingCertificatePluginManager\.test_get_plugin_by_ca_id.*|.*plugin\.interface\.test_certificate_manager\.WhenTestingCertificatePluginManager\.test_get_plugin_by_name.*|.*plugin\.interface\.test_certificate_manager\.WhenTestingCertificatePluginManager\.test_refresh_ca_list.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_delete_secret_assert_called.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_generate_asymmetric_key_assert_called.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_generate_symmetric_key_assert_called.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_get_secret_opaque.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_get_secret_private_key.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_get_secret_public_key.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_get_secret_symmetric.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_store_private_key_secret_assert_called.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_store_symmetric_secret_assert_called.*|.*tasks\.test_keystone_consumer\.WhenUsingKeystoneEventConsumerProcessMethod\.test_existing_project_entities_cleanup_for_plain_secret.*|.*plugin\.test_kmip\.WhenTestingKMIPSecretStore\.test_credential.*|.*test_hacking\.HackingTestCase\.test_logging_with_tuple_argument.*|.*common\.test_validators\.WhenTestingSecretMetadataValidator\.test_should_validate_all_fields_and_make_key_lowercase.*|.*test_hacking\.HackingTestCase\.test_str_on_exception.*|.*test_hacking\.HackingTestCase\.test_str_on_multiple_exceptions.*|.*test_hacking\.HackingTestCase\.test_str_unicode_on_multiple_exceptions.*|.*test_hacking\.HackingTestCase\.test_unicode_on_exception.*|.*common\.test_validators\.WhenTestingSimpleCMCOrderValidator\.test_should_raise_with_unsigned_pkcs10_data.*|.*test_keystone_listener\.WhenUsingNotificationTask.*))' endif # Generate the barbican.conf config using installed python-barbican files. mkdir -p $(CURDIR)/debian/barbican-common/usr/share/barbican-common PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \ --output-file $(CURDIR)/debian/barbican-common/usr/share/barbican-common/barbican.conf \ --wrap-width 140 \ --namespace barbican.certificate.plugin \ --namespace barbican.certificate.plugin.snakeoil \ --namespace barbican.common.config \ --namespace barbican.plugin.crypto \ --namespace barbican.plugin.crypto.p11 \ --namespace barbican.plugin.crypto.simple \ --namespace barbican.plugin.dogtag \ --namespace barbican.plugin.secret_store \ --namespace barbican.plugin.secret_store.kmip \ --namespace barbican.plugin.secret_store.vault \ --namespace keystonemiddleware.audit \ --namespace keystonemiddleware.auth_token \ --namespace oslo.log \ --namespace oslo.messaging \ --namespace oslo.middleware.cors \ --namespace oslo.middleware.healthcheck \ --namespace oslo.middleware.http_proxy_to_wsgi \ --namespace oslo.policy \ --namespace oslo.service.periodic_task \ --namespace oslo.service.service \ --namespace oslo.service.sslutils \ --namespace oslo.service.wsgi pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/barbican-common/usr/share/barbican-common/barbican.conf keystone_authtoken barbican # Same with policy.conf mkdir -p $(CURDIR)/debian/barbican-common/etc/barbican/policy.d PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \ --output-file $(CURDIR)/debian/barbican-common/etc/barbican/policy.d/00_default_policy.yaml \ --format yaml \ --namespace barbican # Comment out deprecated policies, otherwise, the policy doesn't work sed -i 's/^"/#"/' $(CURDIR)/debian/barbican-common/etc/barbican/policy.d/00_default_policy.yaml # Use the policy.d folder pkgos-fix-config-default $(CURDIR)/debian/barbican-common/usr/share/barbican-common/barbican.conf oslo_policy policy_dirs /etc/barbican/policy.d # Restore sanity... pkgos-fix-config-default $(CURDIR)/debian/barbican-common/usr/share/barbican-common/barbican.conf keystone_notifications enable True dh_install rm -rf $(CURDIR)/debian/tmp/usr/etc dh_missing --fail-missing # Installing the other config files. for i in api_audit_map.conf barbican-api-paste.ini barbican-functional.conf ; do \ install -D -m 0664 etc/barbican/$$i $(CURDIR)/debian/barbican-common/usr/share/barbican-common/$$i ; \ done override_dh_sphinxdoc: ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) PYTHONPATH=. PYTHON=python3 python3 -m sphinx -b html doc/source $(CURDIR)/debian/barbican-doc/usr/share/doc/barbican-doc/html dh_sphinxdoc endif override_dh_python3: dh_python3 --shebang=/usr/bin/python3