Adrien Devresse 665aa5c
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Adrien Devresse 665aa5c
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
Adrien Devresse 665aa5c
%{!?python_version:  %global python_version  %(%{__python} -c "from sys import version_info; print('%d.%d'% (version_info[0],version_info[1]))")}
Adrien Devresse 665aa5c
Alejandro Alvarez Ayllon b2471c0
Name:           gfal2-util
Alejandro Alvarez Ayllon 5ecbf71
Version:        1.4.0
Alejandro Alvarez Ayllon 5ecbf71
Release:        1%{?dist}
Alejandro Alvarez Ayllon b2471c0
Summary:        GFAL2 utility tools
Alejandro Alvarez Ayllon b2471c0
Group:          Applications/Internet
Alejandro Alvarez Ayllon b2471c0
License:        GPLv3
Alejandro Alvarez Ayllon b2471c0
URL:            http://dmc.web.cern.ch/
Alejandro Alvarez Ayllon 5ecbf71
# git clone https://gitlab.cern.ch/dmc/gfal2-util.git gfal2-util-1.4.0 --depth=1
Alejandro Alvarez Ayllon 5ecbf71
# pushd gfal2-util-1.4.0
Alejandro Alvarez Ayllon 5ecbf71
# git checkout v1.4.0
Alejandro Alvarez Ayllon 7d156e7
# popd
Alejandro Alvarez Ayllon 5ecbf71
# tar czf gfal2-util-1.4.0.tar.gz --exclude-vcs gfal2-util-1.4.0
Alejandro Alvarez Ayllon b2471c0
Source0:        %{name}-%{version}.tar.gz
Alejandro Alvarez Ayllon b2471c0
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Adrien Devresse 665aa5c
Alejandro Alvarez Ayllon b2471c0
BuildArch:      noarch
Adrien Devresse 665aa5c
Alejandro Alvarez Ayllon b2471c0
BuildRequires:  gfal2-core
Alejandro Alvarez Ayllon b2471c0
BuildRequires:  gfal2-python >= 1.8.0
Alejandro Alvarez Ayllon b2471c0
BuildRequires:  gfal2-plugin-file
Alejandro Alvarez Ayllon 7d156e7
Alejandro Alvarez Ayllon b2471c0
Requires:       gfal2-python >= 1.8.0
Adrien Devresse 665aa5c
Alejandro Alvarez Ayllon 5ecbf71
%if %{?fedora}%{!?fedora:0} < 26
Alejandro Alvarez Ayllon b2471c0
BuildRequires:      python-argparse
Alejandro Alvarez Ayllon b2471c0
Requires:       python-argparse
Alejandro Alvarez Ayllon 5ecbf71
%endif
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%description
Adrien Devresse 665aa5c
gfal2-util is a set of basic utility tools for file 
Adrien Devresse 665aa5c
interactions and file copy based on the GFAL 2.0 toolkit.
Adrien Devresse 665aa5c
gfal2-util supports the protocols of GFAL 2.0 : WebDav(s),
Alejandro Alvarez Ayllon c6a7c00
gridFTP, http(s), SRM, xrootd, etc...
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%clean
Adrien Devresse 665aa5c
rm -rf %{buildroot}
Alejandro Alvarez Ayllon c6a7c00
python setup.py clean
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%prep
Adrien Devresse 665aa5c
%setup -q
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%build
Alejandro Alvarez Ayllon 58ffb6b
# Validate the version
Alejandro Alvarez Ayllon 58ffb6b
gfal2_util_ver=`sed -n "s/VERSION = '\(.*\)'/\1/p" src/gfal2_util/base.py`
Alejandro Alvarez Ayllon 58ffb6b
gfal2_util_spec_ver=`expr "%{version}" : '\([0-9]*\\.[0-9]*\\.[0-9]*\)'`
Alejandro Alvarez Ayllon 58ffb6b
if [ "$gfal2_util_ver" != "$gfal2_util_spec_ver" ]; then
Alejandro Alvarez Ayllon 58ffb6b
    echo "The version in the spec file does not match the base.py version!"
