File python-micawber.spec of Package python-micawber

# spec file for package python-micawber
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 LISA GmbH, Bingen, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-micawber
Version:        0.4.0
Release:        0
Summary:        Extract rich content from urls
License:        MIT
Group:          Development/Languages/Python
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module beautifulsoup4}
Requires:       python-beautifulsoup4
BuildArch:      noarch

micawber supplies a few methods for retrieving rich metadata about a variety of
links, such as links to youtube videos. micawber also provides functions for
parsing blocks of text and html and replacing links to videos with rich
embedded content.

%setup -q -n micawber-%{version}
# remove wrong shebang and executable flag from examples
find examples -type f -name '*.py' -exec sed -i -e '1{\@^#!%{_bindir}/env python@d}' {} \;
find examples -type f -name '*.py' -exec chmod 644 {} \;


%python_expand %fdupes %{buildroot}%{$python_sitelib}

%python_exec test

%files %{python_files}
%doc README.rst examples
%license LICENSE