%define subver   1.3
%define revision   16
%define sname gimp

Summary: The GNU Image Manipulation Program.
Name: gimp2
Version: %subver.%revision
Release: alt1
License: GPL, LGPL
Group: Graphics


Source: %name-%version.tar.bz2
Source3: %name.desktop
Source10: %name-16.xpm
Source11: %name-32.xpm
Source12: %name-48.xpm
Requires: lib%name = %version-%release

URL: http://www.gimp.org/
Requires: gtk2 >= 2.0.0, aalib
# Automatically added by buildreq on Wed Mar 19 2003
BuildRequires: fontconfig-devel freetype2-devel glib2-devel libart_lgpl-devel libatk-devel libgtk+2-devel libjpeg-devel libpango-devel libpng-devel libtiff-devel pkgconfig zlib-devel libgpm-devel liblcms-devel libexpat-devel

%description
The GIMP (GNU Image Manipulation Program) is a powerful image
composition and editing program, which can be extremely useful for
creating logos and other graphics for Web pages.  The GIMP has many of
the tools and filters you would expect to find in similar commercial
offerings, and some interesting extras as well. The GIMP provides a
large image manipulation toolbox, including channel operations and
layers, effects, sub-pixel imaging and anti-aliasing, and conversions,
all with multi-level undo.

This is developer version.

%package -n lib%name
Summary: GIMP libraries
Group: System/Libraries
License: LGPL


%package -n lib%name-devel
Summary: GIMP plugin and extension development kit.
Group: Graphics
Requires: gtk2-devel >= 2.0.0, pkgconfig
Requires: lib%name = %version-%release

%package -n lib%name-devel-static
Summary: GIMP static libraries
Group: Development/C
Requires: gtk+-devel-static
Requires: lib%name-devel = %version-%release

%description -n lib%name
Libraries used to communicate between The GIMP and other programs which
may function as "GIMP plugins".

%description -n lib%name-devel
Development libraries and header files for writing GIMP plugins and extensions.

%description -n lib%name-devel-static
Static libraries for developing statically linked GIMP plugins and extensions.



%prep
%setup -q

%build
%configure \
  --enable-default-binary \
  --disable-print
make %{_smp_mflags}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p $RPM_BUILD_ROOT{%_menudir,%_infodir,%_iconsdir/mini,%_includedir,%_bindir,%_libdir/%name/%subver/plug-ins,%_sysconfdir/X11/wmconfig}


# install desktop entry (does Mandrake need this ?)
install -p -m644 -D $RPM_SOURCE_DIR/%name.desktop %buildroot%_sysconfdir/X11/applnk/Graphics/%name.desktop

mkdir -p $RPM_BUILD_ROOT%_iconsdir/{large,mini}
install -p -m644 -D %SOURCE10 $RPM_BUILD_ROOT%_iconsdir/mini/%name-16.xpm
install -p -m644 -D %SOURCE11 $RPM_BUILD_ROOT%_iconsdir/%name-32.xpm
install -p -m644 -D %SOURCE12 $RPM_BUILD_ROOT%_iconsdir/large/%name-48.xpm

# We don't want those
find %{buildroot}%{_libdir} -name "*.la" | xargs rm -f



# Execute find_lang for all components and merge the resulting lists
rm -f global.lang
for what in gimp14 gimp14-libgimp gimp14-std-plug-ins gimp14-script-fu; do
  %find_lang ${what}
  cat ${what}.lang >> global.lang
  done

#
cat >$RPM_BUILD_ROOT%_menudir/%sname-%subver <<EOF
?package(%name): command="gimp-1.3" icon="%name-32.xpm" section="Multimedia/Graphics" title="The GIMP-1.3" longtitle="The GNU Image Manipulation Program 1.3" needs="x11" kde_mimetype="image/gif;image/jpeg;image/png;image/tiff;image/x-xbm;image/x-xpm;image/bmp;image/fits;image/pcx;image/pix;image/pnm;"
EOF

%clean
rm -rf %{buildroot}

%post 
/sbin/ldconfig
%update_menus

%postun 
/sbin/ldconfig
%clean_menus


%files -f global.lang
%defattr (-, root, root)
%doc AUTHORS ChangeLog* COPYING MAINTAINERS NEWS README README.i18n
%doc docs/*
%dir %{_sysconfdir}/%{sname}/%{subver}
%config %{_sysconfdir}/%{sname}/%{subver}/*
%{_bindir}/*
%{_libdir}/%{sname}/%{subver}/plug-ins
%{_datadir}/%{sname}
%{_mandir}/man1/*
%_iconsdir/mini/%name-16.xpm
%_iconsdir/large/%name-48.xpm
%_iconsdir/%name-32.xpm
%_menudir/%sname-%subver


%files -n lib%name
%{_libdir}/*.so*
%dir %{_libdir}/%{sname}
%dir %{_libdir}/%{sname}/%{subver}
%{_libdir}/%{sname}/%{subver}/environ
%dir %{_libdir}/%{sname}/%{subver}/modules
%{_libdir}/%{sname}/%{subver}/modules/*.so


%files -n lib%name-devel
%defattr (-, root, root)
%doc HACKING PLUGIN_MAINTAINERS
%doc %{_datadir}/gtk-doc/html/*
%{_includedir}/*
%{_libdir}/*.so
%dir %{_libdir}/%{sname}
%dir %{_libdir}/%{sname}/%{subver}
%dir %{_libdir}/%{sname}/%{subver}/modules
%{_libdir}/pkgconfig/*
%{_datadir}/aclocal/*
%{_mandir}/man5/*

%files -n lib%name-devel-static
%_libdir/lib*.a
%dir %_libdir/%sname
%dir %_libdir/%sname/%subver
%dir %_libdir/%sname/%subver/modules
%_libdir/%sname/%subver/modules/*.a


%changelog
* Mon Jun 29 2003 Anatoly Yakushin <jaa@altlinux.ru> 1.3.16-alt1
- new version

* Wed May 28 2003 Anatoly Yakushin <jaa@altlinux.ru> 1.3.14-alt2
- fixed bugs in spec file, add new ru.po

* Sun Apr 13 2003 Anatoly Yakushin <jaa@altlinux.ru> 1.3.14-alt1
- package in Sisyphus

* Mon Mar 24 2003 Anatoly Yakushin <jaa@altlinux.ru> 1.3.13-alt0.1
- version 1.3.13 

* Wed Mar 19 2003 Anatoly Yakushin <jaa@altlinux.ru> 1.3.12-alt0.1
- Adapted spec for AltLinux 

* Fri Feb 14 2003 Matthias Saou <matthias.saou@est.une.marmotte.net>
- Reinvented the wheel, but packaged 1.3.11.

* Fri Apr 14 2000 Matt Wilson <msw@redhat.com>
- include subdirs in the help find
- remove gimp-help-files generation
- both gimp and gimp-perl own prefix/lib/gimp/1.1/plug-ins
- both gimp and gimp-devel own prefix/lib/gimp/1.1 and
  prefix/lib/gimp/1.1/modules

* Thu Apr 13 2000 Matt Wilson <msw@redhat.com>
- 1.1.19
- get all .mo files

* Wed Jan 19 2000 Gregory McLean <gregm@comstar.net>
- Version 1.1.15

* Wed Dec 22 1999 Gregory McLean <gregm@comstar.net>
- Version 1.1.14
- Added some auto %files section generation scriptlets


