python-tqdm/python-tqdm.spec

93 lines
2.8 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-tqdm
#
# 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/
#
Name: python-tqdm
Version: 4.11.2
Release: 0
Summary: A Fast, Extensible Progress Meter
License: MIT
Group: Development/Languages/Python
Url: https://github.com/tqdm/tqdm
Source: https://files.pythonhosted.org/packages/source/t/tqdm/tqdm-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-docopt
BuildRequires: python-setuptools
# Test requirements
BuildRequires: python-coverage
BuildRequires: python-Cython
BuildRequires: python-flake8
BuildRequires: python-mccabe
BuildRequires: python-nose
BuildRequires: python-numpy-devel
BuildRequires: python-pandas
Requires: python-docopt
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
Instantly make your loops show a smart progress meter - just wrap any
iterable with "tqdm(iterable)", and you're done!
%prep
%setup -q -n tqdm-%{version}
if [ -e LICENCE ] ; then mv LICENCE LICENSE; fi
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in tqdm ; do
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
# create a dummy target for /etc/alternatives/$p
touch %{buildroot}%{_sysconfdir}/alternatives/$p
done
%post
"%_sbindir/update-alternatives" \
--install %{_bindir}/tqdm tqdm %{_bindir}/tqdm-%{py_ver} 30
%postun
if [ $1 -eq 0 ] ; then
"%_sbindir/update-alternatives" --remove tqdm %{_bindir}/tqdm-%{py_ver}
fi
%check
nosetests --ignore-files="tests_perf\.py"
%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{python_sitelib}/*
%{_bindir}/tqdm
%{_bindir}/tqdm-%{py_ver}
%ghost %{_sysconfdir}/alternatives/tqdm
%changelog