LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File python-openqa_review.spec of Package python-openqa_review (Project devel:languages:python)

# spec file for package python
# Copyright (c) 2018 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/

# Define just "test" as a package in _multibuild file to distinguish test
# instructions here
%if "@BUILD_FLAVOR@" == ""
%define _test 0
%define name_ext %nil
%define _test 1
%define name_ext -test

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define         short_name openqa_review
%define         binaries openqa-review openqa-review-daily-email openqa-review-sles-ha tumblesle-release openqa-review-functional_autoyast_concise
%define         oldpython python
Name:           python-%{short_name}%{?name_ext}
Version:        1.13.1
Release:        0
Summary:        A review helper script for openQA
License:        MIT
Group:          Development/Languages/Python
Source:         python-%{short_name}-%{version}.tar.xz
Url:            https://github.com/okurz/%{short_name}
BuildRequires:  python-rpm-macros
%if 0%{?_test}
BuildRequires:  %{oldpython}-%{short_name} == %{version}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
# workaround because of python-configparser not providing the '__init__.py'
# file within site-packages/backports
%if "%{python_flavor}" == "python2"
Requires:       python-backports.ssl_match_hostname
Requires:       python-configparser
Requires:       python-PyYAML
Requires:       python-beautifulsoup4
Requires:       python-certifi
Requires:       python-future
Requires:       python-humanfriendly
Requires:       python-pika
Requires:       python-requests
Requires:       python-setuptools
Requires:       python-sortedcontainers
Requires(post): update-alternatives
Requires(preun): update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

Obsoletes:      %{oldpython}-%{short_name} < %{version}


A review helper script for openQA. For more details look into the README file.

%if 0%{?_test}
# workaround to prevent post/install failing assuming this file for whatever
# reason
touch %{_sourcedir}/%{short_name}
%setup -q
# delete shebang of files not in executable path
find %{short_name}/ -name '*.py' -print0 | xargs -0 sed -i '1s/#!.*$//'

%if 0%{?_test}
openqa-review --help
tumblesle-release --help

%if 0%{?_test}
# disable debug packages in package test to prevent error about missing files
%define debug_package %{nil}
rm %{buildroot}/%{python_sitelib}/version.*

for i in %{binaries}; do
    %python_clone -a %{buildroot}%{_bindir}/$i
%fdupes %{buildroot}%{_prefix}

%{python_install_alternative %{binaries}}

%python_uninstall_alternative openqa-review

%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/openqa-review
%python_alternative %{_bindir}/openqa-review-sles-ha
%python_alternative %{_bindir}/openqa-review-daily-email
%python_alternative %{_bindir}/openqa-review-functional_autoyast_concise
%python_alternative %{_bindir}/tumblesle-release