File mtpaint.spec of Package mtpaint

#
# spec file for package mtpaint
#
# Copyright (c) 2011 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/
#

# norootforbuild

Summary:        Painting program for creating icons and pixel-based artwork

Name:           mtpaint
Version:        3.31
Release:        13
License:        GPLv3
Group:          Productivity/Graphics/Bitmap Editors
Url:            http://mtpaint.sourceforge.net/
Source:         http://downloads.sf.net/%{name}/%{name}-%{version}.tar.bz2
Source1:        http://downloads.sf.net/%{name}/%{name}_handbook-%{version}.tar.bz2
Patch:          %{name}-3.31-xdg-open.patch
Patch1:         %{name}-3.31-openjpeg.patch
Patch2:         %{name}-3.31-buff.diff
Patch3:         %{name}-3.31-libpng14.patch
Patch4:         %{name}-fix-no-add-needed.patch
Patch5:         %{name}-3.31-ld_fix.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
AutoReqProv:    on
BuildRequires:  gtk2-devel libpng-devel update-desktop-files zlib-devel
BuildRequires:  giflib-devel libjpeg-devel libtiff-devel
BuildRequires:  desktop-file-utils dos2unix gettext

%description 
mtPaint is a simple painting program designed for creating icons and
pixel-based artwork. It can edit indexed palette or 24 bit RGB images
and offers basic painting and palette manipulation tools. Its main
file format is PNG, although it can also handle JPEG, GIF, TIFF, BMP,
XPM, and XBM files.

%package handbook
Summary:        Handbook for the mtpaint painting application
Group:          Productivity/Graphics/Bitmap Editors
License:        GFDL
Requires:       %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif

%description handbook
Install this package is want to read the handbook for the painting
application mtpaint.

%prep
%setup -q -a 1
%patch -p0
%patch1 -p0
%patch2 -p0 
%if 0%{?suse_version} > 1120
%patch3 -p1
%endif
%patch4
%patch5 -p1
%{__chmod} 0755 %{name}_handbook-%{version}/docs/{en_GB,img,files,cs}
dos2unix -k %{name}_handbook-%{version}/docs/index.html
dos2unix -k %{name}_handbook-%{version}/docs/{en_GB,cs}/*.html

%build

# fix warnings for gcc >= 4.4, use -fno-strict-aliasing

%if 0%{?suse_version} >= 1100
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%endif

# This is not a "normal" configure
%configure cflags asneeded debug intl man gtk2 tiff jpeg GIF
%{__make} 

%install
%{__make} install MT_PREFIX=%{buildroot}%{_prefix}            \
                  MT_MAN_DEST=%{buildroot}%{_mandir}/man1     \
                  MT_LANG_DEST=%{buildroot}%{_datadir}/locale \
                  BIN_INSTALL=%{buildroot}%{_bindir}

%suse_update_desktop_file %{name}

%find_lang %{name}

%clean
%__rm -rf %buildroot

%if 0%{?suse_version} >= 1140

%post
%desktop_database_post

%postun
%desktop_database_postun
%endif

%files -f %{name}.lang
%defattr(-, root, root, -)
%doc COPYING NEWS README
%{_mandir}/man1/%{name}*
%{_bindir}/%{name}
%{_datadir}/applications/*.desktop
%{_datadir}/pixmaps/%{name}.png

%files handbook
%defattr(-, root, root, -)
%doc %{name}_handbook-%{version}/COPYING %{name}_handbook-%{version}/docs/*

%changelog
openSUSE Build Service is sponsored by