minio-client/minio-client.spec

44 lines
1.3 KiB
RPMSpec

%define debug_package %nil
%define oname mc
%define rel 2020-09-23T20-02-13Z
%define ver RELEASE
%define commit db1b508d8b418ef67617a9770b0d0020de427f88
%define shortcommit %(c=%{commit}; echo ${c:0:12})
Name: minio-client
Version: 20200923
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
%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}
%build
#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 docs
%{_bindir}/%{name}