File tuxpaint.spec of Package tuxpaint

# spec file for package tuxpaint
# Copyright (c) 2015 SUSE LINUX 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

%define         kderootdir %(kde4-config --prefix || kde-config --prefix)
%define         gnomedir   %(gnome-config --prefix)
Name:           tuxpaint
Version:        0.9.22
Release:        0
Summary:        Drawing Program for Young Children
License:        GPL-2.0+
Group:          Productivity/Graphics/Bitmap Editors
Source1:        tuxpaint-rpmlintrc
Patch1:         tuxpaint-import-eval.patch
BuildRequires:  SDL-devel
BuildRequires:  SDL_Pango-devel
BuildRequires:  SDL_image-devel
BuildRequires:  SDL_mixer-devel
BuildRequires:  SDL_ttf-devel > 2.0.8
BuildRequires:  fribidi-devel
BuildRequires:  gperf
BuildRequires:  libpaper-devel
BuildRequires:  libpng-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# openSUSE
%if 0%{?suse_version}
BuildRequires:  fdupes
BuildRequires:  gettext-devel
# Makefile uses gnome-config to detect GNOME_PREFIX
BuildRequires:  libgnome-devel
BuildRequires:  librsvg-devel
BuildRequires:  update-desktop-files
Requires:       freefont
Requires:       netpbm
Recommends:     tuxpaint-config
Recommends:     tuxpaint-stamps
# Makefile uses kde-config to detect KDE_PREFIX
BuildRequires:  kdelibs4-core
# Fedora
%if 0%{?fedora_version}
BuildRequires:  desktop-file-utils
BuildRequires:  freetype-devel >= 2.0
BuildRequires:  gettext
BuildRequires:  librsvg2-devel
BuildRequires:  netpbm-devel
# This should guarantee the proper permissions on
# all of the /usr/share/icons/hicolor/* directories.
Requires:       hicolor-icon-theme

Tux Paint" is a drawing program for young children. It has a simple
interface and fixed canvas size, and provides access to previous images
using a thumbnail browser (it provides no access to the underlying

Unlike popular drawing programs such as "The GIMP," it has a very
limited toolset. However, it provides a much simpler interface, and has
entertaining, child-oriented additions such as sound effects.

%package devel
Summary:        Devel files of tuxpaint
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       SDL-devel
Requires:       SDL_Pango-devel
Requires:       SDL_image-devel
Requires:       SDL_mixer-devel
Requires:       SDL_ttf-devel
Requires:       fribidi-devel
Requires:       libpaper-devel
Requires:       libpng-devel
Requires:       zlib-devel
%if 0%{?suse_version}
Requires:       gcc-c++
Requires:       gettext-devel
Requires:       librsvg-devel
%if 0%{?fedora_version}
Requires:       gettext
Requires:       librsvg2-devel

%description devel
Header files and development documentation for tuxpaint.

%setup -q
%patch1  -b .import-eval-patch
find . -name CVS   -print0 | xargs -0 rm -rf
find docs/ -type f -print0 | xargs -0 chmod -v 644

make PREFIX=%{_prefix} MAGIC_PREFIX=%{_libdir}/%{name}/plugins tp-magic-config

make %{?_smp_mflags} \
     PREFIX=%{_prefix} \
     CFLAGS="%{optflags}" \
     MAGIC_PREFIX=%{_libdir}/%{name}/plugins -lpng14

%if ! 0%{?suse_version}
mkdir -p %{buildroot}
make install install-kde-icons \
             PREFIX="%{_prefix}" \
             X11_ICON_PREFIX="%{buildroot}/%{_datadir}/pixmaps" \
             MAGIC_PREFIX="%{buildroot}/%{_libdir}/%{name}/plugins" \
             GNOME_PREFIX="%{_prefix}" \
             KDE_ICON_PREFIX="%{_datadir}/icons" \
%if 0%{?suse_version}
             DEVDOC_PREFIX="%{buildroot}/%{_defaultdocdir}/%{name}-devel" \
             DOC_PREFIX="%{buildroot}/%{_defaultdocdir}/%{name}" \

find %{buildroot}/%{_mandir} -type f -exec chmod 644 {} \;
find %{buildroot} -type d -exec chmod 0755 {} \;

%if 0%{?suse_version}
find %{buildroot} -name "*.desktop" -exec rm -v {} \;
%suse_update_desktop_file -i %{name} Game KidsGame
%fdupes -s %{buildroot}
desktop-file-install --dir %{buildroot}/%{_datadir}/applications \
    --vendor %{vendor} \
    --add-category KidsGame \
    --delete-original \
rm -rf %{buildroot}/%{_docdir}/%{name}
# remove unneeded scripts
rm %{buildroot}/%{_datadir}/%{name}/fonts/locale/zh_tw_docs/*.{sh,py,pe}
# find lang
%find_lang %{name}

%files -f %{name}.lang
%if 0%{?suse_version}
%doc %{_defaultdocdir}/%{name}
%doc %{_mandir}/man1/tuxpaint*
%doc %{_mandir}/pl/man1/tuxpaint.1*
%dir %{_sysconfdir}/%{name}
%dir %{_mandir}/pl
%dir %{_mandir}/pl/man1
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %{_sysconfdir}/bash_completion.d/tuxpaint-completion.bash
%if 0%{?suse_version} <= 1130
# locales not in official openSUSE distribution
%dir %{_datadir}/locale/en_ZA
%dir %{_datadir}/locale/en_ZA/LC_MESSAGES
%dir %{_datadir}/locale/gos
%dir %{_datadir}/locale/gos/LC_MESSAGES
%dir %{_datadir}/locale/nr
%dir %{_datadir}/locale/nr/LC_MESSAGES
%dir %{_datadir}/locale/oj
%dir %{_datadir}/locale/oj/LC_MESSAGES
%dir %{_datadir}/locale/tlh
%dir %{_datadir}/locale/tlh/LC_MESSAGES
%if ! %{defined fedora}
%dir %{_datadir}/locale/twi
%dir %{_datadir}/locale/twi/LC_MESSAGES
%dir %{_datadir}/locale/shs
%dir %{_datadir}/locale/shs/LC_MESSAGES
%dir %{_datadir}/locale/son
%dir %{_datadir}/locale/son/LC_MESSAGES
%dir %{_datadir}/locale/zam
%dir %{_datadir}/locale/zam/LC_MESSAGES

%files devel
%if 0%{?suse_version}
%doc %{_defaultdocdir}/%{name}-devel
%doc %{_mandir}/man1/tp-magic-config*
%dir %{_includedir}/%{name}

openSUSE Build Service is sponsored by