File python-tvdb_api.spec of Package python-tvdb_api

#
# spec file for package python-tvdb_api
#
# Copyright (c) 2020 Packman Team <packman@links2linux.de>
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 Packman Team <packman@links2linux.de>
#
# 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 https://bugs.links2linux.org/
#


Name:           python-tvdb_api
Version:        3.1
Release:        1699.2.pm.24
Summary:        Interface to thetvdb.com
# The UnLicense (https://unlicense.org)
License:        SUSE-Permissive
Group:          Productivity/Multimedia/Other
URL:            https://github.com/dbr/tvdb_api
Source0:        https://files.pythonhosted.org/packages/source/t/tvdb_api/tvdb_api-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  python-rpm-macros
BuildRequires:  fdupes
Requires:       python-requests-cache
BuildArch:      noarch
%python_subpackages

%description
An easy to use API interface to TheTVDB.com.

%prep
%setup -q -n tvdb_api-%{version}

%build
%python_build

%install
%python_install

# Fix: non-executable-script
%{python_expand \
pushd %{buildroot}%{$python_sitelib}
for _file in $(grep -rl '^\#\!\/'); do
  find -name ${_file##*/} -type f -not -perm /111 -exec sed '/^\#\!\//d' -i {} +
  find -name ${_file##*/} -type f -perm /111 -exec sed 's|#!%{_bindir}/env python|#!%__$python|' -i {} +
done
popd
}

%if 0%{?have_python2}
%py_compile %{buildroot}%{python2_sitelib}
%py_compile -O %{buildroot}%{python2_sitelib}
%endif
%if 0%{?have_python3}
%py3_compile %{buildroot}%{python3_sitelib}
%py3_compile -O %{buildroot}%{python3_sitelib}
%endif
#

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

%files %{python_files}
%license UNLICENSE
%doc readme.md
%{python_sitelib}/*

%changelog
* Wed Apr 22 2020 Luigi Baldoni <aloisio@gmx.com>
- Spec cleanup
* Thu Nov  1 2018 Aliaksei Padvalski <avvissu@yandex.by>
- Update to 2.0:
  * Switch to TheTVDB new JSON based API - issue #57
- Add support for Python3
- Fix: non-executable-script
- Update to description
- Spec file cleanup
* Fri Apr 21 2017 aloisio@gmx.com
- Update to version 1.10
- Spec cleanup
* Mon Feb  4 2013 hvogel@opensuse.org
- Update to version 1.8.2
* Wed May  5 2010 henne@links2linux.de
- Update to version 1.4
* Tue Nov 17 2009 henne@links2linux.de
- Initial Package, Version 1.0
openSUSE Build Service is sponsored by