diff --git a/python-absl-py.spec b/python-absl-py.spec index 8312621..dd0a1b5 100644 --- a/python-absl-py.spec +++ b/python-absl-py.spec @@ -14,10 +14,6 @@ License: ASL 2.0 and Python URL: https://github.com/abseil/%{reponame}/ Source0: %{url}/archive/pypi-v%{version}/%{reponame}-pypi-v%{version}.tar.gz -BuildRequires: python3-devel >= 3.4 -BuildRequires: python3dist(setuptools) -BuildRequires: pyproject-rpm-macros - BuildArch: noarch %global common_description %{expand: @@ -35,17 +31,32 @@ Features: %description %{common_description} -%generate_buildrequires -%pyproject_buildrequires -r +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{summary} +%py_provides python%{python3_pkgversion}-%{srcname} + +BuildRequires: python%{python3_pkgversion}-devel >= 3.4 +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-six + +Requires: python%{python3_pkgversion}-six +%description -n python%{python3_pkgversion}-%{srcname} %{common_description} -%package -n python3-%{srcname} + +%package -n python2-%{srcname} Summary: %{summary} -%if 0%{?fedora} < 33 -%py_provides python3-%{srcname} -%endif +%py_provides python2-%{srcname} + +BuildRequires: python2-devel >= 2.7 +BuildRequires: python2-setuptools +BuildRequires: python2-six +BuildRequires: python2-enum34 -%description -n python3-%{srcname} %{common_description} +Requires: python2-six +Requires: python2-enum34 + +%description -n python2-%{srcname} %{common_description} %prep @@ -64,10 +75,17 @@ cp -p absl/third_party/unittest3_backport/LICENSE LICENSE-PYTHON %build %py3_build +%py2_build %install %py3_install +# No async support in Python 2; if we built with bazel (not available in EPEL), +# it would take care of not installing this in the Python 2 environment. We +# need to remove it manually instead. If we left it, byte-compiling would fail +# with a syntax error. +find . -name _parameterized_async.py -print -delete +%py2_install %check @@ -75,17 +93,20 @@ cp -p absl/third_party/unittest3_backport/LICENSE LICENSE-PYTHON # Internet. We can, however, run the sample Python scripts manually, which is # better than nothing. PYTHONPATH=%{buildroot}/%{python3_sitelib}; export PYTHONPATH -%{__python3} smoke_tests/sample_app.py --echo smoke +%{__python3} smoke_tests/sample_app.py --echo smoke %{__python3} smoke_tests/sample_test.py +PYTHONPATH=%{buildroot}/%{python2_sitelib}; export PYTHONPATH +%{__python2} smoke_tests/sample_app.py --echo smoke +%{__python2} smoke_tests/sample_test.py # Running the actual test suite requires bazel, which will almost certainly -# never be packaged for Fedora due to its Byzantine mass of bundled +# never be packaged for EPEL due to its Byzantine mass of bundled # dependencies. It is possible to invoke the tests with another runner, such as # pytest, but there are many spurious failures due to the incorrect # environment, so it is useless to do so. -%files -n python3-%{srcname} +%files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %license LICENSE-PYTHON %doc AUTHORS @@ -97,8 +118,20 @@ PYTHONPATH=%{buildroot}/%{python3_sitelib}; export PYTHONPATH %{python3_sitelib}/%{egginfo_name}-%{version}-py%{python3_version}.egg-info +%files -n python2-%{srcname} +%license LICENSE +%license LICENSE-PYTHON +%doc AUTHORS +%doc CONTRIBUTING.md +%doc README.md +%doc smoke_tests + +%{python2_sitelib}/%{modname} +%{python2_sitelib}/%{egginfo_name}-%{version}-py%{python2_version}.egg-info + + %changelog -* Wed Nov 25 2020 Benjamin A. Beasley - 1.1.0-2 +* Thu Nov 26 2020 Benjamin A. Beasley - 1.1.0-2 - Remove EPEL conditionals from Fedora spec file * Wed Nov 25 2020 Benjamin A. Beasley - 1.1.0-1 - Initial package