| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
UPSTREAM_GIT = https://github.com/openstack/neutron-dynamic-routing.git |
| 4 |
include /usr/share/openstack-pkg-tools/pkgos.make |
| 5 |
|
| 6 |
%: |
| 7 |
dh $@ --buildsystem=pybuild --with python3 |
| 8 |
|
| 9 |
override_dh_auto_clean: |
| 10 |
python3 setup.py clean |
| 11 |
rm -f debian/*.init debian/*.service debian/*.upstart |
| 12 |
rm -rf build *.egg-info |
| 13 |
rm -f debian/neutron-dynamic-routing-common.config debian/neutron-dynamic-routing-common.postinst |
| 14 |
find . -iname '*.pyc' -delete |
| 15 |
for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done |
| 16 |
|
| 17 |
override_dh_clean: |
| 18 |
dh_clean |
| 19 |
find . -type f -name "*.pyc" -delete |
| 20 |
rm -rf build |
| 21 |
|
| 22 |
override_dh_auto_build: |
| 23 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-dynamic-routing-common.config |
| 24 |
/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-dynamic-routing-common.postinst |
| 25 |
|
| 26 |
override_dh_auto_install: |
| 27 |
echo "Do nothing..." |
| 28 |
|
| 29 |
override_dh_install: |
| 30 |
set -e ; for pyvers in $(PYTHON3S); do \ |
| 31 |
python$$pyvers setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \ |
| 32 |
done |
| 33 |
|
| 34 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) |
| 35 |
pkgos-dh_auto_test --no-py2 'neutron_dynamic_routing\.tests.unit\.(?!(.*services\.bgp.agent\.test_bgp_dragent\.TestBgpDrAgent\.test_bgp_dragent_manager.*))' |
| 36 |
endif |
| 37 |
|
| 38 |
mkdir -p $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron |
| 39 |
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslo-config-generator \ |
| 40 |
--output-file $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron/bgp_dragent.ini \ |
| 41 |
--wrap-width 140 \ |
| 42 |
--namespace bgp.agent |
| 43 |
|
| 44 |
mkdir -p $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron/policy.d |
| 45 |
PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages oslopolicy-sample-generator \ |
| 46 |
--output-file $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron/policy.d/dynamic_routing.json \ |
| 47 |
--namespace neutron-dynamic-routing |
| 48 |
|
| 49 |
rm -rf $(CURDIR)/debian/tmp/usr/etc |
| 50 |
|
| 51 |
# Fix bgp_speaker_driver |
| 52 |
# neutron_dynamic_routing.services.bgp.agent.driver.os_ken.driver.OsKenBgpDriver is currently only one and should be default |
| 53 |
pkgos-fix-config-default $(CURDIR)/debian/neutron-dynamic-routing-common/etc/neutron/bgp_dragent.ini bgp bgp_speaker_driver neutron_dynamic_routing.services.bgp.agent.driver.os_ken.driver.OsKenBgpDriver |
| 54 |
|
| 55 |
dh_install |
| 56 |
dh_missing --fail-missing |
| 57 |
|
| 58 |
override_dh_auto_test: |
| 59 |
echo "Do nothing..." |
| 60 |
|
| 61 |
override_dh_python3: |
| 62 |
dh_python3 --shebang=/usr/bin/python3 |