File plantumlqeditor.spec of Package plantumleditor
#
# spec file for package plantumleditor
#
# Copyright (c) 2018, Martin Hauke <mardnh@gmx.de>
#
# 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: plantumlqeditor
Version: 1.2.0.+git.20170403
Release: 0
Summary: Simple editor for PlantUML
License: GPL-3.0-or-later
Group: Productivity/Publishing/Other
URL: https://sourceforge.net/projects/plantumlqeditor/
Source: %{name}-%{version}.tar.xz
#Patch0: plantumlqeditor-use-system-wide-qtsingleapplication-library.patch
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libqt5-linguist
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Widgets)
Requires: graphviz
Requires: plantuml
Requires(post): hicolor-icon-theme
Requires(post): update-desktop-files
Requires(postun): hicolor-icon-theme
Requires(postun): update-desktop-files
%description
PlantUML QEditor is a simple editor written in Qt5 for PlantUML.
At a glance:
- simple PlantUML editor, with a preview,
- update the diagram while editing,
- code assistant to insert ready-made code snippets,
- written in Qt5, so it should run on all platforms supported by Qt5 and
PlantUML.
The editor is quite simple: it monitors the editor for changes, and, if any,
runs plantuml to regenerate the image.
The editor also supports an assistant that allows easy insertion of code
snippets into the editor. The assistant is defined by a simple XML and a bunch
of icons, one for each snippet.
%prep
%setup -q
# FIXME: unbundle /qtsingleapplication
#%%patch0 -p1
# remove bundled qtsingleapplication library sources
#rm -rf thirdparty/qtsingleapplication
# Set the default configuration values
# so it's ready to use without any extra configuration steps
sed -i "s#%{_bindir}/plantuml#%{_javadir}/plantuml.jar#g" settingsconstants.h
sed -i "s#\(reloadAssistantXml(settings.value(SETTINGS_ASSISTANT_XML_PATH\)\().toString());\)#\1, QVariant(\"%{_datadir}/%{name}/assistant.xml\")\2#g" mainwindow.cpp
sed -i "s#\"translations\"#\"%{_datadir}/%{name}/translations\"#g" main.cpp
%build
%qmake5
%make_jobs
lrelease-qt5 translations/*.ts
%install
install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name}
install -Dpm 0644 assistant.xml %{buildroot}%{_datadir}/%{name}/assistant.xml
cp -ar icons %{buildroot}%{_datadir}/%{name}/
install -p -m 0644 -D icon.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
install -p -m 0644 -D plantumlqeditor-mime.xml %{buildroot}%{_datadir}/mime/packages/%{name}.xml
mkdir -p %{buildroot}%{_datadir}/%{name}/translations/
cp -a translations/*.qm %{buildroot}%{_datadir}/%{name}/translations/
%find_lang %{name} --with-qt --without-mo
install -p -m 0644 -D %{name}.appdata.xml %{buildroot}/%{_datadir}/appdata/%{name}.appdata.xml
%suse_update_desktop_file -c %{name} %{name} "Editor for PlantUML" %{name} %{name} Development Documentation
%if 0%{?suse_version} < 1330
%post
%desktop_database_post
%postun
%desktop_database_postun
%endif
%files
%license COPYING
%doc README.* AUTHORS.md
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}/assistant.xml
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/appdata/%{name}.appdata.xml
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/icons
%{_datadir}/%{name}/icons/*
%dir %{_datadir}/%{name}/translations
%{_datadir}/%{name}/translations/*.qm
%changelog