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