File highlight.spec of Package highlight

# spec file for package highlight
# 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

Name:           highlight
Version:        3.42
Release:        0
Summary:        Universal Source Code to Formatted Text Converter
License:        GPL-3.0+
Group:          Development/Tools/Other
Source99:       highlight.keyring
# PATCH-FIX-OPENSUSE highlight-3.41-fix-doc-dir.patch
Patch0:         highlight-3.41-fix-doc-dir.patch
# PATCH-FIX-OPENSUSE highlight-3.42-use_optflags.patch
Patch1:         highlight-3.42-use_optflags.patch
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
BuildRequires:  boost-devel
BuildRequires:  dos2unix
BuildRequires:  gcc-c++
BuildRequires:  lua-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

A utility that converts sourcecode to HTML, XHTML, RTF, LaTeX, TeX, XML or ANSI
escape sequences with syntax highlighting.
It supports several programming and markup languages.
Language descriptions are configurable and support regular expressions.
The utility offers indentation and reformatting capabilities.
It is easily possible to create new language definitions and colour themes.

%package gui
Summary:        Graphical Interface for %{name}
Group:          Development/Tools/Other
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  update-desktop-files
%if 0%{suse_version} < 1330
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
Requires:       %{name} = %{version}

%description gui
This package provides graphical interface for %{name}.

%package gui-lang
Summary:        Translations for %{name}-gui
Group:          System/Localization
Requires:       %{name}-gui = %{version}
Provides:       %{name}-gui-lang-all = %{version}
Supplements:    packageand(bundle-lang-other:%{name}-gui)
Provides:       %{name}-gui-lang-all = %{version}
BuildArch:      noarch

%description gui-lang
This package provides translations for %{name}-gui.

%setup -q
%patch0 -p1
dos2unix extras/pandoc/*

make OPTFLAGS="%{optflags}" %{?_smp_mflags}
make gui OPTFLAGS="%{optflags}" %{?_smp_mflags}

%makeinstall install-gui
%suse_update_desktop_file -G "Text converter" -r %{name} Utility TextEditor
%find_lang %{name} --with-qt

%if 0%{suse_version} < 1330
%post gui

%postun gui

%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/*
%dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/filetypes.conf
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/langDefs
%dir %{_datadir}/%{name}/plugins
%dir %{_datadir}/%{name}/themes
%exclude %{_docdir}/%{name}/INSTALL

%files gui
%dir %{_datadir}/%{name}/gui_files
%dir %{_datadir}/%{name}/gui_files/ext

%files gui-lang -f %{name}.lang
%dir %{_datadir}/%{name}/gui_files/l10n