File stellarium.spec of Package stellarium
#
# spec file for package stellarium
#
# Copyright (c) 2012 SUSE LINUX Products 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: stellarium
Version: 0.11.3
Release: 0
Summary: Astronomical Sky Simulator
License: GPL-2.0+
Group: Productivity/Scientific/Astronomy
Url: http://stellarium.sourceforge.net
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1: stellarium_user_guide-0.10.2-1.pdf
Source2: stellarium_user_guide.desktop
BuildRequires: ImageMagick
BuildRequires: hicolor-icon-theme
BuildRequires: Mesa-devel
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: libqt4-devel >= 4.6
BuildRequires: phonon-devel
BuildRequires: update-desktop-files
BuildRequires: zlib-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Stellarium is a free software available for Windows, Linux/Unix and MacOSX.
It renders 3D photo-realistic skies in real time.. With stellarium, you
really see what you can see with your eyes, binoculars or a small
telescope.
%prep
%setup -q
install -p -m644 %{S:1} stellarium_user_guide.pdf
# This creates 5 png images with res from 64x64 down to 16x16
# named from %%{name}-0.png to %%{name}-4.png respectively, all of which we install.
convert data/%{name}.ico %{name}.png
# Remove Apache licensed file used only for Windows builds and not needed here anyway
# See bnc#766373
rm src/core/external/kdewin32/dirent.c
%build
CFLAGS='%{optflags}' \
CXXFLAGS='%{optflags}' \
cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DENABLE_SOUND=1 .
make VERBOSE=1 %{?_smp_mflags}
%install
make install DESTDIR=%{?buildroot}
install -p -D -m0644 %{name}-0.png %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
install -p -D -m0644 %{name}-1.png %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.png
install -p -D -m0644 %{name}-2.png %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
install -p -D -m0644 %{name}-3.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/%{name}.png
install -p -D -m0644 %{name}-4.png %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/%{name}.png
# Remove .xpm icon from /usr/share/pixmaps as we already
# install appropriate icons in the hicolor directory
rm %{buildroot}%{_datadir}/pixmaps/%{name}.xpm
%suse_update_desktop_file -c stellarium Stellarium "Planetarium in your computer" stellarium stellarium Science Astronomy
%suse_update_desktop_file -n -i stellarium_user_guide
# entry for susehelp
%{__install} -pDm 644 %{S:2} %{buildroot}/%{_datadir}/susehelp/meta/Stellarium/stellarium_user_guide.desktop
mkdir -p %{buildroot}/%{_datadir}/stellarium/data/script_internet_update
%fdupes %{buildroot}
%find_lang %{name}
%find_lang %{name}-skycultures
cat %{name}-skycultures.lang >> %{name}.lang
%post
%if 0%{?suse_version} > 1130
%icon_theme_cache_post
%else
gtk-update-icon-cache
%endif
%postun
%if 0%{?suse_version} > 1130
%icon_theme_cache_postun
%else
gtk-update-icon-cache
%endif
%files -f %{name}.lang
%defattr(-,root,root,755)
%doc AUTHORS ChangeLog COPYING README stellarium_user_guide.pdf
%dir %{_datadir}/susehelp/
%dir %{_datadir}/susehelp/meta
%dir %{_datadir}/susehelp/meta/Stellarium
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}*.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/susehelp/meta/Stellarium/stellarium_user_guide.desktop
%{_mandir}/man1/%{name}.1%{ext_man}
%changelog