File geogebra-thumbnail-kde.spec of Package geogebra-thumbnail-kde

Name:             geogebra-thumbnail-kde
Summary:          KDE Thumbnail Creator for GeoGebra files
Version:          1.0
Release:          1
%if 0%{?mandriva_version}
Group:            Sciences/Mathematics
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
Group:            Applications/Productivity
%else
Group:            Productivity/Scientific/Math
%endif
%endif
Url:              http://www.geogebra.org
License:          LGPLv3
Source:           GeoGebra_Thumbnail_KDE.tar.gz
Source1:          geogebrathumbnail.desktop
%if 0%{?mandriva_version}
BuildRequires:    kdelibs4-devel
%if 0%{?mandriva_version} == 201100
BuildRequires:    aspell-de
BuildRequires:    kde-l10n-de
%endif
%else
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires:    cmake
BuildRequires:    gcc-c++
BuildRequires:    kdelibs4-devel
BuildRequires:    kernel
%else
BuildRequires:    libkde4-devel
%endif
%endif
Requires:         kdebase4-runtime
Requires:         geogebra-mime-data
%if !0%{?fedora} && !0%{?rhel_version} && !0%{?centos_version} && !0%{?mandriva_version}
Supplements:      packageand(geogebra-mime-data:kdebase4-runtime)
%endif
BuildRoot:        %{_tmppath}/%{name}-%{version}-build

%description
This package provides GeoGebraThumbnail, a KDE thumbnail-plugin that generates small images (thumbnails) for GeoGebra files, to be displayed, for example, on Konqueror and Dolphin file managers.



Authors:
--------
   Ariel Constenla-Haile (La Plata, Argentina)

%prep
%setup -q -n GeoGebraThumbnail
%{__install} -m644 %{SOURCE1} src/geogebrathumbnail.desktop

%build
%{__install} -d -m755 build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
make

%install
%{__install} -d -m755 %{buildroot}%{_docdir}/%{name}
%{__install} -m644 LICENSE %{buildroot}%{_docdir}/%{name}/COPYING
%{__install} -d -m755 %{buildroot}%{_libdir}/kde4
cd build
%if 0%{?mandriva_version} || 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
make DESTDIR=%{?buildroot:%{buildroot}} install/fast
%else
%kde4_makeinstall
%endif

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%dir %{_libdir}/kde4
%dir %{_datadir}/kde4
%dir %{_datadir}/kde4/services
%{_docdir}/%{name}
%{_libdir}/kde4/geogebrathumbnail.so
%{_datadir}/kde4/services/geogebrathumbnail.desktop

%changelog