Alejandro Alvarez Ayllon 58ffb6b
    echo "%{version} != $gfal2_util_ver"
Alejandro Alvarez Ayllon 58ffb6b
    exit 1
Alejandro Alvarez Ayllon 58ffb6b
fi
Alejandro Alvarez Ayllon 58ffb6b
Alejandro Alvarez Ayllon c6a7c00
python setup.py build
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%install
Adrien Devresse 665aa5c
rm -rf %{buildroot}
Alejandro Alvarez Ayllon c6a7c00
python setup.py install --root=%{buildroot}
Alejandro Alvarez Ayllon c6a7c00
Alejandro Alvarez Ayllon c6a7c00
%check
Alejandro Alvarez Ayllon c6a7c00
python test/functional/test_all.py
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%files
Adrien Devresse 665aa5c
%defattr (-,root,root)
Alejandro Alvarez Ayllon c6a7c00
%{python_sitelib}/gfal2_util*
Adrien Devresse 665aa5c
%{_bindir}/gfal-*
Adrien Devresse 665aa5c
%{_mandir}/man1/*
Adrien Devresse 665aa5c
%doc RELEASE-NOTES VERSION LICENSE
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
Adrien Devresse 665aa5c
%changelog
Alejandro Alvarez Ayllon 5ecbf71
* Tue Sep 27 2016  Alejandro Alvarez <aalvarez at cern.ch> - 1.4.0-1
Alejandro Alvarez Ayllon 5ecbf71
- New upstream release
Alejandro Alvarez Ayllon 5ecbf71
- python-argparse is part of python's stdlib
Alejandro Alvarez Ayllon 5ecbf71
52fd2c2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-2
52fd2c2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
52fd2c2
Alejandro Alvarez Ayllon b2471c0
* Tue Mar 08 2016 Alejandro Alvarez <aalvarez at cern.ch> - 1.3.2-1
Alejandro Alvarez Ayllon b2471c0
- Update for new upstream 1.3.2 release
Alejandro Alvarez Ayllon b2471c0
efd3f25
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
efd3f25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
efd3f25
Alejandro Alvarez Ayllon 58ffb6b
* Mon Nov 09 2015 Alejandro Alvarez <aalvarez at cern.ch> - 1.3.1-1
Alejandro Alvarez Ayllon 58ffb6b
- Update for new upstream 1.3.1 release
Alejandro Alvarez Ayllon 58ffb6b
388807c
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.1-2
388807c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
388807c
Alejandro Alvarez Ayllon 7d156e7
* Fri Apr 17 2015 Alejandro Alvarez <aalvarez at cern.ch> - 1.2.1-1
Alejandro Alvarez Ayllon 7d156e7
- Update for new upstream 1.2.1 release
Alejandro Alvarez Ayllon 7d156e7
Alejandro Alvarez Ayllon 9c90574
* Fri Nov 07 2014 Alejandro Alvarez <aalvarez at cern.ch> - 1.1.0-1
Alejandro Alvarez Ayllon 9c90574
- Update for new upstream 1.1.0 release
Alejandro Alvarez Ayllon 9c90574
Alejandro Alvarez Ayllon c6a7c00
* Wed Jul 02 2014 Alejandro Alvarez <aalvarez at cern.ch> - 1.0.0-1
Alejandro Alvarez Ayllon c6a7c00
- Update for new upstream 1.0.0 release
Alejandro Alvarez Ayllon c6a7c00
- Installation done with distutils
Alejandro Alvarez Ayllon c6a7c00
- Run tests on check stage 
Alejandro Alvarez Ayllon c6a7c00
8ec3168
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.1-2
8ec3168
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8ec3168
Adrien Devresse 665aa5c
* Mon Nov 04 2013 Adrien Devresse <adevress at cern.ch> - 0.2.1-1
Adrien Devresse 665aa5c
 - Initial EPEL compatible version