File labplot-kf5.spec of Package labplot-kf5

#
# spec file for package labplot-kf5
#
# Copyright (c) 2016 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:           labplot-kf5
Version:        2.3.0
Release:        0
Summary:        KDE Framework 5 data analysis and visualization application
License:        GPL-2.0+
Group:          Productivity/Scientific/Other
Url:            https://edu.kde.org/applications/science/labplot/
Source:         http://download.kde.org/stable/labplot/%{version}/labplot-%{version}-kf5.tar.xz
# PATCH-FIX-UPSTREAM fix-desktop-file.patch -- fix the Exec line in the .desktop file so labplot can be started from the application menu
Patch:          fix-desktop-file.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  cantor-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  fdupes
BuildRequires:  hdf5-devel
BuildRequires:  hicolor-icon-theme
BuildRequires:  kf5-filesystem
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5Archive)
BuildRequires:  cmake(KF5I18n)
BuildRequires:  cmake(KF5KDE4Support)
BuildRequires:  cmake(KF5KIO)
BuildRequires:  cmake(KF5WidgetsAddons)
BuildRequires:  cmake(KF5XmlGui)
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Svg)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  pkgconfig(gsl)
BuildRequires:  pkgconfig(libpng)
BuildRequires:  pkgconfig(muparser)
BuildRequires:  pkgconfig(netcdf)
BuildRequires:  pkgconfig(shared-mime-info)
BuildRequires:  pkgconfig(zlib)
Provides:       labplot = %{version}
Obsoletes:      labplot < 2.3.0

%lang_package

%description
LabPlot is a KDE application for interactive graphing and analysis
of scientific data. LabPlot provides an easy way to create, manage
and edit plots. It allows you to produce plots based on data from a
spreadsheet or on data imported from external files. Plots can be
exported to several pixmap and vector graphic formats.

This version is based on KDE Frameworks 5

%prep
%setup -q -n labplot-%{version}-kf5
%patch -p1

%build
%cmake_kf5 -d build
%make_jobs

%install
pushd build
%kf5_makeinstall
popd

# appstream-builder vetoes application unless appdata.xml file and .desktop file have matching names
# appdata.xml file references "org.kde.labplot2.desktop" but .desktop file installed as labplot2.desktop
mv %{buildroot}%{_kf5_applicationsdir}/labplot2.desktop %{buildroot}%{_kf5_applicationsdir}/org.kde.labplot2.desktop
mv %{buildroot}%{_kf5_sharedir}/appdata/org.kde.labplot.appdata.xml %{buildroot}%{_kf5_sharedir}/appdata/org.kde.labplot2.appdata.xml

%find_lang labplot2 %{?no_lang_C}

%fdupes -s %{buildroot}

%kf5_post_install

%post
%desktop_database_post
%icon_theme_cache_post
%mime_database_post

%postun
%desktop_database_postun
%icon_theme_cache_postun
%mime_database_postun

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING README
%{_kf5_bindir}/labplot2
%{_kf5_appsdir}/labplot2/
%{_kf5_applicationsdir}/org.kde.labplot2.desktop
%dir %{_kf5_iconsdir}/hicolor/512x512/
%dir %{_kf5_iconsdir}/hicolor/512x512/apps/
%{_kf5_iconsdir}/hicolor/scalable/apps/labplot-*
%{_kf5_iconsdir}/hicolor/*/apps/labplot2.*
%{_kf5_kxmlguidir}/labplot2/
%{_kf5_sharedir}/mime/packages/labplot2.xml
%dir %{_kf5_sharedir}/appdata/
%{_kf5_sharedir}/appdata/org.kde.labplot2.appdata.xml
%{_kf5_htmldir}/en/labplot2/

%files lang -f labplot2.lang
%defattr(-,root,root,-)
%{_kf5_htmldir}/*/labplot2/
%{_kf5_htmldir}/pt_BR/
## These belong in the main package
%exclude %{_kf5_htmldir}/en/labplot2/

%changelog
openSUSE Build Service is sponsored by