diff --git a/python-pysrt-rpmlintrc b/python-pysrt-rpmlintrc deleted file mode 100644 index bb1d6f0..0000000 --- a/python-pysrt-rpmlintrc +++ /dev/null @@ -1,3 +0,0 @@ -# remove warnings about modules not being executable -addFilter("non-executable-script") - diff --git a/python-pysrt.changes b/python-pysrt.changes index 23759a8..16a657f 100644 --- a/python-pysrt.changes +++ b/python-pysrt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 28 17:34:13 UTC 2017 - aloisio@gmx.com + +- Converted to single-spec +- Added tests +- Dropped python-pysrt-rpmlintrc (those are pertinent warnings) + ------------------------------------------------------------------- Thu Dec 15 15:32:32 UTC 2016 - aloisio@gmx.com diff --git a/python-pysrt.spec b/python-pysrt.spec index e74d040..8bbbfca 100644 --- a/python-pysrt.spec +++ b/python-pysrt.spec @@ -1,7 +1,7 @@ # # spec file for package python-pysrt # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# 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 @@ -16,6 +16,7 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pysrt Version: 1.1.1 Release: 0 @@ -24,17 +25,16 @@ License: GPL-3.0 Group: System/Libraries Url: https://github.com/byroot/pysrt Source0: https://pypi.python.org/packages/source/p/pysrt/pysrt-%{version}.tar.gz -Source1: python-pysrt-rpmlintrc +BuildRequires: %{python_module base} +BuildRequires: %{python_module chardet} +BuildRequires: %{python_module nose} +BuildRequires: %{python_module setuptools} BuildRequires: fdupes -BuildRequires: python -BuildRequires: python-chardet -BuildRequires: python-setuptools -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Requires: python +BuildRequires: python-rpm-macros Requires: python-chardet -%if 0%{?suse_version} > 1110 +BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -%endif +%python_subpackages %description pysrt is a python library to search and download subtitles. @@ -42,19 +42,23 @@ It comes with an easy to use CLI suitable for direct use or cron jobs. %prep %setup -q -n pysrt-%{version} +# Remove shebang from non-executable file +sed -e '1d' -i pysrt/commands.py %build -python setup.py build +%python_build %install -python setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} -%fdupes -s %{buildroot} +%python_install +%python_expand %fdupes -s %{buildroot}%{$python_sitelib} -%files +%check +%python_exec %{_bindir}/nosetests + +%files %{python_files} %defattr(-,root,root) -%{_bindir}/srt -%dir %{python_sitelib}/pysrt -%{python_sitelib}/pysrt/* -%{python_sitelib}/pysrt-%{version}-py%{py_ver}.egg-info +%python3_only %{_bindir}/srt +%{python_sitelib}/pysrt +%{python_sitelib}/pysrt-%{version}-py%{python_version}.egg-info %changelog