summaryrefslogtreecommitdiff
path: root/python-os-log-merger.spec
blob: fd616e9977ecf7d8930183659c39e8ee2efd616e (plain)
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
%global _empty_manifest_terminate_build 0
Name:		python-os-log-merger
Version:	1.2.1
Release:	1
Summary:	OpenStack Log merge tool
License:	Apache Software License
URL:		https://github.com/openstack/os-log-merger
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/3f/0c/af89e514e39a40390e9ac721b7946e59fad6bbbf6ede756e884daced1ff9/os-log-merger-1.2.1.tar.gz
BuildArch:	noarch

Requires:	python3-pbr
Requires:	python3-dateutil
Requires:	python3-six

%description
What is os-log-merger?
~~~~~~~~~~~~~~~~~~~~~~
os-log-merger stands for OpenStack LOG merger, it's a tool designed to take a
bunch of openstack logs across different projects, and merge them in a single
file, ordered by time entries.
It should work as long as the logs are based on oslo logger output.
Quick presentation: http://mangelajo.github.io/openstack-debugging-presentation/
Limitations
~~~~~~~~~~~
This tool is not able to properly (or meaningfully) merge logs if your servers
are not time synced to a common time source.
How to install
~~~~~~~~~~~~~~
pip install os-log-merger
Basic Usage
~~~~~~~~~~~
    $ os-log-merger ../bz/1257567/40-os1ctrl01/var/log/neutron/server.log:NS1 \
Please note that the :NS1, :NS2, :OVS1, :OVS2 are aliases and can be omitted,
and in such case, the extra column used to associate a log file to a log line
will use the original file path instead of the [ALIAS]
The previous example would produce something like this::
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.context [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] Arguments dropped when creating context: {u'project_name': None, u'tenant': None} __init__ /usr/lib/python2.7/site-packages/neutron/context.py:83
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.plugins.ml2.db [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] get_ports_and_sgs() called for port_ids [u'4136d577-e02f-47c1-b543-f0bfd65ef85e', u'5d5ea109-4807-4df3-bef4-b5d89c3ffebc', u'6adcffbf-09d5-4a85-9339-9d6beb2bf82c', u'6b4d7b51-c87d-483e-9606-0e2a54ad8184', u'743ccaa6-7ed9-4195-aabd-3d55006338e1', u'dc662767-61a5-4807-b2ed-a7c76b541fd6', u'4decdd33-6f13-46df-b2f0-d9ff99878514', u'34b826df-9787-443c-9bef-084374827a85', u'7bbc404b-3df7-498a-b6fb-e81f9370a19f', u'c12e6e06-ff6a-44dc-b75f-78ec55dd3dd3', u'586cd86d-59d0-434b-ab27-76975ce5abc4', u'79b33879-3232-4b3a-a27c-c0a79da10379', u'ba6a28cc-9851-4cd7-acae-40034a19c761', u'05c4115a-da58-41db-b3f7-7326e1a22971'] get_ports_and_sgs /usr/lib/python2.7/site-packages/neutron/plugins/ml2/db.py:224
    2015-08-25 09:37:15.463 [OVS1] 12613 DEBUG neutron.agent.linux.utils [req-588c942a-6526-464f-a447-782a5e2d436a None]
                                        Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-vsctl', '--timeout=10', 'list-ports', 'br-int']
                                        Exit code: 0
                                        Stdout: 'ha-2cdba01d-e4\nha-44dca3a9-44\nha-499d3db7-97\nha-55a19f5e-ef\nha-b2d04f15-f2\nha-b5b271a1-d8\nha-fa58d644-81\nint-br-enp7s0\nint-br-ex\nqr-34b826df-97\nqr-5d5ea109-48\nqr-6adcffbf-09\nqr-743ccaa6-7e\nqr-79b33879-32\nqr-c12e6e06-ff\nqr-dc662767-61\n'
References to http url files instead of local files is also supported. Files
will be cached locally to avoid re-downloading on next runs.
Common Base
~~~~~~~~~~~
In many cases we'll have a common base directory where log reside and they'll
probably share the .log extension. So for the sake of brevity os-log-merger
allows setting the base directory and postfix for all files with the `-b` and
`-p` option (`--log-base` and `--log-postfix` long options).
Example for Cinder:
    $ os-log-merger -b /var/log/cinder/ -p .log api:api scheduler:sch volume:vol
