2016-09-01 19:45:49 +00:00
|
|
|
#
|
2017-12-17 14:42:24 +00:00
|
|
|
# spec file for package python
|
2016-09-01 19:45:49 +00:00
|
|
|
#
|
2018-01-19 07:39:51 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-08-22 09:11:58 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2016-09-01 19:45:49 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2016-08-22 09:11:58 +00:00
|
|
|
|
2017-12-17 14:42:24 +00:00
|
|
|
# Define just "test" as a package in _multibuild file to distinguish test
|
|
|
|
# instructions here
|
|
|
|
%if "@BUILD_FLAVOR@" == ""
|
2018-02-01 21:12:46 +00:00
|
|
|
%define _test 0
|
|
|
|
%define name_ext %nil
|
2017-12-17 14:42:24 +00:00
|
|
|
%else
|
2018-02-01 21:12:46 +00:00
|
|
|
%define _test 1
|
|
|
|
%define name_ext -test
|
2017-12-17 14:42:24 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2016-09-01 20:32:37 +00:00
|
|
|
%define short_name openqa_review
|
2017-12-17 14:42:24 +00:00
|
|
|
%define binaries openqa-review openqa-review-daily-email openqa-review-sles-ha tumblesle-release
|
|
|
|
%define oldpython python
|
|
|
|
Name: python-%{short_name}%{?name_ext}
|
2018-02-09 13:31:49 +00:00
|
|
|
Version: 1.10.0
|
2016-08-22 09:11:58 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: A review helper script for openQA
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Python
|
2017-12-17 14:42:24 +00:00
|
|
|
Source: https://github.com/okurz/%{short_name}/archive/%{version}.tar.gz#/python-%{short_name}-%{version}.tar.gz
|
2016-09-01 20:32:37 +00:00
|
|
|
Url: https://github.com/okurz/%{short_name}
|
2017-12-17 14:42:24 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2018-02-01 21:12:46 +00:00
|
|
|
%if 0%{?_test}
|
2017-12-17 14:42:24 +00:00
|
|
|
BuildRequires: %{oldpython}-%{short_name}
|
|
|
|
%else
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
# workaround because of python-configparser not providing the '__init__.py'
|
|
|
|
# file within site-packages/backports
|
2017-12-20 08:16:02 +00:00
|
|
|
%if "%{python_flavor}" == "python2"
|
2017-12-17 14:42:24 +00:00
|
|
|
Requires: python-backports.ssl_match_hostname
|
2017-12-20 08:16:02 +00:00
|
|
|
Requires: python-configparser
|
|
|
|
%endif
|
|
|
|
Requires: python-PyYAML
|
2016-08-22 09:11:58 +00:00
|
|
|
Requires: python-beautifulsoup4
|
2017-02-14 16:20:50 +00:00
|
|
|
Requires: python-certifi
|
2016-08-22 09:11:58 +00:00
|
|
|
Requires: python-future
|
|
|
|
Requires: python-humanfriendly
|
2017-02-17 16:15:30 +00:00
|
|
|
Requires: python-pika
|
2016-08-22 09:11:58 +00:00
|
|
|
Requires: python-requests
|
2016-09-01 19:45:49 +00:00
|
|
|
Requires: python-setuptools
|
|
|
|
Requires: python-sortedcontainers
|
2017-12-17 14:42:24 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(preun): update-alternatives
|
|
|
|
%endif
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2016-08-22 09:11:58 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
2017-12-17 14:42:24 +00:00
|
|
|
%ifpython2
|
|
|
|
Obsoletes: %{oldpython}-%{short_name} < %{version}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%python_subpackages
|
|
|
|
|
2016-08-22 09:11:58 +00:00
|
|
|
%description
|
|
|
|
A review helper script for openQA. For more details look into the README file.
|
|
|
|
|
|
|
|
%prep
|
2018-02-01 21:12:46 +00:00
|
|
|
%if 0%{?_test}
|
2017-12-17 14:42:24 +00:00
|
|
|
# workaround to prevent post/install failing assuming this file for whatever
|
|
|
|
# reason
|
|
|
|
touch %{_sourcedir}/%{short_name}
|
|
|
|
%else
|
2017-12-17 15:06:47 +00:00
|
|
|
%setup -q -n %{short_name}-%{version}
|
2017-12-17 14:42:24 +00:00
|
|
|
# delete shebang of files not in executable path
|
|
|
|
find %{short_name}/ -name '*.py' -print0 | xargs -0 sed -i '1s/#!.*$//'
|
|
|
|
%endif
|
2016-08-22 09:11:58 +00:00
|
|
|
|
|
|
|
%build
|
2018-02-01 21:12:46 +00:00
|
|
|
%if 0%{?_test}
|
2017-12-17 14:42:24 +00:00
|
|
|
openqa-review --help
|
|
|
|
tumblesle-release --help
|
|
|
|
%else
|
|
|
|
%python_build
|
|
|
|
%endif
|
2016-08-22 09:11:58 +00:00
|
|
|
|
2018-02-01 21:12:46 +00:00
|
|
|
%if 0%{?_test}
|
2018-02-07 16:30:28 +00:00
|
|
|
# disable debug packages in package test to prevent error about missing files
|
|
|
|
%define debug_package %{nil}
|
2017-12-17 14:42:24 +00:00
|
|
|
%else
|
2016-08-22 09:11:58 +00:00
|
|
|
%install
|
2017-12-17 14:42:24 +00:00
|
|
|
%python_install
|
2017-02-27 19:47:59 +00:00
|
|
|
rm %{buildroot}/%{python_sitelib}/version.*
|
2016-08-22 09:11:58 +00:00
|
|
|
|
2017-12-17 14:42:24 +00:00
|
|
|
for i in %{binaries}; do
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$i
|
|
|
|
done
|
|
|
|
%fdupes %{buildroot}%{_prefix}
|
|
|
|
|
|
|
|
%post
|
|
|
|
%{python_install_alternative %{binaries}}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%python_uninstall_alternative openqa-review
|
|
|
|
|
|
|
|
%files %{python_files}
|
2016-08-22 09:11:58 +00:00
|
|
|
%defattr(-,root,root,-)
|
2018-02-08 09:31:02 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
2016-08-22 09:11:58 +00:00
|
|
|
%{python_sitelib}
|
2017-12-17 14:42:24 +00:00
|
|
|
%python_alternative %{_bindir}/openqa-review
|
|
|
|
%python_alternative %{_bindir}/openqa-review-sles-ha
|
|
|
|
%python_alternative %{_bindir}/openqa-review-daily-email
|
|
|
|
%python_alternative %{_bindir}/tumblesle-release
|
|
|
|
|
|
|
|
%endif
|
2016-08-22 09:11:58 +00:00
|
|
|
|
|
|
|
%changelog
|