3 %bcond_with tests # build with tests
4 %bcond_without tests # build without tests
6 Summary: Vault SSH Agent is used to enable one time keys and passwords
12 Source0: https://github.com/hashicorp/vault-ssh-helper/archive/v%{version}/%{name}-%{version}.tar.gz
13 # Source0-md5: d81009708ddf16d4aa9cd2e51f352ac8
14 URL: https://github.com/hashicorp/vault-ssh-helper
16 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18 %define _enable_debug_packages 0
19 %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
20 %define gopath %{_libdir}/golang
21 %define import_path github.com/hashicorp/vault-ssh-helper
24 Vault SSH Agent is a counterpart to Vault's SSH backend. It enables
25 creation of One-Time-Passwords (OTP) by Vault servers. OTPs will be
26 used as client authentication credentials while establishing SSH
27 connections with remote hosts.
32 mkdir -p src/github.com/hashicorp
33 ln -s ../../../ src/github.com/hashicorp/vault-ssh-helper
36 export GOPATH=$(pwd):%{gopath}
37 %gobuild -o bin/%{name} %{import_path}
40 rm -rf $RPM_BUILD_ROOT
41 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/%{name}.d,%{_bindir}}
42 install -p bin/%{name} $RPM_BUILD_ROOT%{_bindir}
43 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.d/config.hcl
46 rm -rf $RPM_BUILD_ROOT
49 %defattr(644,root,root,755)
50 %doc README.md LICENSE
51 %attr(755,root,root) %{_bindir}/%{name}
52 %config(noreplace) %{_sysconfdir}/%{name}.d/config.hcl