]> git.pld-linux.org Git - packages/python3-regex.git/blob - python-regex.spec
- updated to 2021.3.17 (the last version with python2 support)
[packages/python3-regex.git] / python-regex.spec
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 %define         module  regex
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
12 Version:        2021.3.17
13 Release:        1
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
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-setuptools
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3-devel >= 1:3.6
28 BuildRequires:  python3-setuptools
29 %endif
30 Requires:       python-modules >= 1:2.7
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 Alternative regular expression module, to replace re.
35
36 %description -l pl.UTF-8
37 Moduł wyrażeń regularnych alternatywny dla oryginalnego re.
38
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
44
45 %description -n python3-%{module}
46 Alternative regular expression module, to replace re.
47
48 %description -n python3-%{module} -l pl.UTF-8
49 Moduł wyrażeń regularnych alternatywny dla oryginalnego re.
50
51 %prep
52 %setup -q -n %{module}-%{version}
53
54 %build
55 %if %{with python2}
56 %py_build
57
58 %if %{with tests}
59 # directory with test_regex.py must not contain regex*
60 install -d tests_2
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
64 %endif
65 %endif
66
67 %if %{with python3}
68 %py3_build
69
70 %if %{with tests}
71 # directory with test_regex.py must not contain regex*
72 install -d tests_3
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
76 %endif
77 %endif
78
79 %install
80 rm -rf $RPM_BUILD_ROOT
81
82 %if %{with python2}
83 %py_install
84
85 %py_postclean
86 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/regex/test_regex.py*
87 %endif
88
89 %if %{with python3}
90 %py3_install
91
92 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/regex/test_regex.py \
93         $RPM_BUILD_ROOT%{py3_sitedir}/regex/__pycache__/test_regex.*
94 %endif
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %if %{with python2}
100 %files
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
107 %endif
108
109 %if %{with python3}
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
118 %endif
This page took 0.0815 seconds and 3 git commands to generate.