File go.spec of Package go-1.12.6
#
# spec file for SUSE CAP buildpack dependency
#
# 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.
Name: go-1.12.6
Version: 1.12.6
Release: 1
Summary: This is a dependency used in SUSE CAP buildpacks
License: BSD-3-Clause
Group: Cloud/Platform/scf
Url: http://golang.org
Source0: https://storage.googleapis.com/golang/go1.12.6.src.tar.gz
Source1: sources.yml
BuildRequires: go1.4
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# BEGIN shared macros for all dependency packages
BuildRequires: aaa_stack_build_requires
%if 0%{?suse_version} == 1315
%define stack sle12
%else
%define stack sle15
%endif
%define otherdir %{_topdir}/OTHER
%define prefix_path /app/vendor/%{name}
%define destdir /tmp/%{name}
%define dependencydir %{destdir}%{prefix_path}
# END shared macros
%description
%prep
%setup -q -n go/src
%build
export GOROOT_BOOTSTRAP=/usr/lib64/go1.4
export GOBIN=%{_builddir}/go/bin
./make.bash
%install
cp %{SOURCE1} ../../
TARBALL=%{otherdir}/%{name}-linux-amd64.tgz
# The upstream binary-builder is using `cp -r` which has the same effect
# as the --hard-dereference flag here.
# (https://github.com/cloudfoundry/binary-builder/blob/master/lib/archive_recipe.rb#L20)
tar czf ${TARBALL} --hard-dereference -C ../../ go sources.yml --owner=0 --group=0
CHECKSUM=`sha256sum ${TARBALL}`
NEW_TARBALL=%{otherdir}/%{name}-linux-amd64-%{stack}-${CHECKSUM:0:8}.tgz
mv ${TARBALL} ${NEW_TARBALL}
pushd $(dirname ${NEW_TARBALL})
sha256sum $(basename ${NEW_TARBALL}) > ${NEW_TARBALL}.sha256
popd
%files
%defattr(-,root,root)
%changelog