File geogebra.spec of Package geogebra

Name:             geogebra
Summary:          Free mathematics software for learning and teaching
Version:          4.2.58.0
Release:          1
%if 0%{?mandriva_version}
Group:            Sciences/Mathematics
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
Group:            Applications/Productivity
%else
Group:            Productivity/Scientific/Math
%endif
%endif
%define           _description GeoGebra
Url:              http://www.geogebra.org
License:          GPL-3.0+ ; CC-BY-SA-3.0 ; CC-BY-NC-SA-3.0
Source:           http://geogebra.googlecode.com/files/GeoGebra-Unixlike-Installer-%{version}.tar.gz
Source1:          GeoGebra_icons.tar.gz
Source2:          geogebra
Source3:          geogebra.desktop
Source4:          install-geogebra
Source5:          install-geogebra-icons-oxygen
Source6:          geogebra_exportgraphicsview.desktop
%if 0%{?suse_version}
BuildRequires:    update-desktop-files
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
BuildRequires:    desktop-file-utils
%endif
%endif
BuildRequires:    unzip
Requires:         java >= 1.6.0
Requires:         geogebra-mime-data
Requires(post):   desktop-file-utils
Requires(post):   hicolor-icon-theme
Requires(postun): desktop-file-utils
Requires(postun): hicolor-icon-theme
%if !0%{?fedora} && !0%{?rhel_version} && !0%{?centos_version} && !0%{?scientificlinux_version}
Recommends:       java-plugin >= 1.6.0
%endif
BuildArch:        noarch
BuildRoot:        %{_tmppath}/%{name}-%{version}-build

%description
This package provides %{_description}.

GeoGebra is free and multi-platform dynamic mathematics software for all levels of education that joins geometry, algebra, tables, graphing, statistics and calculus in one easy-to-use package. It has received several educational software awards in Europe and the USA.

Quick Facts:

- Graphics, algebra and tables are connected and fully dynamic
- Easy-to-use interface, yet many powerful features 
- Authoring tool to create interactive learning materials as web pages 
- Available in many languages for our millions of users around the world 
- Free and open source software

%package icons-oxygen
License:          LGPL-3.0
Summary:          GeoGebra application icons for Oxygen Icon Theme
%if 0%{?mandriva_version}
Group:            Sciences/Mathematics
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
Group:            Applications/Productivity
%else
Group:            Productivity/Scientific/Math
%endif
%endif
Requires:         %{name} = %{version}
Requires:         oxygen-icon-theme
Requires(post):   hicolor-icon-theme
Requires(postun): hicolor-icon-theme
%if 0%{?suse_version}
Supplements:      packageand(%{name}:oxygen-icon-theme)
%endif
BuildArch:        noarch

%description icons-oxygen
This package provides application icons that integrate well into the KDE/Oxygen icon theme (http://www.oxygen-icons.org).

%package servicemenu-kde
License:          LGPL-3.0
Summary:          GeoGebra service menu for KDE
%if 0%{?mandriva_version}
Group:            Sciences/Mathematics
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
Group:            Applications/Productivity
%else
Group:            Productivity/Scientific/Math
%endif
%endif
Requires:         %{name} = %{version}
Requires:         kdebase4-runtime
%if 0%{?suse_version}
Supplements:      packageand(%{name}:kdebase4-runtime)
%endif
BuildArch:        noarch

%description servicemenu-kde
This package installs a KDE service menu that lets the user export the graphics view of a GeoGebra file to SVG/PNG/PDF/EPS/EMF.

%prep
%setup -q -n geogebra-%{version}
tar -xzf %{SOURCE1}
%{__install} -m644 %{SOURCE2} geogebra
%{__install} -m644 %{SOURCE3} geogebra.desktop
%{__install} -m644 %{SOURCE4} install-geogebra
%{__chmod} 755 install-geogebra
%{__install} -m644 %{SOURCE5} install-geogebra-icons-oxygen
%{__chmod} 755 install-geogebra-icons-oxygen

%build
#

%install
export NO_BRP_CHECK_BYTECODE_VERSION=true
export NAME='%{name}'
export DESCRIPTION='%{_description}'
export INSTALL='%{__install}'
export CHMOD='%{__chmod}'
export BINDIR='%{_bindir}'
export DATADIR='%{_datadir}'
export DOCDIR='%{_docdir}'
export SYSCONFDIR='%{_sysconfdir}'
export VERSION_CHECK_ALLOW='false'
export PREFIX='%{buildroot}'
./install-geogebra
./install-geogebra-icons-oxygen
%{__install} -d -m755 %{buildroot}%{_datadir}/kde4/services/ServiceMenus
%{__install} -m644 %{SOURCE6} %{buildroot}%{_datadir}/kde4/services/ServiceMenus/%{name}_exportgraphicsview.desktop

%if 0%{?suse_version}
%suse_update_desktop_file %{name}
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?scientificlinux_version}
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
%endif
%endif

