File golang-github-hashicorp-packer.spec of Package golang-github-hashicorp-packer
#
# spec file for package golang-github-hashicorp-packer
#
# Copyright (c) 2019 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 __arch_install_post export NO_BRP_STRIP_DEBUG=true
%global provider github
%global provider_tld com
%global project hashicorp
%global repo packer
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
Name: golang-%{provider}-%{project}-%{repo}
Version: 1.7.10
Release: 0
Summary: A tool for creating machine images for multiple platforms
License: MPL-2.0
Group: Development/Languages/Other
Url: https://github.com/hashicorp/packer
Source0: packer-%{version}.tar.gz
Source1: vendor.tar.gz
# PATCH-FIX-OPENSUSE 0001-Turn-telemetry-off-unconditionally.patch
# disables telemetry in packer, which is opt-out by default
Patch0: 0001-Turn-telemetry-off-unconditionally.patch
BuildRequires: go >= 1.13
%description
A tool for creating identical machine images for multiple platforms from a
single source configuration.
%prep
%setup -q -n %{repo}-%{version}
%setup -q -T -D -a 1 -n %{repo}-%{version}
%patch0 -p1
%build -n %{repo}-%{version}
go build \
-mod=vendor \
-ldflags="-X main.Version=%{version}" \
-o bin/packer
%install
# Install the binary.
# Avoid filename clash with cracklib
install -D -m 0755 ./bin/packer "%{buildroot}/%{_bindir}/packer-go"
%files
# /usr/share/licenses is not owned by any package on SLE 12 SP2 and older
%if 0%{?sle_version} <= 120200 && !0%{?is_opensuse}
%doc LICENSE
%else
%license LICENSE
%endif
%doc README.md CHANGELOG.md
%_bindir/packer-go
%changelog