File minio-client.spec of Package minio-client
#
# spec file for package minio-client
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
Name: minio-client
Version: 20240909T075310Z
Release: 0
Summary: Client for MinIO
License: AGPL-3.0-only
URL: https://github.com/minio/mc
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
BuildRequires: go1.22
%description
MinIO Client is a replacement for ls, cp, mkdir, diff and rsync commands for
filesystems and object storage.
Please note: In contrast to upstream this package provides the executable as
`minio-client`.
%prep
%autosetup -p 1 -a 1
%build
COMMIT_HASH="$(sed -n 's/commit: \(.*\)/\1/p' %_sourcedir/%{name}.obsinfo)"
go build \
-mod=vendor \
-buildmode=pie \
-trimpath -tags kqueue \
-ldflags="-X github.com/minio/mc/cmd.Version=%{version} \
-X github.com/minio/mc/cmd.ReleaseTag=${COMMIT_HASH}" \
-o bin/%{name}
%install
# Install the binary.
install -D -m 0755 bin/%{name} %{buildroot}/%{_bindir}/%{name}
%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%changelog