Package openstack-aodh: Specfile

  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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
%global oname aodh
%def_without doc

Name: openstack-%oname
Version: 16.0.0
Release: alt1.p10

Summary: OpenStack Telemetry Alarming

Group: System/Servers
License: Apache-2.0
Url: http://docs.openstack.org/developer/%oname

Source: https://tarballs.openstack.org/%oname/%oname-%version.tar.gz

BuildArch: noarch

Source2: aodh.logrotate
Source6: aodh.conf
Source9: %name.tmpfiles
Source10: %name-api.service
Source11: %name-evaluator.service
Source12: %name-notifier.service
Source13: %name-expirer.service
Source14: %name-listener.service

Source110: %name-api.init
Source111: %name-evaluator.init
Source112: %name-notifier.init
Source113: %name-expirer.init
Source114: %name-listener.init

Requires: python3-module-PasteDeploy
Requires(pre):    shadow-utils

BuildRequires: crudini
BuildRequires: webserver-common
BuildRequires: rpm-build-webserver-common
BuildRequires: rpm-macros-apache2

BuildRequires(pre): rpm-build-python3
BuildRequires: python3-devel
BuildRequires: python3-module-setuptools
BuildRequires: python3-module-wheel
BuildRequires: python3-module-tenacity >= 3.2.1
BuildRequires: python3-module-croniter >= 0.3.4
BuildRequires: python3-module-futurist >= 0.11.0
BuildRequires: python3-module-jsonschema >= 3.2.0
BuildRequires: python3-module-keystonemiddleware >= 5.1.0
BuildRequires: python3-module-gnocchiclient >= 6.0.0
BuildRequires: python3-module-lxml >= 2.3
BuildRequires: python3-module-oslo.db >= 4.8.0
BuildRequires: python3-module-oslo.config >= 6.8.0
BuildRequires: python3-module-oslo.i18n >= 1.5.0
BuildRequires: python3-module-oslo.log >= 4.3.0
BuildRequires: python3-module-oslo.reports >= 1.18.0
BuildRequires: python3-module-oslo.policy >= 3.7.0
BuildRequires: python3-module-oslo.upgradecheck >= 1.3.0
BuildRequires: python3-module-PasteDeploy >= 1.5.0
BuildRequires: python3-module-pbr >= 2.0.0
BuildRequires: python3-module-pecan >= 0.8.0
BuildRequires: python3-module-oslo.messaging >= 5.2.0
BuildRequires: python3-module-oslo.middleware >= 3.22.0
BuildRequires: python3-module-oslo.utils >= 3.5.0
BuildRequires: python3-module-keystoneclient >= 1.6.0
BuildRequires: python3-module-pytz >= 2013.6
BuildRequires: python3-module-requests >= 2.5.2
BuildRequires: python3-module-stevedore >= 1.5.0
BuildRequires: python3-module-sqlalchemy >= 1.4.1
BuildRequires: python3-module-tooz >= 1.28.0
BuildRequires: python3-module-voluptuous >= 0.8.10
BuildRequires: python3-module-webob >= 1.2.3
BuildRequires: python3-module-wsme >= 0.8
BuildRequires: python3-module-cachetools >= 1.1.6
BuildRequires: python3-module-cotyledon
BuildRequires: python3-module-keystoneauth1 >= 2.1
BuildRequires: python3-module-debtcollector >= 1.2.0
BuildRequires: python3-module-octaviaclient >= 1.8.0
BuildRequires: python3-module-dateutil
BuildRequires: python3-module-heatclient >= 1.17.0

%if_with doc
BuildRequires: python3-module-openstackdocstheme >= 2.2.1
BuildRequires: python3-module-reno >= 3.1.0
BuildRequires: python3-module-sphinx >= 2.0.0
BuildRequires: python3-module-sphinxcontrib-httpdomain
BuildRequires: python3-module-sphinxcontrib-pecanwsme >= 0.10.0
%endif

# /proc need for generate sample config fix "nova.cmd.novncproxy: [Errno 2] No such file or directory: '/proc/stat'"
BuildRequires: /proc

%description
Aodh is the alarm engine of the Ceilometer project.

