3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Alternative regular expression module, to replace re
9 Summary(pl.UTF-8): Moduł wyrażeń regularnych alternatywny dla oryginalnego re
10 Name: python-%{module}
11 # keep 2021.3.x here for python2 support
14 License: PSF, Apache v2.0
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/regex/
17 Source0: https://files.pythonhosted.org/packages/source/r/regex/%{module}-%{version}.tar.gz
18 # Source0-md5: c72d3bf55414ffbf92e43462ad91d508
19 URL: https://bitbucket.org/mrabarnett/mrab-regex
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools
27 BuildRequires: python3-devel >= 1:3.6
28 BuildRequires: python3-setuptools
30 Requires: python-modules >= 1:2.7
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 Alternative regular expression module, to replace re.
36 %description -l pl.UTF-8
37 Moduł wyrażeń regularnych alternatywny dla oryginalnego re.
39 %package -n python3-%{module}
40 Summary: Alternative regular expression module, to replace re
41 Summary(pl.UTF-8): Moduł wyrażeń regularnych alternatywny dla oryginalnego re
42 Group: Libraries/Python
43 Requires: python3-modules >= 1:3.6
45 %description -n python3-%{module}
46 Alternative regular expression module, to replace re.
48 %description -n python3-%{module} -l pl.UTF-8
49 Moduł wyrażeń regularnych alternatywny dla oryginalnego re.
52 %setup -q -n %{module}-%{version}
59 # directory with test_regex.py must not contain regex*
61 ln regex_2/test_regex.py tests_2/test_regex.py
62 PYTHONPATH=$(echo $(pwd)/build-2/lib.*) \
63 %{__python} tests_2/test_regex.py
71 # directory with test_regex.py must not contain regex*
73 ln regex_3/test_regex.py tests_3/test_regex.py
74 PYTHONPATH=$(echo $(pwd)/build-3/lib.*) \
75 %{__python3} tests_3/test_regex.py
80 rm -rf $RPM_BUILD_ROOT
86 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/regex/test_regex.py*
92 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/regex/test_regex.py \
93 $RPM_BUILD_ROOT%{py3_sitedir}/regex/__pycache__/test_regex.*
97 rm -rf $RPM_BUILD_ROOT
101 %defattr(644,root,root,755)
102 %doc LICENSE.txt README.rst docs/Features.html
103 %dir %{py_sitedir}/regex
104 %attr(755,root,root) %{py_sitedir}/regex/_regex.so
105 %{py_sitedir}/regex/*.py[co]
106 %{py_sitedir}/%{module}-%{version}-py*.egg-info
110 %files -n python3-%{module}
111 %defattr(644,root,root,755)
112 %doc LICENSE.txt README.rst docs/Features.html
113 %dir %{py3_sitedir}/regex
114 %attr(755,root,root) %{py3_sitedir}/regex/_regex.cpython-*.so
115 %{py3_sitedir}/regex/*.py
116 %{py3_sitedir}/regex/__pycache__
117 %{py3_sitedir}/%{module}-%{version}-py*.egg-info