From 5d5ae8731251e0da9be6ecdbef01b039578d97cf948eee439da6f5ea92879c47 Mon Sep 17 00:00:00 2001 From: Tim Hardeck Date: Thu, 6 Sep 2018 09:11:55 +0000 Subject: [PATCH] Accepting request 629744 from home:okurz:branches:Cloud:Tools Change to single-spec package self-test as discussed OBS-URL: https://build.opensuse.org/request/show/629744 OBS-URL: https://build.opensuse.org/package/show/Cloud:Tools/cf-cli?expand=0&rev=50 --- _multibuild | 3 +++ cf-cli-test.changes | 0 cf-cli-test.spec | 44 -------------------------------------------- cf-cli.changes | 6 ++++++ cf-cli.spec | 29 +++++++++++++++++++++++++++-- 5 files changed, 36 insertions(+), 46 deletions(-) create mode 100644 _multibuild delete mode 100644 cf-cli-test.changes delete mode 100644 cf-cli-test.spec diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..6996b96 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/cf-cli-test.changes b/cf-cli-test.changes deleted file mode 100644 index 473a0f4..0000000 diff --git a/cf-cli-test.spec b/cf-cli-test.spec deleted file mode 100644 index 5c2f7fd..0000000 --- a/cf-cli-test.spec +++ /dev/null @@ -1,44 +0,0 @@ -# -# spec file for package cf-cli-test -# -# 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 short_name cf-cli -Name: %{short_name}-test -Version: 6.38.0 -Release: 0 -Summary: Test package for Cloud Foundry command line client -License: Apache-2.0 -BuildRequires: %{short_name} == %{version} - -%description -. - -%prep -# workaround to prevent post/install failing assuming this file for whatever -# reason -touch %{_sourcedir}/%{short_name} - -%build -# call one of the components but not openqa itself which would need a valid -# configuration -cf --help - -%install -# disable debug packages in package test to prevent error about missing files -%define debug_package %{nil} - -%changelog diff --git a/cf-cli.changes b/cf-cli.changes index 463d5b0..6fd6251 100644 --- a/cf-cli.changes +++ b/cf-cli.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 17 07:49:30 UTC 2018 - okurz@suse.com + +- Change package self-test to _multibuild single-spec file approach for easier + handling of package submissions + ------------------------------------------------------------------- Wed Aug 8 21:42:29 UTC 2018 - thardeck@suse.com diff --git a/cf-cli.spec b/cf-cli.spec index 4559ff7..fedc793 100644 --- a/cf-cli.spec +++ b/cf-cli.spec @@ -1,5 +1,5 @@ # -# spec file for package cf-cli +# spec file for package cf # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # @@ -16,6 +16,16 @@ # +# Define just "test" as a package in _multibuild file to distinguish test +# instructions here +%if "@BUILD_FLAVOR@" == "" +%define _test 0 +%define name_ext %nil +%else +%define _test 1 +%define name_ext -test +%endif + %global provider code.cloudfoundry %global provider_tld org %global project "" @@ -24,7 +34,7 @@ %global import_path %{provider_prefix} %define short_name cf-cli -Name: %{short_name} +Name: %{short_name}%{?name_ext} Version: 6.38.0 Release: 0 Summary: Cloud Foundry command line client @@ -34,6 +44,9 @@ Url: https://github.com/cloudfoundry/cli Source: v%{version}.tar.gz Source1: README Source2: cf-cli-rpmlintrc +%if 0%{?_test} +BuildRequires: %{short_name} +%else BuildRequires: go >= 1.8.3 BuildRequires: golang-packaging BuildRequires: xz @@ -41,16 +54,26 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %{go_nostrip} %{go_provides} +%endif %description This is the official command line client for Cloud Foundry. %prep +%if 0%{?_test} +# workaround to prevent post/install failing assuming this file for whatever +# reason +touch %{_sourcedir}/%{short_name} +%else %setup -q -c -n %{name}-%{version} mv */* ./ cp %{SOURCE1} ./ +%endif %build +%if 0%{?_test} +cf --help +%else # show correct version instead of 0.0.0 grep -rl "0.0.0-unknown-version" ./ | xargs sed -i 's/0.0.0-unknown-version/%{version}/g' %goprep %{import_path} @@ -71,4 +94,6 @@ cp ci/installers/completion/cf %{buildroot}/%{_sysconfdir}/bash_completion.d/cf. %config %{_sysconfdir}/bash_completion.d/cf.sh %doc LICENSE NOTICE README +%endif + %changelog