%package -n python3-module-%oname
Summary: OpenStack aodh python libraries
Group: Development/Python3
Requires: python3-module-tenacity >= 3.2.1
Requires: python3-module-croniter >= 0.3.4
Requires: python3-module-futurist >= 0.11.0
Requires: python3-module-jsonschema >= 3.2.0
Requires: python3-module-keystonemiddleware = 10.2.0
Requires: python3-module-gnocchiclient >= 6.0.0
Requires: python3-module-lxml >= 2.3
Requires: python3-module-oslo.db >= 12.2.0 python3-module-oslo.db <= 12.3.2
Requires: python3-module-oslo.config >= 9.1.0 python3-module-oslo.config <= 9.1.1
Requires: python3-module-oslo.i18n = 6.0.0
Requires: python3-module-oslo.log >= 5.1.0 python3-module-oslo.log <= 5.2.0
Requires: python3-module-oslo.reports = 3.0.0
Requires: python3-module-oslo.policy >= 4.1.0 python3-module-oslo.policy <= 4.1.1
Requires: python3-module-oslo.upgradecheck >= 2.1.0 python3-module-oslo.upgradecheck <= 2.1.1
Requires: python3-module-PasteDeploy >= 1.5.0
Requires: python3-module-pbr >= 2.0.0
Requires: python3-module-pecan >= 0.8.0
Requires: python3-module-oslo.messaging >= 14.1.0 python3-module-oslo.messaging <= 14.2.2
Requires: python3-module-oslo.middleware >= 5.1.0 python3-module-oslo.middleware <= 5.1.1
Requires: python3-module-oslo.utils = 6.1.0
Requires: python3-module-keystoneclient = 5.1.0
Requires: python3-module-pytz >= 2013.6
Requires: python3-module-requests >= 2.5.2
Requires: python3-module-stevedore >= 4.1.0 python3-module-stevedore <= 5.0.0
Requires: python3-module-sqlalchemy >= 1.4.1
Requires: python3-module-tooz >= 1.28.0
Requires: python3-module-voluptuous >= 0.8.10
Requires: python3-module-webob >= 1.2.3
Requires: python3-module-wsme >= 0.8
Requires: python3-module-cachetools >= 1.1.6
Requires: python3-module-cotyledon
Requires: python3-module-keystoneauth1 >= 5.1.0 python3-module-keystoneauth1 <= 5.1.2
Requires: python3-module-debtcollector >= 1.2.0
Requires: python3-module-octaviaclient >= 3.2.0 python3-module-octaviaclient <= 3.4.0
Requires: python3-module-dateutil
Requires: python3-module-heatclient = 3.2.0

%description -n python3-module-%oname
OpenStack aodh provides API and services for managing alarms.

This package contains the aodh python3 library.

%package common
Summary: Components common to all OpenStack aodh services
Group: System/Servers

Requires: python3-module-aodh = %version-%release
Requires: python3-module-ceilometerclient

%description common
OpenStack aodh provides API and services for managing alarms.

%package api
Summary: OpenStack aodh api
Group: System/Servers

Requires: %name-common = %version-%release
Requires: python3-module-ceilometerclient

%description api
OpenStack aodh provides API and servicesfor managing alarms.

This package contains the aodh API service.

%package evaluator
Summary: OpenStack aodh evaluator
Group: System/Servers

Requires: %name-common = %version-%release

%description evaluator
OpenStack aodh provides API and services for managing alarms.

This package contains the aodh evaluator service.

%package notifier
Summary: OpenStack aodh notifier
Group: System/Servers

Requires: %name-common = %version-%release

%description notifier
OpenStack aodh provides API and services for managing alarms.

This package contains the aodh notifier service.

%package listener
Summary: OpenStack aodh listener
Group: System/Servers

Requires: %name-common = %version-%release

%description listener
OpenStack aodh provides API and services for managing alarms.

This package contains the aodh listener service.

%package expirer
Summary: OpenStack aodh expirer
Group: System/Servers

Requires: %name-common = %version-%release

%description expirer
OpenStack aodh provides API and services for managing alarms.

This package contains the aodh expirer service.

%package -n python3-module-%oname-tests
Summary: Aodh tests
Group: Development/Python3
Requires: python3-module-aodh = %version-%release

%description -n python3-module-%oname-tests
OpenStack aodh provides API and services for managing alarms.

This package contains the Aodh test files.

%prep
%setup -n %oname-%version

