minio-client/minio-client.spec
Your Name a609614b95
All checks were successful
Run CI/CD... / main (push) Successful in 11m5s
20250215
2025-02-20 11:13:27 +00:00

65 lines
No EOL
1.6 KiB
RPMSpec

%define debug_package %nil
%define oname mc
%define rel 2025-02-15T10-36-16Z
%define ver RELEASE
%define commit 060b0762fb17e26829fdcc5b43e42fdc437aeefc
%define shortcommit %(c=%{commit}; echo ${c:0:12})
%define secscan 0
Name: minio-client
Version: 20250215
Release: 1
Summary: MinIO client
License: ASL 2.0
URL: https://min.io
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
BuildRequires: pkgconfig(openssl3.3)
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
%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}
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
%build
export GOPROXY=https://proxy.golang.org/cached-only
#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
%doc README.md LICENSE
%{_bindir}/%{name}
%check
export GOPROXY=https://proxy.golang.org/cached-only
go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif