96f9b34
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
96f9b34
%global with_python3 1
96f9b34
%endif
96f9b34
96f9b34
%global modname watchdog
96f9b34
96f9b34
Name:               python-watchdog
84276a3
Version:            0.8.2
ac614b6
Release:            5%{?dist}
96f9b34
Summary:            File system events monitoring
96f9b34
96f9b34
Group:              Development/Libraries
96f9b34
License:            ASL 2.0 and BSD and MIT
96f9b34
URL:                http://pypi.python.org/pypi/watchdog
96f9b34
Source0:            http://pypi.python.org/packages/source/w/%{modname}/%{modname}-%{version}.tar.gz
96f9b34
96f9b34
BuildArch:          noarch
96f9b34
96f9b34
BuildRequires:      python2-devel
96f9b34
BuildRequires:      pytest
96f9b34
BuildRequires:      python-pytest-cov
96f9b34
BuildRequires:      PyYAML >= 3.09
96f9b34
BuildRequires:      python-argh >= 0.8.1
96f9b34
BuildRequires:      python-pathtools >= 0.1.1
96f9b34
96f9b34
%if 0%{?with_python3}
96f9b34
BuildRequires:      python3-devel
96f9b34
BuildRequires:      python3-pytest
96f9b34
BuildRequires:      python3-pytest-cov
96f9b34
BuildRequires:      python3-PyYAML >= 3.09
96f9b34
BuildRequires:      python3-argh >= 0.8.1
96f9b34
BuildRequires:      python3-pathtools >= 0.1.1
96f9b34
%endif
96f9b34
96f9b34
%description
96f9b34
A Python API and shell utilities to monitor file system events.
96f9b34
96f9b34
%if 0%{?with_python3}
96f9b34
%package -n python3-watchdog
96f9b34
Summary:            Filesystem events monitoring
96f9b34
Group:              Development/Libraries
96f9b34
96f9b34
%description -n python3-watchdog
96f9b34
A Python API and shell utilities to monitor file system events.
96f9b34
96f9b34
%endif
96f9b34
96f9b34
%prep
96f9b34
%setup -q -n %{modname}-%{version}
96f9b34
96f9b34
# Remove all shebangs
96f9b34
find src -name "*.py" | xargs sed -i -e '/^#!\//, 1d'
96f9b34
96f9b34
# Remove +x of the README file
96f9b34
chmod -x README.rst
96f9b34
96f9b34
# Remove bundled egg-info in case it exists
96f9b34
rm -rf %{modname}.egg-info
96f9b34
%if 0%{?with_python3}
96f9b34
rm -rf %{py3dir}
96f9b34
cp -a . %{py3dir}
96f9b34
%endif
96f9b34
96f9b34
%build
96f9b34
%{__python2} setup.py build
96f9b34
%if 0%{?with_python3}
96f9b34
pushd %{py3dir}
96f9b34
%{__python3} setup.py build
96f9b34
popd
96f9b34
%endif
96f9b34
96f9b34
96f9b34
%install
96f9b34
%if 0%{?with_python3}
96f9b34
pushd %{py3dir}
96f9b34
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
96f9b34
mv %{buildroot}/%{_bindir}/watchmedo %{buildroot}/%{_bindir}/watchmedo-py3
96f9b34
popd
96f9b34
%endif
96f9b34
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
96f9b34
96f9b34
%check
96f9b34
# Tests are no currently included in the releases
96f9b34
# https://github.com/gorakhargosh/watchdog/pull/232
96f9b34
96f9b34
#%{__python2} setup.py test
96f9b34
#%if 0%{?with_python3}
96f9b34
#pushd %{py3dir}
96f9b34
#%{__python3} setup.py test
96f9b34
#popd
96f9b34
#%endif
96f9b34
96f9b34
%files
96f9b34
%doc README.rst LICENSE
96f9b34
%{python2_sitelib}/%{modname}/
96f9b34
%{python2_sitelib}/%{modname}-%{version}*
96f9b34
%{_bindir}/watchmedo
96f9b34
96f9b34
%if 0%{?with_python3}
96f9b34
%files -n python3-watchdog
96f9b34
%doc README.rst LICENSE
96f9b34
%{python3_sitelib}/%{modname}/
96f9b34
%{python3_sitelib}/%{modname}-%{version}-*
96f9b34
%{_bindir}/watchmedo-py3
96f9b34
96f9b34
%endif
96f9b34
96f9b34
%changelog
ac614b6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-5
ac614b6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ac614b6
7315223
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-4
7315223
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
7315223
c457332
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-3
c457332
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
c457332
34a5b73
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.8.2-2
34a5b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
34a5b73
84276a3
* Sat Nov 22 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.8.2-1
84276a3
- Update to 0.8.2
84276a3
96f9b34
* Fri Apr 25 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.7.1-4
96f9b34
- Adjust the license tag to ASL2.0 and BSD and MIT
96f9b34
96f9b34
* Fri Apr 18 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.7.1-3
96f9b34
- Adjust the check for Fedora/RHEL release number for the py3 package
96f9b34
96f9b34
* Fri Apr 18 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.7.1-2
96f9b34
- Remove all shebang of the python files
96f9b34
96f9b34
* Fri Apr 18 2014 Pierre-Yves Chibon <pingou@pingoured.fr> - 0.7.1-1
96f9b34
- initial package for Fedora