Blob Blame History Raw
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
%global with_python3 1

%global modname watchdog

Name:               python-watchdog
Version:            0.8.2
Release:            1%{?dist}
Summary:            File system events monitoring

Group:              Development/Libraries
License:            ASL 2.0 and BSD and MIT
Source0:  {modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      pytest
BuildRequires:      python-pytest-cov
BuildRequires:      PyYAML >= 3.09
BuildRequires:      python-argh >= 0.8.1
BuildRequires:      python-pathtools >= 0.1.1

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-pytest
BuildRequires:      python3-pytest-cov
BuildRequires:      python3-PyYAML >= 3.09
BuildRequires:      python3-argh >= 0.8.1
BuildRequires:      python3-pathtools >= 0.1.1

A Python API and shell utilities to monitor file system events.

%if 0%{?with_python3}
%package -n python3-watchdog
Summary:            Filesystem events monitoring
Group:              Development/Libraries

%description -n python3-watchdog
A Python API and shell utilities to monitor file system events.


%setup -q -n %{modname}-%{version}

# Remove all shebangs
find src -name "*.py" | xargs sed -i -e '/^#!\//, 1d'

# Remove +x of the README file
chmod -x README.rst

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}

%{__python2} build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} install -O1 --skip-build --root=%{buildroot}
mv %{buildroot}/%{_bindir}/watchmedo %{buildroot}/%{_bindir}/watchmedo-py3
%{__python2} install -O1 --skip-build --root=%{buildroot}

# Tests are no currently included in the releases

#%{__python2} test
#%if 0%{?with_python3}
#pushd %{py3dir}
#%{__python3} test


%if 0%{?with_python3}
%files -n python3-watchdog


* Sat Nov 22 2014 Pierre-Yves Chibon <> - 0.8.2-1
- Update to 0.8.2

* Fri Apr 25 2014 Pierre-Yves Chibon <> - 0.7.1-4
- Adjust the license tag to ASL2.0 and BSD and MIT

* Fri Apr 18 2014 Pierre-Yves Chibon <> - 0.7.1-3
- Adjust the check for Fedora/RHEL release number for the py3 package

* Fri Apr 18 2014 Pierre-Yves Chibon <> - 0.7.1-2
- Remove all shebang of the python files

* Fri Apr 18 2014 Pierre-Yves Chibon <> - 0.7.1-1
- initial package for Fedora