File marble.spec of Package marble

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

%bcond_without lang

%define _so -27
%define _so_astro 1
Name:           marble
Version:        17.04.2
Release:        0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 16.08 in KA, but 16.11.80 in KUA)
%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
Summary:        Generic map viewer
# License note: the tools directory contains GPL-3 tools, but they are neither built nor installed by the package
License:        LGPL-2.1+
Group:          Amusements/Teaching/Other
Url:            http://edu.kde.org
Source0:        marble-%{version}.tar.xz
# PATCH-FIX-UPSTREAM Add-fallback-InputHandler.patch boo#1044747, kde#381872 -- fix crash when opening the "Edit Bookmark" dialog if you set the View Angle to UTM
Patch1:         Add-fallback-InputHandler.patch
# PATCH-FIX-UPSTREAM Fix-plain-map-and-political-map-showing-no-content.patch kde#379297 -- fix display of the plain map and the political map
Patch2:         Fix-plain-map-and-political-map-showing-no-content.patch
BuildRequires:  extra-cmake-modules
BuildRequires:  fdupes
BuildRequires:  gpsd-devel
BuildRequires:  kconfig-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  kcrash-devel
BuildRequires:  kdoctools-devel
BuildRequires:  kf5-filesystem
BuildRequires:  ki18n-devel
BuildRequires:  knewstuff-devel
BuildRequires:  kparts-devel
BuildRequires:  krunner-devel
BuildRequires:  kservice-devel
BuildRequires:  kwallet-devel
BuildRequires:  libqt5-qtlocation-devel
BuildRequires:  libquazip-qt5-devel
BuildRequires:  perl
BuildRequires:  phonon4qt5-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Concurrent) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Core) >= 5.2.0
BuildRequires:  pkgconfig(Qt5DBus) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Designer) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Network) >= 5.2.0
BuildRequires:  pkgconfig(Qt5OpenGL) >= 5.2.0
BuildRequires:  pkgconfig(Qt5PrintSupport) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Quick) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Script) >= 5.2.0
BuildRequires:  pkgconfig(Qt5SerialPort) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Sql) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Svg) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Test) >= 5.2.0
BuildRequires:  pkgconfig(Qt5WebKitWidgets) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.2.0
BuildRequires:  pkgconfig(Qt5Xml) >= 5.2.0
Requires:       %{name}-data = %{version}
Requires:       libastro%{_so_astro} = %{version}
Requires:       libmarblewidget-qt5%{_so} = %{version}
Requires:       marble-frontend = %{version}
Recommends:     %{name}-doc = %{version}
Obsoletes:      marble5 < %{version}
Provides:       marble5 < %{version}
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Marble is a viewer of map data.

%package qt
Summary:        Qt Frontend for Marble
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Conflicts:      otherproviders(marble-frontend)
Provides:       marble-frontend = %{version}

%description qt
The Qt frontend for the Marble map viewer

%package kde
Summary:        The KDE optimized frontend for Marble and several Plasmoids/Wallpapers
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Supplements:    packageand(marble:plasma5-desktop)
Conflicts:      otherproviders(marble-frontend)
Provides:       marble-frontend = %{version}

%description kde
The KDE frontend for the Marble map viewer. It also includes several plasmoids and wallpapers for Plasma

%package data
Summary:        Generic map viewer: data
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Obsoletes:      marble5-data < %{version}
Provides:       marble5-data < %{version}
BuildArch:      noarch

%description data
Marble is a viewer of map data. This package contains its data.

%package devel
Summary:        Generic map viewer: Build Environment
Group:          Development/Libraries/KDE
Requires:       libastro%{_so_astro} = %{version}
Requires:       libmarblewidget-qt5%{_so} = %{version}
Obsoletes:      marble5-devel < %{version}
Provides:       marble5-devel = %{version}

%description devel
Development headers and libraries for Marble.

%package doc
Summary:        Marble documentation
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Obsoletes:      marble5-doc < %{version}
Provides:       marble5-doc = %{version}
BuildArch:      noarch

%description doc
Marble is a viewer of map data. This package contains its documentation.

%package -n libmarblewidget-qt5%{_so}
Summary:        Generic map viewer: Shared Library
Group:          Development/Libraries/KDE

