Accepting request 489963 from home:alois:branches:devel:languages:python

Converted to single-spec

OBS-URL: https://build.opensuse.org/request/show/489963
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-watchdog?expand=0&rev=4
This commit is contained in:
Jan Matejek 2017-05-16 13:55:44 +00:00 committed by Git OBS Bridge
parent 5bc133800a
commit cac729941b
2 changed files with 46 additions and 21 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Apr 22 18:19:08 UTC 2017 - aloisio@gmx.com
- Converted to single-spec
- Split docs into separate package
-------------------------------------------------------------------
Fri Mar 11 09:29:58 UTC 2016 - freitag@opensuse.org

View File

@ -1,7 +1,7 @@
#
# spec file for package python-watchdog
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,6 +16,7 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-watchdog
Version: 0.8.3
Release: 0
@ -23,43 +24,61 @@ Url: http://github.com/gorakhargosh/watchdog
Summary: Filesystem events monitoring
License: MIT
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/w/watchdog/watchdog-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-Sphinx
BuildRequires: python-devel
Source: http://files.pythonhosted.org/packages/source/w/watchdog/watchdog-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-Sphinx
# test requirements
BuildRequires: %{python_module pathtools}
BuildRequires: %{python_module pytest}
%ifpython2
Requires: python-Brownie
%endif
Requires: python-PyYAML
Requires: python-argh
Requires: python-pathtools
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%endif
%python_subpackages
%description
Python API and shell utilities to monitor file system events.
%package doc
Summary: Documentation and examples for %{name}
Group: Documentation/Other
%description doc
This package contains documentation and examples for %{name}.
%prep
%setup -q -n watchdog-%{version}
chmod -x README.rst
# Remove all shebangs
find src -name "*.py" | xargs sed -i -e '/^#!\//, 1d'
%build
python setup.py build
cd docs && make html && rm -r build/html/.buildinfo # Build HTML docs
%python_build
cd docs && make html && rm -r build/html/.buildinfo build/html/objects.inv # Build HTML docs
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} --record-rpm=INSTALLED_FILES
# remove shebangs from all scripts
find %{buildroot}%{python_sitelib} -name '*.py' \
-exec sed -i -e '1{/^#!/d}' {} \;
# Fix python-bytecode-inconsistent-mtime
pushd %{buildroot}%{python_sitelib}
%py_compile .
popd
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
%files -f INSTALLED_FILES
%check
%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_version}
%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS changelog.rst COPYING LICENSE MANIFEST.in README.rst docs/build/html
%doc AUTHORS changelog.rst COPYING LICENSE MANIFEST.in README.rst
%python3_only %{_bindir}/watchmedo
%{python_sitelib}/watchdog
%{python_sitelib}/watchdog-%{version}-py%{python_version}.egg-info
%files %{python_files doc}
%defattr(-,root,root,-)
%doc docs/build/html
%changelog