27793d
%{?!_without_python2:%global with_python2 0%{?_with_python2:1} || !(0%{?fedora} >= 30 || 0%{?rhel} >= 8)}
27793d
%{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7}
27793d
27793d
%global srcname filelock
27793d
27793d
Name:           python-%{srcname}
27793d
Version:        3.0.12
27793d
Release:        9%{?dist}
27793d
Summary:        A platform independent file lock
27793d
27793d
License:        Unlicense
27793d
URL:            https://github.com/benediktschmitt/py-%{srcname}
27793d
Source0:        https://github.com/benediktschmitt/py-%{srcname}/archive/v%{version}/py-%{srcname}-%{version}.tar.gz
27793d
27793d
BuildArch:      noarch
27793d
27793d
%description
27793d
This package contains a single module, which implements a platform independent
27793d
file locking mechanism for Python.
27793d
27793d
The lock includes a lock counter and is thread safe. This means, when locking
27793d
the same lock object twice, it will not block.
27793d
27793d
27793d
%package doc
27793d
Summary:        Documentation for %{srcname}, %{summary}
27793d
BuildRequires: make
27793d
BuildRequires:  python%{python3_pkgversion}-sphinx
27793d
BuildRequires:  python%{python3_pkgversion}-sphinx-theme-alabaster
27793d
27793d
%description doc
27793d
%{summary}
27793d
27793d
27793d
%if 0%{?with_python2}
27793d
%package -n python2-%{srcname}
27793d
Summary:        %{summary}
27793d
BuildRequires:  python2-devel
27793d
BuildRequires:  python2-setuptools
27793d
Conflicts:      python%{python3_pkgversion}-%{srcname} < %{version}-%{release}
27793d
%{?python_provide:%python_provide python2-%{srcname}}
27793d
27793d
%if 0%{?fedora}
27793d
Suggests:       %{name}-doc
27793d
%endif # with_doc
27793d
27793d
%description -n python2-%{srcname}
27793d
This package contains a single module, which implements a platform independent
27793d
file locking mechanism for Python.
27793d
27793d
The lock includes a lock counter and is thread safe. This means, when locking
27793d
the same lock object twice, it will not block.
27793d
%endif # with_python2
27793d
27793d
27793d
%if 0%{?with_python3}
27793d
%package -n python%{python3_pkgversion}-%{srcname}
27793d
Summary:        %{summary}
27793d
BuildRequires:  python%{python3_pkgversion}-devel
27793d
BuildRequires:  python%{python3_pkgversion}-setuptools
27793d
Conflicts:      python2-%{srcname} < %{version}-%{release}
27793d
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
27793d
27793d
%if 0%{?fedora}
27793d
Suggests:       %{name}-doc
27793d
%endif # fedora
27793d
27793d
%description -n python%{python3_pkgversion}-%{srcname}
27793d
This package contains a single module, which implements a platform independent
27793d
file locking mechanism for Python.
27793d
27793d
The lock includes a lock counter and is thread safe. This means, when locking
27793d
the same lock object twice, it will not block.
27793d
%endif # with_python3
27793d
27793d
27793d
%prep
27793d
%autosetup -p1 -n py-%{srcname}-%{version}
27793d
27793d
27793d
%build
27793d
%if 0%{?with_python2}
27793d
%py2_build
27793d
%endif # with_python2
27793d
27793d
%if 0%{?with_python3}
27793d
%py3_build
27793d
%endif # with_python3
27793d
27793d
%make_build -C docs html man SPHINXBUILD=sphinx-build-%{python3_version}
27793d
rm docs/build/html/.buildinfo
27793d
27793d
27793d
%install
27793d
%if 0%{?with_python2}
27793d
%py2_install
27793d
%endif # with_python2
27793d
27793d
%if 0%{?with_python3}
27793d
%py3_install
27793d
%endif # with_python3
27793d
27793d
install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1
27793d
27793d
27793d
%check
27793d
%if 0%{?with_python2}
27793d
%{__python2} test.py
27793d
%endif # with_python2
27793d
27793d
%if 0%{?with_python3}
27793d
%{__python3} test.py
27793d
%endif # with_python3
27793d
27793d
27793d
%files doc
27793d
%license LICENSE
27793d
%doc docs/build/html
27793d
27793d
%if 0%{?with_python2}
27793d
%files -n python2-%{srcname}
27793d
%license LICENSE
27793d
%doc README.md
27793d
%{python2_sitelib}/%{srcname}.py
27793d
%{python2_sitelib}/%{srcname}.py[co]
27793d
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
27793d
%{_mandir}/man1/py-%{srcname}.1.gz
27793d
%endif # with_python2
27793d
27793d
%if 0%{?with_python3}
27793d
%files -n python%{python3_pkgversion}-%{srcname}
27793d
%license LICENSE
27793d
%doc README.md
27793d
%{python3_sitelib}/%{srcname}.py
27793d
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
27793d
%{python3_sitelib}/__pycache__/%{srcname}*.py[co]
27793d
%{_mandir}/man1/py-%{srcname}.1.gz
27793d
%endif # with_python3
27793d
27793d
27793d
%changelog
27793d
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-9
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
27793d
27793d
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-8
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
27793d
27793d
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.12-7
27793d
- Rebuilt for Python 3.9
27793d
27793d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-6
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
27793d
27793d
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.12-5
27793d
- Rebuilt for Python 3.8.0rc1 (#1748018)
27793d
27793d
* Sat Aug 17 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.12-4
27793d
- Rebuilt for Python 3.8
27793d
27793d
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-3
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
27793d
27793d
* Fri Jun 28 2019 Scott K Logan <logans@cottsay.net> - 3.0.12-2
27793d
- Add explicit conflict between unlike python2/3 subpackages (rhbz#1708871)
27793d
- Make the -doc subpackage dependency weaker
27793d
27793d
* Sun May 19 2019 Scott K Logan <logans@cottsay.net> - 3.0.12-1
27793d
- Update to 3.0.12 (rhbz#1711583)
27793d
- Switch to Python 3 sphinx
27793d
27793d
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.10-2
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
27793d
27793d
* Fri Nov 16 2018 Scott K Logan <logans@cottsay.net> - 3.0.10-1
27793d
- Update to 3.0.10
27793d
27793d
* Tue Oct 30 2018 Scott K Logan <logans@cottsay.net> - 3.0.9-1
27793d
- Update to 3.0.9
27793d
- Add spec conditionals for python version targeting (rhbz#1632320)
27793d
- Fix theme package dependency (s/sphinx_rtd_theme/sphinx-theme-alabaster/)
27793d
27793d
* Fri Sep 14 2018 Scott K Logan <logans@cottsay.net> - 3.0.8-1
27793d
- Update to 3.0.8 (rhbz#1459712)
27793d
27793d
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.8-7
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
27793d
27793d
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.0.8-6
27793d
- Rebuilt for Python 3.7
27793d
27793d
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.8-5
27793d
- Update Python 2 dependency declarations to new packaging standards
27793d
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
27793d
27793d
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.8-4
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
27793d
27793d
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.8-3
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
27793d
27793d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.8-2
27793d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
27793d
27793d
* Sat Feb 04 2017 Scott K Logan <logans@cottsay.net> - 2.0.8-1
27793d
- Update to version 2.0.8
27793d
27793d
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.0.6-2
27793d
- Rebuild for Python 3.6
27793d
27793d
* Sun May 01 2016 Scott K Logan <logans@cottsay.net> - 2.0.6-1
27793d
- Initial package