From d26a470ef6556ae649bcdccd40e965a7725231f1c1ba5b2e4a42c96eeb8a7cfe Mon Sep 17 00:00:00 2001 From: Jeff Kowalczyk Date: Wed, 4 May 2022 15:16:25 +0000 Subject: [PATCH] Accepting request 974534 from home:ph03nix * Use build-linux target on x86_64 to include git tag and version (for `gosec -version`) * Add additional build check OBS-URL: https://build.opensuse.org/request/show/974534 OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/gosec?expand=0&rev=5 --- _service | 4 +++- gosec-2.10.0.tar.gz | 3 --- gosec.spec | 12 +++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 gosec-2.10.0.tar.gz diff --git a/_service b/_service index c14c746..579c416 100644 --- a/_service +++ b/_service @@ -12,5 +12,7 @@ *.tar gz - + + gz + diff --git a/gosec-2.10.0.tar.gz b/gosec-2.10.0.tar.gz deleted file mode 100644 index c71c413..0000000 --- a/gosec-2.10.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24b1dfc49d9c1fc24b6d7d5e49ce55e6512e8bbcb1d2391d6b7bc009f7b3ae3d -size 138227 diff --git a/gosec.spec b/gosec.spec index ae9a4f3..dd64da5 100644 --- a/gosec.spec +++ b/gosec.spec @@ -25,22 +25,28 @@ URL: https://github.com/securego/gosec Source: gosec-%{version}.tar.gz Source1: vendor.tar.gz BuildRequires: golang-packaging -BuildRequires: go >= 1.11 +BuildRequires: go >= 1.16 %{go_nostrip} %description -Inspects source code for security problems by scanning the Go AST. +Inspects source code for security problems by scanning the go abstract syntax tree. %prep %autosetup -D -a 1 %build +# Native linux build includes version tags but currently works only on x86_64 +%ifarch x86_64 +GOFLAGS="-buildmode=pie" make build-linux +%else GOFLAGS="-buildmode=pie" make build +%endif %check # check if binary is working ./gosec --version -## this check is not yet working due to missing dependencies +make sec +# Not yet working because it wants to pull the latest ginkgo version from GitHub #make test %install