2020-09-19 13:12:24 +03:00
|
|
|
%define debug_package %nil
|
|
|
|
%define oname mc
|
2024-07-13 14:05:05 +00:00
|
|
|
%define rel 2024-07-11T18-01-28Z
|
2020-09-19 13:12:24 +03:00
|
|
|
%define ver RELEASE
|
2020-11-26 09:33:55 +03:00
|
|
|
%define commit 060b0762fb17e26829fdcc5b43e42fdc437aeefc
|
2020-09-19 13:12:24 +03:00
|
|
|
%define shortcommit %(c=%{commit}; echo ${c:0:12})
|
2024-06-27 08:09:52 +00:00
|
|
|
%define secscan 1
|
2020-09-19 13:12:24 +03:00
|
|
|
|
|
|
|
Name: minio-client
|
2024-07-13 14:05:05 +00:00
|
|
|
Version: 20240711
|
2020-09-19 13:12:24 +03:00
|
|
|
Release: 1
|
|
|
|
Summary: MinIO client
|
|
|
|
License: ASL 2.0
|
2024-07-13 14:05:05 +00:00
|
|
|
URL: https://min.io
|
2020-09-19 13:12:24 +03:00
|
|
|
Source0: https://github.com/minio/mc/archive/RELEASE.%{rel}/%{oname}-%{ver}.%{rel}.tar.gz
|
|
|
|
Group: Development/Other
|
|
|
|
BuildRequires: golang >= 1.13
|
|
|
|
BuildRequires: git-core
|
|
|
|
BuildRequires: upx
|
|
|
|
|
2024-06-27 08:09:52 +00:00
|
|
|
%if %{secscan}
|
|
|
|
BuildRequires: clamav
|
|
|
|
BuildRequires: trivy
|
|
|
|
%endif
|
|
|
|
|
2020-09-19 13:12:24 +03:00
|
|
|
%description
|
|
|
|
MinIO Client is a replacement for ls, cp, mkdir, diff and
|
|
|
|
rsync commands for filesystems and object storage.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -qn %{oname}-RELEASE.%{rel}
|
|
|
|
|
2024-06-27 08:09:52 +00:00
|
|
|
%if %{secscan}
|
|
|
|
clamscan -ir .
|
|
|
|
trivy fs --scanners vuln --format cosign-vuln .
|
|
|
|
%endif
|
|
|
|
|
2020-09-19 13:12:24 +03:00
|
|
|
%build
|
2024-06-08 19:51:22 +00:00
|
|
|
export GOPROXY=direct
|
2020-09-19 13:12:24 +03:00
|
|
|
#make BUILD_LDFLAGS="-X cmd.Version=RELEASE.%{rel}"
|
|
|
|
GO111MODULE=on CGO_ENABLED=0 go build -trimpath -tags kqueue \
|
|
|
|
-ldflags="-s -w \
|
|
|
|
-X github.com/minio/mc/cmd.Version=%{ver} \
|
|
|
|
-X github.com/minio/mc/cmd.ReleaseTag=%{ver}.%{rel} \
|
|
|
|
-X github.com/minio/mc/cmd.CommitID=%{commit} \
|
|
|
|
-X github.com/minio/mc/cmd.ShortCommitID=%{shortcommit}" \
|
|
|
|
-o bin/%{name}
|
|
|
|
upx bin/%{name}
|
|
|
|
|
|
|
|
%install
|
|
|
|
install -Dm0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
|
|
|
|
%files
|
2024-06-08 21:29:24 +00:00
|
|
|
%doc README.md LICENSE
|
2020-09-19 13:12:24 +03:00
|
|
|
%{_bindir}/%{name}
|
|
|
|
|
2024-06-27 08:09:52 +00:00
|
|
|
%check
|
|
|
|
export GOPROXY=direct
|
|
|
|
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
%if %{secscan}
|
|
|
|
clamscan -ir %{buildroot}
|
|
|
|
%endif
|