# Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/foxboron/ssh-tpm-agent %global goipath github.com/foxboron/ssh-tpm-agent Version: 0.9.0 # https://github.com/google/go-tpm-tools %global go_tpm_tools_version 0.4.11 %gometa -L -f Name: ssh-tpm-agent Release: %autorelease Summary: :computer: :key: ssh-agent for TPMs # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-only AND MIT URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml # Bring in go-tpm-tools source separately due to it containing # vendored CGO code which is dropped by go-vendor-tools Source3: https://github.com/google/go-tpm-tools/archive/refs/tags/v%{go_tpm_tools_version}.tar.gz BuildRequires: go-vendor-tools BuildRequires: openssl-devel BuildRequires: openssh-clients %description An ssh-agent compatible agent that allows keys to be created by the Trusted Platform Module (TPM) for authentication towards ssh servers. %prep %goprep -p1 tar -xf %{S:1} # Restore C sources dropped by go-vendor-tools tar -xf %{S:3} cp -av go-tpm-tools-%{go_tpm_tools_version}/simulator/ms-tpm-20-ref/. \ vendor/github.com/google/go-tpm-tools/simulator/ms-tpm-20-ref/ # Remove LICENSE files to deal with build failure (our SPDX # entries are already accounted for in the License section) find go-tpm-tools-%{go_tpm_tools_version} -name 'LICENSE' -delete %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on %gobuild -tags noserial -o %{gobuilddir}/bin/ssh-tpm-add %{goipath}/cmd/ssh-tpm-add %gobuild -tags noserial -o %{gobuilddir}/bin/ssh-tpm-agent %{goipath}/cmd/ssh-tpm-agent %gobuild -tags noserial -o %{gobuilddir}/bin/ssh-tpm-hostkeys %{goipath}/cmd/ssh-tpm-hostkeys %gobuild -tags noserial -o %{gobuilddir}/bin/ssh-tpm-keygen %{goipath}/cmd/ssh-tpm-keygen %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %check %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./... %endif %files -f %{go_vendor_license_filelist} %doc README.md %{_bindir}/ssh-tpm-add %{_bindir}/ssh-tpm-agent %{_bindir}/ssh-tpm-hostkeys %{_bindir}/ssh-tpm-keygen %changelog %autochangelog