## this could go, it's really just so we notice if the soname changes
%define sover 0

%define gettext_package libgnomeprint-2.2

%define glib2_base_version 2.2.0
%define glib2_version %{glib2_base_version}
%define pango_version 1.2.0
%define libxml2_version 2.5
%define libart_lgpl_version 2.3.8
%define libbonobo_version 2.1.0
%define bonobo_activation_version 1.0.0
%define freetype_version 2.0.3
%define gtk_doc_version 0.9

Summary: Printing library for GNOME.
Name:           libgnomeprint22
Version:        2.2.1.1
Release:        3
License:        LGPL
Group:          System Environment/Base
Source:         libgnomeprint-%{version}.tar.bz2
URL:            http://ftp.gnome.org/pub/GNOME/sources/libgnomeprint/
BuildRoot:      %{_tmppath}/%{name}-%{version}-root

# http://bugzilla.gnome.org/show_bug.cgi?id=106984
Patch0: libgnomeprint-2.2.1.1-defaultval.patch

PreReq: urw-fonts
PreReq: ghostscript
PreReq: ghostscript-fonts
PreReq: libxml
PreReq: perl
PreReq: XFree86

BuildPrereq: glib2-devel >= %{glib2_version}
BuildPrereq: pango-devel >= %{pango_version}
BuildPrereq: libxml2-devel >= %{libxml2_version}
BuildPrereq: libart_lgpl-devel >= %{libart_lgpl_version}
BuildPrereq: libbonobo-devel >= %{libbonobo_version}
BuildPrereq: bonobo-activation-devel >= %{bonobo_activation_version}
BuildPrereq: freetype >= %{freetype_version}
BuildPrereq: gtk-doc >= %{gtk_doc_version}
BuildPrereq: fontconfig
BuildPrereq: cups-devel

%description
GNOME (GNU Network Object Model Environment) is a user-friendly set of
applications and desktop tools to be used in conjunction with a window
manager for the X Window System. The gnome-print package contains
libraries and fonts needed by GNOME applications for printing.

You should install the gnome-print package if you intend to use any of
the GNOME applications that can print. If you would like to develop
GNOME applications that can print you will also need to install the
gnome-print devel package.

%package devel
Summary: Libraries and include files for developing GNOME applications.
Group: Development/Libraries

Requires: %{name} = %{PACKAGE_VERSION}
Requires: libgnomeprint22 = %{PACKAGE_VERSION}

Requires: glib2-devel >= %{glib2_version}
Requires: pango-devel >= %{pango_version}
Requires: libxml2-devel >= %{libxml2_version}
Requires: libart_lgpl-devel >= %{libart_lgpl_version}
Requires: libbonobo-devel >= %{libbonobo_version}
Requires: bonobo-activation-devel >= %{bonobo_activation_version}
Requires: freetype >= %{freetype_version}

%description devel
GNOME (GNU Network Object Model Environment) is a user-friendly set of
applications and desktop tools to be used in conjunction with a window
manager for the X Window System. The gnome-print-devel package
includes the libraries and include files needed for developing
applications that use the GNOME printing capabilities.

You should install the gnome-print-devel package if you would like to
develop GNOME applications that will use the GNOME print capabilities.
You do not need to install the gnome-print-devel package if you just
want to use the GNOME desktop environment.

%prep
%setup -q -n libgnomeprint-%{version}

%patch0 -p1 -b .defaultval

%build

%configure
make LIBTOOL=/usr/bin/libtool

%install
rm -rf $RPM_BUILD_ROOT

%makeinstall LIBTOOL=/usr/bin/libtool

# remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la

%find_lang %{gettext_package}

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{gettext_package}.lang
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog NEWS README
%{_libdir}/lib*.so.%{sover}
%{_libdir}/lib*.so.%{sover}.*
%{_libdir}/libgnomeprint
%{_datadir}/libgnomeprint

%files devel
%defattr(-, root, root)

%{_libdir}/lib*.so
%{_libdir}/*.a
%{_includedir}/*
%{_libdir}/pkgconfig/*
%{_datadir}/gtk-doc

%changelog
* Mon Feb 24 2003 Owen Taylor <otaylor@redhat.com>
- Fix crash from HP Color LaserJet 4500 PPD file
  (http://bugzilla.gnome.org/show_bug.cgi?id=106984)

* Fri Feb 14 2003 Tim Powers <timp@redhat.com> 2.2.1.1-2
- remove buildreq on Xft

* Tue Feb  4 2003 Alexander Larsson <alexl@redhat.com> 2.2.1.1-1
- Update to 2.2.1.1 (needed for new gedit)

* Tue Jan 28 2003 Matt Wilson <msw@redhat.com> 2.1.8-4
- BuildPrereq: cups-devel and use LIBTOOL=/usr/bin/libtool

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Fri Jan 17 2003 Havoc Pennington <hp@redhat.com>
- rebuild to get all arches

* Thu Jan 16 2003 Havoc Pennington <hp@redhat.com>
- 2.1.8

* Tue Jan  7 2003 Nalin Dahyabhai <nalin@redhat.com> 2.1.4-3
- rebuild

* Mon Dec 16 2002 Havoc Pennington <hp@redhat.com>
- initial build of libgnomeprint 2.2 (version 2.1.4)
- don't try to prereq ourselves, wtf was that about