44# For example, it should have a dash instead of tilde for release candidates.
55%global package_version 2.3.2
66
7- %global go_version 1.24.6
7+ %global go_version 1.24.4
88
99%global oldname vault
1010
@@ -17,12 +17,18 @@ Summary: A tool for securely accessing secrets
1717License: MPL-2.0
1818Source0: https://github.com/opensciencegrid/%{name }-rpm/releases/download/v%{package_version }/%{name }-rpm-%{package_version }.tar.gz
1919Source1: https://github.com/openbao/%{name }/releases/download/v%{package_version }/%{name }-dist-%{package_version }.tar.xz
20- Source2: https://golang.org/dl/go%{ go_version }.src.tar.gz
20+ Patch0: goversion.patch
2121
2222BuildRequires: golang
2323BuildRequires: systemd-rpm-macros
2424URL: https://openbao.org
2525
26+ %if "%{?osg }" != ""
27+ Provides: %{name }-%{oldname }-compat = %{version }-%{release }
28+ Provides: %{oldname } = %{version }-%{release }
29+ Obsoletes: %{oldname } < 2.0
30+ %endif
31+
2632Provides: bundled(golang(cel.dev/expr)) = v0.24.0
2733Provides: bundled(golang(cloud.google.com/go)) = v0.116.0
2834Provides: bundled(golang(cloud.google.com/go/auth)) = v0.14.1
@@ -383,6 +389,7 @@ can access an encrypted Key/Value store and network encryption-as-a-service, or
383389generate AWS IAM/STS credentials, SQL/NoSQL databases, X.509 certificates, SSH
384390credentials, and more.
385391
392+ %if "%{?osg }" == ""
386393%package %{oldname }-compat
387394Summary: Vault-compatible command and service
388395Requires: %{name } = %{version }-%{release }
@@ -392,29 +399,22 @@ Obsoletes: %{oldname} < 2.0
392399%description %{oldname }-compat
393400Provides a compatibility layer on top of OpenBao to emulate a Hashicorp
394401Vault package.
402+ %endif
395403
396404%prep
397405%setup -q -n %{name }-rpm-%{package_version }
398- RPMDIR=` pwd`
406+ RPMDIR=$( pwd)
399407%setup -q -T -b 1 -n %{name }-dist-%{package_version }
400- # put go src inside the above dir
401- %setup -q -D -T -a 2 -c -n %{name }-dist-%{package_version }
408+ %autopatch
402409
403410%build
404411# starts out in %%{name}-dist-%%{package_version} directory
405- cd go/src
406- ./make.bash
407- cd ../..
408- export PATH=$PWD /go/bin:$PATH
412+
409413# this prevents it from complaining that ui assets are too old
410414touch http/web_ui/index.html
411415
412416uname_m= $(uname -m)
413- if [ "$uname_m" = ppc64le ]; then
414- GO_BUILD_MODE= "-buildmode default"
415- else
416- GO_BUILD_MODE= "-buildmode pie"
417- fi
417+ GO_BUILD_MODE= "-buildmode pie"
418418GO_BUILD_GCFLAGS=
419419GO_BUILD_LDFLAGS= "-X github.com/%{name }/%{name }/version.fullVersion= %{version }-%{release }"
420420GO_BUILD_LDFLAGS+= " -X github.com/%{name }/%{name }/version.GitCommit= "
@@ -485,7 +485,9 @@ cp %{name}.conf %{buildroot}%{_sysusersdir}/%{name}.conf
485485%doc README.md
486486%doc CHANGELOG.md
487487
488+ %if "%{?osg }" == ""
488489%files %{oldname }-compat
490+ %endif
489491%{_bindir }/%{oldname }
490492%{_sysconfdir }/%{oldname }.d
491493%{_sharedstatedir }/%{oldname }
0 commit comments