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