summaryrefslogtreecommitdiff
path: root/python-sas-esppy.spec
blob: fdba34d04043090c084424b772e4dd55bc2d1817 (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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
%global _empty_manifest_terminate_build 0
Name:		python-sas-esppy
Version:	7.1.16
Release:	1
Summary:	SAS Event Stream Processing Python Interface
License:	Apache 2.0
URL:		https://github.com/sassoftware/python-esppy/
Source0:	https://mirrors.aliyun.com/pypi/web/packages/94/a0/f3032d3f385f41b53e50eaa4818c7f1396a163d51bd6b47b89cd27e8414c/sas-esppy-7.1.16.tar.gz
BuildArch:	noarch

Requires:	python3-pandas
Requires:	python3-pillow
Requires:	python3-six
Requires:	python3-plotly
Requires:	python3-ipywidgets
Requires:	python3-requests
Requires:	python3-graphviz
Requires:	python3-rbtranslations
Requires:	python3-websocket-client
Requires:	python3-ws4py

%description
# SAS Event Stream Processing Python Interface

The ESPPy package enables you to create
[SAS Event Stream Processing (ESP)](https://www.sas.com/en_us/software/event-stream-processing.html)
models programmatically in Python. Using ESPPy, you can connect to 
an ESP server and interact with projects and their components as 
Python objects. These objects include projects, continuous queries, 
windows, events, loggers, SAS Micro Analytic Service modules, 
routers, and analytical algorithms.

ESPPy has full integration with [Jupyter](https://jupyter.org/) notebooks including visualizing 
diagrams of your ESP projects, and support for streaming charts and 
images. This enables you to easily explore and prototype your ESP 
projects in a familiar notebook interface.

## Installation

To install ESPPy, use `pip`. This installs
ESPPy and the Python package dependencies.

```
pip install sas-esppy
```

### Additional Requirements

In addition to the Python package dependencies, you also need the 
`graphviz` command-line tools to fully take advantage of ESPPy. Download them from http://www.graphviz.org/download/.

### Performance Enhancement

ESPPy uses the `ws4py` websocket Python package. In some cases,
you can improve performance greatly by installing the `wsaccel` package.
This may not be available on all platforms though, and is left up to 
the user to install.

## The Basics

To import the ESPPy package, use the same method as with any other Python package.

```
>>> import esppy
```

To connect to an ESP server, use the `ESP` class.  In most cases, the only
information that is needed is the hostname and port.

```
>>> esp = esppy.ESP('http://myesp.com:8777')
```

### Getting Information about the Server

After you have connected to the server, you can get information about the
server and projects.

```
>>> esp.server_info
{'analytics-license': True,
 'engine': 'esp',
 'http-admin': 8777,
 'pubsub': 8778,
 'version': 'X.X'}

# Currently no projects are loaded
>>> esp.get_projects()
{}
```

### Loading a Project

To load a project, use the `load_project` method.

```
>>> esp.load_project('project.xml')

>>> esp.get_projects()
{'project': Project(name='project')}
```

To access continous queries and windows within projects, use 
the `queries` and `windows` attributes of the `Project` and
`ContinuousQuery` objects, respectively.

```
>>> proj = esp.get_project('project')
>>> proj.queries
{'contquery': ContinuousQuery(name='contquery', project='project')}

>>> proj.queries['contquery'].windows
{'w_data': CopyWindow(name='w_data', continuous_query='contquery', project='project'),
 'w_request': SourceWindow(name='w_request', continuous_query='contquery', project='project'),
 'w_calculate': CalculateWindow(name='w_calculate', continuous_query='contquery', project='project')}

>>> dataw = proj.queries['contquery'].windows['w_data']
```

As a shortcut, you can drop the `queries` and `windows` attribute name.
Projects and continuous queries act like dictionaries of those components.

```
>>> dataw = proj['contquery']['w_data']
```

### Publishing Event Data

To publish events to a window, use the `publish_events` method.
It accepts a file name, file-like object, DataFrame, or a string of
CSV, XML, or JSON data.

```
>>> dataw.publish_events('data.csv')
```

### Monitoring Events

You can subscribe to the events of any window in a project. By default,
all event data are cached in the local window object.

```
>>> dataw.subscribe()
>>> dataw
       time        x        y        z
id                                    
6   0.15979 -2.30180  0.23155  10.6510
7   0.18982 -1.41650  1.18500  11.0730
8   0.22040 -0.27241  2.22010  11.9860
9   0.24976 -0.61292  2.22010  11.9860
10  0.27972  1.33480  4.24950  11.4140
11  0.31802  3.44590  7.58650  12.5990
```

To limit the number of cached events, use the `limit`
parameter. For example, to only keep the last 20 events, enter 
the following line:

```
>>> dataw.subscribe(limit=20)
```

You can also limit the amount of time that events are collected using
the `horizon` parameter. Use one of the following objects: `datetime`, `date`, `time`,
or `timedelta`.

```
>>> dataw.subscribe(horizon=datetime.timedelta(hours=1))
```

You can also perform any DataFrame operation on your ESP windows.

```
>>> dataw.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 2108 entries, 6 to 2113
Data columns (total 4 columns):
time    2108 non-null float64
x       2108 non-null float64
y       2108 non-null float64
z       2108 non-null float64
dtypes: float64(4)
memory usage: 82.3 KB

>>> dataw.describe()
            time          x          y          z
count  20.000000  20.000000  20.000000  20.000000
mean   69.655050  -4.365320   8.589630  -1.675292
std     0.177469   1.832482   2.688911   2.108300
min    69.370000  -7.436700   4.862500  -5.175700
25%    69.512500  -5.911250   7.007675  -3.061150
50%    69.655000  -4.099700   7.722700  -1.702500
75%    69.797500  -2.945400   9.132350  -0.766110
max    69.940000  -1.566300  14.601000   3.214400
```

### Using ESPPy Visualizations with JupyterLab

NOTE: These instructions assume you have Anaconda installed.

To use jupyterlab visualizations with ESPPy (available in version 6.2 or higher), perform the following steps:

1. Create a new Anaconda environment. For this example, the environment is called esp.
```
    $ conda create -n esp python=3.X
```
2. Activate the new environment.
```
$ conda activate esp
```
3. Install the following packages:
```
$ pip install jupyter
$ pip install jupyterlab
$ pip install matplotlib
$ pip install ipympl
$ pip install pandas
$ pip install requests
$ pip install image
$ pip install ws4py
$ pip install plotly
$ pip install ipyleaflet
$ pip install graphviz
```
4. Install the following Jupyterlab extensions:
```
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager
$ jupyter labextension install plotlywidget
$ jupyter labextension install jupyter-leaflet
```

5. Install the following packages (WINDOWS ONLY):
```
$ conda install -c conda-forge python-graphviz
```

6. Create and change to a working directory.
```
$ cd $HOME
$ mkdir esppy
$ cd esppy
```

7. Install ESPPy.
```
pip install sas-esppy
```

8. Create a notebooks directory to store your notebooks.
```
$ mkdir notebooks
```

9. Start the Jupyterlab server. Select an available port. For this example, port 35000 was selected.
```
$ jupyter lab --port 35000
```

After you complete these steps, you can use the latest ESP graphics in your Jupyter notebooks.

### Documentation

To view the full API documentation for ESPPy, see 
https://sassoftware.github.io/python-esppy/.




%package -n python3-sas-esppy
Summary:	SAS Event Stream Processing Python Interface
Provides:	python-sas-esppy
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-sas-esppy
# SAS Event Stream Processing Python Interface

The ESPPy package enables you to create
[SAS Event Stream Processing (ESP)](https://www.sas.com/en_us/software/event-stream-processing.html)
models programmatically in Python. Using ESPPy, you can connect to 
an ESP server and interact with projects and their components as 
Python objects. These objects include projects, continuous queries, 
windows, events, loggers, SAS Micro Analytic Service modules, 
routers, and analytical algorithms.

ESPPy has full integration with [Jupyter](https://jupyter.org/) notebooks including visualizing 
diagrams of your ESP projects, and support for streaming charts and 
images. This enables you to easily explore and prototype your ESP 
projects in a familiar notebook interface.

## Installation

To install ESPPy, use `pip`. This installs
ESPPy and the Python package dependencies.

```
pip install sas-esppy
```

### Additional Requirements

In addition to the Python package dependencies, you also need the 
`graphviz` command-line tools to fully take advantage of ESPPy. Download them from http://www.graphviz.org/download/.

### Performance Enhancement

ESPPy uses the `ws4py` websocket Python package. In some cases,
you can improve performance greatly by installing the `wsaccel` package.
This may not be available on all platforms though, and is left up to 
the user to install.

## The Basics

To import the ESPPy package, use the same method as with any other Python package.

```
>>> import esppy
```

To connect to an ESP server, use the `ESP` class.  In most cases, the only
information that is needed is the hostname and port.

```
>>> esp = esppy.ESP('http://myesp.com:8777')
```

### Getting Information about the Server

After you have connected to the server, you can get information about the
server and projects.

```
>>> esp.server_info
{'analytics-license': True,
 'engine': 'esp',
 'http-admin': 8777,
 'pubsub': 8778,
 'version': 'X.X'}

# Currently no projects are loaded
>>> esp.get_projects()
{}
```

### Loading a Project

To load a project, use the `load_project` method.

```
>>> esp.load_project('project.xml')

>>> esp.get_projects()
{'project': Project(name='project')}
```

To access continous queries and windows within projects, use 
the `queries` and `windows` attributes of the `Project` and
`ContinuousQuery` objects, respectively.

```
>>> proj = esp.get_project('project')
>>> proj.queries
{'contquery': ContinuousQuery(name='contquery', project='project')}

>>> proj.queries['contquery'].windows
{'w_data': CopyWindow(name='w_data', continuous_query='contquery', project='project'),
 'w_request': SourceWindow(name='w_request', continuous_query='contquery', project='project'),
 'w_calculate': CalculateWindow(name='w_calculate', continuous_query='contquery', project='project')}

>>> dataw = proj.queries['contquery'].windows['w_data']
```

As a shortcut, you can drop the `queries` and `windows` attribute name.
Projects and continuous queries act like dictionaries of those components.

```
>>> dataw = proj['contquery']['w_data']
```

### Publishing Event Data

To publish events to a window, use the `publish_events` method.
It accepts a file name, file-like object, DataFrame, or a string of
CSV, XML, or JSON data.

```
>>> dataw.publish_events('data.csv')
```

### Monitoring Events

You can subscribe to the events of any window in a project. By default,
all event data are cached in the local window object.

```
>>> dataw.subscribe()
>>> dataw
       time        x        y        z
id                                    
6   0.15979 -2.30180  0.23155  10.6510
7   0.18982 -1.41650  1.18500  11.0730
8   0.22040 -0.27241  2.22010  11.9860
9   0.24976 -0.61292  2.22010  11.9860
10  0.27972  1.33480  4.24950  11.4140
11  0.31802  3.44590  7.58650  12.5990
```

To limit the number of cached events, use the `limit`
parameter. For example, to only keep the last 20 events, enter 
the following line:

```
>>> dataw.subscribe(limit=20)
```

You can also limit the amount of time that events are collected using
the `horizon` parameter. Use one of the following objects: `datetime`, `date`, `time`,
or `timedelta`.

```
>>> dataw.subscribe(horizon=datetime.timedelta(hours=1))
```

You can also perform any DataFrame operation on your ESP windows.

```
>>> dataw.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 2108 entries, 6 to 2113
Data columns (total 4 columns):
time    2108 non-null float64
x       2108 non-null float64
y       2108 non-null float64
z       2108 non-null float64
dtypes: float64(4)
memory usage: 82.3 KB

>>> dataw.describe()
            time          x          y          z
count  20.000000  20.000000  20.000000  20.000000
mean   69.655050  -4.365320   8.589630  -1.675292
std     0.177469   1.832482   2.688911   2.108300
min    69.370000  -7.436700   4.862500  -5.175700
25%    69.512500  -5.911250   7.007675  -3.061150
50%    69.655000  -4.099700   7.722700  -1.702500
75%    69.797500  -2.945400   9.132350  -0.766110
max    69.940000  -1.566300  14.601000   3.214400
```

### Using ESPPy Visualizations with JupyterLab

NOTE: These instructions assume you have Anaconda installed.

To use jupyterlab visualizations with ESPPy (available in version 6.2 or higher), perform the following steps:

1. Create a new Anaconda environment. For this example, the environment is called esp.
```
    $ conda create -n esp python=3.X
```
2. Activate the new environment.
```
$ conda activate esp
```
3. Install the following packages:
```
$ pip install jupyter
$ pip install jupyterlab
$ pip install matplotlib
$ pip install ipympl
$ pip install pandas
$ pip install requests
$ pip install image
$ pip install ws4py
$ pip install plotly
$ pip install ipyleaflet
$ pip install graphviz
```
4. Install the following Jupyterlab extensions:
```
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager
$ jupyter labextension install plotlywidget
$ jupyter labextension install jupyter-leaflet
```

5. Install the following packages (WINDOWS ONLY):
```
$ conda install -c conda-forge python-graphviz
```

6. Create and change to a working directory.
```
$ cd $HOME
$ mkdir esppy
$ cd esppy
```

7. Install ESPPy.
```
pip install sas-esppy
```

8. Create a notebooks directory to store your notebooks.
```
$ mkdir notebooks
```

9. Start the Jupyterlab server. Select an available port. For this example, port 35000 was selected.
```
$ jupyter lab --port 35000
```

After you complete these steps, you can use the latest ESP graphics in your Jupyter notebooks.

### Documentation

To view the full API documentation for ESPPy, see 
https://sassoftware.github.io/python-esppy/.




%package help
Summary:	Development documents and examples for sas-esppy
Provides:	python3-sas-esppy-doc
%description help
# SAS Event Stream Processing Python Interface

The ESPPy package enables you to create
[SAS Event Stream Processing (ESP)](https://www.sas.com/en_us/software/event-stream-processing.html)
models programmatically in Python. Using ESPPy, you can connect to 
an ESP server and interact with projects and their components as 
Python objects. These objects include projects, continuous queries, 
windows, events, loggers, SAS Micro Analytic Service modules, 
routers, and analytical algorithms.

ESPPy has full integration with [Jupyter](https://jupyter.org/) notebooks including visualizing 
diagrams of your ESP projects, and support for streaming charts and 
images. This enables you to easily explore and prototype your ESP 
projects in a familiar notebook interface.

## Installation

To install ESPPy, use `pip`. This installs
ESPPy and the Python package dependencies.

```
pip install sas-esppy
```

### Additional Requirements

In addition to the Python package dependencies, you also need the 
`graphviz` command-line tools to fully take advantage of ESPPy. Download them from http://www.graphviz.org/download/.

### Performance Enhancement

ESPPy uses the `ws4py` websocket Python package. In some cases,
you can improve performance greatly by installing the `wsaccel` package.
This may not be available on all platforms though, and is left up to 
the user to install.

## The Basics

To import the ESPPy package, use the same method as with any other Python package.

```
>>> import esppy
```

To connect to an ESP server, use the `ESP` class.  In most cases, the only
information that is needed is the hostname and port.

```
>>> esp = esppy.ESP('http://myesp.com:8777')
```

### Getting Information about the Server

After you have connected to the server, you can get information about the
server and projects.

```
>>> esp.server_info
{'analytics-license': True,
 'engine': 'esp',
 'http-admin': 8777,
 'pubsub': 8778,
 'version': 'X.X'}

# Currently no projects are loaded
>>> esp.get_projects()
{}
```

### Loading a Project

To load a project, use the `load_project` method.

```
>>> esp.load_project('project.xml')

>>> esp.get_projects()
{'project': Project(name='project')}
```

To access continous queries and windows within projects, use 
the `queries` and `windows` attributes of the `Project` and
`ContinuousQuery` objects, respectively.

```
>>> proj = esp.get_project('project')
>>> proj.queries
{'contquery': ContinuousQuery(name='contquery', project='project')}

>>> proj.queries['contquery'].windows
{'w_data': CopyWindow(name='w_data', continuous_query='contquery', project='project'),
 'w_request': SourceWindow(name='w_request', continuous_query='contquery', project='project'),
 'w_calculate': CalculateWindow(name='w_calculate', continuous_query='contquery', project='project')}

>>> dataw = proj.queries['contquery'].windows['w_data']
```

As a shortcut, you can drop the `queries` and `windows` attribute name.
Projects and continuous queries act like dictionaries of those components.

```
>>> dataw = proj['contquery']['w_data']
```

### Publishing Event Data

To publish events to a window, use the `publish_events` method.
It accepts a file name, file-like object, DataFrame, or a string of
CSV, XML, or JSON data.

```
>>> dataw.publish_events('data.csv')
```

### Monitoring Events

You can subscribe to the events of any window in a project. By default,
all event data are cached in the local window object.

```
>>> dataw.subscribe()
>>> dataw
       time        x        y        z
id                                    
6   0.15979 -2.30180  0.23155  10.6510
7   0.18982 -1.41650  1.18500  11.0730
8   0.22040 -0.27241  2.22010  11.9860
9   0.24976 -0.61292  2.22010  11.9860
10  0.27972  1.33480  4.24950  11.4140
11  0.31802  3.44590  7.58650  12.5990
```

To limit the number of cached events, use the `limit`
parameter. For example, to only keep the last 20 events, enter 
the following line:

```
>>> dataw.subscribe(limit=20)
```

You can also limit the amount of time that events are collected using
the `horizon` parameter. Use one of the following objects: `datetime`, `date`, `time`,
or `timedelta`.

```
>>> dataw.subscribe(horizon=datetime.timedelta(hours=1))
```

You can also perform any DataFrame operation on your ESP windows.

```
>>> dataw.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 2108 entries, 6 to 2113
Data columns (total 4 columns):
time    2108 non-null float64
x       2108 non-null float64
y       2108 non-null float64
z       2108 non-null float64
dtypes: float64(4)
memory usage: 82.3 KB

>>> dataw.describe()
            time          x          y          z
count  20.000000  20.000000  20.000000  20.000000
mean   69.655050  -4.365320   8.589630  -1.675292
std     0.177469   1.832482   2.688911   2.108300
min    69.370000  -7.436700   4.862500  -5.175700
25%    69.512500  -5.911250   7.007675  -3.061150
50%    69.655000  -4.099700   7.722700  -1.702500
75%    69.797500  -2.945400   9.132350  -0.766110
max    69.940000  -1.566300  14.601000   3.214400
```

### Using ESPPy Visualizations with JupyterLab

NOTE: These instructions assume you have Anaconda installed.

To use jupyterlab visualizations with ESPPy (available in version 6.2 or higher), perform the following steps:

1. Create a new Anaconda environment. For this example, the environment is called esp.
```
    $ conda create -n esp python=3.X
```
2. Activate the new environment.
```
$ conda activate esp
```
3. Install the following packages:
```
$ pip install jupyter
$ pip install jupyterlab
$ pip install matplotlib
$ pip install ipympl
$ pip install pandas
$ pip install requests
$ pip install image
$ pip install ws4py
$ pip install plotly
$ pip install ipyleaflet
$ pip install graphviz
```
4. Install the following Jupyterlab extensions:
```
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager
$ jupyter labextension install plotlywidget
$ jupyter labextension install jupyter-leaflet
```

5. Install the following packages (WINDOWS ONLY):
```
$ conda install -c conda-forge python-graphviz
```

6. Create and change to a working directory.
```
$ cd $HOME
$ mkdir esppy
$ cd esppy
```

7. Install ESPPy.
```
pip install sas-esppy
```

8. Create a notebooks directory to store your notebooks.
```
$ mkdir notebooks
```

9. Start the Jupyterlab server. Select an available port. For this example, port 35000 was selected.
```
$ jupyter lab --port 35000
```

After you complete these steps, you can use the latest ESP graphics in your Jupyter notebooks.

### Documentation

To view the full API documentation for ESPPy, see 
https://sassoftware.github.io/python-esppy/.




%prep
%autosetup -n sas-esppy-7.1.16

%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-sas-esppy -f filelist.lst
%dir %{python3_sitelib}/*

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

%changelog
* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 7.1.16-1
- Package Spec generated