# Generated by go2rpm
%bcond_without check
# https://github.com/cloudflare/cfssl
%global goipath github.com/cloudflare/cfssl
Version: 1.6.0
%gometa
%global common_description %{expand:
CFSSL is CloudFlare's PKI/TLS swiss army knife. It is both a command line tool
and an HTTP API server for signing, verifying, and bundling TLS certificates. It
requires Go 1.11+ to build.}
%global golicenses LICENSE LICENSE-whitelist
%global godocs doc CHANGELOG README.md
Name: %{goname}
Release: %autorelease
Summary: CFSSL: Cloudflare's PKI and TLS toolkit
# Upstream license specification: ISC and BSD-2-Clause
# main package: BSD
# whitelist: ISC
License: ISC and BSD
URL: %{gourl}
Source0: %{gosource}
BuildRequires: golang(github.com/cloudflare/backoff)
BuildRequires: golang(github.com/cloudflare/redoctober/client)
BuildRequires: golang(github.com/cloudflare/redoctober/core)
BuildRequires: golang(github.com/GeertJohan/go.rice)
BuildRequires: golang(github.com/go-sql-driver/mysql)
BuildRequires: golang(github.com/google/certificate-transparency-go)
BuildRequires: golang(github.com/google/certificate-transparency-go/client)
BuildRequires: golang(github.com/google/certificate-transparency-go/jsonclient)
BuildRequires: golang(github.com/google/certificate-transparency-go/tls)
BuildRequires: golang(github.com/google/certificate-transparency-go/x509)
BuildRequires: golang(github.com/jmhodges/clock)
BuildRequires: golang(github.com/jmoiron/sqlx)
BuildRequires: golang(github.com/jmoiron/sqlx/types)
BuildRequires: golang(github.com/kisielk/sqlstruct)
BuildRequires: golang(github.com/kisom/goutils/assert)
BuildRequires: golang(github.com/lib/pq)
BuildRequires: golang(github.com/mattn/go-sqlite3)
BuildRequires: golang(github.com/prometheus/client_golang/prometheus)
BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promauto)
BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp)
BuildRequires: golang(github.com/zmap/zcrypto/x509)
BuildRequires: golang(github.com/zmap/zlint/v3)
BuildRequires: golang(github.com/zmap/zlint/v3/lint)
BuildRequires: golang(golang.org/x/crypto/ed25519)
BuildRequires: golang(golang.org/x/crypto/ocsp)
BuildRequires: golang(golang.org/x/crypto/pkcs12)
BuildRequires: golang(golang.org/x/net/context)
%if %{with check}
# Tests
BuildRequires: golang(github.com/stretchr/testify/require)
%endif
%description
%{common_description}
%gopkg
%prep
%goprep
mv whitelist/LICENSE LICENSE-whitelist
%build
for cmd in cmd/* ; do
%gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done
mv %{gobuilddir}/bin/mkbundle %{gobuilddir}/bin/cfssl-mkbundle
%install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
%if %{with check}
%check
# api/bundle, bundler, revoke: needs network
# signer/remote: https://github.com/cloudflare/cfssl/issues/1200
%gocheck -d api/bundle \
-d bundler \
-d certdb/ocspstapling \
-d helpers \
-d revoke \
-d scan/crypto/tls \
-d signer/local \
-d api/generator \
-d signer/remote
%endif
%files
%license LICENSE LICENSE-whitelist
%doc doc CHANGELOG README.md
%{_bindir}/*
%gopkgfiles
%changelog
%autochangelog