File gocp.spec of Package gocp

#
# spec file for package gocp
#
# Copyright (c) 2017 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/
#


%{!?python_sitelib:  %global python_sitelib  %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
Name:           gocp
Version:        0.1.3
Release:        0
Summary:        Command Line File Copying Tool
License:        GPL-3.0
Group:          Productivity/File utilities
Url:            http://wiki.goffi.org/wiki/Gcp
Source:         ftp://ftp.goffi.org/gcp/gcp-%{version}.tar.bz2
Source99:       gocp-rpmlintrc
Patch1:         gcp-rename.patch
Patch2:         gcp-no_distribute.patch
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  python-progressbar
Requires:       python-progressbar
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description
gcp (Goffi's CoPier) is a command line file copying tool, loosely inspired by
cp, but with high level functionality like a progress indicator, the ability to
continue copying multiple files even when there is a problem with one of them,
and the use of a journal to track successful copying. File names can be fixed
to ensure compatibility with the target filesystem. If you launch a copy
operation when another is already running, the files are added to the first
queue to avoid hard drive thrashing. You can keep track of files you have
copied, and re-copy them later. gcp is approximately option-compatible with cp.

Note that the package, the command-line application and then man page have been
renamed to %{name} instead of gcp to avoid clashes with the already packaged
gcp package.

%prep
%setup -q -n "gcp-%{version}"
%patch1
%patch2 -p1

%build
python ./setup.py build

%install
python ./setup.py install \
    --prefix="%{_prefix}" \
    --root=%{buildroot}

rm -rf "%{buildroot}%{_datadir}/doc"

mv "%{buildroot}%{_bindir}"/{gcp,gocp}
mv "%{buildroot}%{_mandir}/man1"/{gcp,gocp}.1
for mo in "%{buildroot}%{_datadir}/locale"/*/LC_MESSAGES/gcp.mo; do
    [ -e "$mo" ] || continue
    d="${mo%/*}"
    mv "$mo" "$d/gocp.mo"
done

%find_lang gocp
%fdupes -s %{buildroot}

%check
PATH=%{buildroot}%{_bindir}:$PATH PYTHONPATH=%{buildroot}%{python_sitelib}/ python setup.py test

%files -f gocp.lang
%defattr(-,root,root)
%doc CHANGELOG COPYING README
%{_bindir}/gocp
%{_mandir}/man1/gocp.1*
%{python_sitelib}/gcp-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by