File gcompris.spec of Package gcompris

#
# spec file for package gcompris
#
# Copyright (c) 2013 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:           gcompris
Summary:        J'ai compris / I Have Understood
License:        GPL-3.0+
Group:          Amusements/Teaching/Other
Version:        12.11
Release:        0
Url:            http://gcompris.net
Source0:        %{name}-%{version}.tar.bz2
Source1:        gcompris.desktop
Source2:        gcompris-edit.desktop
Source3:        gcompris-rpmlintrc
Patch0:         gcompris-incorrect-fsf-address.patch
# work around solver bug, require the package instead the lib
BuildRequires:  gettext-devel
BuildRequires:  gnuchess >= 5.02
BuildRequires:  intltool
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  sqlite-devel >= 3
BuildRequires:  texinfo
%if 0%{?sles_version}
BuildRequires:  gtk2-devel
BuildRequires:  libxml2-devel
%else
BuildRequires:  pkgconfig(gtk+-2.0)
BuildRequires:  pkgconfig(libxml-2.0)
%endif
Requires:       gcompris-voices >= %{version}
Requires:       gnucap
Requires:       gnuchess
Requires:       tuxpaint
###########################################
# Fedora specials
###########################################
%if 0%{?fedora_version}
BuildRequires:  desktop-file-utils
BuildRequires:  desktop-file-utils
BuildRequires:  gnome-python2-devel
BuildRequires:  gstreamer-devel
BuildRequires:  libX11-devel
BuildRequires:  librsvg2-devel
BuildRequires:  pycairo-devel
BuildRequires:  pygtk2-devel
BuildRequires:  texi2html
%if 0%{?fedora} <= 15
BuildRequires:  pypkgconfig(gtk+-2.0)
%else
BuildRequires:  gtk+-devel
%endif
%if 0%{?fedora} <= 16
BuildRequires:  python-sqlite2
Requires:       python-sqlite2
%endif
Requires(pre):  info
Requires(post): info
%endif
###########################################
# Mandriva specials
###########################################
%if 0%{?mandriva_version}
BuildRequires:  codeina
BuildRequires:  desktop-file-utils
BuildRequires:  gnome-python-devel
BuildRequires:  gstreamer0.10-devel
BuildRequires:  librsvg-devel
BuildRequires:  polkit-gnome
BuildRequires:  pygtk2.0-devel
BuildRequires:  python-sqlite2
BuildRequires:  tetex-texi2html
Requires:       python-sqlite2
Requires(pre):  info
Requires(post): info
%endif
###########################################
# SUSE specials
###########################################
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  gstreamer010-devel
BuildRequires:  intltool
BuildRequires:  libgnome-devel
BuildRequires:  libgnomeui-devel
BuildRequires:  librsvg-devel
PreReq:         %install_info_prereq
BuildRequires:  python-gnome
BuildRequires:  python-gtk
BuildRequires:  python-gtk-devel
BuildRequires:  texlive-latex
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-libs
%endif
%define         prefix /usr
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#----------------------------------------------------------------------

%description
GCompris is an educational software suite comprising of numerous activities
for children aged 2 to 10. Some of the activities are game orientated,  but
nonetheless still educational. Below you can find a list of categories with
some of the activities available in that category.

-  computer discovery: keyboard, mouse, different mouse gesture, ...
-  algebra: table memory, enumeration, double entry table, mirror image, ...
-  science: the canal lock, the water cycle, the submarine, electric simulation ...
-  geography: place the country on the map
-  games: chess, memory, connect 4, oware, sudoku ...
-  reading: reading practice
-  other: learn to tell time, puzzle of famous paintings, vector drawing, ...

Currently GCompris offers in excess of 80 activities and more are being
developed. GCompris is free software, that means that you can adapt  it
to your own needs, improve it and, most importantly, share it with
children everywhere.

%package devel
Version:        %{version}
Release:        0
Summary:        Development package for gcompris
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       atk-devel
Requires:       fontconfig-devel
Requires:       freetype2-devel
Requires:       gdk-pixbuf-devel
Requires:       glibc-devel
Requires:       librsvg-devel
Requires:       xorg-x11-libX11-devel
Requires:       zlib-devel
Requires:       pkgconfig(cairo)
Requires:       pkgconfig(glib-2.0)
Requires:       pkgconfig(gtk+-2.0)
Requires:       pkgconfig(libxml-2.0)
Requires:       pkgconfig(pango)

%description devel
This package contains header files for developing new applications with gcompris.

%package voices-ar
Version:        %{version}
Release:        0
Summary:        GCompris Arabic voices
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:ar)

%description voices-ar
Arabic voices for the GCompris game.

%package voices-br
Version:        %{version}
Release:        0
Summary:        GCompris Brazil voices
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:br)

