bceae89
%global srcname paperwork
bceae89
bceae89
Name:           %{srcname}
f1e3100
Version:        2.1.2
67b9b4a
Release:        %autorelease
bceae89
Summary:        Using scanner and OCR to grep dead trees the easy way
bceae89
f1e3100
License:        GPL-3.0-or-later
72dc027
URL:            https://gitlab.gnome.org/World/OpenPaperwork/paperwork
f1e3100
Source0:        %pypi_source %{srcname}
cdb20f2
Patch0001:      0001-Drop-extra-icon-dirs.patch
fde9596
# python-Levenshtein changed to just Levenshtein. There isn't an upstream
fde9596
# patch because upstream has decided to drop the dependency
fde9596
# https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/commit/9072eea40e09b337939ed3c98b642df203752e9e
fde9596
Patch0002:      0002-fix-levenshtein.patch
bceae89
bceae89
BuildArch:      noarch
bceae89
a198437
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
a198437
ExcludeArch: %{ix86}
a198437
bceae89
BuildRequires:  desktop-file-utils
bceae89
BuildRequires:  libappstream-glib
bceae89
BuildRequires:  python3-devel
bceae89
bceae89
Requires:       hicolor-icon-theme
bceae89
Requires:       python3-%{srcname} = %{version}-%{release}
bceae89
bceae89
%global _description %{expand: \
72dc027
Paperwork is a tool to make papers searchable.
bceae89
72dc027
The basic idea behind Paperwork is "scan & forget": You should be able to just
72dc027
scan a new document and forget about it until the day you need it again.
bceae89
72dc027
Let the machine do most of the work.
bceae89
}
bceae89
bceae89
%description %{_description}
bceae89
bceae89
bceae89
%package -n     python3-%{srcname}
bceae89
Summary:        %{summary}
9348aae
bceae89
BuildRequires:  python3-gobject
bceae89
BuildRequires:  libnotify
bceae89
BuildRequires:  /usr/bin/xvfb-run
bceae89
9cc4039
# Fallback to old orientation heuristic just freezes, so ensure this is
9cc4039
# available.
9cc4039
Requires:       tesseract-osd
cdb20f2
Requires:       libinsane-gobject
9cc4039
bceae89
%description -n python3-%{srcname} %{_description}
bceae89
bceae89
%prep
bceae89
%autosetup -n %{srcname}-%{version} -p2
bceae89
9348aae
%generate_buildrequires
9348aae
%pyproject_buildrequires -r
bceae89
bceae89
%build
9348aae
%pyproject_wheel
bceae89
bceae89
bceae89
%install
9348aae
%pyproject_install
bceae89
bceae89
PYTHONPATH=%{buildroot}%{python3_sitelib} \
72dc027
    xvfb-run -a \
72dc027
        python3 -m paperwork_gtk.main install \
72dc027
            --data_base_dir %{buildroot}%{_datadir} \
72dc027
            --icon_base_dir %{buildroot}%{_datadir}/icons
bceae89
9348aae
%pyproject_save_files paperwork_gtk
bceae89
bceae89
%check
72dc027
export PATH=%{buildroot}%{_bindir}:$PATH PYTHONPATH=%{buildroot}%{python3_sitelib}
bceae89
bceae89
desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
bceae89
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.appdata.xml
bceae89
72dc027
xvfb-run -a paperwork-gtk chkdeps
72dc027
xvfb-run -a %{python3} -m unittest discover --verbose -s tests
72dc027
bceae89
%files
72dc027
%{_bindir}/paperwork-gtk
bceae89
%{_datadir}/applications/*.desktop
bceae89
%{_datadir}/icons/hicolor/*/apps/*
bceae89
%{_metainfodir}/*.appdata.xml
bceae89
9348aae
%files -n python3-%{srcname} -f %{pyproject_files}
bceae89
%doc README.markdown
bceae89
bceae89
%changelog
67b9b4a
%autochangelog