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
|
#!/usr/bin/make -f
include /usr/share/openstack-pkg-tools/pkgos.make
%:
dh $@ --buildsystem=python_distutils --with python3,systemd,sphinxdoc
override_dh_auto_clean:
rm -f debian/*.init debian/*.service debian/*.upstart
rm -rf build
rm -rf barbican.sqlite
rm -f debian/barbican-api.postinst debian/barbican-api.config debian/barbican-common.postinst debian/barbican-common.config debian/barbican-common.postrm
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
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
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.*))'
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 keystonemiddleware.auth_token \
--namespace oslo.log \
--namespace oslo.messaging \
--namespace oslo.middleware.cors \
--namespace oslo.middleware.http_proxy_to_wsgi \
--namespace oslo.policy \
--namespace oslo.service.periodic_task \
--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
# 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
|