File kstars.spec of Package kstars
#
# spec file for package kstars
#
# 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 http://bugs.opensuse.org/
#
%bcond_without lang
Name: kstars
Version: 2.9.5
Release: 0
Summary: Desktop Planetarium
# Note for legal: the Apache licensed files in the tarball are for the
# Android version - they're neither built nor installed
# Likewise, the non-commercial files in kstars-17.04.2/README.images are not
# used nor installed
License: GPL-2.0+
Group: Productivity/Scientific/Astronomy
Url: http://edu.kde.org/kstars/
Source0: https://download.kde.org/stable/%{name}/%{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE -- disable_downloading_into_system_dirs.patch -- do not allow saving runtime files into system dirs.
Patch0: disable_downloading_into_system_dirs.patch
BuildRequires: Mesa-devel
BuildRequires: cfitsio-devel
BuildRequires: eigen3-devel
BuildRequires: extra-cmake-modules
BuildRequires: fdupes
BuildRequires: gsl-devel
BuildRequires: kconfig-devel
BuildRequires: kcrash-devel
BuildRequires: kdoctools-devel
BuildRequires: ki18n-devel
BuildRequires: kio-devel
BuildRequires: knewstuff-devel
BuildRequires: knotifications-devel
BuildRequires: kplotting-devel
BuildRequires: kwidgetsaddons-devel
BuildRequires: kxmlgui-devel
BuildRequires: libindi-devel
BuildRequires: libnova-devel
BuildRequires: libraw-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
%if 0%{?suse_version} > 1320 || (0%{?is_opensuse} && 0%{?sle_version} >= 120300)
BuildRequires: wcslib-devel
%endif
BuildRequires: xplanet
BuildRequires: cmake(KF5NotifyConfig)
BuildRequires: pkgconfig(Qt5Concurrent)
%if 0%{?suse_version} > 1320
BuildRequires: pkgconfig(Qt5DataVisualization)
%endif
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5PrintSupport)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Sql)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Xml)
Recommends: libindi
Recommends: xplanet
%if %{with lang}
Recommends: %{name}-lang
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
KStars is a Desktop Planetarium for KDE. It provides an accurate graphical
simulation of the night sky, from any location on Earth, at any date and time.
%if %{with lang}
%lang_package
%endif
%prep
%setup -q
%patch0 -p1
%build
%ifarch ppc ppc64
export RPM_OPT_FLAGS="%{optflags} -mminimal-toc"
%endif
%cmake_kf5 -d build
%make_jobs
%install
%kf5_makeinstall -C build
%if %{with lang}
%find_lang %{name} --with-man --all-name
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120300
%kf5_find_htmldocs
%else
# %%kf5_find_htmldocs is only defined since Leap 42.3
CURDIR=`pwd`
pushd %{buildroot}%{_kf5_htmldir}
for i in *; do
if ! [ -d "/usr/share/locale/${i}" ]; then
echo "Removing unsupported translation %{_kf5_htmldir}/${i}"
rm -rf "$i"
elif [ "$i" != "en" ]; then
echo "%doc %lang($i) %{_kf5_htmldir}/${i}" >> $CURDIR/%{name}.lang
fi
done
popd
%endif
%endif
# Remove static library
rm -f %{buildroot}%{_kf5_libdir}/libhtmesh.a
%fdupes -s %{buildroot}
%files
%defattr(-,root,root,-)
%license COPYING COPYING.DOC
%doc AUTHORS ChangeLog README README.customize README.ephemerides README.images
%{_kf5_applicationsdir}/org.kde.kstars.desktop
%{_kf5_appsdir}/kstars/
%{_kf5_bindir}/kstars
%dir %{_kf5_configkcfgdir}
%{_kf5_configkcfgdir}/kstars.kcfg
%doc %{_kf5_htmldir}/en/kstars/
%{_kf5_iconsdir}/hicolor/*/*/*
%{_kf5_appstreamdir}/org.kde.kstars.appdata.xml
%{_kf5_notifydir}/kstars.notifyrc
%{_datadir}/sounds/*.ogg
%dir %{_kf5_appstreamdir}
%if %{with lang}
%files lang -f %{name}.lang
%license COPYING COPYING.DOC
%endif
%changelog