A new user interface for you! Read more...

File xchm.spec of Package xchm

#
# spec file for package xchm
#
# Copyright (c) 2018 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:           xchm
Version:        1.23
Release:        0
Summary:        CHM Viewer for UNIX
License:        GPL-2.0-or-later
Group:          Productivity/Office/Other
URL:            http://xchm.sourceforge.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Source2:        %{name}.1
# PATCH-FIX-UPSTREAM xchm-1.23-russian.patch lazy.kent@opensuse.org -- update and correct Russian translation
Patch0:         xchm-1.23-russian.patch
# PATCH-FIX-UPSTREAM xchm-wx3.0-compat.patch olly@survex.com -- compile with wxWidgets 3.0
Patch1:         xchm-wx3.0-compat.patch
BuildRequires:  chmlib-devel
BuildRequires:  gcc-c++
BuildRequires:  hicolor-icon-theme
BuildRequires:  icoutils
BuildRequires:  update-desktop-files
BuildRequires:  wxWidgets-3_0-devel
Recommends:     %{name}-lang

%description
xCHM is a cross-platform GUI front-end to chmlib, with borrowed bits
from Pabs' chmdeco project.
xCHM can show the content tree if one is available, print pages, change
font face and size, remember bookmarks, display a searchable index, and
search for words in the current page and the whole book.

%lang_package

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
%configure
# Update compiled locales.
pushd po
make update-gmo
popd
make %{?_smp_mflags}

%install
%make_install
# Install man page.
install -Dm 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1
# Extract and install icons.
pushd rc
icotool -x xchm.ico
install -Dm 0644 xchm_1_16x16x8.png \
    %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
install -Dm 0644 xchm_2_32x32x8.png \
    %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -Dm 0644 xchm_3_48x48x8.png \
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
install -Dm 0644 xchm_4_128x128x8.png \
    %{buildroot}%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
rm -rf %{buildroot}%{_datadir}/pixmaps
popd
%find_lang %{name}
%suse_update_desktop_file -i %{name}

%post
%desktop_database_post
%icon_theme_cache_post

%postun
%desktop_database_postun
%icon_theme_cache_postun

%files
%license COPYING
%doc AUTHORS ChangeLog README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*
%{_mandir}/man?/*

%files lang -f %{name}.lang

%changelog