/var/log/messages
~~~~~~~~~~~~~~~~~
os-log-merger also supports /var/log/messages type of files with options `-ml`
and `--msg-logs` options.
Since the format for those files is missing year information -MAR 24 14:11:19-
the year from the last file modification will be used.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-ml` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -ml messages:MSG *.log
Timestamped logs
~~~~~~~~~~~~~~~~
os-log-merger also supports timestamped -[    0.003036]- with options `-tl`
and `--timestamp-logs` options.
Since timestamp many times will not take epoc time as the source of the
timestamp but the time the system started, the initial datetime will be
calculated by substracting from the file modified datetime the last timestamp
in the file.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-tl` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -tl dmesg:DMSG
Auto Alias
~~~~~~~~~~
As we've seen above you can easily set you alias using `:ALIAS` after each log
file, but since most of log files names and locations are well known,
os-log-merger has an auto alias feature with different levels to adapt to your
specific needs.
If an alias has been defined in the command line it will disable the auto alias
on that file.
**Level 0**
The most basic auto alias generation level is level 0, and is the default
behavior explained above, where the file path is used as an alias.
**Level 1**
Since default configuration will create considerable long aliases, you can use
level 1 when using base directory and log postfix options to remove them from
the alias.
Then the following command line:
    $ os-log-merger -a1 -b /var/log/cinder/ -p .log api scheduler volume
Would use `api`, `scheduler` and `volume` aliases::
    2016-02-01 12:11:17.573 [api] ...
    2016-02-01 12:11:17.701 [scheduler] ...
    2016-02-01 11:11:18.667 [volume] ...
