File rclone.spec of Package rclone

#
# spec file for package rclone
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
# nodebuginfo

%define import_path github.com/ncw/rclone

Name:           rclone
Version:        1.39
Release:        0
Summary:        Rsync for cloud storage
License:        MIT
Group:          Productivity/Networking/Web/Utilities
Url:            https://rclone.org/
Source:         %{name}-%{version}.tar.xz
BuildRequires:  golang(API) >= 1.6
BuildRequires:  fdupes

%description
rsync for cloud storage. rclone is a command line program to sync files and
directories to and from a wide variety of cloud storage providers, providing
various additional features.

%prep
%setup -q

%build
# Set up GOPATH.
export GOPATH="$GOPATH:$HOME/go"
mkdir -p $HOME/go/src/%{import_path}
cp -rT $PWD $HOME/go/src/%{import_path}
# Build.
go build -buildmode=pie -o %{name} \
         -ldflags "-s -X github.com/ncw/rclone/fs.Version=v%{version}" \
		 %{import_path}

%install
install -m0755 -D %{name} %{buildroot}%{_bindir}/%{name}
install -m0644 -D %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%fdupes %{buildroot}

%files
%defattr(-,root,root,-)
%doc docs/ COPYING MANUAL.md README.md RELEASE.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%changelog
openSUSE Build Service is sponsored by