%description voices-br
Brazil voices for the GCompris game.

%package voices-cs
Version:        %{version}
Release:        0
Summary:        GCompris Czech voices
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:cs)

%description voices-cs
Czech voices for the GCompris game.

%package voices-da
Version:        %{version}
Release:        0
Summary:        GCompris Danish voices
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:da)

%description voices-da
Danish voices for the GCompris game.

%package voices-de
Version:        %{version}
Release:        0
Summary:        GCompris voices in German
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:de)

%description voices-de
German voices for the GCompris game.

%package voices-el
Version:        %{version}
Release:        0
Summary:        GCompris voices in Greek
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:el)

%description voices-el
Greek voices for the GCompris game.

%package voices-en
Version:        %{version}
Release:        0
Summary:        GCompris voices in English
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:en)

%description voices-en
English voices for the GCompris game.

%package voices-es
Version:        %{version}
Release:        0
Summary:        GCompris voices in Spanish
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:es)

%description voices-es
Spanish voices for the GCompris game.

%package voices-eu
Version:        %{version}
Release:        0
Summary:        GCompris voices in Basque
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:eu)

%description voices-eu
Basque voices for the GCompris game

%package voices-fi
Version:        %{version}
Release:        0
Summary:        GCompris voices in Finish
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:fi)

%description voices-fi
Finish voices for the GCompris game.

%package voices-fr
Version:        %{version}
Release:        0
Summary:        GCompris voices in French
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:fr)

%description voices-fr
French voices for the GCompris game.

%package voices-hi
Version:        %{version}
Release:        0
Summary:        GCompris voices in Hindi
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
%if 0%{?suse_version} >= 1010
Provides:       locale(gcompris:hi)
%endif

%description voices-hi
Hindi voices for the GCompris game.

%package voices-hu
Version:        %{version}
Release:        0
Summary:        GCompris voices in Hungarian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:hu)

%description voices-hu
Hungarian voices for the GCompris game.

%package voices-id
Version:        %{version}
Release:        0
Summary:        GCompris voices in Indonesian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:id)

%description voices-id
Indonesian voices for the GCompris game.

%package voices-it
Version:        %{version}
Release:        0
Summary:        GCompris voices in Italian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:it)

%description voices-it
Italian voices for the GCompris game.

%package voices-nb
Version:        %{version}
Release:        0
Summary:        GCompris voices in Norwegian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:nb)

%description voices-nb
Norwegian voices for the GCompris game.

%package voices-nl
Version:        %{version}
Release:        0
Summary:        GCompris voices in Dutch
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:nl)

%description voices-nl
Dutch voices for the GCompris game.

%package voices-mr
Version:        %{version}
Release:        0
Summary:        GCompris voices in Marathi
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:mr)

%description voices-mr
Marathi voices for the GCompris game.

%package voices-pt
Version:        %{version}
Release:        0
Summary:        GCompris voices in Portuguese
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:pt_PT)

%description voices-pt
Portuguese voices for the GCompris game.

%package voices-pt-br
Version:        %{version}
Release:        0
Summary:        GCompris voices in Brasilian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:pt_BR)

%description voices-pt-br
Brasilian voices for the GCompris game.

%package voices-ru
Version:        %{version}
Release:        0
Summary:        GCompris voices in Russian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:ru)

%description voices-ru
Russian voices for the GCompris game.

%package voices-so
Version:        %{version}
Release:        0
Summary:        GCompris voices in Somali
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:so)

%description voices-so
Somali voices for the GCompris game.

%package voices-sr
Version:        %{version}
Release:        0
Summary:        GCompris voices in Serbian
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:sr)

%description voices-sr
Serbian voices for the GCompris game.

%package voices-sv
Version:        %{version}
Release:        0
Summary:        GCompris voices in Swedish
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:sv)

%description voices-sv
Swedish voices for the GCompris game.

%package voices-tr
Version:        %{version}
Release:        0
Summary:        GCompris voices in Turkish
Group:          Amusements/Teaching/Other
Requires:       %{name} = %{version}
Provides:       gcompris-voices = %{version}
Provides:       locale(gcompris:tr)

%description voices-tr
Turkish voices for the GCompris game.

%prep
%setup -q
%patch0 -p1
find . -name ".cvsignore" -exec rm -f {} \;
find . -name ".gitignore" -exec rm -f {} \;
# wrong-file-end-of-line-encoding
#sed -i "s|||g" ./docs/eu/topic.dat

%build
# workaround for missing config.rpath
if [ -f /usr/share/gettext/config.rpath -a ! -f config.rpath ] ; then
    cp -v /usr/share/gettext/config.rpath .
