a3bcda8
%{?!_without_doc:%global with_doc 1}
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
%{?!_without_python3_other:%global with_python3_other 0%{?_with_python3_other:1} || 0%{?rhel} == 7}
a3bcda8
%{?!_without_tests:%global with_tests 1}
a3bcda8
f8531d3
%global srcname filelock
f8531d3
f8531d3
Name:           python-%{srcname}
65c2dd0
Version:        3.0.10
4fa0b65
Release:        1%{?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
a3bcda8
%if 0%{?with_doc}
f8531d3
%package doc
65c2dd0
Summary:        Documentation for %{srcname}, %{summary}
a3bcda8
65c2dd0
%if !0%{?rhel} || 0%{?rhel} >= 8
a3bcda8
BuildRequires:  python%{python3_pkgversion}-sphinx
a3bcda8
BuildRequires:  python%{python3_pkgversion}-sphinx-theme-alabaster
65c2dd0
%else # rhel
65c2dd0
BuildRequires:  python2-sphinx
65c2dd0
BuildRequires:  python2-sphinx-theme-alabaster
a3bcda8
%endif # rhel
f8531d3
f8531d3
%description doc
65c2dd0
%{summary}
a3bcda8
%endif # with_doc
f8531d3
a3bcda8
%if 0%{?with_python2}
f8531d3
%package -n python2-%{srcname}
65c2dd0
Summary:        %{summary}
a3bcda8
f8531d3
BuildRequires:  python2-devel
a3bcda8
BuildRequires:  python2-setuptools
a3bcda8
a3bcda8
%if 0%{?fedora}
f8531d3
%{?python_provide:%python_provide python2-%{srcname}}
a3bcda8
%if 0%{?with_doc}
f8531d3
Recommends:     %{name}-doc
a3bcda8
%endif # with_doc
a3bcda8
%else # fedora
a3bcda8
Provides:       %{name} = %{version}-%{release}
a3bcda8
%endif # fedora
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
a3bcda8
%if 0%{?with_python3}
a3bcda8
%package -n python%{python3_pkgversion}-%{srcname}
65c2dd0
Summary:        %{summary}
a3bcda8
a3bcda8
BuildRequires:  python%{python3_pkgversion}-devel
a3bcda8
BuildRequires:  python%{python3_pkgversion}-setuptools
a3bcda8
a3bcda8
%if 0%{?fedora}
a3bcda8
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
a3bcda8
%if 0%{?with_doc}
a3bcda8
Recommends:     %{name}-doc
a3bcda8
%endif # with_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
a3bcda8
%if 0%{?with_python3_other}
a3bcda8
%package -n python%{python3_other_pkgversion}-%{srcname}
65c2dd0
Summary:        %{summary}
a3bcda8
a3bcda8
BuildRequires:  python%{python3_other_pkgversion}-devel
a3bcda8
BuildRequires:  python%{python3_other_pkgversion}-setuptools
a3bcda8
a3bcda8
%if 0%{?fedora}
a3bcda8
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
a3bcda8
%if 0%{?with_doc}
f8531d3
Recommends:     %{name}-doc
a3bcda8
%endif # with_doc
a3bcda8
%endif # fedora
f8531d3
a3bcda8
%description -n python%{python3_other_pkgversion}-%{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_python3_other
f8531d3
f8531d3
%prep
65c2dd0
%autosetup -p1 -n py-%{srcname}-%{version}
f8531d3
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
a3bcda8
%if 0%{?with_python3_other}
a3bcda8
%py3_other_build
a3bcda8
%endif # with_python3_other
a3bcda8
a3bcda8
%if 0%{?with_doc}
a3bcda8
make -C docs html man
f8531d3
rm docs/build/html/.buildinfo
a3bcda8
%endif # with_doc
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
a3bcda8
%if 0%{?with_python3_other}
a3bcda8
%py3_other_install
a3bcda8
%endif # with_python3_other
f8531d3
a3bcda8
%if 0%{?with_doc}
f8531d3
install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1
a3bcda8
%endif # with_doc
f8531d3
a3bcda8
%if 0%{?with_tests}
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
a3bcda8
%if 0%{?with_python3_other}
a3bcda8
%{__python3_other} test.py
a3bcda8
%endif # with_python3_other
a3bcda8
%endif # with_tests
f8531d3
a3bcda8
%if 0%{?with_doc}
f8531d3
%files doc
f8531d3
%license LICENSE.rst
65c2dd0
%doc docs/build/html
a3bcda8
%endif # with_doc
f8531d3
a3bcda8
%if 0%{?with_python2}
f8531d3
%files -n python2-%{srcname}
f8531d3
%license LICENSE.rst
65c2dd0
%doc README.rst
f8531d3
%{python2_sitelib}/%{srcname}.py
f8531d3
%{python2_sitelib}/%{srcname}.py[co]
a3bcda8
%{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
65c2dd0
%if 0%{?with_doc}
65c2dd0
%{_mandir}/man1/py-%{srcname}.1.gz
65c2dd0
%endif # with_doc
a3bcda8
%endif # with_python2
f8531d3
a3bcda8
%if 0%{?with_python3}
a3bcda8
%files -n python%{python3_pkgversion}-%{srcname}
f8531d3
%license LICENSE.rst
65c2dd0
%doc README.rst
f8531d3
%{python3_sitelib}/%{srcname}.py
a3bcda8
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
f8531d3
%{python3_sitelib}/__pycache__/%{srcname}*.py[co]
65c2dd0
%if 0%{?with_doc}
65c2dd0
%{_mandir}/man1/py-%{srcname}.1.gz
65c2dd0
%endif # with_doc
a3bcda8
%endif # with_python3
a3bcda8
a3bcda8
%if 0%{?with_python3_other}
a3bcda8
%files -n python%{python3_other_pkgversion}-%{srcname}
a3bcda8
%license LICENSE.rst
65c2dd0
%doc README.rst
a3bcda8
%{python3_other_sitelib}/%{srcname}.py
a3bcda8
%{python3_other_sitelib}/%{srcname}-%{version}-py%{python3_other_version}.egg-info
a3bcda8
%{python3_other_sitelib}/__pycache__/%{srcname}*.py[co]
65c2dd0
%if 0%{?with_doc}
65c2dd0
%{_mandir}/man1/py-%{srcname}.1.gz
65c2dd0
%endif # with_doc
a3bcda8
%endif # with_python3_other
f8531d3
f8531d3
%changelog
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