File coolreader3-wx.spec of Package coolreader3-qt
#
# spec file for package coolreader3-wx
#
# Copyright (c) 2014 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/
#
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
%define crengine cr3
Name: coolreader3-wx
Version: 3.1.2
Release: 0
License: GPL-2.0+
Summary: E-Book Viewer for Comfort Reading (wxWidgets Based GUI)
Url: http://coolreader.org/e-index.htm
Group: Productivity/Other
Source0: %{crengine}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM coolreader3-3.0.40-desktop.patch lazy.kent@opensuse.org -- correct desktop file
Patch0: coolreader3-3.0.40-desktop.patch
# PATCH-FIX-UPSTREAM coolreader3-3.0.32-gcc_warnings.patch lazy.kent@opensuse.org -- remove gcc warnings
Patch2: coolreader3-3.0.32-gcc_warnings.patch
# PATCH-FIX-OPENSUSE coolreader3-wx-3.0.50-link_fontconfig.patch lazy.kent@opensuse.org -- directly link to libfontconfig
Patch4: coolreader3-wx-3.0.50-link_fontconfig.patch
# PATCH-FIX-UPSTREAM coolreader3-3.1.2-use-recommended-freetype-include.patch lazy.kent@opensuse.org -- use freetype recommended include style
Patch5: coolreader3-3.1.2-use-recommended-freetype-include.patch
BuildRequires: ImageMagick
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libjpeg-devel
BuildRequires: update-desktop-files
BuildRequires: wxWidgets-devel
BuildRequires: xz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Conflicts: coolreader3-qt
%description
Cool Reader is an e-book viewer. Understands a number of text document
formats. Fully customizable palette, text reformatting with any font
size, font antialiasing, extra smooth scrolling and a lot of other
features turn reading into a pleasure.
This is a version with wxWidgets based GUI.
%prep
%setup -qn %{crengine}-%{version}
%patch0
%patch2
%if 0%{?suse_version} >= 1210
%patch4
%patch5 -p1
%endif
rm -f \
cr3wx/src/%{crengine}.desktop cr3qt/src/desktop/%{crengine}.desktop
%build
mkdir build
cd build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
cmake .. \
-DGUI=WX \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_SKIP_RPATH=1 \
-DMAX_IMAGE_SCALE_MUL=2 \
-DDOC_DATA_COMPRESSION_LEVEL=3 \
-DDOC_BUFFER_SIZE=0x1400000
make %{?_smp_mflags} VERBOSE=1
%install
pushd build
%make_install
popd
# Install icons of various sizes.
for size in 64x64 48x48 32x32 22x22 16x16 ; do
install -dm 0755 \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps/
convert -strip -resize ${size} cr3gui/data/desktop/%{crengine}.png \
%{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{crengine}.png
done
install -Dm 644 cr3qt/data/docs/%{crengine}.1 \
%{buildroot}%{_mandir}/man1/%{crengine}.1
%suse_update_desktop_file -i %{crengine}
%post
%desktop_database_post
%icon_theme_cache_post
%postun
%desktop_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root,-)
# FIXME: Check cr3gui/data/manual/cr3-manual-uk.fb2. Don't install now.
# It is a copy of cr3-manual-ru.fb2 (at least in version 3.0.50)
%doc %{crengine}gui/data/manual/%{crengine}-manual-ru.fb2
%doc %{crengine}gui/{AUTHORS,COPYING} changelog
%{_bindir}/%{crengine}
%{_datadir}/%{crengine}/
%{_datadir}/applications/%{crengine}.desktop
%{_datadir}/icons/hicolor/*/*/%{crengine}.*
%doc %{_mandir}/man?/*
%changelog