File: rules

package info (click to toggle)
neutron 2:13.0.2-15
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 30,764 kB
  • sloc: python: 188,554; sh: 1,060; makefile: 246
file content (221 lines) | stat: -rwxr-xr-x 10,734 bytes parent folder | download
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/usr/bin/make -f

include /usr/share/openstack-pkg-tools/pkgos.make

DHCP_CONF=$(CURDIR)/debian/neutron-common/usr/share/neutron-common/dhcp_agent.ini
L3_CONF=$(CURDIR)/debian/neutron-common/usr/share/neutron-common/l3_agent.ini
ML2_CONF=$(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2/ml2_conf.ini
OVS_CONF=$(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2/openvswitch_agent.ini
N_CONF=$(CURDIR)/debian/neutron-common/usr/share/neutron-common/neutron.conf

%:
	dh $@ --buildsystem=python_distutils --with python3,systemd

override_dh_auto_clean:
	python3 setup.py clean
	find . -type f -name "*.pyc" | xargs rm -fr
	rm -rf build neutron.egg-info
	rm -f debian/neutron-common.config \
		debian/neutron-common.postinst \
		debian/neutron-api.config \
		debian/neutron-api.postinst \
		debian/neutron-dhcp-agent.postinst \
		debian/neutron-metadata-agent.config \
		debian/neutron-metadata-agent.postinst \
		debian/neutron-common.postrm
	rm -f debian/*.init debian/*.service debian/*.upstart debian/neutron-common.templates

override_dh_clean:
	dh_clean
	find . -type f -name "*.pyc" -delete
	rm -f AUTHORS ChangeLog

override_dh_auto_build:
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-common.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-common.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-api.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-api.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-dhcp-agent.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-metadata-agent.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-metadata-agent.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-openvswitch-agent.postinst
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_func neutron-openvswitch-agent.config
	/usr/share/openstack-pkg-tools/pkgos_insert_include pkgos_postrm neutron-common.postrm
	pkgos-merge-templates neutron-api neutron endpoint
	pkgos-merge-templates neutron-common neutron db rabbit ksat

override_dh_auto_test:
	echo "Doing nothing..."

override_dh_auto_install:
	echo "Do nothing..."

override_dh_install:
	python3 setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages pkgos-dh_auto_test --no-py2 'neutron\.tests\.unit(?!.*test_wsgi\.TestWSGIServer\.test_start_random_port_with_ipv6.*|.*agent\.dhcp\.test_agent\.TestDhcpAgent\.test_dhcp_agent_manager.*|.*test_wsgi\.TestWSGIServer\.test_app.*|.*test_wsgi\.TestWSGIServer\.test_disable_ssl.*)'
endif

	cp -auxf neutron $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages
	rm -rf $(CURDIR)/debian/tmp/usr/etc

	# dhcp_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/dhcp_agent.ini \
		--wrap-width 140 \
		--namespace neutron.az.agent \
		--namespace neutron.base.agent \
		--namespace neutron.dhcp.agent \
		--namespace oslo.log

	pkgos-fix-config-default $(DHCP_CONF) DEFAULT interface_driver openvswitch
	pkgos-fix-config-default $(DHCP_CONF) DEFAULT enable_isolated_metadata True

	# l3_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/l3_agent.ini \
		--wrap-width 140 \
		--namespace neutron.az.agent \
		--namespace neutron.base.agent \
		--namespace neutron.l3.agent \
		--namespace oslo.log

	pkgos-fix-config-default $(L3_CONF) DEFAULT interface_driver openvswitch
	pkgos-fix-config-default $(L3_CONF) DEFAULT ovs_use_veth False

	# linuxbridge_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-linuxbridge-agent/etc/neutron/plugins/ml2
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-linuxbridge-agent/etc/neutron/plugins/ml2/linuxbridge_agent.ini \
		--wrap-width 140 \
		--namespace neutron.ml2.linuxbridge.agent \
		--namespace oslo.log

	# openvswitch_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2/openvswitch_agent.ini \
		--wrap-width 140 \
		--namespace neutron.ml2.ovs.agent \
		--namespace neutron.ml2.xenapi \
		--namespace oslo.log

	pkgos-fix-config-default ${OVS_CONF} agent tunnel_types vxlan
	pkgos-fix-config-default ${OVS_CONF} ovs bridge_mappings external:br-ex
	pkgos-fix-config-default ${OVS_CONF} ovs integration_bridge br-int
	pkgos-fix-config-default ${OVS_CONF} ovs tunnel_bridge br-tun
	pkgos-fix-config-default ${OVS_CONF} securitygroup firewall_driver openvswitch
	pkgos-fix-config-default ${OVS_CONF} securitygroup enable_security_group True
	pkgos-fix-config-default ${OVS_CONF} securitygroup enable_ipset True

	# macvtap_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-macvtap-agent/etc/neutron/plugins/ml2
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-macvtap-agent/etc/neutron/plugins/ml2/macvtap_agent.ini \
		--wrap-width 140 \
		--namespace neutron.ml2.macvtap.agent \
		--namespace oslo.log

	# metadata_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/metadata_agent.ini \
		--wrap-width 140 \
		--namespace neutron.metadata.agent \
		--namespace oslo.log \
		--namespace oslo.cache
#	sed -i 's|^[ #\t]*nova_metadata_protocol[ \t]*=.*|nova_metadata_protocol = http|' $(CURDIR)/debian/neutron-metadata-agent/usr/share/neutron-metadata-agent/metadata_agent.ini
#	sed -i 's|^[ #\t]*nova_metadata_ip[ \t]*=.*|nova_metadata_ip = 127.0.0.1|' $(CURDIR)/debian/neutron-metadata-agent/usr/share/neutron-metadata-agent/metadata_agent.ini

	# metering_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-metering-agent/etc/neutron
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-metering-agent/etc/neutron/metering_agent.ini \
		--wrap-width 140 \
		--namespace neutron.base.agent \
		--namespace neutron.metering.agent \
		--namespace oslo.log

	# ml2_conf.ini

	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/plugins/ml2/ml2_conf.ini \
		--wrap-width 140 \
		--namespace neutron.ml2 \
		--namespace oslo.log

	pkgos-fix-config-default $(ML2_CONF) ml2 type_drivers flat,vxlan
	pkgos-fix-config-default $(ML2_CONF) ml2 tenant_network_types vxlan
	pkgos-fix-config-default $(ML2_CONF) ml2 mechanism_drivers openvswitch,l2population
	pkgos-fix-config-default $(ML2_CONF) ml2_type_flat flat_networks external
	pkgos-fix-config-default $(ML2_CONF) ml2_type_vxlan vni_ranges 1:1000
	pkgos-fix-config-default $(ML2_CONF) securitygroup enable_security_group True
	pkgos-fix-config-default $(ML2_CONF) securitygroup enable_ipset True
	pkgos-fix-config-default $(ML2_CONF) ml2 extension_drivers port_security,qos
	
	# neutron.conf
	mkdir -p $(CURDIR)/debian/neutron-common/usr/share/neutron-common
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/usr/share/neutron-common/neutron.conf \
		--wrap-width 140 \
		--namespace neutron \
		--namespace neutron.agent \
		--namespace neutron.db \
		--namespace neutron.extensions \
		--namespace nova.auth \
		--namespace oslo.log \
		--namespace oslo.db \
		--namespace oslo.policy \
		--namespace oslo.concurrency \
		--namespace oslo.messaging \
		--namespace oslo.middleware.cors \
		--namespace oslo.middleware.http_proxy_to_wsgi \
		--namespace oslo.service.sslutils \
		--namespace oslo.service.wsgi \
		--namespace keystonemiddleware.auth_token

	pkgos-readd-keystone-authtoken-missing-options $(CURDIR)/debian/neutron-common/usr/share/neutron-common/neutron.conf keystone_authtoken neutron

	# Config default for neutron.conf

	pkgos-fix-config-default $(N_CONF) DEFAULT core_plugin ml2
	pkgos-fix-config-default $(N_CONF) oslo_concurrency lock_path /var/lock/neutron
	pkgos-fix-config-default $(N_CONF) DEFAULT interface_driver openvswitch

	pkgos-fix-config-default $(N_CONF) DEFAULT service_plugins router,metering,qos
	pkgos-fix-config-default $(N_CONF) DEFAULT auth_strategy keystone
	pkgos-fix-config-default $(N_CONF) DEFAULT allow_overlapping_ips True
	pkgos-fix-config-default $(N_CONF) DEFAULT notify_nova_on_port_status_changes True
	pkgos-fix-config-default $(N_CONF) DEFAULT notify_nova_on_port_data_changes True
	pkgos-fix-config-default $(N_CONF) database connection sqlite:///var/lib/neutron/neutrondb
	pkgos-fix-config-default $(N_CONF) oslo_policy policy_file /etc/neutron/policy.json
	pkgos-fix-config-default $(N_CONF) nova auth_type password
	pkgos-fix-config-default $(N_CONF) nova project_domain_name default
	pkgos-fix-config-default $(N_CONF) nova user_domain_name default
	# Workaround, as pkgos-fix-config-default don't support more than one word
	sed -i 's|^[ #\t]*root_helper[ \t]*=.*|root_helper = sudo neutron-rootwrap /etc/neutron/rootwrap.conf|' $(N_CONF)

	# Add a [designate] configuration example
	cat debian/designate-addition.txt >> $(CURDIR)/debian/neutron-common/usr/share/neutron-common/neutron.conf


	# sriov_agent.ini
	mkdir -p $(CURDIR)/debian/neutron-common/etc/neutron/plugins/ml2
	PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages python3-oslo-config-generator \
		--output-file $(CURDIR)/debian/neutron-common/etc/neutron/plugins/ml2/sriov_agent.ini \
		--wrap-width 140 \
		--namespace neutron.ml2.sriov.agent \
		--namespace oslo.log

	# Install neutron-plugin-manage maintainer script
	mkdir -p $(CURDIR)/debian/neutron-common/usr/bin
	cp debian/neutron-plugin-manage $(CURDIR)/debian/neutron-common/usr/bin/neutron-plugin-manage
	dh_install
	dh_missing --fail-missing -X/usr/etc

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3