2016-04-26 22:12:17 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-subliminal
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2016-06-13 21:32:59 +00:00
|
|
|
%define subliminal_priority 30
|
|
|
|
|
2016-04-26 22:12:17 +00:00
|
|
|
Name: python-subliminal
|
2016-09-03 20:26:24 +00:00
|
|
|
Version: 2.0.5
|
2016-04-26 22:12:17 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Python library to search and download subtitles
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Python
|
|
|
|
Url: https://github.com/Diaoul/subliminal
|
2016-09-03 20:26:24 +00:00
|
|
|
Source0: https://github.com/Diaoul/subliminal/archive/%{version}.tar.gz#/subliminal-%{version}.tar.gz
|
2016-06-13 21:32:59 +00:00
|
|
|
Source1: subliminal.1
|
2016-04-26 22:12:17 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-argparse >= 1.3.0
|
2016-06-13 21:32:59 +00:00
|
|
|
BuildRequires: python-babelfish >= 0.5.5
|
2016-04-26 22:12:17 +00:00
|
|
|
BuildRequires: python-beautifulsoup4 >= 4.4.0
|
|
|
|
BuildRequires: python-chardet >= 2.3.0
|
|
|
|
BuildRequires: python-click >= 4.1
|
|
|
|
BuildRequires: python-devel >= 2.7
|
2016-06-13 21:32:59 +00:00
|
|
|
BuildRequires: python-dogpile.cache >= 0.6.0
|
2016-04-26 22:12:17 +00:00
|
|
|
BuildRequires: python-enzyme >= 0.4.1
|
|
|
|
BuildRequires: python-guessit >= 2.0.1
|
|
|
|
BuildRequires: python-html5lib >= 0.999999
|
|
|
|
BuildRequires: python-pbr >= 1.3.0
|
|
|
|
BuildRequires: python-pysrt >= 1.0.1
|
|
|
|
BuildRequires: python-python-dateutil >= 2.2
|
|
|
|
BuildRequires: python-requests >= 2.7.0
|
|
|
|
BuildRequires: python-setuptools >= 18.0.1
|
|
|
|
BuildRequires: python-six >= 1.9.0
|
|
|
|
BuildRequires: python-stevedore >= 1.6.0
|
|
|
|
BuildRequires: python-xdg >= 0.25
|
|
|
|
Requires: python-appdirs >= 1.3
|
|
|
|
Requires: python-argparse >= 1.3.0
|
|
|
|
Requires: python-babelfish >= 0.5.4
|
|
|
|
Requires: python-beautifulsoup4 >= 4.4.0
|
|
|
|
Requires: python-chardet >= 2.3.0
|
|
|
|
Requires: python-click >= 4.1
|
2016-06-13 21:32:59 +00:00
|
|
|
Requires: python-dogpile.cache >= 0.6.0
|
2016-04-26 22:12:17 +00:00
|
|
|
Requires: python-enzyme >= 0.4.1
|
2016-04-29 18:25:21 +00:00
|
|
|
Requires: python-futures >= 3.0
|
2016-04-26 22:12:17 +00:00
|
|
|
Requires: python-guessit >= 2.0.1
|
|
|
|
Requires: python-html5lib >= 0.999999
|
|
|
|
Requires: python-python-dateutil >= 2.2
|
|
|
|
%if 0%{?suse_version} <= 1320 && 0%{?is_opensuse} == 0
|
|
|
|
Requires: python-ndg-httpsclient
|
|
|
|
%endif
|
|
|
|
Requires: python-pbr >= 1.3.0
|
|
|
|
Requires: python-pysrt >= 1.0.1
|
|
|
|
Requires: python-rarfile >= 2.7
|
|
|
|
Requires: python-requests >= 2.7.0
|
|
|
|
Requires: python-six >= 1.9.0
|
|
|
|
Requires: python-stevedore >= 1.6.0
|
|
|
|
Requires: python-xdg >= 0.25
|
|
|
|
Recommends: python-colorlog >= 2.6.0
|
2016-06-13 21:32:59 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
2016-04-26 22:12:17 +00:00
|
|
|
Conflicts: subliminal
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%if 0%{?suse_version} > 1110
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
2016-04-26 22:13:35 +00:00
|
|
|
Provides: subliminal = %{version}
|
|
|
|
Obsoletes: subliminal < %{version}
|
2016-04-26 22:12:17 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Subliminal is a python library to search and download subtitles.
|
|
|
|
It comes with an easy to use CLI suitable for direct use or cron jobs.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -n subliminal-%{version}
|
2016-06-13 21:32:59 +00:00
|
|
|
# set the exe name
|
|
|
|
sed -e 's/subliminal = subliminal.cli:subliminal/subliminal-%{py_ver} = subliminal.cli:subliminal/' -i setup.py
|
|
|
|
gzip < %{SOURCE1} > subliminal-%{py_ver}.1.gz
|
2016-04-26 22:12:17 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
%install
|
|
|
|
python setup.py install --skip-build --prefix=%{_prefix} --root=%{buildroot}
|
|
|
|
mkdir -p %{buildroot}/%{_docdir}/%{name}
|
|
|
|
mkdir -p %{buildroot}/%{_mandir}/man1
|
2016-06-13 21:32:59 +00:00
|
|
|
install -m 644 subliminal-%{py_ver}.1.gz -t %{buildroot}/%{_mandir}/man1
|
|
|
|
# Setup update-alternatives
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/subliminal
|
|
|
|
touch %{buildroot}%{_sysconfdir}/alternatives/subliminal.1.gz
|
|
|
|
ln -s -f %{_sysconfdir}/alternatives/subliminal %{buildroot}%{_bindir}/subliminal
|
|
|
|
ln -s -f %{_sysconfdir}/alternatives/subliminal.1.gz %{buildroot}%{_mandir}/man1/subliminal.1.gz
|
2016-04-26 22:12:17 +00:00
|
|
|
%fdupes -s %{buildroot}
|
|
|
|
|
2016-06-13 21:32:59 +00:00
|
|
|
%post
|
|
|
|
update-alternatives \
|
|
|
|
--install %{_bindir}/subliminal subliminal %{_bindir}/subliminal-%{py_ver} \
|
|
|
|
%{subliminal_priority} \
|
|
|
|
--slave %{_mandir}/man1/subliminal.1.gz subliminal.1.gz %{_mandir}/man1/subliminal-%{py_ver}.1.gz
|
|
|
|
|
|
|
|
%postun
|
|
|
|
# Note: we don't use "$1 -eq 0", to avoid issues if the package gets renamed
|
|
|
|
if [ ! -f %{_bindir}/subliminal-%{py_ver} ]; then
|
|
|
|
update-alternatives --remove subliminal %{_bindir}/subliminal-%{py_ver}
|
|
|
|
fi
|
|
|
|
|
2016-04-26 22:12:17 +00:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc HISTORY.rst LICENSE README.rst
|
|
|
|
%{_bindir}/subliminal
|
2016-06-13 21:32:59 +00:00
|
|
|
%{_bindir}/subliminal-%{py_ver}
|
|
|
|
%ghost %{_sysconfdir}/alternatives/subliminal
|
2016-04-26 22:12:17 +00:00
|
|
|
%{_mandir}/man1/subliminal.1.gz
|
2016-06-13 21:32:59 +00:00
|
|
|
%{_mandir}/man1/subliminal-%{py_ver}.1.gz
|
|
|
|
%ghost %{_sysconfdir}/alternatives/subliminal.1.gz
|
2016-04-26 22:12:17 +00:00
|
|
|
%dir %{python_sitelib}/subliminal
|
|
|
|
%{python_sitelib}/subliminal/*
|
|
|
|
%{python_sitelib}/subliminal-%{version}-py%{py_ver}.egg-info
|
|
|
|
|
|
|
|
%changelog
|