%define _prefix /opt/freeware
%define _defaultdocdir %{_prefix}/doc
%define glib2_version 2.12.4
%define freetype2_version 2.1.4
#%define pkgconfig_version @pkgconfig_version@

Summary: 	System for layout and rendering of internationalized text.
Name: 		pango
Version: 	1.14.5
Release: 	1
License: 	LGPL
Group: 		System Environment/Libraries
Source: 	ftp://ftp.gtk.org/pub/gtk/v2.1/pango-%{version}.tar.bz2

Patch0:		pango-1.14.5-aix.patch
Patch1:		pango-1.14.5-autotools.patch

URL: 		http://www.pango.org
BuildRoot: 	%{_tmppath}/%{name}-%{version}-root

# We need to prereq this so we can run pango-querymodules
Prereq: glib2 >= %{glib2_version}
Requires: freetype2 >= %{freetype2_version}

# BuildRequires: libtool >= 1.4.2-10
BuildRequires: glib2-devel >= %{glib2_version}
#BuildRequires: pkgconfig >= %{pkgconfig_version}
BuildRequires: freetype2-devel >= %{freetype2_version}
# BuildRequires: fontconfig-devel >= %{fontconfig_version}
# BuildRequires: Xft-devel >= %{xft_version}
# BuildRequires: XFree86-devel >= 4.0.2
Obsoletes: pango-gtkbeta, fribidi-gtkbeta

%description
Pango is a system for layout and rendering of internationalized text.

%package devel
Summary: 	System for layout and rendering of internationalized text.
Group: 		Development/Libraries
Requires: 	pango = %{PACKAGE_VERSION}
Requires: 	glib2-devel >= %{glib2_version}
Requires: 	freetype2-devel >= %{freetype2_version}
#Requires: 	XFree86-devel
#Requires: 	fontconfig-devel >= %{fontconfig_version}
#Requires: 	Xft-devel >= %{xft_version}
Obsoletes: fribidi-gtkbeta-devel, pango-gtkbeta-devel

%description devel
The pango-devel package includes the static libraries, header files,
and developer docs for the pango package.

Install pango-devel if you want to develop programs which will use
pango.

%post
%{_prefix}/bin/pango-querymodules > %{_prefix}/etc/pango/pango.modules
# Prototype support gtk 64 bit
mkdir -p /opt/freeware/64/lib
cd /opt/freeware/64/lib
ln -sf /opt/freeware/lib/libpango-1.0.a .
ln -sf /opt/freeware/lib/libpangocairo-1.0.a .
ln -sf /opt/freeware/lib/libpangoft2-1.0.a .
ln -sf /opt/freeware/lib/libpangox-1.0.a .
ln -sf /opt/freeware/lib/libpangoxft-1.0.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-basic-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-basic-x.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-arabic-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-hangul-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-hebrew-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-indic-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-khmer-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-syriac-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-thai-fc.a .
ln -sf /opt/freeware/lib/pango/1.4.0/modules/libpango-tibetan-fc.a .

%prep
%setup -q

if test x$PATCH = x ; then
  PATCH=patch ;
fi
$PATCH -p2 -s < %{_sourcedir}/pango-1.14.5-aix.patch
$PATCH -p2 -s < %{_sourcedir}/pango-1.14.5-autotools.patch


%build
PATH=%{_bindir}:$PATH ./configure --prefix=%{_prefix} --disable-gtk-doc
LIBPATH=%{_libdir} PATH=%{_bindir}:$PATH make

%install
if test "%{buildroot}" != "/"; then
	rm -rf %{buildroot}
fi
mkdir -p %{buildroot}
make DESTDIR=%{buildroot} install-strip

# Small hack to package the XftConfig file
cp XftConfig %{buildroot}%{_sysconfdir}/XftConfig

# make links
cd %{buildroot}
for dir in bin lib include
do
        mkdir -p usr/$dir
        cd usr/$dir
        ln -sf ../..%{_prefix}/$dir/* .
        cd -
done


%files

%defattr(-, root, system)
%doc README AUTHORS COPYING ChangeLog TODO
%doc examples/HELLO.utf8
%{_prefix}/bin/pango-querymodules
/usr/bin/*
%{_prefix}/lib/libpango*-*.a
/usr/lib/libpango*-*.a
%{_prefix}/lib/pango
%{_mandir}/man1/*
%config %{_sysconfdir}/pango/pangox.aliases
%config %{_sysconfdir}/XftConfig
# %ghost %{_sysconfdir}/pango/pango.modules

%files devel

%defattr(-, root, system)
%{_prefix}/lib/libpango*.la
%{_prefix}/include/*
/usr/include/*
%{_prefix}/lib/pkgconfig/*
%{_prefix}/share/gtk-doc/*

%changelog
*  Fri Nov 17 2006  BULL
 - Release  1
 - New version  version: 1.14.5
 - gnome 2.16.1

*  Mon Sep 18 2006  BULL
 - Release  5
 - support 64 bits

*  Thu Jul 20 2006  BULL
 - Release  4
 - built with ORBit 2.14

*  Thu Jul 10 2006  BULL
 - Release  3
 - New version  version: 1.12.0

*  Tue Jan 17 2006  BULL
 - Release  3

*  Fri Dec 23 2005  BULL
 - Release 2
 - Prototype gtk 64 bit
*  Tue Nov 15 2005  BULL
 - Release  1
 - New version  version: 1.10.0

*  Wed Aug 10 2005  BULL
 - Release  3

*  Mon May 30 2005  BULL
 - Release  2
 - .o removed from lib
*  Wed May 25 2005  BULL
 - Release  1
 - New version  version: 1.8.1
 - Fix Xscreensaver-demo core at initialisation on AIX

*  Tue Nov 23 2004  BULL
 - Release  1
 - New version  version: 1.6.0

*  Wed Jul 28 2004  BULL
 - Release  2
 - fix bug causing the generation of a core file

