File jade.spec of Package jade
#
# spec file for package jade
#
# Copyright (c) 2020 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
Name: jade
Version: @SERVICE@
Release: 0
Summary: Cross-platform diagram editor
License: GPL-3.0-or-later
Group: Productivity/Publishing/Other
URL: https://github.com/jaallen85/jade
Source: %{name}-%{version}.tar.xz
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: jade-devel-static
BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(zlib)
BuildRequires: quazip-qt5-devel
BuildRequires: shared-mime-info
BuildRequires: update-desktop-files
%description
Jade is a cross-platform diagram editor based on the Qt framework.
%prep
%autosetup
sed -i 's/\(-lquazip\)/\15/' %{name}.pro
%build
export CXXFLAGS="%{optflags} -I%{_includedir}/quazip5"
%qmake5
%make_jobs
%install
#%%qmake5_install
install -Dm 0755 bin/%{name} -t %{buildroot}%{_bindir}/
install -Dm 0644 icons/jade/diagram.png %{buildroot}%{_datadir}/pixmaps/jade.png
%suse_update_desktop_file -c %{name} "Diagram editor" "Cross-platform diagram editor" %{name} %{name} Qt Office FlowChart
cat >> %{buildroot}%{_datadir}/applications/%{name}.desktop <<-EOF
MimeType=application/x-jade-drawing;
EOF
install -dm 0755 %{buildroot}%{_datadir}/mime/packages
cat > %{buildroot}%{_datadir}/mime/packages/%{name}.xml <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-jade-drawing">
<generic-icon name="jade"/>
<comment xml:lang="en">Jade Drawings</comment>
<glob pattern="*.jdm"/>
</mime-type>
</mime-info>
EOF
%files
%doc README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/pixmaps/%{name}.??g
%license LICENSE
%changelog