File python-archive-tools.spec of Package python-archive-tools

%bcond_without tests
%global distname archive-tools

%if 0%{?sle_version} >= 150500
%global pythons python311
%else
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%endif

Name:		python-%{distname}
Version:	0.6
Release:	0
Url:		https://github.com/RKrahl/archive-tools
Summary:	Tools for managing archives
License:	Apache-2.0
Group:		Development/Libraries/Python
Source:		%{distname}-%{version}.tar.gz
BuildRequires:	%{python_module base >= 3.6}
BuildRequires:	%{python_module setuptools}
BuildRequires:	fdupes
BuildRequires:	python-rpm-macros
%if %{with tests}
BuildRequires:	%{python_module PyYAML}
%if 0%{?sle_version} >= 150500
BuildRequires:	%{python_module lark}
%else
BuildRequires:	%{python_module lark-parser}
%endif
BuildRequires:	%{python_module distutils-pytest}
BuildRequires:	%{python_module pytest-dependency >= 0.2}
BuildRequires:	%{python_module pytest >= 3.0}
%endif
Requires:	python-PyYAML
%if 0%{?sle_version} >= 150500
Requires:	python-lark
%else
Requires:	python-lark-parser
%endif
Recommends:	python-IMAPClient
Recommends:	python-python-dateutil
BuildArch:	noarch
%python_subpackages

%description
This package provides tools for managing archives.  An archive in
terms of this package is a (compressed) tar archive file with some
embedded metadata on the included files.  This metadata include the
name, file stats, and checksums of the file.

The package provides a command line tool to enable the following
tasks:

+ Create an archive, takes a list of files to include in the archive
  as input.

+ Check the integrity and consistency of an archive.

+ List the contents of the archive.

+ Display details on a file in an archive.

+ Given a list of files as input, list those files that are either not
  in the archive or where the file in the archive differs.

All tasks providing information on an archive take this information
from the embedded metadata.  Retrieving this metadata does not require
reading through the compressed tar archive.


%prep
%setup -q -n %{distname}-%{version}


%build
%python_build


%install
%python_install
for f in `ls %{buildroot}%{_bindir}`
do
    mv %{buildroot}%{_bindir}/$f %{buildroot}%{_bindir}/${f%%.py}
done
%fdupes %{buildroot}%{python_sitelib}


%if %{with tests}
%check
%python_expand $python setup.py test
%endif


%files %{python_files}
%doc README.rst CHANGES.rst
%license LICENSE.txt
%config(noreplace) %{_sysconfdir}/backup.cfg
%{python_sitelib}/*
%{_bindir}/*


%changelog
openSUSE Build Service is sponsored by