-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathpython3.spec
1309 lines (1147 loc) · 46.1 KB
/
python3.spec
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
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# NOTE: tests require processes limit >128 (256 is sufficient)
#
# Conditional build:
%bcond_without default_python # build as default system Python
%bcond_with info # info pages (requires emacs)
%bcond_without system_mpdecimal # system libmpdec library
%bcond_without tkinter # disables tkinter module building
%bcond_without tests # disables Python testing
%bcond_with verbose_tests # runs tests in verbose mode
%bcond_without optimizations # expensive, stable optimizations (PGO etc.) + LTO
#
# tests which will not work on 64-bit platforms
%define no64bit_tests -x test_rgbimg -x test_imageop
# tests which may fail because of builder environment limitations (no /proc or /dev/pts)
%define nobuilder_tests -u-network -x test_resource -x test_openpty -x test_socket -x test_posix -x test_locale -x test_pty -x test_asyncio -x test_os -x test_readline -x test_normalization
# tests which fail because of some unknown/unresolved reason (this list should be %%{nil})
# test_site: fails because our site.py is patched to include both /usr/share/... and /usr/lib...
# test_gdb: fails, as the gdb uses old python version
# test_time: test_AsTimeval (test.test_time.TestCPyTime), rounding error
%ifarch x32
%define broken_tests_x32 -x test_time
%undefine with_optimizations
%endif
%define broken_tests -x test_embed -x test_gdb -x test_site -x test_ssl %{?broken_tests_x32}
%ifarch armv6hl armv7hl armv7hnl
%define _python_target_abi %{?_gnu}hf
%else
%define _python_target_abi %{?_gnu}
%endif
%define py_ver 3.13
%define py_abi %{py_ver}
%define py_platform %{py_abi}-%{_target_base_arch}-%{_target_os}%{?_python_target_abi}
%define py_prefix %{_prefix}
%define py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
%define py_incdir %{_includedir}/python%{py_abi}
%define py_sitedir %{py_libdir}/site-packages
%define py_dyndir %{py_libdir}/lib-dynload
Summary: Very high level scripting language with X interface
Summary(es.UTF-8): Lenguaje script de alto nivel con interfaz X
Summary(fr.UTF-8): Langage de script de très haut niveau avec interface X
Summary(pl.UTF-8): Python - język obiektowy wysokiego poziomu
Summary(pt_BR.UTF-8): Linguagem de programação interpretada de alto nível
Summary(ru.UTF-8): Язык программирования очень высокого уровня с X-интерфейсом
Summary(tr.UTF-8): X arayüzlü, yüksek düzeyli, kabuk yorumlayıcı dili
Summary(uk.UTF-8): Мова програмування дуже високого рівня з X-інтерфейсом
Name: python3
Version: %{py_ver}.2
Release: 1
Epoch: 1
License: PSF
Group: Development/Languages/Python
Source0: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
# Source0-md5: 4c2d9202ab4db02c9d0999b14655dfe5
Source1: pyconfig.h.in
Patch2: %{name}-multilib.patch
Patch3: %{name}-no_cmdline_tests.patch
Patch4: %{name}-BLDLIBRARY.patch
Patch5: %{name}-config.patch
Patch9: %{name}-tests_with_pythonpath.patch
Patch11: %{name}-installcompile.patch
Patch14: python3-profile-tests.patch
Patch15: python3-tests.patch
URL: https://www.python.org/
BuildRequires: autoconf >= 2.65
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: bluez-libs-devel
BuildRequires: bzip2-devel
BuildRequires: db-devel >= 4
%{?with_info:BuildRequires: emacs >= 21}
BuildRequires: expat-devel >= 1:1.95.7
BuildRequires: file
BuildRequires: gdbm-devel >= 1.8.3
%if %(locale -a | grep -q '^C\.utf8$'; echo $?)
BuildRequires: glibc-localedb-all
%endif
BuildRequires: gmp-devel >= 4.0
BuildRequires: libffi-devel
BuildRequires: libnsl-devel
BuildRequires: libstdc++-devel
BuildRequires: libtirpc-devel
%{?with_system_mpdecimal:BuildRequires: mpdecimal-devel >= 2.5.0}
BuildRequires: ncurses-ext-devel >= 5.2
BuildRequires: openssl-devel >= 0.9.7
BuildRequires: pkgconfig
BuildRequires: readline-devel >= 5.0
BuildRequires: rpm-build >= 4.6
BuildRequires: rpm-pythonprov
BuildRequires: sed >= 4.0
BuildRequires: sqlite3-devel >= 3.3.5
BuildRequires: tar >= 1:1.22
%{?with_info:BuildRequires: tetex-makeindex}
%{?with_tkinter:BuildRequires: tix-devel >= 1:8.1.4-4}
%{?with_tkinter:BuildRequires: tk-devel >= 8.4.3}
BuildRequires: xz
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
Suggests: pip
%if %{with default_python}
Conflicts: python < 1:2.7.18-10
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define specflags_ppc -D__ppc__=1
%define specflags_ppc64 -D__ppc64__=1
%if %{with verbose_tests}
%define test_flags -v
%else
%define test_flags -wW
%endif
%ifarch alpha ia64 ppc64 sparc64 ppc64 %{x8664}
%define test_list %{nobuilder_tests} %{broken_tests} %{no64bit_tests}
%else
%define test_list %{nobuilder_tests} %{broken_tests}
%endif
%ifarch sparc
%define test_list %{nobuilder_tests} %{broken_tests} -x test_fcntl -x test_ioctl
%endif
%description
Python is an interpreted, interactive, object-oriented programming
language. It incorporates modules, exceptions, dynamic typing, very
high level dynamic data types, and classes. Python combines remarkable
power with very clear syntax. It has interfaces to many system calls
and libraries, as well as to various window systems, and is extensible
in C or C++. It is also usable as an extension language for
applications that need a programmable interface. Finally, Python is
portable: it runs on many brands of UNIX, on the Mac, and on PCs under
MS-DOS, Windows, Windows NT, and OS/2.
This package contains the Python binary.
%description -l de.UTF-8
Python ist eine interpretierte, interaktive, objektorientierte
Programmiersprache, vergleichbar zu Tcl, Perl, Scheme oder Java.
Python enthält Module, Klassen, Exceptions, High-Level dynamische
Datentypen und dynamisches Typisieren. Python unterstützt Interfaces
zu vielen Systemaufrufen und Libraries, sowie verschiedene
Fenstersysteme (X11, Motif, Tk, Mac und MFC)
Programmierer können neue built-in-Module für Python in C oder C++
schreiben. Python kann auch als Erweiterungssprache für Applikationen
benutzt werden, die ein programmierbares Interface brauchen. Dieses
Paket enthält die meisten Standard-Python-Module, und Module zum
Ansprechen von Tix (Tk-widget set) und RPM.
%description -l es.UTF-8
Python es un lenguaje de scripts interpretado orientado a objetos.
Contiene soporte para carga dinámica de objetos, clases, módulos y
excepciones.
Es sencillo adicionar interfaces para nuevos sistemas de biblioteca a
través de código C, tornando Python fácil de usar en ambientes
particulares/personalizados. Este paquete Python incluye la mayoría de
los módulos padrón Python, junto con módulos para crear interfaces
para el conjunto de componentes Tix para Tk y RPM.
%description -l fr.UTF-8
Python est un langage de script interprété et orienté objet. Il gère
le chargement dynamique des objets, les classes, les modules et les
exceptions. L'ajout d'interfaces aux nouvelles bibliothèques systèmes
avec du code C est simple, ce qui rend Python facile à utiliser dans
des configs personnalisées.
Ce paquetage Python contient la plupart des modules Python standards,
ainsi que ceux permettant l'interfaçage avec les widgets Tix pour Tk
et RPM.
%description -l pl.UTF-8
Python jest interpretowanym, interaktywnym i zorientowanym obiektowo
językiem programowania. Jest modularny, obsługuje wyjątki, dynamiczne
typy, zaawansowane dynamiczne struktury danych i klasy. Python łączy w
sobie duże możliwości i przejrzystą składnię. Posiada interfejsy do
wielu wywołań systemowych i bibliotek, w tym również do różnych
bibliotek okienkowych. Możliwości jego można jeszcze rozszerzać
poprzez odpowiednie moduły pisane w C lub C++. Python może być również
użyty jako element aplikacji, którym potrzebny jest interpreter do
skryptów. I wreszcie, Python jest wieloplatformowy, działa na wielu
odmianach UNIX-a, Macu oraz PC pod DOS-em, Windows, WindowsNT oraz
OS/2.
Ten pakiet zawiera binarkę Pythona.
%description -l pt_BR.UTF-8
Python é uma linguagem de scripts interpretada orientada a objetos.
Contém suporte para carga dinâmica de objetos, classes, módulos e
exceções. Adicionar interfaces para novos sistemas de biblioteca
através de código C é simples, tornando Python fácil de usar em
ambientes particulares/personalizados.
Este pacote Python inclui a maioria do módulos padrão Python, junto
com módulos para interfaceamento para o conjunto de componentes Tix
para Tk e RPM.
%description -l ru.UTF-8
Python - это интерпретируемый, объектно-ориентированный язык
программирования. Он поддерживает динамическую загрузку объектов,
классы, модули и обработку исключительных ситуаций (exceptions).
Простота добавления интерфейсов к новым системным библиотекам через
код на языке C делает Python хорошим выбором для использования в
специальных конфигурациях.
%description -l tr.UTF-8
Python, nesneye yönelik bir kabuk yorumlayıcıdır. Nesnelerin,
sınıfların, modüllerin ve aykırı durumların dinamik yüklenmelerine
destek verir. C koduyla birlikte kullanımı son derece kolaydır. Bu
paket, standart Python birimlerinin çoğunun yanısıra Tk ve RPM için
arayüz birimlerini de içerir.
%description -l uk.UTF-8
Python - це інтерпретована, об'єктно-орієнтована мова програмування.
Він підтримує динамічну загрузку об'єктів, класи, модулі та обробку
виключних ситуацій (exceptions). Простота додавання інтерфейсів для
нових системних бібліотек через код на мові C робить Python добрим
вибором для використання в спеціальних конфігураціях.
%package libs
Summary: Python library
Summary(pl.UTF-8): Biblioteka języka Python
Group: Libraries/Python
# broken detection in rpm/pythondeps.sh
Provides: python(abi) = %{py_ver}
# for compatibility with existing Ac packages
Provides: python(bytecode) = %{py_ver}
Provides: python3-enum
Obsoletes: python3-enum < 0.5
%{!?with_info:Obsoletes: python3-doc-info < %{epoch}:%{version}-%{release}}
%description libs
Python shared library and very essental modules for Python binary.
%description libs -l pl.UTF-8
Biblioteka współdzielona języka Python oraz bardzo podstawowe moduły
dla Pythona.
%package modules
Summary: Python modules
Summary(pl.UTF-8): Moduły języka Python
Group: Libraries/Python
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
%{?with_system_mpdecimal:Requires: mpdecimal >= 2.4.2-2}
Obsoletes: python3-modules-sqlite < 1:3.1-2
%requires_ge_to expat expat-devel
%requires_ge_to openssl openssl-devel
%description modules
Python officially distributed modules.
%description modules -l pl.UTF-8
Oficjalnie rozprowadzane moduły języka Python.
%package -n pydoc3
Summary: Python interactive module documentation access support
Summary(pl.UTF-8): Interaktywne korzystanie z dokumentacji modułów języka Python
Group: Applications
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
%description -n pydoc3
Python interactive module documentation access support.
%description -n pydoc3 -l pl.UTF-8
Interaktywne korzystanie z dokumentacji modułów języka Python.
%package -n idle3
Summary: IDE for Python language
Summary(pl.UTF-8): IDE dla języka Python
Group: Applications
Requires: %{name}-tkinter = %{epoch}:%{version}-%{release}
%description -n idle3
IDE for Python language.
%description -n idle3 -l pl.UTF-8
IDE dla języka Python.
%package devel
Summary: Libraries and header files for building python code
Summary(de.UTF-8): Libraries und Header-Dateien zum Erstellen von Python-Code
Summary(es.UTF-8): Bibliotecas y archivos de inclusión para construir programas en python
Summary(fr.UTF-8): Bibliothèques et en-têtes pour construire du code python
Summary(pl.UTF-8): Pliki nagłówkowe i biblioteki Pythona
Summary(pt_BR.UTF-8): Bibliotecas e arquivos de inclusão para o Python
Summary(ru.UTF-8): Библиотеки и хедеры для построения кода на языке Python
Summary(tr.UTF-8): Python ile geliştirme yapmak için gerekli dosyalar
Summary(uk.UTF-8): Бібліотеки та хедери для програмування на мові Python
Group: Development/Languages/Python
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
Obsoletes: python3-devel-src < 1:3.2-1
%description devel
The Python interpreter is relatively easy to extend with dynamically
loaded extensions and to embed in other programs. This package
contains the header files and libraries which are needed to do both of
these tasks.
%description devel -l de.UTF-8
Der Python-Interpretierer ist relativ einfach anhand von dynamisch
ladbaren Erweiterungen auszubauen und läßt sich in andere Programme
integrieren. Dieses Paket enthält die Header-Dateien und Libraries,
die für beide Aufgaben erforderlich sind.
%description devel -l es.UTF-8
El interpretador Python permite incluir con facilidad extensiones
cargadas dinámicamente. Python es también fácil de ser empotrado en
otros programas. Este paquete contiene los archivos de inclusión y
bibliotecas necesarios para estas dos tareas.
%description devel -l fr.UTF-8
L'interpréteur Python est relativement facile à étendre avec des
extensions chargées dynamiquement et à insérer dans d'autres
programmes. Ce paquetage contient les en-têtes et les bibliothèques
nécessaires à ces deux tâches.
%description devel -l pl.UTF-8
Interpreter Pythona jest w miarę łatwy do rozszerzania przy pomocy
dynamicznie ładowanych rozszerzeń napisanych w C lub C++ oraz
osadzania w innych programach. Ten pakiet zawiera pliki nagłówkowe i
wszystko inne co potrzebne do tych celów.
%description devel -l pt_BR.UTF-8
O interpretador Python permite incluir com facilidade extensões
carregadas dinamicamente. Python é também fácil de ser embutido em
outros programas. Este pacote contém os arquivos de inclusão e
bibliotecas necessários para estas duas tarefas.
%description devel -l ru.UTF-8
Интерпретатор Python относительно легко расширяется при помощи
динамически загружаемых расширений и встраивается в другие программы.
Этот пакет содержит хедеры и библиотеки, необходимые для обеих этих
задач.
%description devel -l tr.UTF-8
Bu paket, Python ile geliştirme yapılabilmesi için gerekli başlık
dosyalarını ve kitaplıkları içerir.
%description devel -l uk.UTF-8
Інтерпретатор Python відносно легко розширюється за допомогою
розширень з динамічною загрузкою та вбудовується в інші програми. Цей
пакет містить хедери та бібліотеки, необхідні для обох цих задач.
%package devel-tools
Summary: Python development tools
Summary(pl.UTF-8): Narzędzia programistyczne języka Python
Group: Development/Languages/Python
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
%description devel-tools
Python development tools such as profilers and debugger.
%description devel-tools -l pl.UTF-8
Narzędzia programistyczne języka Python takie jak profiler oraz
debugger.
%package static
Summary: Static python library
Summary(pl.UTF-8): Statyczna biblioteka Pythona
Group: Development/Languages/Python
Requires: %{name}-devel = %{epoch}:%{version}-%{release}
%description static
Static python library.
%description static -l pl.UTF-8
Statyczna biblioteka Pythona.
%package doc-info
Summary: Documentation on Python in texinfo format
Summary(pl.UTF-8): Dokumentacja do Pythona w formacie texinfo
Group: Documentation
%description doc-info
Documentation on Python in texinfo format.
%description doc-info -l pl.UTF-8
Dokumentacja do Pythona w formacie texinfo.
%package tkinter
Summary: Standard Python interface to the Tk GUI toolkit
Summary(de.UTF-8): Grafische Tk-Schnittstelle für Python
Summary(es.UTF-8): Interfaz de GUI Tk para Python
Summary(fr.UTF-8): Interface graphique Tk pour Python
Summary(pl.UTF-8): Standardowy interfejs Pythona do biblioteki Tk
Summary(pt_BR.UTF-8): Interface GUI Tk para Phyton
Summary(tr.UTF-8): Python için grafik kullanıcı arayüzü
Group: Libraries/Python
Requires: %{name}-modules = %{epoch}:%{version}-%{release}
Requires: tcl >= 8.4.3
Requires: tix >= 1:8.1.4-4
Requires: tk >= 8.4.3
%description tkinter
Standard Python interface to the Tk GUI toolkit.
%description tkinter -l de.UTF-8
Eine grafische Schnittstelle für Python, basierend auf Tcl/Tk, und von
vielen Konfigurations-Tools genutzt.
%description tkinter -l es.UTF-8
Una interfaz gráfica para Python, basada en Tcl/Tk, y usada por muchas
herramientas de configuración.
%description tkinter -l fr.UTF-8
Interface graphique pour Python, basée sur Tcl/Tk et utilisée par
beaucoup des outils de configuration.
%description tkinter -l pl.UTF-8
Standardowy interfejs Pythona do biblioteki Tk.
%description tkinter -l pt_BR.UTF-8
Uma interface gráfica para Python, baseada em Tcl/Tk, e usada por
muitas ferramentas de configuração.
%description tkinter -l ru.UTF-8
Графический интерфейс (GUI) для Python, построенный на Tcl/Tk.
%description tkinter -l tr.UTF-8
Python için Tcl/Tk'ye dayalı ve pek çok ayarlama aracı tarafından
kullanılan grafik bir arayüzdür.
%description tkinter -l uk.UTF-8
Графічний інтерфейс (GUI) для Python, побудований на Tcl/Tk.
%package examples
Summary: Example programs in Python
Summary(pl.UTF-8): Przykładowe programy w Pythonie
Group: Development/Languages/Python
BuildArch: noarch
%description examples
Example programs in Python.
These are for Python 2.3.4, not %{version}.
%description examples -l pl.UTF-8
Przykładowe programy w Pythonie.
Przykłady te są dla Pythona 2.3.4, nie %{version}.
%package test
Summary: Test modules for Python
Summary(pl.UTF-8): Moduły testowe dla Pythona
Group: Development/Languages/Python
%description test
Test modules for Python.
%description test -l pl.UTF-8
Moduły testowe dla Pythona.
%prep
%setup -q -n Python-%{version}
%patch -P 2 -p1
%patch -P 3 -p1
%patch -P 4 -p1
%patch -P 5 -p1
%patch -P 9 -p1
%patch -P 11 -p1
%patch -P 14 -p1
%patch -P 15 -p1
%{__rm} -r Modules/expat
%if "%{pld_release}" == "ac"
files="md5module.c sha1module.c"
files="$files sha256module.c sha512module.c"
for f in $files; do
%{__rm} Modules/$f
done
%endif
sed -i -e '1s,/usr/bin/python$,%{__python3},' \
Tools/gdb/libpython.py
sed -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
Tools/scripts/idle3 \
Tools/scripts/pydoc3
find . -name '*.py' | xargs -r grep -El '^#! */usr/bin/env python3?' | xargs %{__sed} -i -e '1s,^#! */usr/bin/env python3\?,#!/usr/bin/python3,'
sed -E -i -e '1s,#!\s*/usr/bin/env\s+bash(\s|$),#!/bin/bash\1,' \
Tools/build/regen-configure.sh \
Tools/c-analyzer/must-resolve.sh
%build
if ! grep -q "tmpfs" /proc/self/mounts; then
echo "You need to have /dev/shm mounted in order to build this package!" >&2
echo "(Or any other tmpfs mounted and accessible to the rpmbuild process)" >&2
exit 1
fi
export SETUPTOOLS_USE_DISTUTILS=stdlib
%{__aclocal}
%{__autoconf}
%configure \
CC="%{__cc}" \
OPT="%{rpmcflags}" \
CPPFLAGS="%{rpmcppflags}" \
LDFLAGS="%{rpmldflags}" \
LDFLAGS_NODIST="%{debuginfocflags}" \
ac_cv_posix_semaphores_enabled=yes \
ac_cv_broken_sem_getvalue=no \
--enable-ipv6 \
--enable-shared \
--with-computed-gotos \
--with-dbmliborder=gdbm:ndbm:bdb \
--with-doc-strings \
--without-ensurepip \
--with-platlibdir="%{_lib}" \
%{?with_debug:--with-pydebug} \
--with-ssl-default-suites=openssl \
--with-system-expat \
%{?with_system_mpdecimal:--with-system-libmpdec} \
%if %{with optimizations}
--enable-optimizations \
--with-lto
%endif
if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then
echo "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." >&2
exit 1
fi
%{__make} \
TESTOPTS="%{_smp_mflags} %{test_list}" \
2>&1 | awk '
BEGIN { fail = 0; logmsg = ""; }
{
if ($0 ~ /\*\*\* WARNING:/) {
fail = 1;
logmsg = logmsg $0;
}
print $0;
}
END { if (fail) { print "\nPROBLEMS FOUND:"; print logmsg; exit(1); } }'
LC_ALL=C.UTF-8
export LC_ALL
%if %{with tests}
cp -a Makefile Makefile.org
sed -i -e 's#^test: all.*#test:#g' Makefile
WITHIN_PYTHON_RPM_BUILD=1 \
EXTRATESTOPTS="-v" \
%{__make} test \
TESTOPTS="%{test_flags} %{test_list}"
cp -a Makefile.org Makefile
%endif
%if %{with info}
%{__make} -C Doc texinfo
%{__make} -C Doc/build/texinfo info
%endif
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_pkgconfigdir}} \
$RPM_BUILD_ROOT{%{py_sitedir},%{py_sitescriptdir}}/__pycache__ \
$RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} \
$RPM_BUILD_ROOT{%{_infodir},%{_mandir}/man1} \
$RPM_BUILD_ROOT/etc/shrc.d \
$RPM_BUILD_ROOT%{_prefix}/lib/debug/%{_libdir}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
%if %{with info}
cp -p Doc/build/texinfo/python*info* $RPM_BUILD_ROOT%{_infodir}
%endif
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -a Tools $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
# make libpython3.so simply symlink to real lib
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libpython3.so
ln -s libpython%{py_abi}.so $RPM_BUILD_ROOT%{_libdir}/libpython3.so
# gdb helper that will end up in -debuginfo package
soname=$(ls -1d $RPM_BUILD_ROOT%{_libdir}/libpython%{py_abi}.so.*.* | sed -e "s#^$RPM_BUILD_ROOT##g")
cp -a Tools/gdb/libpython.py "$RPM_BUILD_ROOT%{_prefix}/lib/debug/${soname}-gdb.py"
#
# create several useful aliases, such as timeit.py, profile.py, pdb.py, smtpd.py
#
# for python devel tools
for script in timeit profile pdb pstats; do
echo "#alias ${script}%{py_ver}.py='python%{py_ver} -m ${script}'"
done > $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-devel.sh
echo "#alias pygettext%{py_ver}.py='pygettext%{py_ver}'" \
>> $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-devel.sh
sed 's/=/ /' \
< $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-devel.sh \
> $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-devel.csh
# for python modules
for script in smtpd webbrowser; do
echo "#alias ${script}%{py_ver}.py='python%{py_ver} -m ${script}'"
done > $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-modules.sh
sed 's/=/ /' \
< $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-modules.sh \
> $RPM_BUILD_ROOT/etc/shrc.d/python%{py_ver}-modules.csh
# xgettext specific for Python code
#
# we will have two commands: pygettext.py (an alias) and pygettext;
# this way there are no import (which is impossible now) conflicts and
# pygettext.py is provided for compatibility
install -p Tools/i18n/pygettext.py $RPM_BUILD_ROOT%{_bindir}/pygettext%{py_ver}
# reindent python code
install -p Tools/patchcheck/reindent.py $RPM_BUILD_ROOT%{_bindir}/pyreindent%{py_ver}
# just to cut the noise, as they are not packaged (now)
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/ctypes/macholib/fetch_macholib*
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/idlelib/*.bat
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/idlelib/*.pyw
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/idlelib/help.html
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/site-packages/README.txt
# that seems to be only an empty extension template,
# which seems to be built only {with tests}
%{__rm} $RPM_BUILD_ROOT%{py_dyndir}/xxlimited*.*.so
# already in %%doc
%{__rm} $RPM_BUILD_ROOT%{py_libdir}/LICENSE.txt
%{__mv} $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h $RPM_BUILD_ROOT%{py_libdir}/config-%{py_platform}/pyconfig.h
%{__sed} -e's#@PREFIX@#%{_prefix}#g;s#@PY_VER@#%{py_ver}#g;s#@PY_ABI@#%{py_platform}#g' %{SOURCE1} > $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h
%if %{with default_python}
# python points to python3 now
ln -s python3 $RPM_BUILD_ROOT%{_bindir}/python
echo '.so python3.1' >$RPM_BUILD_ROOT%{_mandir}/man1/python.1
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%post doc-info -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
%postun doc-info -p /sbin/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
%files
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/python%{py_ver}
%if "%{py_ver}" != "%{py_abi}"
%attr(755,root,root) %{_bindir}/python%{py_abi}
%endif
%attr(755,root,root) %{_bindir}/python3
%{_mandir}/man1/python3*.1*
%if %{with default_python}
%attr(755,root,root) %{_bindir}/python
%{_mandir}/man1/python.1*
%endif
%files libs
%defattr(644,root,root,755)
%doc LICENSE
%attr(755,root,root) %{_libdir}/libpython%{py_abi}.so.*.*
%dir %{py_incdir}
%{py_incdir}/pyconfig.h
%dir %{py_libdir}
%dir %{py_dyndir}
%dir %{py_sitedir}
%dir %{py_sitedir}/__pycache__
%dir %{py_libdir}/__pycache__
%dir %{py_scriptdir}
%dir %{py_sitescriptdir}
%dir %{py_sitescriptdir}/__pycache__
# shared modules required by python library
%attr(755,root,root) %{py_dyndir}/_struct.cpython-*.so
# modules required by python library
%{py_libdir}/__future__.py
%{py_libdir}/_collections_abc.py
%{py_libdir}/_sitebuiltins.py
%{py_libdir}/_sysconfigdata_*.py
%{py_libdir}/_weakrefset.py
%{py_libdir}/abc.py
%{py_libdir}/bisect.py
%{py_libdir}/codecs.py
%{py_libdir}/copyreg.py
%{py_libdir}/enum.py
%{py_libdir}/functools.py
%{py_libdir}/genericpath.py
%{py_libdir}/heapq.py
%{py_libdir}/keyword.py
%{py_libdir}/linecache.py
%{py_libdir}/locale.py
%{py_libdir}/io.py
%{py_libdir}/operator.py
%{py_libdir}/posixpath.py
%{py_libdir}/reprlib.py
%{py_libdir}/site.py
%{py_libdir}/sre_*.py
%{py_libdir}/stat.py
%{py_libdir}/token.py
%{py_libdir}/tokenize.py
%{py_libdir}/traceback.py
%{py_libdir}/weakref.py
%{py_libdir}/os.py
# needed by the dynamic sys.lib patch
%{py_libdir}/types.py
%{py_libdir}/__pycache__/__future__.cpython-*.py[co]
%{py_libdir}/__pycache__/_sitebuiltins.cpython-*.py[co]
%{py_libdir}/__pycache__/_sysconfigdata_*.cpython-*.py[co]
%{py_libdir}/__pycache__/_weakrefset.cpython-*.py[co]
%{py_libdir}/__pycache__/abc.cpython-*.py[co]
%{py_libdir}/__pycache__/bisect.cpython-*.py[co]
%{py_libdir}/__pycache__/codecs.cpython-*.py[co]
%{py_libdir}/__pycache__/_collections_abc.cpython-*.py[co]
%{py_libdir}/__pycache__/copyreg.cpython-*.py[co]
%{py_libdir}/__pycache__/enum.cpython-*.py[co]
%{py_libdir}/__pycache__/functools.cpython-*.py[co]
%{py_libdir}/__pycache__/genericpath.cpython-*.py[co]
%{py_libdir}/__pycache__/heapq.cpython-*.py[co]
%{py_libdir}/__pycache__/keyword.cpython-*.py[co]
%{py_libdir}/__pycache__/linecache.cpython-*.py[co]
%{py_libdir}/__pycache__/locale.cpython-*.py[co]
%{py_libdir}/__pycache__/io.cpython-*.py[co]
%{py_libdir}/__pycache__/operator.cpython-*.py[co]
%{py_libdir}/__pycache__/posixpath.cpython-*.py[co]
%{py_libdir}/__pycache__/reprlib.cpython-*.py[co]
%{py_libdir}/__pycache__/site.cpython-*.py[co]
%{py_libdir}/__pycache__/sre_*.cpython-*.py[co]
%{py_libdir}/__pycache__/stat.cpython-*.py[co]
%{py_libdir}/__pycache__/token.cpython-*.py[co]
%{py_libdir}/__pycache__/tokenize.cpython-*.py[co]
%{py_libdir}/__pycache__/traceback.cpython-*.py[co]
%{py_libdir}/__pycache__/weakref.cpython-*.py[co]
%{py_libdir}/__pycache__/os.cpython-*.py[co]
%{py_libdir}/__pycache__/types.cpython-*.py[co]
# main modules needed by core python
%{py_libdir}/_pyrepl
%{py_libdir}/collections
%{py_libdir}/encodings
%{py_libdir}/importlib
%{py_libdir}/sysconfig
%dir %{py_libdir}/config-%{py_platform}
%{py_libdir}/config-%{py_platform}/Makefile
%{py_libdir}/config-%{py_platform}/Setup
%{py_libdir}/config-%{py_platform}/Setup.bootstrap
%{py_libdir}/config-%{py_platform}/Setup.local
%{py_libdir}/config-%{py_platform}/Setup.stdlib
%{py_libdir}/config-%{py_platform}/pyconfig.h
%files modules
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) /etc/shrc.d/python*-modules*
%{py_libdir}/__hello__.py
%{py_libdir}/_aix_support.py
%{py_libdir}/_android_support.py
%{py_libdir}/_apple_support.py
%{py_libdir}/_colorize.py
%{py_libdir}/_compat_pickle.py
%{py_libdir}/_compression.py
%{py_libdir}/_ios_support.py
%{py_libdir}/_markupbase.py
%{py_libdir}/_opcode_metadata.py
%{py_libdir}/_osx_support.py
%{py_libdir}/_pydecimal.py
%{py_libdir}/_py_abc.py
%{py_libdir}/_pydatetime.py
%{py_libdir}/_pyio.py
%{py_libdir}/_pylong.py
%{py_libdir}/_strptime.py
%{py_libdir}/_threading_local.py
%{py_libdir}/antigravity.py
%{py_libdir}/argparse.py
%{py_libdir}/ast.py
%{py_libdir}/base64.py
%{py_libdir}/bdb.py
%{py_libdir}/bz2.py
%{py_libdir}/cProfile.py
%{py_libdir}/calendar.py
%{py_libdir}/cmd.py
%{py_libdir}/code.py
%{py_libdir}/codeop.py
%{py_libdir}/colorsys.py
%{py_libdir}/compileall.py
%{py_libdir}/configparser.py
%{py_libdir}/contextlib.py
%{py_libdir}/contextvars.py
%{py_libdir}/copy.py
%{py_libdir}/csv.py
%{py_libdir}/dataclasses.py
%{py_libdir}/datetime.py
%{py_libdir}/decimal.py
%{py_libdir}/difflib.py
%{py_libdir}/dis.py
%{py_libdir}/doctest.py
%{py_libdir}/filecmp.py
%{py_libdir}/fileinput.py
%{py_libdir}/fnmatch.py
%{py_libdir}/fractions.py
%{py_libdir}/ftplib.py
%{py_libdir}/getopt.py
%{py_libdir}/getpass.py
%{py_libdir}/gettext.py
%{py_libdir}/glob.py
%{py_libdir}/graphlib.py
%{py_libdir}/gzip.py
%{py_libdir}/hashlib.py
%{py_libdir}/hmac.py
%{py_libdir}/imaplib.py
%{py_libdir}/inspect.py
%{py_libdir}/ipaddress.py
%{py_libdir}/lzma.py
%{py_libdir}/mailbox.py
%{py_libdir}/mimetypes.py
%{py_libdir}/modulefinder.py
%{py_libdir}/netrc.py
%{py_libdir}/ntpath.py
%{py_libdir}/nturl2path.py
%{py_libdir}/numbers.py
%{py_libdir}/opcode.py
%{py_libdir}/optparse.py
%{py_libdir}/pdb.py
%{py_libdir}/pickle.py
%{py_libdir}/pickletools.py
%{py_libdir}/pkgutil.py
%{py_libdir}/platform.py
%{py_libdir}/plistlib.py
%{py_libdir}/poplib.py
%{py_libdir}/pprint.py
%{py_libdir}/profile.py
%{py_libdir}/pstats.py
%{py_libdir}/pty.py
%{py_libdir}/py_compile.py
%{py_libdir}/pyclbr.py
%{py_libdir}/queue.py
%{py_libdir}/quopri.py
%{py_libdir}/random.py
%{py_libdir}/rlcompleter.py
%{py_libdir}/runpy.py
%{py_libdir}/sched.py
%{py_libdir}/secrets.py
%{py_libdir}/selectors.py
%{py_libdir}/shelve.py
%{py_libdir}/shlex.py
%{py_libdir}/shutil.py
%{py_libdir}/signal.py
%{py_libdir}/smtplib.py
%{py_libdir}/socket.py
%{py_libdir}/socketserver.py
%{py_libdir}/ssl.py
%{py_libdir}/statistics.py
%{py_libdir}/string.py
%{py_libdir}/stringprep.py
%{py_libdir}/struct.py
%{py_libdir}/subprocess.py
%{py_libdir}/symtable.py
%{py_libdir}/tabnanny.py
%{py_libdir}/tarfile.py
%{py_libdir}/tempfile.py
%{py_libdir}/textwrap.py
%{py_libdir}/this.py
%{py_libdir}/threading.py
%{py_libdir}/trace.py
%{py_libdir}/tracemalloc.py
%{py_libdir}/tty.py
%{py_libdir}/turtle.py
%{py_libdir}/typing.py
%{py_libdir}/uuid.py
%{py_libdir}/warnings.py
%{py_libdir}/wave.py
%{py_libdir}/webbrowser.py
%{py_libdir}/zipapp.py
%{py_libdir}/zipimport.py
%{py_libdir}/__pycache__/__future__.cpython-*.py[co]
%{py_libdir}/__pycache__/__hello__.cpython-*.py[co]
%{py_libdir}/__pycache__/_aix_support.cpython-*.py[co]
%{py_libdir}/__pycache__/_android_support.cpython-*.py[co]
%{py_libdir}/__pycache__/_apple_support.cpython-*.py[co]
%{py_libdir}/__pycache__/_colorize.cpython-*.py[co]
%{py_libdir}/__pycache__/_compat_pickle.cpython-*.py[co]
%{py_libdir}/__pycache__/_compression.cpython-*.py[co]
%{py_libdir}/__pycache__/_ios_support.cpython-*.py[co]
%{py_libdir}/__pycache__/_markupbase.cpython-*.py[co]
%{py_libdir}/__pycache__/_opcode_metadata.cpython-*.py[co]
%{py_libdir}/__pycache__/_osx_support.cpython-*.py[co]
%{py_libdir}/__pycache__/_pydecimal.cpython-*.py[co]
%{py_libdir}/__pycache__/_py_abc.cpython-*.py[co]
%{py_libdir}/__pycache__/_pydatetime.cpython-*.py[co]
%{py_libdir}/__pycache__/_pyio.cpython-*.py[co]
%{py_libdir}/__pycache__/_pylong.cpython-*.py[co]
%{py_libdir}/__pycache__/_strptime.cpython-*.py[co]
%{py_libdir}/__pycache__/_threading_local.cpython-*.py[co]
%{py_libdir}/__pycache__/antigravity.cpython-*.py[co]
%{py_libdir}/__pycache__/argparse.cpython-*.py[co]
%{py_libdir}/__pycache__/ast.cpython-*.py[co]
%{py_libdir}/__pycache__/base64.cpython-*.py[co]
%{py_libdir}/__pycache__/bdb.cpython-*.py[co]
%{py_libdir}/__pycache__/bz2.cpython-*.py[co]
%{py_libdir}/__pycache__/cProfile.cpython-*.py[co]
%{py_libdir}/__pycache__/calendar.cpython-*.py[co]
%{py_libdir}/__pycache__/cmd.cpython-*.py[co]
%{py_libdir}/__pycache__/code.cpython-*.py[co]
%{py_libdir}/__pycache__/codeop.cpython-*.py[co]
%{py_libdir}/__pycache__/colorsys.cpython-*.py[co]
%{py_libdir}/__pycache__/compileall.cpython-*.py[co]
%{py_libdir}/__pycache__/configparser.cpython-*.py[co]
%{py_libdir}/__pycache__/contextlib.cpython-*.py[co]
%{py_libdir}/__pycache__/contextvars.cpython-*.py[co]
%{py_libdir}/__pycache__/copy.cpython-*.py[co]
%{py_libdir}/__pycache__/csv.cpython-*.py[co]
%{py_libdir}/__pycache__/dataclasses.cpython-*.py[co]
%{py_libdir}/__pycache__/datetime.cpython-*.py[co]
%{py_libdir}/__pycache__/decimal.cpython-*.py[co]
%{py_libdir}/__pycache__/difflib.cpython-*.py[co]
%{py_libdir}/__pycache__/dis.cpython-*.py[co]
%{py_libdir}/__pycache__/doctest.cpython-*.py[co]
%{py_libdir}/__pycache__/filecmp.cpython-*.py[co]
%{py_libdir}/__pycache__/fileinput.cpython-*.py[co]
%{py_libdir}/__pycache__/fnmatch.cpython-*.py[co]
%{py_libdir}/__pycache__/fractions.cpython-*.py[co]
%{py_libdir}/__pycache__/ftplib.cpython-*.py[co]
%{py_libdir}/__pycache__/getopt.cpython-*.py[co]
%{py_libdir}/__pycache__/getpass.cpython-*.py[co]
%{py_libdir}/__pycache__/gettext.cpython-*.py[co]
%{py_libdir}/__pycache__/glob.cpython-*.py[co]
%{py_libdir}/__pycache__/graphlib.cpython-*.py[co]
%{py_libdir}/__pycache__/gzip.cpython-*.py[co]
%{py_libdir}/__pycache__/hashlib.cpython-*.py[co]
%{py_libdir}/__pycache__/hmac.cpython-*.py[co]
%{py_libdir}/__pycache__/imaplib.cpython-*.py[co]
%{py_libdir}/__pycache__/inspect.cpython-*.py[co]
%{py_libdir}/__pycache__/ipaddress.cpython-*.py[co]
%{py_libdir}/__pycache__/lzma.cpython-*.py[co]
%{py_libdir}/__pycache__/mailbox.cpython-*.py[co]
%{py_libdir}/__pycache__/mimetypes.cpython-*.py[co]
%{py_libdir}/__pycache__/modulefinder.cpython-*.py[co]
%{py_libdir}/__pycache__/netrc.cpython-*.py[co]
%{py_libdir}/__pycache__/ntpath.cpython-*.py[co]
%{py_libdir}/__pycache__/nturl2path.cpython-*.py[co]
%{py_libdir}/__pycache__/numbers.cpython-*.py[co]
%{py_libdir}/__pycache__/opcode.cpython-*.py[co]
%{py_libdir}/__pycache__/optparse.cpython-*.py[co]
%{py_libdir}/__pycache__/pdb.cpython-*.py[co]
%{py_libdir}/__pycache__/pickle.cpython-*.py[co]
%{py_libdir}/__pycache__/pickletools.cpython-*.py[co]
%{py_libdir}/__pycache__/pkgutil.cpython-*.py[co]
%{py_libdir}/__pycache__/platform.cpython-*.py[co]
%{py_libdir}/__pycache__/plistlib.cpython-*.py[co]
%{py_libdir}/__pycache__/poplib.cpython-*.py[co]
%{py_libdir}/__pycache__/pprint.cpython-*.py[co]
%{py_libdir}/__pycache__/profile.cpython-*.py[co]
%{py_libdir}/__pycache__/pstats.cpython-*.py[co]
%{py_libdir}/__pycache__/pty.cpython-*.py[co]
%{py_libdir}/__pycache__/py_compile.cpython-*.py[co]
%{py_libdir}/__pycache__/pyclbr.cpython-*.py[co]
%{py_libdir}/__pycache__/queue.cpython-*.py[co]
%{py_libdir}/__pycache__/quopri.cpython-*.py[co]
%{py_libdir}/__pycache__/random.cpython-*.py[co]
%{py_libdir}/__pycache__/rlcompleter.cpython-*.py[co]
%{py_libdir}/__pycache__/runpy.cpython-*.py[co]
%{py_libdir}/__pycache__/sched.cpython-*.py[co]
%{py_libdir}/__pycache__/secrets.cpython-*.py[co]
%{py_libdir}/__pycache__/selectors.cpython-*.py[co]
%{py_libdir}/__pycache__/shelve.cpython-*.py[co]
%{py_libdir}/__pycache__/shlex.cpython-*.py[co]
%{py_libdir}/__pycache__/shutil.cpython-*.py[co]
%{py_libdir}/__pycache__/signal.cpython-*.py[co]
%{py_libdir}/__pycache__/smtplib.cpython-*.py[co]
%{py_libdir}/__pycache__/socket.cpython-*.py[co]
%{py_libdir}/__pycache__/socketserver.cpython-*.py[co]
%{py_libdir}/__pycache__/ssl.cpython-*.py[co]
%{py_libdir}/__pycache__/statistics.cpython-*.py[co]
%{py_libdir}/__pycache__/string.cpython-*.py[co]
%{py_libdir}/__pycache__/stringprep.cpython-*.py[co]
%{py_libdir}/__pycache__/struct.cpython-*.py[co]