File tuxpaint.spec of Package tuxpaint

#
# spec file for package tuxpaint
#
# 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:           tuxpaint
Summary:        Drawing Program for Young Children
License:        GPL-2.0+
Group:          Productivity/Graphics/Bitmap Editors
Url:            http://www.newbreedsoftware.com/tuxpaint/
Version:        0.9.21
Release:        0
Source:         %{name}-%{version}.tar.bz2
Patch1:         tuxpaint-import-eval.patch
Patch2:         tuxpaint-de_translation.patch
Patch3:         tuxpaint-linux_arch_links.patch
Patch4:         tuxpaint-manpage_fix.patch
# libpng15.patch sent to  bill@newbreedsoftware.com
Patch5:         tuxpaint-libpng15.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:  libpaper-devel
BuildRequires:  libpng-devel
BuildRequires:  zlib-devel
#
# 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
# Makefile uses kde-config to detect KDE_PREFIX
%if 0%{suse_version} > 1110
BuildRequires:  kdelibs4-core
%else
BuildRequires:  kdelibs3
%endif
Recommends:     tuxpaint-stamps 
Recommends:     tuxpaint-config
Requires:       freefont
Requires:       netpbm
%endif
#
# 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
%endif
%define         kderootdir %(kde4-config --prefix || kde-config --prefix)
%define         gnomedir   %(gnome-config --prefix)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
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
filesystem).

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.



Authors:
--------
    Bill Kendrick <bill@newbreedsoftware.com>


%package devel
Summary:        Devel files of tuxpaint
Group:          Development/Libraries
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
%endif
%if 0%{?fedora_version}
Requires:       gettext
Requires:       librsvg2-devel
%endif

%description devel
Header files and development documentation for tuxpaint.


Authors:
--------
    Bill Kendrick <bill@newbreedsoftware.com>



%prep
%setup -q 
%patch1 -p0 -b .import-eval-patch
%patch2 -p0 -b .de_translation-patch
%if %{?suse_version} > 1140
%patch3 -p0
%endif
%patch4 -p0
%patch5 -p1
sed -i "s|/usr/lib|%_libdir|g" Makefile
find . -name CVS   -print0 | xargs -0 rm -rf
find docs/ -type f -print0 | xargs -0 sed -i "s|$||g"
find docs/ -type f -print0 | xargs -0 chmod -v 644

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

%build
make %{?jobs:-j%jobs} \
     PREFIX=%{_prefix} \
     CFLAGS="%optflags" \
     MAGIC_PREFIX=%{_libdir}/%{name}/plugins -lpng14 

%install
%if ! 0%{?suse_version}
rm -rf %buildroot
mkdir -p %buildroot
%endif
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}" \
%endif
             DESTDIR="%{buildroot}" 

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
%else
desktop-file-install --dir %{buildroot}/%{_datadir}/applications \
    --vendor %{vendor} \
    --add-category KidsGame \
    --delete-original \
    %{buildroot}/%{_datadir}/applications/tuxpaint.desktop
rm -rf %{buildroot}/%{_docdir}/%{name}
%endif
# remove unneeded scripts
rm %buildroot/%_datadir/%name/fonts/locale/zh_tw_docs/*.{sh,py,pe}
# find lang
%find_lang %name

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %name.lang
%defattr(-,root,root)
%if 0%{?suse_version}
%doc %_defaultdocdir/%name
%endif
%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
%_bindir/%{name}
%_bindir/tuxpaint-import
%_libdir/%{name}
%_datadir/%{name}/
%_datadir/pixmaps/%{name}.*
%_datadir/applications/*.desktop
%kderootdir/share/icons/hicolor
%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
%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
%endif

%files devel
%defattr(-,root,root)
%if 0%{?suse_version}
%doc %{_defaultdocdir}/%{name}-devel
%endif
%doc %{_mandir}/man1/tp-magic-config*
%dir %{_includedir}/%{name}
%{_bindir}/tp-magic-config
%{_includedir}/%{name}/*

%changelog
openSUSE Build Service is sponsored by