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

%define gettext_package libgnomeprint-2.0

%define glib2_base_version 2.0.0
%define glib2_version %{glib2_base_version}
%define pango_version 1.0.99
%define libxml2_version 2.4.21
%define libart_lgpl_version 2.3.8
%define libbonobo_version 2.0.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.
Summary(ja): GNOME プリントライブラリ
Name:		libgnomeprint20
Version: 	1.116.0
Release:	0vl2
License:	LGPL
Group:          System Environment/Libraries
Source:         ftp://ftp.gnome.org/pub/GNOME/sources/libgnomeprint/1.116/libgnomeprint-%{version}.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

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

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: freetype2 >= %{freetype_version}
BuildPrereq: gtk-doc >= %{gtk_doc_version}
BuildPrereq: automake14

# Bug fix patches
# remove libexec breakage
Patch3: libgnomeprint-1.105.0.90-libexec.patch
# improve the printing performance
Patch4: libgnomeprint-1.116.0-perfprint.patch
# generate the correct PostScript
Patch5: libgnomeprint-1.116.0-correctps.patch

# for Vine 
# build with newer freetype2
Patch100: libgnomeprint-1.116.0-ft2build.patch

%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: 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: freetype2 >= %{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}

%patch3 -p1 -b .libexec
%patch4 -p0 -b .perfprint
%patch5 -p1 -b .correctps
%patch100 -p1 -b .ft2build

%build

automake-1.4

%configure --disable-font-install
make

%install
rm -rf $RPM_BUILD_ROOT

# It would probably be cleaner to use install DESTDIR=$RPM_BUILD_ROOT
# instead of %%makeinstall with this hack.
%makeinstall FONTMAPDIR_STATIC=$RPM_BUILD_ROOT/usr/share/gnome/libgnomeprint-2.0/fonts
./mkinstalldirs $RPM_BUILD_ROOT/%{_sysconfdir}/gnome/libgnomeprint-2.0/fonts

/bin/rm -rf $RPM_BUILD_ROOT%{_datadir}/gtk-doc

%find_lang %{gettext_package}

#Add redhat-update-gnome-font-install
cat > $RPM_BUILD_ROOT%{_bindir}/redhat-update-gnome-font-install2 << EOF
#! /bin/sh
/usr/bin/libgnomeprint-2.0-font-install					\
	--aliases=%{_datadir}/gnome/libgnomeprint-2.0/fonts/adobe-urw.font		\
	--target=%{_sysconfdir}/gnome/libgnomeprint-2.0/fonts/libgnomeprint-rpm.fontmap	\
	--recursive --clean						\
	/usr/X11R6/lib/X11/fonts/Type1					\
	%{_datadir}/fonts
EOF
chmod 755 $RPM_BUILD_ROOT%{_bindir}/redhat-update-gnome-font-install2

# remove unpackaged files from the buildroot
rm -f $RPM_BUILD_ROOT%{_datadir}/fonts/README.installer
rm -f $RPM_BUILD_ROOT%{_libdir}/libgnomeprint-2.la

%clean
rm -rf $RPM_BUILD_ROOT

%post 
/sbin/ldconfig
## we could pass --dynamic here to install to /etc instead
## but I think it makes more sense to have this not be a config 
## file, then people make their changes in /etc if they want
/usr/bin/redhat-update-gnome-font-install2

%postun -p /sbin/ldconfig

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

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