%description -n libmarblewidget-qt5%{_so}
The shared library for the MarbleWidget shared library.

%package -n libastro%{_so_astro}
Summary:        Astronomy: Shared Library
Group:          Development/Libraries/KDE
Requires:       libmarblewidget-qt5%{_so}
Obsoletes:      libastro-qt5-%{_so_astro} < %{version}
Provides:       libastro-qt5-%{_so_astro} = %{version}

%description -n libastro%{_so_astro}
The astronomy library for the satellites plugin.

%if %{with lang}
%lang_package
%endif

%prep
%setup -q -n marble-%{version}
%patch1 -p1
%patch2 -p1

%build
export SUSE_ASNEEDED=0
%ifarch ppc ppc64
export RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
%endif
%cmake_kf5 -d build -- -DBUILD_MARBLE_TESTS=NO -DMOBILE=FALSE -DQT_PLUGINS_DIR=%{_kf5_plugindir}
%make_jobs

%install
  %kf5_makeinstall -C build
  %if %{with lang}
    %find_lang %{name} --with-man --all-name --with-qt
    %kf5_find_htmldocs
  %endif
  %fdupes -s %{buildroot}

%post   -n libmarblewidget-qt5%{_so} -p /sbin/ldconfig
%postun -n libmarblewidget-qt5%{_so} -p /sbin/ldconfig
%post   -n libastro%{_so_astro} -p /sbin/ldconfig
%postun -n libastro%{_so_astro} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc CREDITS ChangeLog COPYING* LICENSE* MANIFESTO.txt
%{_datadir}/marble/
%{_kf5_appstreamdir}/
%{_kf5_iconsdir}/hicolor/*/apps/marble.*
%{_libdir}/marble/
%{_libdir}/libmarbledeclarative.so
%{_kf5_plugindir}/designer/
%exclude %{_datadir}/marble/data
%{_kf5_plugindir}/libmarble*so
%{_kf5_plugindir}/plasma_runner_marble.so
%{_kf5_servicesdir}/*desktop
%{_kf5_applicationsdir}/marble_gpx.desktop
%{_kf5_applicationsdir}/marble_kml.desktop
%{_kf5_applicationsdir}/marble_kmz.desktop
%{_kf5_applicationsdir}/marble_geo.desktop
%{_kf5_applicationsdir}/marble_worldwind.desktop
%{_kf5_applicationsdir}/marble_geojson.desktop
%{_kf5_configkcfgdir}/
%{_kf5_kxmlguidir}/marble/
%{_datadir}/mime/packages/geo.xml
%{_kf5_qmldir}/org/kde/marble/
%{_kf5_configdir}/marble.knsrc

%files devel
%defattr(-,root,root)
%doc BUGS CODING
%{_includedir}/marble/
%{_includedir}/astro/
%{_kf5_libdir}/libmarblewidget-qt5.so
%{_kf5_libdir}/libastro.so
%{_kf5_libdir}/cmake/Astro/
%{_kf5_libdir}/cmake/Marble/
%{_libdir}/qt5/mkspecs/modules/qt_Marble.pri

%files data
%defattr(-,root,root)
%{_datadir}/marble/data

%files doc
%defattr(-,root,root)
%{_kf5_htmldir}/en/marble/

%files -n libmarblewidget-qt5%{_so}
%defattr(-,root,root)
%{_kf5_libdir}/libmarblewidget-qt5.so.*

%files -n libastro%{_so_astro}
%defattr(-,root,root)
%{_kf5_libdir}/libastro.so.*

%files qt
%defattr(-,root,root)
%{_kf5_applicationsdir}/org.kde.marble-qt.desktop
%{_kf5_bindir}/marble-qt

%files kde
%defattr(-,root,root)
%{_kf5_applicationsdir}/org.kde.marble.desktop
%{_kf5_bindir}/marble
%dir %{_datadir}/plasma
%{_datadir}/plasma/plasmoids/
%{_datadir}/plasma/wallpapers/

%if %{with lang}
%files lang -f %{name}.lang
%doc COPYING*
%endif

%changelog
openSUSE Build Service is sponsored by