]>
Commit | Line | Data |
---|---|---|
c38e00c4 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Distribution utilities | |
8 | Summary(pl.UTF-8): Narzędzia do dystrybuowania | |
9 | Name: python-distlib | |
57e0b3b6 | 10 | Version: 0.3.4 |
87845166 | 11 | Release: 2 |
c38e00c4 JB |
12 | License: PSF v2 |
13 | Group: Libraries/Python | |
14 | #Source0Download: https://pypi.org/simple/distlib/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/d/distlib/distlib-%{version}.zip | |
57e0b3b6 JP |
16 | # Source0-md5: c886b7d99b4085c5d960e7435dcbd397 |
17 | Patch0: %{name}-sequencer.patch | |
c38e00c4 JB |
18 | URL: https://pypi.org/project/distlib/ |
19 | %if %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
20 | BuildRequires: glibc-localedb-all | |
21 | %endif | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.7 | |
24 | %endif | |
25 | %if %{with python3} | |
19c993a9 | 26 | BuildRequires: python3-modules >= 1:3.6 |
bf9aabed JB |
27 | %if %{with tests} |
28 | BuildConflicts: python3-astroid < 2.3.3-2 | |
29 | BuildConflicts: python3-pylint < 2.4.4-2 | |
30 | %endif | |
c38e00c4 JB |
31 | %endif |
32 | BuildRequires: rpm-pythonprov | |
33 | BuildRequires: rpmbuild(macros) >= 1.714 | |
13b6f6e7 | 34 | BuildRequires: sed >= 4.0 |
c38e00c4 JB |
35 | BuildRequires: unzip |
36 | Requires: python-modules >= 1:2.7 | |
37 | BuildArch: noarch | |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
41 | Low-level components of distutils2/packaging, augmented with | |
42 | higher-level APIs for making packaging easier. | |
43 | ||
44 | %description -l pl.UTF-8 | |
45 | Niskopoziomowe komponenty distutils2/packaging, rozszerzone o | |
46 | wysokopoziomowe API ułatwiające pakietowanie. | |
47 | ||
48 | %package -n python3-distlib | |
49 | Summary: Distribution utilities | |
50 | Summary(pl.UTF-8): Narzędzia do dystrybuowania | |
51 | Group: Libraries/Python | |
19c993a9 | 52 | Requires: python3-modules >= 1:3.6 |
c38e00c4 JB |
53 | |
54 | %description -n python3-distlib | |
55 | Low-level components of distutils2/packaging, augmented with | |
56 | higher-level APIs for making packaging easier. | |
57 | ||
58 | %description -n python3-distlib -l pl.UTF-8 | |
59 | Niskopoziomowe komponenty distutils2/packaging, rozszerzone o | |
60 | wysokopoziomowe API ułatwiające pakietowanie. | |
61 | ||
62 | %prep | |
63 | %setup -q -n distlib-%{version} | |
64 | %patch0 -p1 | |
c38e00c4 | 65 | |
13b6f6e7 JB |
66 | %if "%{_host_cpu}" == "x32" |
67 | # distlib.wheel doesn't distinguish x32 from x86_64 | |
68 | %{__sed} -i -e 's/test_mount_extensions/disabled&/' tests/test_wheel.py | |
69 | %endif | |
70 | ||
c38e00c4 JB |
71 | %build |
72 | %if %{with python2} | |
73 | %py_build | |
74 | ||
75 | %if %{with tests} | |
76 | LC_ALL=C.UTF-8 \ | |
77 | SKIP_ONLINE=1 \ | |
78 | PYTHONPATH=$(pwd) \ | |
79 | %{__python} tests/test_all.py | |
80 | %endif | |
81 | %endif | |
82 | ||
83 | %if %{with python3} | |
84 | %py3_build | |
85 | ||
86 | %if %{with tests} | |
87 | LC_ALL=C.UTF-8 \ | |
88 | SKIP_ONLINE=1 \ | |
89 | PYTHONPATH=$(pwd) \ | |
90 | %{__python3} tests/test_all.py | |
91 | %endif | |
92 | %endif | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | ||
97 | %if %{with python2} | |
98 | %py_install | |
99 | ||
100 | %py_postclean | |
101 | %endif | |
102 | ||
103 | %if %{with python3} | |
104 | %py3_install | |
105 | %endif | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
110 | %if %{with python2} | |
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst | |
114 | %{py_sitescriptdir}/distlib | |
115 | %{py_sitescriptdir}/distlib-%{version}-py*.egg-info | |
116 | %endif | |
117 | ||
118 | %if %{with python3} | |
119 | %files -n python3-distlib | |
120 | %defattr(644,root,root,755) | |
121 | %doc CHANGES.rst CONTRIBUTORS.txt LICENSE.txt README.rst | |
122 | %{py3_sitescriptdir}/distlib | |
123 | %{py3_sitescriptdir}/distlib-%{version}-py*.egg-info | |
124 | %endif |