From 9214736f378e3d959ae5bcf625648e994432ccb8 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Thu, 2 May 2019 15:23:33 -0500 Subject: [PATCH 1/3] dist/package: drop %check and related build requirements. Not feasible to run tests on OBS. --- dist/package/openSUSE-release-tools.spec | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index bd9b040c..f3a0a40e 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -38,13 +38,6 @@ BuildRequires: python-pycurl BuildRequires: python-python-dateutil BuildRequires: python-pyxdg BuildRequires: python-urlgrabber -%if 0%{?is_opensuse} -# Testing only requirements installed for `make check`. -BuildRequires: libxml2-tools -BuildRequires: python-httpretty -BuildRequires: python-mock -BuildRequires: python-nose -%endif # Spec related requirements. %if 0%{?is_opensuse} @@ -326,12 +319,6 @@ OSC plugin to check for virtually accepted request, see `osc vdelreq --help`. %build make %{?_smp_mflags} -%check -%if 0%{?is_opensuse} -# TODO openSUSE/openSUSE-release-tools#1221: decide how to handle integration tests -# make check -%endif - %install %make_install \ grafana_provisioning_dir="%{_sysconfdir}/grafana/provisioning" \ From be729c0bd143d273c7bb4a565a9ee281f8dbaccf Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Thu, 2 May 2019 15:28:57 -0500 Subject: [PATCH 2/3] dist/package: require influxdb and telegraf for Tumbleweed. The packages have made there way into Tumbleweed and thus can now be required instead of suggested. --- dist/package/openSUSE-release-tools.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index f3a0a40e..ce60648c 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -158,12 +158,16 @@ BuildArch: noarch # TODO Update requirements. Requires: osclib = %{version} Requires(pre): shadow -# TODO Requires: python-influxdb, but package does not exist in Factory, but -# present in Cloud:OpenStack:Master/python-influxdb. -Recommends: python-influxdb Suggests: grafana +%if 0%{?suse_version} > 1500 +Requires: influxdb +Requires: python-influxdb +Requires: telegraf +%else Suggests: influxdb +Suggests: python-influxdb Suggests: telegraf +%endif %description metrics Ingest relevant OBS and annotation data to generate insightful metrics. From c142b9052f85bbc43da940527c19809c1c6a3821 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Thu, 2 May 2019 15:31:27 -0500 Subject: [PATCH 3/3] dist/package: handle python 2 vs python 3 dependencies. Since osc was updated to require python 3 handle dependencies in same fashion as osc so as to get them right. --- dist/package/openSUSE-release-tools.spec | 57 +++++++++++++++--------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/dist/package/openSUSE-release-tools.spec b/dist/package/openSUSE-release-tools.spec index ce60648c..66118a98 100644 --- a/dist/package/openSUSE-release-tools.spec +++ b/dist/package/openSUSE-release-tools.spec @@ -16,6 +16,17 @@ # +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150100 +%bcond_without python3 +%else +%bcond_with python3 +%endif +%if %{with python3} +%define use_python python3 +%else +%define use_python python +%endif + %global __provides_exclude ^perl.* %define source_dir openSUSE-release-tools %define announcer_filename factory-package-news @@ -30,14 +41,14 @@ Source: %{name}-%{version}.tar.xz BuildArch: noarch # Requires sr#512849 which provides osc_plugin_dir. BuildRequires: osc >= 0.159.0 -BuildRequires: python-PyYAML -BuildRequires: python-cmdln -BuildRequires: python-colorama -BuildRequires: python-lxml -BuildRequires: python-pycurl -BuildRequires: python-python-dateutil -BuildRequires: python-pyxdg -BuildRequires: python-urlgrabber +BuildRequires: %{use_python}-PyYAML +BuildRequires: %{use_python}-cmdln +BuildRequires: %{use_python}-colorama +BuildRequires: %{use_python}-lxml +BuildRequires: %{use_python}-pycurl +BuildRequires: %{use_python}-python-dateutil +BuildRequires: %{use_python}-pyxdg +BuildRequires: %{use_python}-urlgrabber # Spec related requirements. %if 0%{?is_opensuse} @@ -49,18 +60,20 @@ BuildRequires: apache2-devel BuildRequires: rsyslog BuildRequires: systemd-rpm-macros -Requires: python-PyYAML -Requires: python-cmdln -Requires: python-colorama -Requires: python-lxml +Requires: %{use_python}-PyYAML +Requires: %{use_python}-cmdln +Requires: %{use_python}-colorama +Requires: %{use_python}-lxml # issue-diff.py, legal-auto.py, and openqa-maintenance.py -Requires: python-pycurl -Requires: python-python-dateutil -Requires: python-pyxdg -Requires: python-requests -Requires: python-urlgrabber +Requires: %{use_python}-pycurl +Requires: %{use_python}-python-dateutil +Requires: %{use_python}-pyxdg +Requires: %{use_python}-requests +Requires: %{use_python}-urlgrabber # ttm/manager.py +%if %{without python3} Requires: python-enum34 +%endif # bs_mirrorfull Requires: perl-Net-SSLeay @@ -88,9 +101,9 @@ Summary: Development requirements for openSUSE-release-tools Group: Development/Tools/Other BuildArch: noarch Requires: libxml2-tools -Requires: python-httpretty -Requires: python-mock -Requires: python-nose +Requires: %{use_python}-httpretty +Requires: %{use_python}-mock +Requires: %{use_python}-nose %description devel Development requirements for openSUSE-release-tools to be used in conjunction @@ -247,8 +260,8 @@ Group: Development/Tools/Other BuildArch: noarch Requires: obs-service-product_converter Requires: osclib = %{version} -Requires: python-requests -Requires: python-solv +Requires: %{use_python}-requests +Requires: %{use_python}-solv # for compressing the .packages files in 000update-repos Requires: /usr/bin/xz # we use the same user as repo-checker