%{_libdir}/lib*.so
%{_libdir}/*.a
%{_includedir}/*
%{_libdir}/pkgconfig/*

%changelog
* Fri May 26 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.116.0-0vl2
- added Japanese summary
- changed Group to System Environment/Libraries
- added Patch100 for build with newer freetype2

* Tue Jan 21 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 1.116.0-0vl1
- libgnomeprint20 for compatibility

* Mon Dec 16 2002 Havoc Pennington <hp@redhat.com>
- nuke the docs, conflicts with 2.1.x libgnomeprint, and this one is
  deprecated anyway

* Fri Dec 13 2002 Tim Powers <timp@redhat.com> 1.116.0-3
- remove unpackaged files from the buildroot
- don't list the dirs twice in the file list

* Thu Aug 15 2002 Akira TAGOH <tagoh@redhat.com> 1.116.0-2
- libgnomeprint-1.116.0-correctps.patch: applied to fix the invalid PostScript.

* Tue Aug 13 2002 Akira TAGOH <tagoh@redhat.com> 1.116.0-1
- libgnomeprint-1.116.0-perfprint.patch: applied to fix the printing
  performance issue. (#66715)

* Fri Jul 12 2002 Akira TAGOH <tagoh@redhat.com> 1.115.0-5
- includes redhat-update-gnome-font-install2 script. (#66899)
- fix the install path for fontmap.
- add some directory owners.

* Thu Jul 11 2002 Tim Powers <timp@redhat.com>
- rebuilt

* Sun Jun 16 2002 Havoc Pennington <hp@redhat.com>
- 1.115.0
- include gtk-doc docs
- move pkg-config files to -devel package

* Fri Jun 07 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Wed Jun  5 2002 Havoc Pennington <hp@redhat.com>
- 1.114.0

* Mon May 20 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment

* Mon May 20 2002 Havoc Pennington <hp@redhat.com>
- rebuild in different environment
- add bonobo-activation requires to make build system happy

* Mon May 20 2002 Havoc Pennington <hp@redhat.com>
- 1.113.0

* Fri May  3 2002 Havoc Pennington <hp@redhat.com>
- rebuild for new libraries

* Fri Apr 19 2002 Havoc Pennington <hp@redhat.com>
- 1.112.0

* Thu Feb 14 2002 Havoc Pennington <hp@redhat.com>
- 1.111.0

* Wed Jan 30 2002 Owen Taylor <otaylor@redhat.com>
- Version 1.110.0

* Tue Jan 22 2002 Havoc Pennington <hp@redhat.com>
- automake14

* Mon Jan  7 2002 Havoc Pennington <hp@redhat.com>
- 1.109.0.90 snap
- remove .options patch which is upstream
- remove .nofontmaps patch, upstream uses sysconfdir sometimes now
  and has --disable-font-install configure option
- remove .fontmapdir, now fixed upstream

* Tue Nov 27 2001 Havoc Pennington <hp@redhat.com>
- rebuild due to build system fuckup

* Tue Nov 27 2001 Havoc Pennington <hp@redhat.com>
- cvs snap 1.106.0.90, glib 1.3.11

* Sun Oct 28 2001 Havoc Pennington <hp@redhat.com>
- new cvs snap, rebuild for glib 1.3.10, remove bogus gtk dep

* Tue Oct  9 2001 Havoc Pennington <hp@redhat.com>
- remove epoch screwup

* Mon Oct  8 2001 Havoc Pennington <hp@redhat.com>
- libgnomeprint package based on the gnome-print package

* Mon Oct  8 2001 Havoc Pennington <hp@redhat.com>
- use 0.30 tarball

* Sat Sep 22 2001 Havoc Pennington <hp@redhat.com>
- new cvs snap, with headers moved

* Wed Aug 15 2001 Owen Taylor <otaylor@redhat.com>
- Back out freetype change, for now, until we can get it in upstream.
- Move gnome-print/<ver>/profiles back to datadir, and remove the %config.
  Making them %config doesn't seem compatible with locating them
  in gnome-print/<ver>.

* Mon Aug 13 2001 Akira TAGOH <tagoh@redhat.com> 0.29-5
- no replace profiles.

* Mon Aug 13 2001 Akira TAGOH <tagoh@redhat.com> 0.29-4
- Move profiles directory to /etc/gnome-print/<ver>/profiles/

* Mon Aug 13 2001 Akira TAGOH <tagoh@redhat.com> 0.29-3
- Add freetype support patch. (Bug#50360)

* Sat Jul 21 2001 Owen Taylor <otaylor@redhat.com>
- Add missing directory

* Fri Jul 20 2001 Owen Taylor <otaylor@redhat.com>
- Upgrade to 0.29
- Don't install run-gnome-font-install (#48466), run gnome-font-install directly.
- Add BuildPrereq and make -devel package require gdk-pixbuf-devel
- Make libgnomeprint package require gnome-print package; otherwise
  packages requiring libgnomeprint might not get a runtime environment
- Add Prereq on ghostscript, since run-gnome-font-install parses output of 'gs -h'

* Mon Jul 16 2001 Trond Eivind Glomsr藷?<teg@redhat.com>
- Kill output from run-gnome-font-install
- s/Copyright/License/
- Add post/postun scripts for the libgnomeprint subpackage

* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.

* Fri Apr 20 2001 Jonathan Blandford <jrb@redhat.com>
- new version (0.28)

* Thu Mar 01 2001 Owen Taylor <otaylor@redhat.com>
- Rebuild for GTK+-1.2.9 include paths

* Fri Feb 23 2001 Trond Eivind Glomsr藷?<teg@redhat.com>
- langify
- patch it to compile (didn't include locale.h when needed)
- use %%{_tmppath}

* Fri Feb 23 2001 Akira TAGOH <tagoh@redhat.com>
- Fixed font problem for Japanese.
- Fixed library dependency on VFlib (Bug#28331)

* Wed Feb 21 2001 Philipp Knirsch <pknirsch@redhat.de>
- Fixed bugzilla bug #27417, simple specfile %post fix.

* Sun Feb 18 2001 Akira TAGOH <tagoh@redhat.com>
- Fixed PostScript broken.
- Added autoheader,automake,autoconf stuff.

* Thu Feb 08 2001 Florian La Roche <Florian.LaRoche@redhat.de>
- add libtoolize to make porting to new archs easy

* Tue Feb 06 2001 Akira TAGOH <tagoh@redhat.com>
- Updated Japanese patch for Gnumeric.
  Created dummy .afm.

* Mon Feb 05 2001 Akira TAGOH <tagoh@redhat.com>
- Fixed gdk_fontset_load().
- Added Japanese patch for Gnumeric.

* Fri Feb 02 2001 Akira TAGOH <tagoh@redhat.com>
- Added Japanese patch.
  Fixed Print and Preview with Japanese.

* Fri Dec 29 2000 Matt Wilson <msw@redhat.com>
- 0.25

* Sat Aug 19 2000 Preston Brown <pbrown@redhat.com>
- added "|| true" to %%post so that if font-install screws up we don't get a
  bad exit status.  gnome-font-install expects that the directory specified by
  HOME env. var is writable, but it isn't always if you install with 'sudo'
  or the equivalent.  bad. bad. bad.

* Fri Aug 11 2000 Jonathan Blandford <jrb@redhat.com>
- Up Epoch and release

* Fri Jul 14 2000 Matt Wilson <msw@redhat.com>
- redirect %%post script output to /dev/null

* Thu Jul 13 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild

* Thu Jun 29 2000 Owen Taylor <otaylor@redhat.com>
- Spec file fixes
