File celestia.spec of Package celestia
#
# spec file for package celestia
#
# Copyright (c) 2023 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/
#
%ifarch %{arm} aarch64
# Qt uses GLES backend
%bcond_without GLES
%else
%bcond_with GLES
%endif
Name: celestia
Summary: OpenGL Space Simulator
Version: 1.7.0~git20240829.3c9edf5
Release: 0
License: GPL-2.0-or-later AND MIT AND Zlib
Group: Productivity/Scientific/Astronomy
URL: https://celestiaproject.space/
Source: Celestia-%{version}.tar.xz
Patch0: celestia-config.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: dejavu-fonts
BuildRequires: eigen3-devel
BuildRequires: fdupes
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: gettext-tools
BuildRequires: hicolor-icon-theme
BuildRequires: libjpeg8-devel
BuildRequires: libpng16-devel
BuildRequires: lua53-devel
BuildRequires: pkgconfig(Qt6Core)
BuildRequires: pkgconfig(Qt6OpenGL)
BuildRequires: pkgconfig(Qt6Widgets)
BuildRequires: pkgconfig(luajit)
BuildRequires: xdg-utils-cxx-devel
BuildRequires: xdg-utils
BuildRequires: pkgconfig(xdg-desktop-portal)
BuildRequires: xdg-desktop-portal
BuildRequires: wayland-utils
BuildRequires: xwayland-devel
BuildRequires: libqt5-qtwayland
BuildRequires: libqt5-qtwayland
BuildRequires: wayland-protocols-devel
BuildRequires: pkgconfig(libprofiler)
BuildRequires: gperf
BuildRequires: pkgconfig(Qt6Core5Compat)
BuildRequires: qt6-base-private-devel
BuildRequires: boost-devel
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: cmake(fmt)
BuildRequires: pkgconfig(epoxy)
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libswscale)
%if %{with GLES}
BuildRequires: pkgconfig(glesv2)
%endif
Requires: dejavu-fonts
Requires: celestia-data >= 1.7.0~
Recommends: celestia-tools
%description
Celestia is a free real-time space simulation that lets you experience
our universe in three dimensions. Unlike most planetarium software,
Celestia does not confine you to the surface of the Earth. You can
travel throughout the solar system to any of over 100,000 stars or even
beyond the galaxy. All travel in Celestia is seamless; the exponential
zoom feature lets you explore space across a huge range of scales, from
galaxy clusters down to spacecraft only a few meters across. A
'point-and-goto' interface makes it simple to navigate through the
universe to the object you want to visit.
%package tools
Summary: Tools for Celestia data file creation
Group: Productivity/Scientific/Astronomy
Provides: celestia:%{_bindir}/makestardb
Conflicts: celestia < %{version}
%description tools
This package contains various tools for creating data files for the
Celestia real-time space simulator.
%package -n libcelestia1_7
Group: System/Libraries
Summary: Celestia shared library
%description -n libcelestia1_7
Shared library used by the Celestia tools and the main GUI.
%prep
%setup -q -n Celestia-%{version}
%build
%cmake \
-DENABLE_DATA:BOOL=ON \
-DENABLE_QT5:BOOL=OFF \
-DENABLE_QT6:BOOL=ON \
-DENABLE_GTK:BOOL=OFF \
-DENABLE_WIN:BOOL=OFF \
-DENABLE_FFMPEG:BOOL=ON \
-DENABLE_MINIAUDIO:BOOL=ON \
-DENABLE_LIBAVIF:BOOL=OFF \
-DUSE_WAYLAND:BOOL=ON \
-DENABLE_GLES:BOOLS=%{?with_GLES:ON}%{!?with_GLES:OFF} \
-DGIT_COMMIT:STRING="%{shortcommit}"
%{nil}
%cmake_build
%install
%cmake_install
mkdir -p %{buildroot}%{_datadir}/doc/packages/%{name}
install -D -m644 src/celestia/gtk/data/celestia.png %{buildroot}%{_datadir}/icons/hicolor/48x48/celestia.png
install -D -m644 src/celestia/gtk/data/celestia.svg %{buildroot}%{_datadir}/icons/hicolor/scalable/celestia.svg
install -D -m644 src/celestia/qt/data/celestia.png %{buildroot}%{_datadir}/icons/hicolor/128x128/celestia.png
rm %{buildroot}%{_datadir}/pixmaps/celestia.png
# Unbundle DejaVu fonts
for font in %buildroot/%{_datadir}/celestia/fonts/*.ttf; do
rm $font
ln -s %{_datadir}/fonts/truetype/$(basename $font) $font
done
%find_lang %name
mkdir -p %{buildroot}%{_defaultlicensedir}/%{name}/locale
%fdupes %buildroot/%{_datadir}/celestia
%post -n libcelestia1_7 -p /sbin/ldconfig
%postun -n libcelestia1_7 -p /sbin/ldconfig
%files -f %name.lang
%license COPYING locale/COPYING_*
%doc AUTHORS README
%{_bindir}/celestia-qt6
%{_datadir}/celestia
%{_datadir}/applications/celestia-qt6.desktop
%{_datadir}/icons/hicolor/48x48/*
%{_datadir}/icons/hicolor/128x128/*
%{_datadir}/icons/hicolor/scalable/*
%{_datadir}/metainfo/space.celestia.celestia_qt6.metainfo.xml
%{_mandir}/man1/celestia*
%files tools
%{_bindir}/*
%exclude %{_bindir}/celestia-qt6
%files -n libcelestia1_7
%{_libdir}/libcelestia.so.1.7*
%changelog