2018-06-05 10:53:09 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package python-csvkit
|
|
|
|
|
#
|
2022-10-07 07:09:51 +00:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2018-06-05 10:53:09 +00:00
|
|
|
#
|
|
|
|
|
# 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.
|
|
|
|
|
|
2019-02-27 08:42:26 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-06-05 10:53:09 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2020-05-27 14:46:32 +00:00
|
|
|
%define binaries csvclean csvcut csvformat csvgrep csvjoin csvjson csvlook csvpy csvsort csvsql csvstack csvstat in2csv sql2csv
|
2019-12-02 15:57:55 +00:00
|
|
|
%define skip_python2 1
|
2018-06-05 10:53:09 +00:00
|
|
|
Name: python-csvkit
|
2022-10-07 07:09:51 +00:00
|
|
|
Version: 1.0.7
|
2018-06-05 10:53:09 +00:00
|
|
|
Release: 0
|
2018-07-31 14:00:54 +00:00
|
|
|
Summary: A library of utilities for working with CSV
|
2018-06-05 10:53:09 +00:00
|
|
|
License: MIT
|
|
|
|
|
Group: Development/Languages/Python
|
2020-03-26 13:08:57 +00:00
|
|
|
URL: https://github.com/wireservice/csvkit
|
2021-02-28 23:12:49 +00:00
|
|
|
Source0: https://files.pythonhosted.org/packages/source/c/csvkit/csvkit-%{version}.tar.gz
|
|
|
|
|
Source1: https://raw.githubusercontent.com/wireservice/csvkit/5f22e664121b13d9ff005a9206873a8f97431dca/examples/testdbf_converted.csv
|
2018-06-05 10:53:09 +00:00
|
|
|
BuildRequires: %{python_module SQLAlchemy >= 0.9.3}
|
|
|
|
|
BuildRequires: %{python_module Sphinx >= 1.0.7}
|
|
|
|
|
BuildRequires: %{python_module aenum}
|
|
|
|
|
BuildRequires: %{python_module agate >= 1.6.1}
|
|
|
|
|
BuildRequires: %{python_module agate-dbf >= 0.2.0}
|
2018-07-31 14:00:54 +00:00
|
|
|
BuildRequires: %{python_module agate-excel >= 0.2.2}
|
2018-06-05 10:53:09 +00:00
|
|
|
BuildRequires: %{python_module agate-sql >= 0.5.3}
|
|
|
|
|
BuildRequires: %{python_module dbf >= 0.9.3}
|
|
|
|
|
BuildRequires: %{python_module et_xmlfile}
|
|
|
|
|
BuildRequires: %{python_module jdcal}
|
|
|
|
|
BuildRequires: %{python_module openpyxl >= 2.2.0.b1}
|
|
|
|
|
BuildRequires: %{python_module python-dateutil >= 2.2}
|
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: %{python_module six >= 1.6.1}
|
|
|
|
|
BuildRequires: %{python_module xlrd >= 0.9.2}
|
|
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2020-05-27 14:46:32 +00:00
|
|
|
Requires(post): update-alternatives
|
2022-10-07 07:09:51 +00:00
|
|
|
Requires(postun):update-alternatives
|
2018-06-05 10:53:09 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
|
|
%description
|
2018-07-31 14:00:54 +00:00
|
|
|
CSVkit is a library of utilities for working with CSV. It is inspired
|
|
|
|
|
by pdftk, gdal and the original csvcut utility by Joe Germuska and
|
|
|
|
|
Aaron Bycoffe.
|
2018-06-05 10:53:09 +00:00
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n csvkit-%{version}
|
|
|
|
|
# find and remove unneeded shebangs
|
|
|
|
|
find csvkit -name "*.py" | xargs sed -i '1 {/^#!/ d}'
|
2021-02-28 23:12:49 +00:00
|
|
|
# agate-dbf >= 0.2.2 creates uppercase fieldnames for this example file -- gh#wireservice/csvkit#1073
|
|
|
|
|
%if %{pkg_vcmp python3-agate-dbf >= 0.2.2}
|
|
|
|
|
cp %{SOURCE1} examples/testdbf_converted.csv
|
|
|
|
|
%endif
|
2018-06-05 10:53:09 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
2020-05-27 14:46:32 +00:00
|
|
|
for b in %{binaries}; do
|
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$b
|
|
|
|
|
done
|
2019-02-27 08:42:26 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2018-06-05 10:53:09 +00:00
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
export LANG=en_US.UTF-8
|
2020-05-27 14:46:32 +00:00
|
|
|
%python_exec -m unittest discover -s tests/ -v
|
|
|
|
|
|
|
|
|
|
%post
|
2021-02-28 23:12:49 +00:00
|
|
|
%{lua:for b in rpm.expand("%{binaries}"):gmatch("%S+") do
|
2022-10-07 07:09:51 +00:00
|
|
|
print(rpm.expand("%python_install_alternative " .. b .. "\n"))
|
2021-02-28 23:12:49 +00:00
|
|
|
end}
|
2020-05-27 14:46:32 +00:00
|
|
|
|
|
|
|
|
%postun
|
2021-02-28 23:12:49 +00:00
|
|
|
%{lua:for b in rpm.expand("%{binaries}"):gmatch("%S+") do
|
2022-10-07 07:09:51 +00:00
|
|
|
print(rpm.expand("%python_uninstall_alternative " .. b .. "\n"))
|
2021-02-28 23:12:49 +00:00
|
|
|
end}
|
2018-06-05 10:53:09 +00:00
|
|
|
|
2020-05-27 14:46:32 +00:00
|
|
|
%files %{python_files}
|
2018-06-05 10:53:09 +00:00
|
|
|
%license COPYING
|
|
|
|
|
%doc AUTHORS.rst CHANGELOG.rst README.rst
|
2021-02-28 23:12:49 +00:00
|
|
|
%{lua:for b in rpm.expand("%{binaries}"):gmatch("%S+") do
|
2022-10-07 07:09:51 +00:00
|
|
|
print(rpm.expand("%python_alternative %{_bindir}/" .. b .. "\n"))
|
2021-02-28 23:12:49 +00:00
|
|
|
end}
|
|
|
|
|
%{python_sitelib}/csvkit-%{version}*-info
|
2018-06-05 10:53:09 +00:00
|
|
|
%{python_sitelib}/csvkit/
|
|
|
|
|
|
|
|
|
|
%changelog
|