]>
Commit | Line | Data |
---|---|---|
11540560 | 1 | # |
511e8467 | 2 | # Conditional build: |
11540560 | 3 | %bcond_without tests # unit tests |
511e8467 | 4 | |
bfee445d | 5 | %define module regex |
511e8467 | 6 | Summary: Alternative regular expression module, to replace re |
11540560 | 7 | Summary(pl.UTF-8): Moduł wyrażeń regularnych alternatywny dla oryginalnego re |
4d7e50c1 JB |
8 | Name: python3-%{module} |
9 | Version: 2022.3.15 | |
de2fe874 | 10 | Release: 3 |
11540560 | 11 | License: PSF, Apache v2.0 |
511e8467 | 12 | Group: Libraries/Python |
f2753113 JB |
13 | #Source0Download: https://pypi.org/simple/regex/ |
14 | Source0: https://files.pythonhosted.org/packages/source/r/regex/%{module}-%{version}.tar.gz | |
4d7e50c1 | 15 | # Source0-md5: 74f1d120a146bc5a7811ccdbfee3d42d |
511e8467 | 16 | URL: https://bitbucket.org/mrabarnett/mrab-regex |
11540560 | 17 | BuildRequires: python3-devel >= 1:3.6 |
f2753113 | 18 | BuildRequires: python3-setuptools |
4d7e50c1 JB |
19 | BuildRequires: rpm-pythonprov |
20 | BuildRequires: rpmbuild(macros) >= 1.714 | |
21 | Requires: python3-modules >= 1:3.6 | |
511e8467 MK |
22 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
23 | ||
24 | %description | |
11540560 | 25 | Alternative regular expression module, to replace re. |
511e8467 MK |
26 | |
27 | %description -l pl.UTF-8 | |
11540560 | 28 | Moduł wyrażeń regularnych alternatywny dla oryginalnego re. |
511e8467 | 29 | |
511e8467 MK |
30 | %prep |
31 | %setup -q -n %{module}-%{version} | |
32 | ||
33 | %build | |
11540560 JB |
34 | %py3_build |
35 | ||
36 | %if %{with tests} | |
37 | # directory with test_regex.py must not contain regex* | |
38 | install -d tests_3 | |
39 | ln regex_3/test_regex.py tests_3/test_regex.py | |
40 | PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \ | |
41 | %{__python3} tests_3/test_regex.py | |
511e8467 | 42 | %endif |
511e8467 MK |
43 | |
44 | %install | |
45 | rm -rf $RPM_BUILD_ROOT | |
11540560 | 46 | |
511e8467 | 47 | %py3_install |
11540560 JB |
48 | |
49 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/regex/test_regex.py \ | |
50 | $RPM_BUILD_ROOT%{py3_sitedir}/regex/__pycache__/test_regex.* | |
511e8467 MK |
51 | |
52 | %clean | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | ||
511e8467 MK |
55 | %files |
56 | %defattr(644,root,root,755) | |
11540560 | 57 | %doc LICENSE.txt README.rst docs/Features.html |
11540560 JB |
58 | %dir %{py3_sitedir}/regex |
59 | %attr(755,root,root) %{py3_sitedir}/regex/_regex.cpython-*.so | |
60 | %{py3_sitedir}/regex/*.py | |
61 | %{py3_sitedir}/regex/__pycache__ | |
62 | %{py3_sitedir}/%{module}-%{version}-py*.egg-info |