1
0
python-djvulibre/python-djvulibre.spec

95 lines
3.0 KiB
RPMSpec

#
# spec file for package python-djvulibre
#
# Copyright (c) 2015 SUSE LINUX 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/
#
Name: python-djvulibre
Version: 0.6.1
Release: 0
Summary: Python Support for the DjVu Image Format
License: GPL-2.0
Group: Development/Libraries/Python
Url: http://jwilk.net/software/python-djvulibre
Source0: http://pypi.python.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz
Source1: http://pypi.python.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz.asc
Source2: %{name}.keyring
BuildRequires: graphviz
BuildRequires: graphviz-gnome
BuildRequires: pkg-config
BuildRequires: python-Cython >= 0.19
BuildRequires: python-devel >= 2.6
BuildRequires: python-setuptools
BuildRequires: python-Sphinx
BuildRequires: pkgconfig(ddjvuapi) >= 3.5.21
# Required for tests.
BuildRequires: djvulibre
BuildRequires: python-nose
Requires: djvulibre >= 3.5.21
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
python-djvulibre is a set of Python bindings for the DjVuLibre library,
an open source implementation of DjVu.
%package doc
Summary: Python Support for the DjVu Image Format (Documentation)
Group: Documentation/HTML
BuildArch: noarch
%description doc
python-djvulibre is a set of Python bindings for the DjVuLibre library,
an open source implementation of DjVu.
This package contains technical documentation.
%prep
%setup -q
chmod -x examples/*
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
python setup.py build
python setup.py build_sphinx
%install
python setup.py install \
--root=%{buildroot} \
--prefix=%{_prefix}
install -dm 0755 %{buildroot}%{_defaultdocdir}/%{name}-doc/_images/
install -dm 0755 %{buildroot}%{_defaultdocdir}/%{name}-doc/_static/
install -m 0644 build/sphinx/html/{*.html,*.js} \
%{buildroot}%{_defaultdocdir}/%{name}-doc/
install -m 0644 build/sphinx/html/_images/* \
%{buildroot}%{_defaultdocdir}/%{name}-doc/_images/
install -m 0644 build/sphinx/html/_static/* \
%{buildroot}%{_defaultdocdir}/%{name}-doc/_static/
%check
cd tests/
ln -sf %{buildroot}%{python_sitearch}/djvu/ djvu
python -m nose --verbose
%files
%defattr(-,root,root,-)
%doc doc/{changelog,COPYING,credits.txt} examples/
%{python_sitearch}/*
%files doc
%defattr(-,root,root,-)
%doc %{_defaultdocdir}/%{name}-doc/
%changelog