File python-guessit.spec of Package python-guessit

#
# spec file for package python-guessit
#
# 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
# 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 http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-guessit
Version:        2.1.1
Release:        0
Summary:        GuessIt - a library for guessing information from video files
License:        LGPL-3.0
Group:          Development/Languages/Python
Url:            https://github.com/wackou/guessit
Source0:        https://pypi.io/packages/source/g/guessit/guessit-%{version}.tar.gz
BuildRequires:  %{python_module babelfish >= 0.5.5}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pytest-runner}
BuildRequires:  %{python_module python-dateutil}
BuildRequires:  %{python_module rebulk >= 0.7.3}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-pytest-runner
BuildRequires:  python-rebulk >= 0.7.3
BuildRequires:  python-rpm-macros
BuildRequires:  python-setuptools
Requires:       python-babelfish >= 0.5.5
Requires:       python-python-dateutil
Requires:       python-rebulk >= 0.7.3
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%python_subpackages

%description
GuessIt is a python library that extracts as much information as
possible from a video file.
It has a very powerful filename matcher that allows to guess a lot of
metadata from a video using its filename only. This matcher works with
both movies and tv shows episodes.

%prep
%setup -q -n guessit-%{version}
# Remove shebang from non-executable files
for i in {'audio_codec','bonus','cds','container','country','crc','date','edition','episodes','episode_title','film','format','__init__','language','mimetype','other','part','release_group','screen_size','streaming_service','title','type','video_codec','website'}; do
sed -i -e "1d" "guessit/rules/properties/$i.py"
done
for i in {'common/comparators','common/date','common/formatters','common/__init__','common/numeral','common/validators','common/words','__init__','markers/groups','markers/__init__','markers/path','processors'}; do
sed -i -e "1d" "guessit/rules/$i.py"
done
for i in {'api','backports','__init__','jsonutils','__main__','options','reutils','test/__init__','test/rules/__init__','test/rules/processors_test','test/test_api','test/test_api_unicode_literals','test/test_benchmark','test/test_main','test/test_yml','__version__','yamlutils'}; do
sed -i -e "1d" "guessit/$i.py"
done

%build
%python_build

%install
%python_install
%python_expand %fdupes -s %%{buildroot}%{$python_sitelib}

%files %{python_files}
%defattr(-,root,root,-)
%python3_only %{_bindir}/guessit
%{python_sitelib}/guessit
%{python_sitelib}/guessit-%{version}-py%{python_version}.egg-info

%changelog
openSUSE Build Service is sponsored by