fi
%configure  --quiet \
            --enable-sqlite \
			--disable-static \
            --localstatedir=/var/%{_lib} 
#            --enable-sugar
make %{?_smp_mflags}

%check
make check

%install
make DESTDIR=%{?buildroot:%{buildroot}} install
test -f %{buildroot}/%{_infodir}/dir && rm -f %{buildroot}/%{_infodir}/dir
#
# sorry, these languages are currently not supported
#
rm -rf %{buildroot}/%{prefix}/share/locale/{oc,so,ar_TN}
#
# install desktop files
#
mkdir -p %{buildroot}/%{_datadir}/{pixmaps,applications}/
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/applications/
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/applications/

if [ ! -f %{buildroot}%{_datadir}/pixmaps/gcompris.png ]; then
	for png in gcompris.png gcompris-edit.png; do
		mv -v %{buildroot}/%{prefix}/share/pixmaps/$png %{buildroot}%{_datadir}/pixmaps/
	done
	rm -rf %{buildroot}/%{prefix}/share/pixmaps
fi
%if 0%{?suse_version}
%suse_update_desktop_file -n -N GCompris -G "Educational suite GCompris" gcompris Education Teaching
%suse_update_desktop_file -n -N GCompris -G "GCompris Administration" gcompris-edit System SystemSetup
# remove old menu entry
rm -rf %{buildroot}/%{prefix}/lib/menu/gcompris
#
# save space, use fdupes
#
%fdupes %{buildroot}
%endif
test -f %{buildroot}%{_datadir}/gcompris/boards/voices/recode.sh && chmod +x %{buildroot}%{_datadir}/gcompris/boards/voices/recode.sh
# fix old LOCALE dir
%if 0%{?suse_version} > 1110
if [ -d %{buildroot}%{_datadir}/locale/sr@Latn ]; then
	mv %{buildroot}%{_datadir}/locale/sr@Latn %{buildroot}%{_datadir}/locale/sr@latin
fi
%endif
# Fedora
%if 0%{?fedora_version}
# install desktop file
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}/%{_datadir}/applications \
  %{name}.desktop
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}/%{_datadir}/applications \
  %{name}-edit.desktop
%endif
%if 0%{?mandriva_version}
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}/%{_datadir}/applications \
  %{name}.desktop
desktop-file-install --vendor="%{vendor}" \
  --dir=%{buildroot}/%{_datadir}/applications \
  %{name}-edit.desktop
%endif

%find_lang %{name}

%post
/sbin/ldconfig
%if 0%{?suse_version}
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%else
if test -x sbin/install-info ; then
	sbin/install-info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
fi
%endif

%postun
/sbin/ldconfig
%if 0%{?suse_version}
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%else
if test -x sbin/install-info ; then
	sbin/install-info --quiet --delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
fi
%endif

%files -f %{name}.lang
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%doc %{_mandir}/man6/gcompris*
%dir %{_libdir}/gcompris
%dir %{prefix}/share/gcompris
%{_datadir}/applications/*gcompris-edit.desktop
%{_datadir}/applications/*gcompris.desktop
%{_datadir}/pixmaps/*.png
%{_libdir}/gcompris/*.so.*
%{prefix}/share/gcompris/boards
%{prefix}/share/gcompris/python
%{prefix}/%{_lib}/gcompris/*.so
%{prefix}/bin/*
%exclude %{prefix}/share/gcompris/boards/voices/[a-z][a-z]
%exclude %{prefix}/share/gcompris/boards/voices/pt_BR

%files devel
%defattr(-, root, root)
%{prefix}/%{_lib}/gcompris/*.*a

%files voices-ar
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/ar

%files voices-br
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/br

%files voices-cs
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/cs

%files voices-da
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/da

%files voices-de
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/de

%files voices-el
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/el

%files voices-en
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/en

%files voices-es
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/es

%files voices-eu
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/eu

%files voices-fi
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/fi

%files voices-fr
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/fr

%files voices-hi
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/hi

%files voices-hu
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/hu

%files voices-id
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/id

%files voices-it
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/it

%files voices-mr
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/mr

%files voices-nb
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/nb

%files voices-nl
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/nl

%files voices-pt
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/pt

%files voices-pt-br
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/pt_BR

%files voices-ru
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/ru

%files voices-so
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/so

%files voices-sr
%defattr(-, root, root)
%if 0%{?suse_version} <= 1120
%dir %{_datadir}/locale/sr_ME
%dir %{_datadir}/locale/sr_ME/LC_MESSAGES
%endif
%{prefix}/share/gcompris/boards/voices/sr

%files voices-sv
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/sv

%files voices-tr
%defattr(-, root, root)
%{prefix}/share/gcompris/boards/voices/tr

%changelog
openSUSE Build Service is sponsored by