find . \( -name .gitignore -o -name .placeholder \) -delete

find aodh -name \*.py -exec sed -i '/\/usr\/bin\/env python/{d;q}' {} +

sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py

rm -rf {test-,}requirements.txt tools/{pip,test}-requires

%build
export PBR_VERSION=%version
%pyproject_build
# Generate config file
PYTHONPATH=. oslo-config-generator --config-file=aodh/cmd/aodh-config-generator.conf --output-file aodh.conf.sample

# Generate i18n files
#python setup.py compile_catalog -d build/lib/%oname/locale

%install
%pyproject_install

# Install config files
install -d -m 755 %buildroot%_sysconfdir/aodh
install -d -m 755 %buildroot%_sysconfdir/aodh/aodh.conf.d
install -p -D -m 640 aodh.conf.sample %buildroot%_sysconfdir/aodh/aodh.conf
install -p -D -m 640 aodh/api/api-paste.ini %buildroot%_sysconfdir/aodh/api-paste.ini

# Setup directories
install -d -m 755 %buildroot%_sharedstatedir/aodh
install -d -m 755 %buildroot%_sharedstatedir/aodh/tmp
install -d -m 755 %buildroot%_logdir/aodh

cp -r aodh/storage/sqlalchemy/alembic/ %buildroot%python3_sitelibdir/aodh/storage/sqlalchemy/alembic/

# Install pid directory
install -d -m 775 %buildroot%_runtimedir/aodh
install -p -D -m 644 %SOURCE9 %buildroot%_tmpfilesdir/%name.conf

# Install logrotate
install -p -D -m 644 %SOURCE2 %buildroot%_sysconfdir/logrotate.d/%name

# Install systemd unit services
install -p -D -m 644 %SOURCE10 %buildroot%_unitdir/%name-api.service
install -p -D -m 644 %SOURCE11 %buildroot%_unitdir/%name-evaluator.service
install -p -D -m 644 %SOURCE12 %buildroot%_unitdir/%name-notifier.service
install -p -D -m 644 %SOURCE13 %buildroot%_unitdir/%name-expirer.service
install -p -D -m 644 %SOURCE14 %buildroot%_unitdir/%name-listener.service

# Install sysv init scripts
install -p -D -m 755 %SOURCE110 %buildroot%_initdir/%name-api
install -p -D -m 755 %SOURCE111 %buildroot%_initdir/%name-evaluator
install -p -D -m 755 %SOURCE112 %buildroot%_initdir/%name-notifier
install -p -D -m 755 %SOURCE113 %buildroot%_initdir/%name-expirer
install -p -D -m 755 %SOURCE114 %buildroot%_initdir/%name-listener

# Install sample HTTPD integration files
install -p -D -m 644 aodh/api/app.wsgi %buildroot%_datadir/aodh/aodh.wsgi

install -m 0644 -D -p %SOURCE6 %buildroot%apache2_sites_available/openstack-aodh.conf
mkdir -p %buildroot%apache2_sites_enabled
touch %buildroot%apache2_sites_enabled/openstack-aodh.conf
mkdir -p %buildroot%webserver_cgibindir
ln -s %_datadir/aodh/aodh.wsgi %buildroot%webserver_cgibindir/aodh-wsgi

### set default configuration
%define aodh_conf %buildroot%_sysconfdir/aodh/aodh.conf.d/010-aodh.conf
crudini --set %aodh_conf DEFAULT log_dir /var/log/aodh
crudini --set %aodh_conf DEFAULT state_path /var/lib/aodh
crudini --set %aodh_conf oslo_concurrency lock_path /var/run/aodh

# Install i18n .mo files (.po and .pot are not required)
#install -d -m 755 %buildroot%_datadir
#rm -f %buildroot%python_sitelibdir/%oname/locale/*/LC_*/%{oname}*po
#rm -f %buildroot%python_sitelibdir/%oname/locale/*pot
#mv %buildroot%python_sitelibdir/%oname/locale %buildroot%_datadir/locale

# Find language files
#%find_lang %oname --all-name

# Remove unused files
rm -fr %buildroot/usr/etc

%pre common
%_sbindir/groupadd -r -f aodh 2>/dev/null ||:
%_sbindir/useradd -r -g aodh -G aodh  -c 'OpenStack aodh Daemons' \
        -s /sbin/nologin  -d %_sharedstatedir/aodh aodh 2>/dev/null ||:

