%global debug_package %{nil} %define _build_id_links none %global package_version 2.7.0 Name: openbao Version: 2.7.0 Release: %autorelease Summary: A tool for securely accessing secrets License: MPL-2.0 AND (BSD-3-Clause OR MIT) AND (MIT OR Apache-2.0) AND (MIT OR CC0-1.0) AND (MPL-2.0 OR Apache-2.0) AND 0BSD AND Apache-2.0 AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BlueOak-1.0.0 AND CC-BY-4.0 AND CC0-1.0 AND ISC AND MIT AND UPL-1.0 AND Unicode-DFS-2016 AND Unlicense AND Zlib URL: https://openbao.org Source0: https://github.com/openbao/%{name}/releases/download/v%{package_version}/%{name}-dist-v%{package_version}.tar.xz Source1: https://github.com/openbao/%{name}-fedora/releases/download/v%{package_version}/%{name}-fedora-%{package_version}.tar.gz BuildRequires: golang-bin BuildRequires: go-rpm-macros %description Openbao secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing. Openbao handles leasing, key revocation, key rolling, and auditing. Through a unified API, users can access an encrypted Key/Value store and network encryption-as-a-service, or generate AWS IAM/STS credentials, SQL/NoSQL databases, X.509 certificates, SSH credentials, and more. %prep %setup -q -T -b 1 -n %{name}-fedora-%{package_version} %setup -q -n %{name}-dist-v%{package_version} %build mkdir -p http/web_ui touch http/web_ui/index.html GO_BUILDTAGS="ui hsm" GO_LDFLAGS="-X github.com/%{name}/%{name}/version.fullVersion=%{version}-%{release}" GO_LDFLAGS+=" -X github.com/%{name}/%{name}/version.GitCommit=" BUILD_DATE="$(date -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d)" GO_LDFLAGS+=" -X github.com/%{name}/%{name}/version.BuildDate=${BUILD_DATE}" %if "%{?go_debug}" != "" # add debugging & testing flags GO_LDFLAGS+=" -X github.com/%{name}/%{name}/version.VersionMetadata=testonly" # openbao documentation says testonly should not be used for production builds GO_BUILDTAGS+=" testonly" %global gobuildflags %{gobuildflags} -gcflags "all=-N -l" %endif # The gobuild macro defaults to not use go modules. Enable go modules # because it is allowed and is the simplest option. %global gomodulesmode GO111MODULE=on %gobuild -o bin/bao %install # starts out in %%{name}-dist-v%%{package_version} directory mkdir -p %{buildroot}%{_bindir}/ cp -p bin/bao %{buildroot}%{_bindir}/ %files %{_bindir}/bao %changelog %autochangelog