2016-10-28 14:56:08 +02:00
|
|
|
#
|
2018-09-06 11:11:55 +02:00
|
|
|
# spec file for package cf
|
2016-10-28 14:56:08 +02:00
|
|
|
#
|
2019-01-14 23:52:27 +01:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-10-28 14:56:08 +02: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.
|
2017-01-18 16:56:46 +01:00
|
|
|
|
2016-10-28 14:56:08 +02:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
2017-01-18 16:56:46 +01:00
|
|
|
#
|
2016-10-28 14:56:08 +02:00
|
|
|
|
2018-02-09 15:39:04 +01:00
|
|
|
|
2018-09-06 11:11:55 +02:00
|
|
|
# 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
|
|
|
|
|
2017-04-06 09:39:57 +02:00
|
|
|
%global provider code.cloudfoundry
|
|
|
|
%global provider_tld org
|
|
|
|
%global project ""
|
|
|
|
%global repo cli
|
|
|
|
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
|
|
|
|
%global import_path %{provider_prefix}
|
2016-10-28 14:56:08 +02:00
|
|
|
|
2018-07-31 17:16:39 +02:00
|
|
|
%define short_name cf-cli
|
2018-09-06 11:11:55 +02:00
|
|
|
Name: %{short_name}%{?name_ext}
|
2019-01-14 23:52:27 +01:00
|
|
|
Version: 6.42.0
|
2016-10-28 14:56:08 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Cloud Foundry command line client
|
2018-02-09 15:39:04 +01:00
|
|
|
License: Apache-2.0
|
2016-10-28 14:56:08 +02:00
|
|
|
Group: System/Management
|
2018-02-09 15:39:04 +01:00
|
|
|
Url: https://github.com/cloudfoundry/cli
|
2018-02-06 15:54:50 +01:00
|
|
|
Source: v%{version}.tar.gz
|
2016-10-28 14:56:08 +02:00
|
|
|
Source1: README
|
2018-02-06 15:54:50 +01:00
|
|
|
Source2: cf-cli-rpmlintrc
|
2018-09-06 11:11:55 +02:00
|
|
|
%if 0%{?_test}
|
2018-11-13 13:04:46 +01:00
|
|
|
BuildRequires: %{short_name} = %{version}
|
2018-09-06 11:11:55 +02:00
|
|
|
%else
|
2017-06-09 10:24:45 +02:00
|
|
|
BuildRequires: go >= 1.8.3
|
2016-10-28 14:56:08 +02:00
|
|
|
BuildRequires: golang-packaging
|
|
|
|
BuildRequires: xz
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2017-10-12 13:54:00 +02:00
|
|
|
|
|
|
|
%{go_nostrip}
|
2016-10-28 14:56:08 +02:00
|
|
|
%{go_provides}
|
2018-09-06 11:11:55 +02:00
|
|
|
%endif
|
2016-10-28 14:56:08 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
This is the official command line client for Cloud Foundry.
|
|
|
|
|
|
|
|
%prep
|
2018-09-06 11:11:55 +02:00
|
|
|
%if 0%{?_test}
|
|
|
|
# workaround to prevent post/install failing assuming this file for whatever
|
|
|
|
# reason
|
|
|
|
touch %{_sourcedir}/%{short_name}
|
|
|
|
%else
|
2017-10-12 14:03:15 +02:00
|
|
|
%setup -q -c -n %{name}-%{version}
|
|
|
|
mv */* ./
|
2017-03-21 16:27:25 +01:00
|
|
|
cp %{SOURCE1} ./
|
2018-09-06 11:11:55 +02:00
|
|
|
%endif
|
2016-10-28 14:56:08 +02:00
|
|
|
|
|
|
|
%build
|
2018-09-06 11:11:55 +02:00
|
|
|
%if 0%{?_test}
|
|
|
|
cf --help
|
|
|
|
%else
|
2017-01-18 16:56:46 +01:00
|
|
|
# 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'
|
2016-10-28 14:56:08 +02:00
|
|
|
%goprep %{import_path}
|
|
|
|
%gobuild
|
|
|
|
|
2017-12-11 13:42:12 +01:00
|
|
|
%check
|
|
|
|
echo 'Test if cf can be executed'
|
|
|
|
../go/bin/cli --version
|
2018-11-14 08:59:28 +01:00
|
|
|
%endif
|
2017-12-11 13:42:12 +01:00
|
|
|
|
2016-10-28 14:56:08 +02:00
|
|
|
%install
|
2018-11-13 10:37:45 +01:00
|
|
|
%if 0%{?_test}
|
|
|
|
# disable debug packages in package test to prevent error about missing files
|
|
|
|
%define debug_package %{nil}
|
|
|
|
%else
|
2017-03-22 18:05:23 +01:00
|
|
|
cp ../go/bin/cli %{buildroot}/%{_bindir}/cf
|
2017-03-21 15:24:32 +01:00
|
|
|
install -m 755 -d %{buildroot}/%{_sysconfdir}/bash_completion.d
|
2017-03-22 15:31:00 +01:00
|
|
|
cp ci/installers/completion/cf %{buildroot}/%{_sysconfdir}/bash_completion.d/cf.sh
|
2018-11-13 10:37:45 +01:00
|
|
|
%endif
|
2016-10-28 14:56:08 +02:00
|
|
|
|
|
|
|
%files
|
2018-11-14 08:59:28 +01:00
|
|
|
%if 0%{?_test}
|
|
|
|
%else
|
2016-10-28 14:56:08 +02:00
|
|
|
%defattr(-,root,root,-)
|
2017-03-21 16:23:30 +01:00
|
|
|
%{_bindir}/cf
|
2017-03-22 15:31:00 +01:00
|
|
|
%config %{_sysconfdir}/bash_completion.d/cf.sh
|
2017-06-29 10:20:43 +02:00
|
|
|
%doc LICENSE NOTICE README
|
2018-09-06 11:11:55 +02:00
|
|
|
%endif
|
|
|
|
|
2016-10-28 14:56:08 +02:00
|
|
|
%changelog
|