%post -n %name-api
%post_service %name-api

%preun -n %name-api
%preun_service %name-api

%post -n %name-evaluator
%post_service %name-evaluator

%preun -n %name-evaluator
%preun_service %name-evaluator

%post -n %name-notifier
%post_service  %name-notifier

%preun -n %name-notifier
%preun_service %name-notifier

%post -n %name-listener
%post_service %name-listener

%preun -n %name-listener
%preun_service %name-listener

%post -n %name-expirer
%post_service %name-expirer

%preun -n %name-expirer
%preun_service %name-expirer

%files -n python3-module-aodh
%_bindir/*
%python3_sitelibdir/*
%exclude %python3_sitelibdir/*/tests

%files -n python3-module-aodh-tests
%python3_sitelibdir/*/tests

%files common
#-f %oname.lang
%doc README.rst
%dir %_sysconfdir/aodh
%dir %_sysconfdir/aodh/aodh.conf.d
%config(noreplace) %attr(640, root, aodh) %_sysconfdir/aodh/aodh.conf
%config(noreplace) %attr(640, root, aodh) %_sysconfdir/aodh/api-paste.ini
%config(noreplace) %attr(640, root, aodh) %_sysconfdir/aodh/aodh.conf.d/010-aodh.conf
%config(noreplace) %_sysconfdir/logrotate.d/%name
%_tmpfilesdir/%name.conf

%dir %attr(0770, root, aodh) %_logdir/aodh
%dir %attr(0775, root, aodh) %_runtimedir/aodh
%dir %attr(0755, aodh, aodh) %_sharedstatedir/aodh
#%dir %attr(0755, aodh, aodh) %_cachedir/aodh

%files api
%_unitdir/%name-api.service
%_initdir/%name-api
%dir %_datadir/aodh
%_datadir/aodh/*
%config(noreplace) %apache2_sites_available/*.conf
%ghost %apache2_sites_enabled/*.conf
%webserver_cgibindir/*

%files evaluator
%_unitdir/%name-evaluator.service
%_initdir/%name-evaluator

%files notifier
%_unitdir/%name-notifier.service
%_initdir/%name-notifier

%files listener
%_unitdir/%name-listener.service
%_initdir/%name-listener

%files expirer
%_unitdir/%name-expirer.service
%_initdir/%name-expirer

%changelog
* Thu Mar 21 2024 Ilfat Aminov <aminov@altlinux.org> 16.0.0-alt1.p10
- 16.0.0

* Fri Nov 10 2023 Ilfat Aminov <aminov@altlinux.org> 10.0.0-alt2.p10
- TODO: aodh not properly packaged yet
- disable oslo-config-generator for future antelope build

* Sat May 16 2020 Grigory Ustinov <grenka@altlinux.org> 10.0.0-alt1
- Automatically updated to 10.0.0.
- Renamed spec file.

* Fri Oct 18 2019 Grigory Ustinov <grenka@altlinux.org> 9.0.0-alt1
- Automatically updated to 9.0.0.
- Build without python2.

* Wed Aug 14 2019 Grigory Ustinov <grenka@altlinux.org> 8.0.0-alt1
- Automatically updated to 8.0.0

* Fri Jan 11 2019 Alexey Shabalin <shaba@altlinux.org> 7.0.0-alt1
- 7.0.0 Rocky release
- switch to python3

* Fri Jun 22 2018 Grigory Ustinov <grenka@altlinux.org> 4.0.1-alt2
- Fixed FTBFS (remove python-module-setuptools-tests from BR).

* Tue Jul 18 2017 Alexey Shabalin <shaba@altlinux.ru> 4.0.1-alt1
- 4.0.1

* Thu Jun 22 2017 Alexey Shabalin <shaba@altlinux.ru> 4.0.0-alt2
- update default config
- Fix the migration to use alarm_history

* Tue Jun 13 2017 Alexey Shabalin <shaba@altlinux.ru> 4.0.0-alt1
- 4.0.0

* Wed Apr 12 2017 Alexey Shabalin <shaba@altlinux.ru> 3.0.2-alt1
- 3.0.2

* Wed Nov 23 2016 Alexey Shabalin <shaba@altlinux.ru> 3.0.1-alt1
- initial build