| |
@@ -1,110 +1,126 @@
|
| |
%global modname parse
|
| |
|
| |
- %if 0%{?rhel} > 7 || 0%{?fedora} >= 12
|
| |
- %bcond_without python3
|
| |
+ %if (%{defined rhel} && 0%{?rhel} < 8) || (%{defined fedora} && 0%{?fedora} < 30)
|
| |
+ %bcond_without python2
|
| |
%else
|
| |
- %bcond_with python3
|
| |
- %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from %distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
| |
+ %bcond_with python2
|
| |
%endif
|
| |
+ %bcond_without python3
|
| |
|
| |
- Name: python-parse
|
| |
- Version: 1.6.4
|
| |
- Release: 4%{?dist}
|
| |
- Summary: Opposite of format()
|
| |
-
|
| |
- Group: Development/Libraries
|
| |
- License: BSD
|
| |
- URL: http://pypi.python.org/pypi/parse
|
| |
- Source0: http://pypi.python.org/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz
|
| |
- # https://bugzilla.redhat.com/show_bug.cgi?id=1291218
|
| |
- Patch0: parse-python-3.5-test.patch
|
| |
-
|
| |
- BuildArch: noarch
|
| |
- BuildRequires: python2-devel
|
| |
- BuildRequires: python-setuptools
|
| |
- %if %{with python3}
|
| |
- BuildRequires: python3-devel
|
| |
- BuildRequires: python3-setuptools
|
| |
- %endif
|
| |
+ Name: python-%{modname}
|
| |
+ Version: 1.8.4
|
| |
+ Release: 2%{?dist}
|
| |
+ Summary: Opposite of format()
|
| |
|
| |
+ License: BSD
|
| |
+ URL: http://pypi.python.org/pypi/parse
|
| |
+ Source0: %pypi_source %{modname}
|
| |
|
| |
- %description
|
| |
- Parse strings using a specification based on the Python format() syntax.
|
| |
+ BuildArch: noarch
|
| |
|
| |
- ``parse()`` is the opposite of ``format()``
|
| |
+ %global _description \
|
| |
+ Parse strings using a specification based on the Python format() syntax.\
|
| |
+ \
|
| |
+ "parse()" is the opposite of "format()"
|
| |
|
| |
- %if %{with python3}
|
| |
- %package -n python3-%{modname}
|
| |
- Summary: Opposite of format()
|
| |
- Group: Development/Libraries
|
| |
+ %description %{_description}
|
| |
|
| |
- %description -n python3-%{modname}
|
| |
- Parse strings using a specification based on the Python format() syntax.
|
| |
+ %if %{with python2}
|
| |
+ %package -n python2-%{modname}
|
| |
+ Summary: %{summary}
|
| |
+ %{?python_provide:%python_provide python2-%{modname}}
|
| |
+ BuildRequires: python2-devel
|
| |
+ BuildRequires: python2-setuptools
|
| |
|
| |
- ``parse()`` is the opposite of ``format()``
|
| |
+ %description -n python2-%{modname} %{_description}
|
| |
|
| |
- This package works with Python 3.
|
| |
+ Python 2 version.
|
| |
%endif
|
| |
|
| |
+ %if %{with python3}
|
| |
+ %package -n python%{python3_pkgversion}-%{modname}
|
| |
+ Summary: %{summary}
|
| |
+ %{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}
|
| |
+ BuildRequires: python%{python3_pkgversion}-devel
|
| |
+ BuildRequires: python%{python3_pkgversion}-setuptools
|
| |
|
| |
- %prep
|
| |
- %setup -q -n %{modname}-%{version}
|
| |
- %patch0 -p1
|
| |
-
|
| |
- # Remove bundled egg-info in case it exists
|
| |
- rm -rf %{modname}.egg-info
|
| |
+ %description -n python%{python3_pkgversion}-%{modname} %{_description}
|
| |
|
| |
- %if %{with python3}
|
| |
- rm -rf %{py3dir}
|
| |
- cp -a . %{py3dir}
|
| |
- find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
| |
+ Python 3 version.
|
| |
%endif
|
| |
|
| |
+ %prep
|
| |
+ %autosetup -n %{modname}-%{version} -p1
|
| |
+ chmod -x README.rst
|
| |
+
|
| |
%build
|
| |
- %{__python} setup.py build
|
| |
+ %{?with_python2:%py2_build}
|
| |
+ %{?with_python3:%py3_build}
|
| |
|
| |
- %if %{with python3}
|
| |
- pushd %{py3dir}
|
| |
- %{__python3} setup.py build
|
| |
- popd
|
| |
- %endif
|
| |
+ %install
|
| |
+ %{?with_python2:%py2_install}
|
| |
+ %{?with_python3:%py3_install}
|
| |
|
| |
+ %check
|
| |
+ %{?with_python2:%{__python2} test_parse.py}
|
| |
+ %{?with python3:%{__python3} test_parse.py}
|
| |
+
|
| |
+ %if %{with python2}
|
| |
+ %files -n python2-%{modname}
|
| |
+ %doc README.rst
|
| |
+ %{python2_sitelib}/%{modname}-%{version}-*.egg-info
|
| |
+ %{python2_sitelib}/%{modname}.py*
|
| |
+ %endif
|
| |
|
| |
- %install
|
| |
- # Must do the python3 install first because the scripts in /usr/bin are
|
| |
- # overwritten with every setup.py install (and we want the python2
|
| |
- # version to be the default for now).
|
| |
%if %{with python3}
|
| |
- pushd %{py3dir}
|
| |
- %{__python3} setup.py install --skip-build --root=%{buildroot}
|
| |
- popd
|
| |
+ %files -n python%{python3_pkgversion}-%{modname}
|
| |
+ %doc README.rst
|
| |
+ %{python3_sitelib}/%{modname}-%{version}-*.egg-info
|
| |
+ %{python3_sitelib}/%{modname}.py
|
| |
+ %{python3_sitelib}/__pycache__/%{modname}.*
|
| |
%endif
|
| |
|
| |
- %{__python} setup.py install -O1 --skip-build --root=%{buildroot}
|
| |
+ %changelog
|
| |
+ * Mon Jan 07 2019 Xavier Bachelot <xavier@bachelot.org> - 1.8.4-2
|
| |
+ - Enable python3 build for EL7.
|
| |
|
| |
+ * Mon Jul 30 2018 Miro Hrončok <mhroncok@redhat.com> - 1.8.4-1
|
| |
+ - Update to 1.8.4
|
| |
|
| |
- %check
|
| |
- %{__python} test_parse.py
|
| |
+ * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-10
|
| |
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
| |
|
| |
- %if %{with python3}
|
| |
- pushd %{py3dir}
|
| |
- %{__python3} test_parse.py
|
| |
- popd
|
| |
- %endif
|
| |
+ * Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.6.6-9
|
| |
+ - Rebuilt for Python 3.7
|
| |
|
| |
- %files
|
| |
- %doc README.rst
|
| |
- %{python_sitelib}/%{modname}*
|
| |
+ * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-8
|
| |
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
| |
|
| |
- %if %{with python3}
|
| |
- %files -n python3-%{modname}
|
| |
- %doc README.rst
|
| |
- %{python3_sitelib}/%{modname}*
|
| |
- %{python3_sitelib}/__pycache__/%{modname}*
|
| |
- %endif
|
| |
+ * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-7
|
| |
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
| |
|
| |
+ * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-6
|
| |
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
| |
+
|
| |
+ * Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.6.6-5
|
| |
+ - Rebuild for Python 3.6
|
| |
+
|
| |
+ * Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.6-4
|
| |
+ - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
| |
+
|
| |
+ * Tue Apr 19 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.6.6-3
|
| |
+ - Remove unneded BuildRequires
|
| |
+ - Use %%python_provde
|
| |
+ - Correctly split to python2- subpkg
|
| |
+ - Fix spurious-executable-perm
|
| |
+ - Don't use %%py3dir
|
| |
+
|
| |
+ * Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.6-2
|
| |
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
| |
+
|
| |
+ * Tue Dec 15 2015 Matěj Cepl <mcepl@redhat.com> - 1.6.6-1
|
| |
+ - Upgrade to the latest upstream (#1291602)
|
| |
|
| |
- %changelog
|
| |
* Mon Dec 14 2015 David King <amigadave@amigadave.com> - 1.6.4-4
|
| |
- Fix test failure with Python 3.5 (#1291218)
|
| |
|
| |