File aws-vault.spec of Package aws-vault
#
# Copyright (c) 2020, Duarte Pousa pousaduarte@gmail.com
#
# 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/
#
%global provider github
%global provider_tld com
%global project 99designs
%global repo aws-vault
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider_prefix}
%global debug_package %{nil}
Name: aws-vault
Version: 7.2.0
Release: 0
License: MIT
Summary: A vault for securely storing and accessing AWS credentials
Group: System/Management
Url: https://github.com/99designs/aws-vault
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: go >= 1.12
BuildRequires: go-md2man
BuildRequires: fdupes
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
AWS Vault is a tool to securely store and access AWS credentials in a development environment.
AWS Vault stores IAM credentials in your operating system's secure keystore and then generates temporary credentials from those to expose to your shell and applications. It's designed to be complementary to the AWS CLI tools, and is aware of your profiles and configuration in ~/.aws/config.
%prep
%setup -q
%setup -q T -D -a 1
find . -iname "vendor" -type d
%build
export VERSION=%{version}
export COMMIT=%{commit}
export CGO_ENABLED=0
go build \
-mod=vendor \
-buildmode=pie \
-ldflags "-s -w -X main.gitCommit=$COMMIT -X main.Version=$VERSION" \
-o %{name} ;
%install
# Install the binary.
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
# Install the bash shell completion
install -D -m 755 contrib/completions/bash/%{name}.bash %{buildroot}/%{_datadir}/bash-completion/completions/%{name}
# Build the man pages.
go-md2man -in USAGE.md -out %{name}.1
# Install the man pages.
mkdir -p "%{buildroot}/%{_mandir}/man1"
install -D -m 0644 %{name}.1 "%{buildroot}/%{_mandir}/man1"
#hardlink duplicated files
%fdupes %{buildroot}
%files
%defattr(-,root,root)
%doc README.md
%if 0%{?suse_version} < 1500
%doc LICENSE
%else
%license LICENSE
%endif
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*.1.gz
%{_datadir}/bash-completion/completions/%{name}
%changelog