**Level 2**
In some cases we may want to use globbing patterns and auto alias level 1 is no
longer useful, so you want to have the filename extensions removed as well as
the common paths and reduce the well know log filenames.
With level 2 os-log-merger will remove all common parts of the path as long as
resulting paths can still uniquely identify the files within the prefixing path.
It will also rename well known files like cinder/scheduler.log with c-sch like
in this example:
    $ os-log-merger -a2 node?/var/log/{cinder,nova}/*.log
That will give you::
    2016-02-01 10:23:34.680 [node1/C-API] ...
    2016-02-01 10:24:34.690 [node1/C-SCH] ...
    2016-02-01 10:25:34.700 [node1/C-VOL] ...
    2016-02-01 10:26:34.710 [node1/N-API] ...
    2016-02-01 10:27:34.680 [node2/N-CPU] ...
**Level 3**
Depending on the name of your non common directories in your log paths you may
want to go one step further and reduce them to the minimum instead of
preserving them unaltered.
Replacing Level 2 auto alias generation in the previous command with the same
files:
    $ os-log-merger -a3 node?/var/log/{cinder,nova}/*.log
Would result in::
    2016-02-01 10:23:34.680 [1/C-API] ...
    2016-02-01 10:24:34.690 [1/C-SCH] ...
    2016-02-01 10:25:34.700 [1/C-VOL] ...
    2016-02-01 10:26:34.710 [1/N-API] ...
    2016-02-01 10:27:34.680 [2/N-CPU] ...

%package -n python3-os-log-merger
Summary:	OpenStack Log merge tool
Provides:	python-os-log-merger
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-os-log-merger
What is os-log-merger?
~~~~~~~~~~~~~~~~~~~~~~
os-log-merger stands for OpenStack LOG merger, it's a tool designed to take a
bunch of openstack logs across different projects, and merge them in a single
file, ordered by time entries.
It should work as long as the logs are based on oslo logger output.
Quick presentation: http://mangelajo.github.io/openstack-debugging-presentation/
Limitations
~~~~~~~~~~~
This tool is not able to properly (or meaningfully) merge logs if your servers
are not time synced to a common time source.
How to install
~~~~~~~~~~~~~~
pip install os-log-merger
Basic Usage
~~~~~~~~~~~
    $ os-log-merger ../bz/1257567/40-os1ctrl01/var/log/neutron/server.log:NS1 \
Please note that the :NS1, :NS2, :OVS1, :OVS2 are aliases and can be omitted,
and in such case, the extra column used to associate a log file to a log line
will use the original file path instead of the [ALIAS]
The previous example would produce something like this::
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.context [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] Arguments dropped when creating context: {u'project_name': None, u'tenant': None} __init__ /usr/lib/python2.7/site-packages/neutron/context.py:83
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.plugins.ml2.db [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] get_ports_and_sgs() called for port_ids [u'4136d577-e02f-47c1-b543-f0bfd65ef85e', u'5d5ea109-4807-4df3-bef4-b5d89c3ffebc', u'6adcffbf-09d5-4a85-9339-9d6beb2bf82c', u'6b4d7b51-c87d-483e-9606-0e2a54ad8184', u'743ccaa6-7ed9-4195-aabd-3d55006338e1', u'dc662767-61a5-4807-b2ed-a7c76b541fd6', u'4decdd33-6f13-46df-b2f0-d9ff99878514', u'34b826df-9787-443c-9bef-084374827a85', u'7bbc404b-3df7-498a-b6fb-e81f9370a19f', u'c12e6e06-ff6a-44dc-b75f-78ec55dd3dd3', u'586cd86d-59d0-434b-ab27-76975ce5abc4', u'79b33879-3232-4b3a-a27c-c0a79da10379', u'ba6a28cc-9851-4cd7-acae-40034a19c761', u'05c4115a-da58-41db-b3f7-7326e1a22971'] get_ports_and_sgs /usr/lib/python2.7/site-packages/neutron/plugins/ml2/db.py:224
    2015-08-25 09:37:15.463 [OVS1] 12613 DEBUG neutron.agent.linux.utils [req-588c942a-6526-464f-a447-782a5e2d436a None]
                                        Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-vsctl', '--timeout=10', 'list-ports', 'br-int']
                                        Exit code: 0
                                        Stdout: 'ha-2cdba01d-e4\nha-44dca3a9-44\nha-499d3db7-97\nha-55a19f5e-ef\nha-b2d04f15-f2\nha-b5b271a1-d8\nha-fa58d644-81\nint-br-enp7s0\nint-br-ex\nqr-34b826df-97\nqr-5d5ea109-48\nqr-6adcffbf-09\nqr-743ccaa6-7e\nqr-79b33879-32\nqr-c12e6e06-ff\nqr-dc662767-61\n'
References to http url files instead of local files is also supported. Files
will be cached locally to avoid re-downloading on next runs.
Common Base
~~~~~~~~~~~
In many cases we'll have a common base directory where log reside and they'll
probably share the .log extension. So for the sake of brevity os-log-merger
allows setting the base directory and postfix for all files with the `-b` and
`-p` option (`--log-base` and `--log-postfix` long options).
Example for Cinder:
    $ os-log-merger -b /var/log/cinder/ -p .log api:api scheduler:sch volume:vol
/var/log/messages
~~~~~~~~~~~~~~~~~
os-log-merger also supports /var/log/messages type of files with options `-ml`
and `--msg-logs` options.
Since the format for those files is missing year information -MAR 24 14:11:19-
the year from the last file modification will be used.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-ml` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -ml messages:MSG *.log
Timestamped logs
~~~~~~~~~~~~~~~~
os-log-merger also supports timestamped -[    0.003036]- with options `-tl`
and `--timestamp-logs` options.
Since timestamp many times will not take epoc time as the source of the
timestamp but the time the system started, the initial datetime will be
calculated by substracting from the file modified datetime the last timestamp
in the file.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-tl` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -tl dmesg:DMSG
Auto Alias
~~~~~~~~~~
As we've seen above you can easily set you alias using `:ALIAS` after each log
file, but since most of log files names and locations are well known,
os-log-merger has an auto alias feature with different levels to adapt to your
specific needs.
If an alias has been defined in the command line it will disable the auto alias
on that file.
**Level 0**
The most basic auto alias generation level is level 0, and is the default
behavior explained above, where the file path is used as an alias.
**Level 1**
Since default configuration will create considerable long aliases, you can use
level 1 when using base directory and log postfix options to remove them from
the alias.
Then the following command line:
    $ os-log-merger -a1 -b /var/log/cinder/ -p .log api scheduler volume
Would use `api`, `scheduler` and `volume` aliases::
    2016-02-01 12:11:17.573 [api] ...
    2016-02-01 12:11:17.701 [scheduler] ...
    2016-02-01 11:11:18.667 [volume] ...
**Level 2**
In some cases we may want to use globbing patterns and auto alias level 1 is no
longer useful, so you want to have the filename extensions removed as well as
the common paths and reduce the well know log filenames.
With level 2 os-log-merger will remove all common parts of the path as long as
resulting paths can still uniquely identify the files within the prefixing path.
It will also rename well known files like cinder/scheduler.log with c-sch like
in this example:
    $ os-log-merger -a2 node?/var/log/{cinder,nova}/*.log
That will give you::
    2016-02-01 10:23:34.680 [node1/C-API] ...
    2016-02-01 10:24:34.690 [node1/C-SCH] ...
    2016-02-01 10:25:34.700 [node1/C-VOL] ...
    2016-02-01 10:26:34.710 [node1/N-API] ...
    2016-02-01 10:27:34.680 [node2/N-CPU] ...
**Level 3**
Depending on the name of your non common directories in your log paths you may
want to go one step further and reduce them to the minimum instead of
preserving them unaltered.
Replacing Level 2 auto alias generation in the previous command with the same
files:
    $ os-log-merger -a3 node?/var/log/{cinder,nova}/*.log
Would result in::
    2016-02-01 10:23:34.680 [1/C-API] ...
    2016-02-01 10:24:34.690 [1/C-SCH] ...
    2016-02-01 10:25:34.700 [1/C-VOL] ...
    2016-02-01 10:26:34.710 [1/N-API] ...
    2016-02-01 10:27:34.680 [2/N-CPU] ...

%package help
Summary:	Development documents and examples for os-log-merger
Provides:	python3-os-log-merger-doc
%description help
What is os-log-merger?
~~~~~~~~~~~~~~~~~~~~~~
os-log-merger stands for OpenStack LOG merger, it's a tool designed to take a
bunch of openstack logs across different projects, and merge them in a single
file, ordered by time entries.
It should work as long as the logs are based on oslo logger output.
Quick presentation: http://mangelajo.github.io/openstack-debugging-presentation/
Limitations
~~~~~~~~~~~
This tool is not able to properly (or meaningfully) merge logs if your servers
are not time synced to a common time source.
How to install
~~~~~~~~~~~~~~
pip install os-log-merger
Basic Usage
~~~~~~~~~~~
    $ os-log-merger ../bz/1257567/40-os1ctrl01/var/log/neutron/server.log:NS1 \
Please note that the :NS1, :NS2, :OVS1, :OVS2 are aliases and can be omitted,
and in such case, the extra column used to associate a log file to a log line
will use the original file path instead of the [ALIAS]
The previous example would produce something like this::
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.context [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] Arguments dropped when creating context: {u'project_name': None, u'tenant': None} __init__ /usr/lib/python2.7/site-packages/neutron/context.py:83
    2015-08-25 09:37:15.463 [NS1] 15062 DEBUG neutron.plugins.ml2.db [req-b751a750-f5d8-4b6e-9af3-82d143ef9416 None] get_ports_and_sgs() called for port_ids [u'4136d577-e02f-47c1-b543-f0bfd65ef85e', u'5d5ea109-4807-4df3-bef4-b5d89c3ffebc', u'6adcffbf-09d5-4a85-9339-9d6beb2bf82c', u'6b4d7b51-c87d-483e-9606-0e2a54ad8184', u'743ccaa6-7ed9-4195-aabd-3d55006338e1', u'dc662767-61a5-4807-b2ed-a7c76b541fd6', u'4decdd33-6f13-46df-b2f0-d9ff99878514', u'34b826df-9787-443c-9bef-084374827a85', u'7bbc404b-3df7-498a-b6fb-e81f9370a19f', u'c12e6e06-ff6a-44dc-b75f-78ec55dd3dd3', u'586cd86d-59d0-434b-ab27-76975ce5abc4', u'79b33879-3232-4b3a-a27c-c0a79da10379', u'ba6a28cc-9851-4cd7-acae-40034a19c761', u'05c4115a-da58-41db-b3f7-7326e1a22971'] get_ports_and_sgs /usr/lib/python2.7/site-packages/neutron/plugins/ml2/db.py:224
    2015-08-25 09:37:15.463 [OVS1] 12613 DEBUG neutron.agent.linux.utils [req-588c942a-6526-464f-a447-782a5e2d436a None]
                                        Command: ['sudo', 'neutron-rootwrap', '/etc/neutron/rootwrap.conf', 'ovs-vsctl', '--timeout=10', 'list-ports', 'br-int']
                                        Exit code: 0
                                        Stdout: 'ha-2cdba01d-e4\nha-44dca3a9-44\nha-499d3db7-97\nha-55a19f5e-ef\nha-b2d04f15-f2\nha-b5b271a1-d8\nha-fa58d644-81\nint-br-enp7s0\nint-br-ex\nqr-34b826df-97\nqr-5d5ea109-48\nqr-6adcffbf-09\nqr-743ccaa6-7e\nqr-79b33879-32\nqr-c12e6e06-ff\nqr-dc662767-61\n'
References to http url files instead of local files is also supported. Files
will be cached locally to avoid re-downloading on next runs.
Common Base
~~~~~~~~~~~
In many cases we'll have a common base directory where log reside and they'll
probably share the .log extension. So for the sake of brevity os-log-merger
allows setting the base directory and postfix for all files with the `-b` and
`-p` option (`--log-base` and `--log-postfix` long options).
Example for Cinder:
    $ os-log-merger -b /var/log/cinder/ -p .log api:api scheduler:sch volume:vol
/var/log/messages
~~~~~~~~~~~~~~~~~
os-log-merger also supports /var/log/messages type of files with options `-ml`
and `--msg-logs` options.
Since the format for those files is missing year information -MAR 24 14:11:19-
the year from the last file modification will be used.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-ml` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -ml messages:MSG *.log
Timestamped logs
~~~~~~~~~~~~~~~~
os-log-merger also supports timestamped -[    0.003036]- with options `-tl`
and `--timestamp-logs` options.
Since timestamp many times will not take epoc time as the source of the
timestamp but the time the system started, the initial datetime will be
calculated by substracting from the file modified datetime the last timestamp
in the file.
These files can also be specified with globs and they support alias definition
as well.
Beware that openstack files should be listed before `-tl` option files.
Example for Cinder:
    $ os-log-merger -b /var/log/ cinder/api.log:API -tl dmesg:DMSG
Auto Alias
~~~~~~~~~~
As we've seen above you can easily set you alias using `:ALIAS` after each log
file, but since most of log files names and locations are well known,
os-log-merger has an auto alias feature with different levels to adapt to your
specific needs.
If an alias has been defined in the command line it will disable the auto alias
on that file.
**Level 0**
The most basic auto alias generation level is level 0, and is the default
behavior explained above, where the file path is used as an alias.
**Level 1**
Since default configuration will create considerable long aliases, you can use
level 1 when using base directory and log postfix options to remove them from
the alias.
Then the following command line:
    $ os-log-merger -a1 -b /var/log/cinder/ -p .log api scheduler volume
Would use `api`, `scheduler` and `volume` aliases::
    2016-02-01 12:11:17.573 [api] ...
    2016-02-01 12:11:17.701 [scheduler] ...
    2016-02-01 11:11:18.667 [volume] ...
**Level 2**
In some cases we may want to use globbing patterns and auto alias level 1 is no
longer useful, so you want to have the filename extensions removed as well as
the common paths and reduce the well know log filenames.
With level 2 os-log-merger will remove all common parts of the path as long as
resulting paths can still uniquely identify the files within the prefixing path.
It will also rename well known files like cinder/scheduler.log with c-sch like
in this example:
    $ os-log-merger -a2 node?/var/log/{cinder,nova}/*.log
That will give you::
    2016-02-01 10:23:34.680 [node1/C-API] ...
    2016-02-01 10:24:34.690 [node1/C-SCH] ...
    2016-02-01 10:25:34.700 [node1/C-VOL] ...
    2016-02-01 10:26:34.710 [node1/N-API] ...
    2016-02-01 10:27:34.680 [node2/N-CPU] ...
**Level 3**
Depending on the name of your non common directories in your log paths you may
want to go one step further and reduce them to the minimum instead of
preserving them unaltered.
Replacing Level 2 auto alias generation in the previous command with the same
files:
    $ os-log-merger -a3 node?/var/log/{cinder,nova}/*.log
Would result in::
    2016-02-01 10:23:34.680 [1/C-API] ...
    2016-02-01 10:24:34.690 [1/C-SCH] ...
    2016-02-01 10:25:34.700 [1/C-VOL] ...
    2016-02-01 10:26:34.710 [1/N-API] ...
    2016-02-01 10:27:34.680 [2/N-CPU] ...

%prep
%autosetup -n os-log-merger-1.2.1

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-os-log-merger -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 1.2.1-1
- Package Spec generated