diff --git a/.gitignore b/.gitignore index 3d084a6..8344345 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /filelock-fde6c13.tar.gz /filelock-252a308.tar.gz /python-filelock-0980867.tar.gz +/python-filelock-b71c3a4.tar.gz diff --git a/python-filelock.spec b/python-filelock.spec index 522b6b9..298e2d3 100644 --- a/python-filelock.spec +++ b/python-filelock.spec @@ -1,10 +1,16 @@ -%global commit 0980867d17db4a3e1b20d588b680582cbbf7e778 +%{?!_without_doc:%global with_doc 1} +%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || (0%{?fedora} < 30 && 0%{?rhel} < 8)} +%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7} +%{?!_without_python3_other:%global with_python3_other 0%{?_with_python3_other:1} || 0%{?rhel} == 7} +%{?!_without_tests:%global with_tests 1} + +%global commit b71c3a494b1a9a84ddaa4a4d43bfd985a01e81e7 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global srcname filelock %global sum A platform independent file lock Name: python-%{srcname} -Version: 3.0.8 +Version: 3.0.9 Release: 1%{?dist} Summary: %{sum} @@ -22,19 +28,37 @@ file locking mechanism for Python. The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block. +%if 0%{?with_doc} %package doc Summary: Documentation for %{srcname}, %{sum} + +%if 0%{?rhel} && 0%{?rhel} < 8 BuildRequires: python2-sphinx -BuildRequires: python2-sphinx_rtd_theme +BuildRequires: python2-sphinx-theme-alabaster +%else # rhel +BuildRequires: python%{python3_pkgversion}-sphinx +BuildRequires: python%{python3_pkgversion}-sphinx-theme-alabaster +%endif # rhel %description doc Documentation for %{srcname}, %{sum} +%endif # with_doc +%if 0%{?with_python2} %package -n python2-%{srcname} Summary: %{sum} + BuildRequires: python2-devel +BuildRequires: python2-setuptools + +%if 0%{?fedora} %{?python_provide:%python_provide python2-%{srcname}} +%if 0%{?with_doc} Recommends: %{name}-doc +%endif # with_doc +%else # fedora +Provides: %{name} = %{version}-%{release} +%endif # fedora %description -n python2-%{srcname} This package contains a single module, which implements a platform independent @@ -42,19 +66,51 @@ file locking mechanism for Python. The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block. +%endif # with_python2 + +%if 0%{?with_python3} +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{sum} + +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools + +%if 0%{?fedora} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +%if 0%{?with_doc} +Recommends: %{name}-doc +%endif # with_doc +%endif # fedora + +%description -n python%{python3_pkgversion}-%{srcname} +This package contains a single module, which implements a platform independent +file locking mechanism for Python. + +The lock includes a lock counter and is thread safe. This means, when locking +the same lock object twice, it will not block. +%endif # with_python3 -%package -n python3-%{srcname} +%if 0%{?with_python3_other} +%package -n python%{python3_other_pkgversion}-%{srcname} Summary: %{sum} -BuildRequires: python3-devel -%{?python_provide:%python_provide python3-%{srcname}} + +BuildRequires: python%{python3_other_pkgversion}-devel +BuildRequires: python%{python3_other_pkgversion}-setuptools + +%if 0%{?fedora} +%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}} +%if 0%{?with_doc} Recommends: %{name}-doc +%endif # with_doc +%endif # fedora -%description -n python3-%{srcname} +%description -n python%{python3_other_pkgversion}-%{srcname} This package contains a single module, which implements a platform independent file locking mechanism for Python. The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block. +%endif # with_python3_other %prep %autosetup -n py-%{srcname}-%{commit} @@ -62,43 +118,103 @@ the same lock object twice, it will not block. sed -i '1{s|^#!\(/usr/bin/\(env \)\?\)\?python||}' %{srcname}.py %build +%if 0%{?with_python2} %py2_build +%endif # with_python2 + +%if 0%{?with_python3} %py3_build +%endif # with_python3 -make -C docs html man SPHINXBUILD=sphinx-build-2 +%if 0%{?with_python3_other} +%py3_other_build +%endif # with_python3_other + +%if 0%{?with_doc} +make -C docs html man rm docs/build/html/.buildinfo +%endif # with_doc %install +%if 0%{?with_python2} %py2_install +%endif # with_python2 + +%if 0%{?with_python3} %py3_install +%endif # with_python3 + +%if 0%{?with_python3_other} +%py3_other_install +%endif # with_python3_other +%if 0%{?with_doc} install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1 +%endif # with_doc +%if 0%{?with_tests} %check +%if 0%{?with_python2} %{__python2} test.py +%endif # with_python2 + +%if 0%{?with_python3} %{__python3} test.py +%endif # with_python3 + +%if 0%{?with_python3_other} +%{__python3_other} test.py +%endif # with_python3_other +%endif # with_tests +%if 0%{?with_doc} %files doc %doc docs/build/html %license LICENSE.rst +%endif # with_doc +%if 0%{?with_python2} %files -n python2-%{srcname} %doc README.rst %license LICENSE.rst +%if 0%{?with_doc} %{_mandir}/man1/py-%{srcname}.1.gz +%endif # with_doc %{python2_sitelib}/%{srcname}.py %{python2_sitelib}/%{srcname}.py[co] -%{python2_sitelib}/%{srcname}-%{version}-py?.?.egg-info +%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info +%endif # with_python2 -%files -n python3-%{srcname} +%if 0%{?with_python3} +%files -n python%{python3_pkgversion}-%{srcname} %doc README.rst %license LICENSE.rst +%if 0%{?with_doc} %{_mandir}/man1/py-%{srcname}.1.gz +%endif # with_doc %{python3_sitelib}/%{srcname}.py -%{python3_sitelib}/%{srcname}-%{version}-py?.?.egg-info +%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/__pycache__/%{srcname}*.py[co] +%endif # with_python3 + +%if 0%{?with_python3_other} +%files -n python%{python3_other_pkgversion}-%{srcname} +%doc README.rst +%license LICENSE.rst +%if 0%{?with_doc} +%{_mandir}/man1/py-%{srcname}.1.gz +%endif # with_doc +%{python3_other_sitelib}/%{srcname}.py +%{python3_other_sitelib}/%{srcname}-%{version}-py%{python3_other_version}.egg-info +%{python3_other_sitelib}/__pycache__/%{srcname}*.py[co] +%endif # with_python3_other %changelog +* Tue Oct 30 2018 Scott K Logan - 3.0.9-1 +- Update to 3.0.9 +- Add spec conditionals for python version targeting (rhbz#1632320) +- Fix theme package dependency (s/sphinx_rtd_theme/sphinx-theme-alabaster/) + * Fri Sep 14 2018 Scott K Logan - 3.0.8-1 - Update to 3.0.8 (rhbz#1459712) diff --git a/sources b/sources index ddf3b1c..71af084 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-filelock-0980867.tar.gz) = bfaca9b50c27f392920c99f217f6a17688c43ca1f407a985365435fd35573b6d935dc09b7905d9272b5142b26cdc54e220d9b5d99b019da65033b81d179af7a5 +SHA512 (python-filelock-b71c3a4.tar.gz) = bf2c3a27488e4e0b0469599c5037658482b27eee08ef1844de5419865a67f01966b72f1f463ce7418660901c991ad06740a90f332db0b2d3d62967f0f270aba9