From 8d56dc14d0fe7b568fc00f0be6a1aada50b63927 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 5 Jul 2023 14:59:32 -0400 Subject: [PATCH] Use vendored dependencies in RHEL builds RHEL does not include packages for Go module dependencies. --- golang-github-cpuguy83-md2man.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/golang-github-cpuguy83-md2man.spec b/golang-github-cpuguy83-md2man.spec index c3c33ab..deb4f21 100644 --- a/golang-github-cpuguy83-md2man.spec +++ b/golang-github-cpuguy83-md2man.spec @@ -30,10 +30,16 @@ Provides: go-md2man = %{version}-%{release} %gopkg %prep +%if %{defined rhel} +%goprep -k +# unpack vendored dependencies to GOPATH +tar c -C vendor/ . | tar x -C %{gobuilddir}/src +%else %goprep %generate_buildrequires %go_generate_buildrequires +%endif %build %gobuild -o %{gobuilddir}/bin/go-md2man %{goipath} @@ -52,7 +58,7 @@ install -Dpm 0644 go-md2man.1 -t %{buildroot}%{_mandir}/man1/ %endif %files -%license LICENSE.md +%license LICENSE.md %{?rhel:vendor/modules.txt} %doc go-md2man.1.md README.md %{_bindir}/* %{_mandir}/man1/go-md2man.1*