%clean
rm -rf %{buildroot}

%post
%if 0%{?mandriva_version}
%{update_menus}
%update_desktop_database
%update_icon_cache hicolor
%update_icon_cache oxygen
%else
%if !0%{?sles_version}
%desktop_database_post
%icon_theme_cache_post hicolor
%icon_theme_cache_post oxygen
%else
%{_bindir}/update-desktop-database > /dev/null
%endif
%endif

%postun
%if 0%{?mandriva_version}
%{clean_menus}
%clean_desktop_database
%update_icon_cache hicolor
%update_icon_cache oxygen
%else
%if !0%{?sles_version}
%desktop_database_postun
%icon_theme_cache_postun hicolor
%icon_theme_cache_postun oxygen
%else
%{_bindir}/update-desktop-database > /dev/null
%endif
%endif

%files
%defattr(-,root,root)
%dir %{_datadir}/icons/hicolor
%dir %{_datadir}/icons/hicolor/16x16
%dir %{_datadir}/icons/hicolor/22x22
%dir %{_datadir}/icons/hicolor/32x32
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/64x64
%dir %{_datadir}/icons/hicolor/128x128
%dir %{_datadir}/icons/hicolor/256x256
%dir %{_datadir}/icons/hicolor/16x16/apps
%dir %{_datadir}/icons/hicolor/22x22/apps
%dir %{_datadir}/icons/hicolor/32x32/apps
%dir %{_datadir}/icons/hicolor/48x48/apps
%dir %{_datadir}/icons/hicolor/64x64/apps
%dir %{_datadir}/icons/hicolor/128x128/apps
%dir %{_datadir}/icons/hicolor/256x256/apps
%{_docdir}/%{name}
%{_datadir}/%{name}
%config /etc/%{name}
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/*.png

%files icons-oxygen
%defattr(-,root,root)
%dir %{_datadir}/icons/oxygen
%dir %{_datadir}/icons/oxygen/16x16
%dir %{_datadir}/icons/oxygen/22x22
%dir %{_datadir}/icons/oxygen/32x32
%dir %{_datadir}/icons/oxygen/48x48
%dir %{_datadir}/icons/oxygen/64x64
%dir %{_datadir}/icons/oxygen/128x128
%dir %{_datadir}/icons/oxygen/256x256
%dir %{_datadir}/icons/oxygen/16x16/apps
%dir %{_datadir}/icons/oxygen/22x22/apps
%dir %{_datadir}/icons/oxygen/32x32/apps
%dir %{_datadir}/icons/oxygen/48x48/apps
%dir %{_datadir}/icons/oxygen/64x64/apps
%dir %{_datadir}/icons/oxygen/128x128/apps
%dir %{_datadir}/icons/oxygen/256x256/apps
%{_docdir}/%{name}-icons-oxygen
%{_datadir}/icons/oxygen/*/*/*.png

%files servicemenu-kde
%defattr(-,root,root)
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%dir %{_datadir}/kde4/services/ServiceMenus
%{_datadir}/kde4/services/ServiceMenus/%{name}_exportgraphicsview.desktop

%changelog
openSUSE Build Service is sponsored by