| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/openstack-pkg-tools/pkgos.make |
| 4 |
|
| 5 |
%: |
| 6 |
dh $@ --buildsystem=pybuild --with python3,sphinxdoc |
| 7 |
|
| 8 |
override_dh_auto_install: |
| 9 |
echo "Do nothing..." |
| 10 |
|
| 11 |
override_dh_auto_clean: |
| 12 |
python3 setup.py clean |
| 13 |
rm -rf build .stestr *.egg-info debian/*.templates debian/po .pybuild |
| 14 |
find . -iname '*.pyc' -delete |
| 15 |
for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done |
| 16 |
rm -f debian/magnum-common.config debian/magnum-common.postinst debian/magnum-api.config debian/magnum-api.postinst |
| 17 |
rm -rf debian/*.upstart debian/*.service debian/*.init |
| 18 |
|
| 19 |
override_dh_auto_test: |
| 20 |
echo "Do nothing..." |
| 21 |
|
| 22 |
override_dh_auto_build: |
| 23 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func magnum-common.postinst |
| 24 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func magnum-common.config |
| 25 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func magnum-api.postinst |
| 26 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func magnum-api.config |
| 27 |
pkgos-merge-templates magnum-api magnum endpoint |
| 28 |
pkgos-merge-templates magnum-common magnum db rabbit ksat |
| 29 |
|
| 30 |
override_dh_install: |
| 31 |
for i in $(PYTHON3S) ; do \ |
| 32 |
python$$i setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp ; \ |
| 33 |
done |
| 34 |
rm -rf $(CURDIR)/debian/tmp/usr/etc |
| 35 |
|
| 36 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) |
| 37 |
# See https://storyboard.openstack.org/#!/story/2003565 |
| 38 |
# to follow-up on failed tests in Sid (works in Stretch) |
| 39 |
pkgos-dh_auto_test --no-py2 --concurrency 2 'magnum\.tests\.unit\.(?!(drivers\.test_heat_driver\.TestHeatPoller\.test_poll_done|drivers\.test_heat_driver\.TestHeatPoller\.test_poll_destroy|api\.controllers\.v1\.test_baymodel\.TestPatch|api\.controllers\.v1\.test_baymodel\.TestPost|api\.controllers\.v1\.test_cluster_template\.TestPost|api\.controllers\.v1\.test_cluster_template\.TestListClusterTemplate|api\.controllers\.v1\.test_cluster_template\.TestPatch\.test_update_cluster_template_with_cluster_not_allow_update|api\.controllers\.v1\.test_federation\.TestListFederation\.test_collection_links|api\.controllers\.v1\.test_federation\.TestPost\.test_create_federation_with_valid_name))' |
| 40 |
endif |
| 41 |
|
| 42 |
# mkdir -p $(CURDIR)/debian/python3-magnum/usr/bin |
| 43 |
# cp $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/magnum/api/app.wsgi $(CURDIR)/debian/python3-magnum/usr/bin/magnum-api-wsgi |
| 44 |
# chmod +x $(CURDIR)/debian/python3-magnum/usr/bin/magnum-api-wsgi |
| 45 |
|
| 46 |
dh_install --fail-missing |
| 47 |
mkdir -p $(CURDIR)/debian/magnum-common/usr/share/magnum-common |
| 48 |
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \ |
| 49 |
--output-file $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf \ |
| 50 |
--namespace magnum.conf \ |
| 51 |
--namespace oslo.concurrency \ |
| 52 |
--namespace oslo.db \ |
| 53 |
--namespace oslo.log \ |
| 54 |
--namespace oslo.messaging \ |
| 55 |
--namespace oslo.middleware.cors \ |
| 56 |
--namespace oslo.policy \ |
| 57 |
--namespace oslo.service.periodic_task \ |
| 58 |
--namespace oslo.service.service \ |
| 59 |
--namespace oslo.versionedobjects \ |
| 60 |
--namespace keystonemiddleware.auth_token |
| 61 |
|
| 62 |
pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_authtoken magnum |
| 63 |
|
| 64 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf oslo_concurrency lock_path /var/lock/magnum |
| 65 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_authtoken auth_protocol http |
| 66 |
|
| 67 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf DEFAULT pybasedir /usr/lib/python3/dist-packages |
| 68 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf DEFAULT bindir /usr/bin |
| 69 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf DEFAULT state_path /var/lock/magnum |
| 70 |
|
| 71 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf api host 0.0.0.0 |
| 72 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf certificates cert_manager_type barbican |
| 73 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf oslo_messaging_notifications driver messaging |
| 74 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_authtoken auth_version v3 |
| 75 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf trust cluster_user_trust true |
| 76 |
|
| 77 |
# Magnum using also keystone_auth, set some defaults |
| 78 |
# which are configured by debconf later |
| 79 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth auth_protocol http |
| 80 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth auth_version v3 |
| 81 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth auth_url http://localhost:5000 |
| 82 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth www_authenticate_uri http://localhost:5000 |
| 83 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth project_name service |
| 84 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth project_domain_name default |
| 85 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth username magnum |
| 86 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth user_domain_name default |
| 87 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth region_name regionOne |
| 88 |
pkgos-fix-config-default $(CURDIR)/debian/magnum-common/usr/share/magnum-common/magnum.conf keystone_auth auth_type password |
| 89 |
|
| 90 |
mkdir -p $(CURDIR)/debian/magnum-common/etc/magnum/policy.d |
| 91 |
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \ |
| 92 |
--output-file $(CURDIR)/debian/magnum-common/etc/magnum/policy.d/00_default_policy.yaml \ |
| 93 |
--namespace magnum |
| 94 |
|
| 95 |
# Comment out deprecated policies, otherwise, Nova doesn't work |
| 96 |
sed -i 's/^"/#"/' $(CURDIR)/debian/magnum-common/etc/magnum/policy.d/00_default_policy.yaml |
| 97 |
|
| 98 |
cp etc/magnum/api-paste.ini $(CURDIR)/debian/magnum-common/usr/share/magnum-common |
| 99 |
cp etc/magnum/keystone_auth_default_policy.sample $(CURDIR)/debian/magnum-common/usr/share/magnum-common/keystone_auth_default_policy.json |
| 100 |
|
| 101 |
override_dh_python3: |
| 102 |
dh_python3 --shebang=/usr/bin/python3 |