d2dfca5
%global srcname flufl.lock
d2dfca5
%global pkgname flufl-lock
d2dfca5
%global summary NFS-safe file locking with timeouts for POSIX systems
d2dfca5
%global _description \
d2dfca5
The flufl.lock library provides an NFS-safe file-based locking algorithm \
d2dfca5
influenced by the GNU/Linux "open(2)" man page, under the description of \
d2dfca5
the "O_EXCL" option.
d2dfca5
d2dfca5
# EPEL7 support: default Python is Python 2, and Python2 packages prefix
d2dfca5
# is unversioned.
d2dfca5
%if 0%{?rhel} && 0%{?rhel} <= 7
d2dfca5
%global py2_namespace python
d2dfca5
%else
d2dfca5
%global py2_namespace python2
d2dfca5
%endif
d2dfca5
d2dfca5
Name:           python-%{pkgname}
d2dfca5
Version:        2.4.1
14009da
Release:        3%{?dist}
d2dfca5
Summary:        %{summary}
d2dfca5
d2dfca5
License:        LGPLv3+
d2dfca5
URL:            https://gitlab.com/warsaw/flufl.lock
d2dfca5
Source0:        https://files.pythonhosted.org/packages/source/f/%{srcname}/%{srcname}-%{version}.tar.gz
d2dfca5
BuildArch:      noarch
d2dfca5
d2dfca5
BuildRequires:  %{py2_namespace}-devel
d2dfca5
BuildRequires:  %{py2_namespace}-setuptools
d2dfca5
# Python3
d2dfca5
BuildRequires:  python3-pkgversion-macros
d2dfca5
BuildRequires:  python%{python3_pkgversion}-devel
d2dfca5
BuildRequires:  python%{python3_pkgversion}-setuptools
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
BuildRequires:  python%{python3_other_pkgversion}-devel
d2dfca5
BuildRequires:  python%{python3_other_pkgversion}-setuptools
d2dfca5
%endif
d2dfca5
d2dfca5
%description %{_description}
d2dfca5
d2dfca5
d2dfca5
%if %{py2_namespace} != python
d2dfca5
%package -n %{py2_namespace}-%{pkgname}
d2dfca5
Summary:        %{summary}
d2dfca5
%{?python_provide:%python_provide %{py2_namespace}-%{pkgname}}
d2dfca5
Requires:       %{py2_namespace}-setuptools
d2dfca5
d2dfca5
%description -n %{py2_namespace}-%{pkgname} %{_description}
d2dfca5
%endif
d2dfca5
d2dfca5
d2dfca5
%package -n python%{python3_pkgversion}-%{pkgname}
d2dfca5
Summary:        %{summary}
d2dfca5
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}}
d2dfca5
Requires:       python%{python3_pkgversion}-setuptools
d2dfca5
d2dfca5
%description -n python%{python3_pkgversion}-%{pkgname} %{_description}
d2dfca5
d2dfca5
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
%package -n python%{python3_other_pkgversion}-%{pkgname}
d2dfca5
Summary:        %{summary}
d2dfca5
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{pkgname}}
d2dfca5
Requires:       python%{python3_other_pkgversion}-setuptools
d2dfca5
d2dfca5
%description -n python%{python3_other_pkgversion}-%{pkgname} %{_description}
d2dfca5
%endif
d2dfca5
d2dfca5
d2dfca5
%prep
d2dfca5
%autosetup -n %{srcname}-%{version}
d2dfca5
d2dfca5
d2dfca5
%build
d2dfca5
%py2_build
d2dfca5
%py3_build
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
%py3_other_build
d2dfca5
%endif
d2dfca5
d2dfca5
d2dfca5
%install
d2dfca5
%py2_install
d2dfca5
%py3_install
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
%py3_other_install
d2dfca5
%endif
d2dfca5
d2dfca5
# This will go in %%doc
d2dfca5
rm -rf %{buildroot}%{_prefix}/lib/python*/site-packages/flufl/lock/{*.rst,docs,conf.py}
d2dfca5
d2dfca5
d2dfca5
%check
d2dfca5
%{__python2} setup.py test
d2dfca5
%{__python3} setup.py test
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
%{__python3_other} setup.py test
d2dfca5
%endif
d2dfca5
d2dfca5
d2dfca5
%files -n %{py2_namespace}-%{pkgname}
d2dfca5
%doc flufl/lock/README.rst flufl/lock/NEWS.rst flufl/lock/docs/using.rst
d2dfca5
%{python2_sitelib}/flufl/
d2dfca5
%{python2_sitelib}/%{srcname}-%{version}*-py%{python2_version}.egg-info/
d2dfca5
%{python2_sitelib}/%{srcname}-%{version}*-py%{python2_version}-nspkg.pth
d2dfca5
d2dfca5
%files -n python%{python3_pkgversion}-%{pkgname}
d2dfca5
%doc flufl/lock/README.rst flufl/lock/NEWS.rst flufl/lock/docs/using.rst
d2dfca5
%{python3_sitelib}/flufl/
d2dfca5
%{python3_sitelib}/%{srcname}-%{version}*-py%{python3_version}.egg-info/
d2dfca5
%{python3_sitelib}/%{srcname}-%{version}*-py%{python3_version}-nspkg.pth
d2dfca5
d2dfca5
%if 0%{?with_python3_other}
d2dfca5
%files -n python%{python3_other_pkgversion}-%{pkgname}
d2dfca5
%doc flufl/lock/README.rst flufl/lock/NEWS.rst flufl/lock/docs/using.rst
d2dfca5
%{python3_other_sitelib}/flufl/
7bb51a8
%{python3_other_sitelib}/%{srcname}-%{version}*-py%{python3_other_version}.egg-info/
d2dfca5
%{python3_other_sitelib}/%{srcname}-%{version}*-py%{python3_other_version}-nspkg.pth
d2dfca5
%endif
d2dfca5
d2dfca5
d2dfca5
%changelog
14009da
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-3
14009da
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
14009da
22be82e
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.4.1-2
22be82e
- Rebuild for Python 3.6
22be82e
d2dfca5
* Wed Sep 14 2016 Aurelien Bompard <abompard@fedoraproject.org> - 2.4.1-1
d2dfca5
- Initial package.