File subdownloader.spec of Package subdownloader

#
# spec file for package subdownloader
#
# Copyright (c) 2019 SUSE LLC
# Copyright (c) 2013 Pavol Rusnak <prusnak@opensuse.org>
#
# 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.opensuse.org/
#


Name:           subdownloader
Version:        2.1.0
Release:        0
Summary:        Tool for automatic download/upload subtitles of videofiles
License:        GPL-3.0-or-later
Group:          Productivity/Multimedia/Video/Editors and Convertors
URL:            https://subdownloader.net/
Source:         https://github.com/subdownloader/subdownloader/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  python3-Sphinx
BuildRequires:  python3-pytest
BuildRequires:  python3-sphinx-argparse
BuildRequires:  python3-setuptools
BuildRequires:  update-desktop-files
Requires:       python-qt5
Recommends:     %{name}-lang = %{version}
BuildArch:      noarch

%description
SubDownloader is a Free Open Source tool written in Python
for automatic download/upload subtitles for videofiles
(DIVX,MPEG,AVI,VOB,etc) and DVDs using fast hashing.

%lang_package

%prep
%setup -q
# fix shebang
sed -i '/#!/d' subdownloader/client/__main__.py subdownloader/client/modules/progressbar/__init__.py

%build
python3 setup.py build
python3 setup.py build_sphinx

%install
python3 setup.py install --root=%{buildroot} --prefix=%{_prefix}
install -vDm 644 build/sphinx/man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
install -vDm 644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
install -vDm 644 scripts/gui/rc/images/%{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
%find_lang %{name}
%fdupes %{buildroot}%{python3_sitelib}

%check
python3 %{_bindir}/py.test

%files -f %{name}.lang
%license COPYING
%doc ChangeLog README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png
%{_mandir}/man1/%{name}.1%{?ext_man}
%{python3_sitelib}/%{name}
%exclude %{python3_sitelib}/%{name}/client/locale
%{python3_sitelib}/%{name}-%{version}-py%{py3_ver}.egg-info

%files lang -f %{name}.lang
%dir %{python3_sitelib}/%{name}/client/locale
%dir %{python3_sitelib}/%{name}/client/locale/*
%dir %{python3_sitelib}/%{name}/client/locale/*/LC_MESSAGES

%changelog
openSUSE Build Service is sponsored by