File i18nspector.spec of Package i18nspector

#
# spec file for package i18nspector
#
# Copyright (c) 2021 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           i18nspector
Version:        0.26
Release:        0
Summary:        Tool for Checking gettext POT/PO/MO Files
License:        MIT
Group:          Development/Tools/Other
URL:            https://jwilk.net/software/i18nspector
Source0:        https://github.com/jwilk/i18nspector/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1:        https://github.com/jwilk/i18nspector/releases/download/%{version}/%{name}-%{version}.tar.gz.asc
Source2:        %{name}.keyring
# PATCH-FIX-UPSTREAM Adapted from gh#jwilk/i18nspector/pull/8
Patch0:         switch-to-pytest.patch
BuildRequires:  python3-devel >= 3.4
# Requires for tests.
BuildRequires:  python3-curses
BuildRequires:  python3-polib
BuildRequires:  python3-pytest
BuildRequires:  python3-rply
#
Requires:       python3-polib
Requires:       python3-rply
BuildArch:      noarch
%if 0%{?suse_version} && 0%{?suse_version} < 1230
Requires:       python3 >= 3.4
%endif

%description
i18nspector is a tool for checking translation templates (POT), message
catalogues (PO) and compiled message catalogues (MO) files for common
problems. These files are used by the GNU gettext translation functions
and tools in many different development environments.

Checks include: incorrect or inconsistent character encoding, missing
headers, incorrect language codes and improper plural forms.

%prep
%setup -q
%autopatch -p1

%build

%install
%make_install PREFIX=%{_prefix}

# Python byte compile.
cd %{buildroot}%{_datadir}/%{name}/
%py3_compile .

%check
pytest -v

%files
%license doc/LICENSE
%doc doc/changelog doc/README doc/tags.rst doc/todo
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_mandir}/man?/*

%changelog
openSUSE Build Service is sponsored by