File djvubind.spec of Package djvubind
#
# spec file for package djvubind
#
# Copyright (c) 2013 SUSE LINUX Products 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/
#
%if 0%{?suse_version} && 0%{?suse_version} < 1210
%define py3_ver %(python3 -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null)
%define python3_sitelib %{_prefix}/lib/python%{py3_ver}/site-packages
%endif
Name: djvubind
Version: 1.2.1
Release: 0
License: GPL-3.0
Summary: Creates DjVu Files with OCR, Metadata and Bookmarks
Url: https://code.google.com/p/djvubind/
Group: Productivity/Graphics/Other
Source0: https://djvubind.googlecode.com/files/%{name}-%{version}.tar.bz2
BuildRequires: python3-devel
Requires: ImageMagick
Requires: djvulibre
Requires: tesseract
Recommends: cuneiform
Recommends: minidjvu
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Djvubind facilitates creating high-quality djvu files, especially
digital versions of scanned books. It functions as a wrapper that
combines the djvulibre tools, minidjvu, and OCR engines to provide
a simple, single command creation of a DjVu file.
%prep
%setup -q
# Remove '/usr/bin/env' from scripts.
sed -i '/\/usr\/bin\/env/d' \
%{name}/{encode.py,organizer.py,utils.py,ocr.py}
sed -i 's/env //' bin/%{name}
%build
%install
python3 setup.py install \
--root=%{buildroot} \
--prefix=%{_prefix}
%files
%defattr(-,root,root,-)
%doc README docs/changelog
%{_bindir}/%{name}
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/config
%doc %{_mandir}/man?/*
%{python3_sitelib}/*
%if 0%{?suse_version} && 0%{?suse_version} < 1210
%dir %{_prefix}/lib/python%{py3_ver}
%dir %{_prefix}/lib/python%{py3_ver}/site-packages
%endif
%changelog