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
This commit is contained in:
Jeff Kowalczyk 2022-05-04 15:16:25 +00:00 committed by Git OBS Bridge
parent 66481f311e
commit d26a470ef6
3 changed files with 12 additions and 7 deletions

View File

@ -12,5 +12,7 @@
<param name="file">*.tar</param> <param name="file">*.tar</param>
<param name="compression">gz</param> <param name="compression">gz</param>
</service> </service>
<service name="go_modules" mode="disabled"/> <service name="go_modules" mode="disabled">
<param name="compression">gz</param>
</service>
</services> </services>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24b1dfc49d9c1fc24b6d7d5e49ce55e6512e8bbcb1d2391d6b7bc009f7b3ae3d
size 138227

View File

@ -25,22 +25,28 @@ URL: https://github.com/securego/gosec
Source: gosec-%{version}.tar.gz Source: gosec-%{version}.tar.gz
Source1: vendor.tar.gz Source1: vendor.tar.gz
BuildRequires: golang-packaging BuildRequires: golang-packaging
BuildRequires: go >= 1.11 BuildRequires: go >= 1.16
%{go_nostrip} %{go_nostrip}
%description %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 %prep
%autosetup -D -a 1 %autosetup -D -a 1
%build %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 GOFLAGS="-buildmode=pie" make build
%endif
%check %check
# check if binary is working # check if binary is working
./gosec --version ./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 #make test
%install %install