%define glib2_version 2.20.0
%define libbonobo_version 2.24.2
%define libxml2_version 2.6.0
%define libxslt_version 1.0.30
%define gconf2_version 2.26.0
%define gnome_vfs2_version 2.24.2
%define orbit2_version 2.14.17

%define po_package libgnome-2.0

%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}

Summary: GNOME base library
Summary(ja): GNOME 基本ライブラリ
Name: libgnome
Version: 2.32.1
Release: 3%{?_dist_release}
URL: ftp://ftp.gnome.org/
Source0: http://ftp.gnome.org/pub/GNOME/sources/libgnome/2.32/%{name}-%{version}.tar.bz2
License: LGPLv2+
Group: System Environment/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-root

Requires:  glib2 >= %{glib2_version}
Requires:  libbonobo >= %{libbonobo_version}
Requires:  gnome-vfs2 >= %{gnome_vfs2_version}
Requires:  libxml2 >= %{libxml2_version}
Requires:  ORBit2 >= %{orbit2_version}
Requires:  libxslt >= %{libxslt_version}
Requires:  vine-backgrounds >= 2.0
Requires(post,pre,preun):  GConf2 >= %{gconf2_version}
# Added to avoid the warning messages about utmp group, bug #24171
# fixme, just libzvt?
Requires(post): utempter

BuildRequires:	zlib-devel
BuildRequires:	glib2-devel >= %{glib2_version}
BuildRequires:  libbonobo-devel >= %{libbonobo_version}
BuildRequires:  GConf2-devel >= %{gconf2_version}
BuildRequires:  gnome-vfs2-devel >= %{gnome_vfs2_version}
BuildRequires:  libxml2-devel >= %{libxml2_version}
BuildRequires:  ORBit2-devel >= %{orbit2_version}
BuildRequires:  libxslt-devel >= %{libxslt_version}
BuildRequires:  intltool
BuildRequires:  popt-devel >= 1.5
BuildRequires:	libcanberra-devel

Patch0: libgnome-2.20.1.1-default-theme-vine.patch
Patch1: libgnome-2.26.0-default-background-vine.patch
Patch2: libgnome-2.8.0-default-cursor-vine.patch
Patch3: libgnome-2.11.1-scoreloc.patch
Patch5: libgnome-2.8.0-default-browser.patch
Patch6: libgnome-2.32.1-default-settings-vine.patch
Patch7: libgnome-2.9.1-popt.patch

Patch11: libgnome-2.32.1-glib-2.36.x.patch

%description
GNOME (GNU Network Object Model Environment) is a user-friendly set of
GUI applications and desktop tools to be used in conjunction with a
window manager for the X Window System. The libgnome package includes
non-GUI-related libraries that are needed to run GNOME. The libgnomeui
package contains X11-dependent GNOME library features.


%package devel
Summary: Libraries and headers for libgnome
Summary(ja): libgnome の開発用ライブラリおよびヘッダファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

Conflicts: gnome-libs-devel < 1.4.1.2
Requires: zlib-devel
Requires: ORBit2-devel >= %{orbit2_version}
Requires: glib2-devel >= %{glib2_version}
Requires: libbonobo-devel >= %{libbonobo_version}
Requires: GConf2-devel >= %{gconf2_version}
Requires: gnome-vfs2-devel >= %{gnome_vfs2_version}
Requires: libxml2-devel >= %{libxml2_version}
Requires: libxslt-devel >= %{libxslt_version}
Requires: popt-devel
Requires: libcanberra-devel

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

You should install the libgnome-devel package if you would like to
compile GNOME applications. You do not need to install libgnome-devel
if you just want to use the GNOME desktop environment.


# compat32
%package -n compat32-%{name}
Summary: GNOME base library
Summary(ja): GNOME 基本ライブラリ
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description -n compat32-%{name}
GNOME (GNU Network Object Model Environment) is a user-friendly set of
GUI applications and desktop tools to be used in conjunction with a
window manager for the X Window System. The libgnome package includes
non-GUI-related libraries that are needed to run GNOME. The libgnomeui
package contains X11-dependent GNOME library features.


%package -n compat32-%{name}-devel
Summary: Libraries and headers for libgnome
Summary(ja): libgnome の開発用ライブラリおよびヘッダファイル
Group: Development/Libraries
Requires: %{name}-devel = %{version}-%{release}
Requires: compat32-%{name} = %{version}-%{release}
Requires: compat32-zlib-devel
Requires: compat32-ORBit2-devel >= %{orbit2_version}
Requires: compat32-glib2-devel >= %{glib2_version}
Requires: compat32-libbonobo-devel >= %{libbonobo_version}
Requires: compat32-GConf2-devel >= %{gconf2_version}
Requires: compat32-gnome-vfs2-devel >= %{gnome_vfs2_version}
Requires: compat32-libxml2-devel >= %{libxml2_version}
Requires: compat32-libxslt-devel >= %{libxslt_version}
Requires: compat32-popt-devel

%description -n compat32-%{name}-devel
GNOME (GNU Network Object Model Environment) is a user-friendly set of
GUI applications and desktop tools to be used in conjunction with a
window manager for the X Window System. The libgnome-devel package
includes the libraries and include files that you will need to
use libgnome.

You should install the libgnome-devel package if you would like to
compile GNOME applications. You do not need to install libgnome-devel
if you just want to use the GNOME desktop environment.

%prep
%setup -q

%patch0 -p1 -b .default-theme
%patch1 -p1 -b .default-background
%patch2 -p1 -b .default-cursor
%patch3 -p1 -b .scoreloc
%patch5 -p1 -b .default-browser
%patch6 -p1 -b .default-settings
%patch7 -p1 -b .popt

%patch11 -p1 -b .glib

%build
%configure --disable-gtk-doc --disable-schemas-install --disable-static --disable-esd
./config.status
export tagname=CC
make %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool

%install
rm -rf $RPM_BUILD_ROOT
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
export tagname=CC
%makeinstall LIBTOOL=%{_bindir}/libtool
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL

rm $RPM_BUILD_ROOT%{_libdir}/*.{a,la}
rm -f $RPM_BUILD_ROOT%{_libdir}/bonobo/monikers/*.{a,la}

for serverfile in $RPM_BUILD_ROOT%{_libdir}/bonobo/servers/*.server; do
    sed -i -e 's|location *= *"/usr/lib\(64\)*/|location="/usr/$LIB/|' $serverfile
done

mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel/.gnome2

# http://bugzilla.gnome.org/show_bug.cgi?id=477846
rm -rf $RPM_BUILD_ROOT%{_datadir}/gnome-background-properties
rm -rf $RPM_BUILD_ROOT%{_datadir}/pixmaps

%find_lang %{po_package}

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/ldconfig
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/desktop_gnome_*.schemas > /dev/null 2>&1 || :

%pre
if [ "$1" -gt 1 ]; then 
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/desktop_gnome_*.schemas > /dev/null || :
fi

%preun
if [ "$1" -eq 0 ]; then 
  export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
  gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/desktop_gnome_*.schemas > /dev/null || :
fi

%postun -p /sbin/ldconfig

%post -n compat32-%{name} -p /sbin/ldconfig

%postun -n compat32-%{name} -p /sbin/ldconfig

%files -f %{po_package}.lang
%defattr(-,root,root)
%doc AUTHORS COPYING.LIB ChangeLog NEWS README
%{_bindir}/*
%{_libdir}/lib*.so.*
%{_libdir}/bonobo/*
%{_sysconfdir}/gconf/schemas/*
%{_sysconfdir}/sound
%{_sysconfdir}/skel/.gnome2
%{_mandir}/man?/*
#{_datadir}/gnome-background-properties
#{_datadir}/pixmaps/backgrounds/gnome/*

%files devel
%defattr(-,root,root)
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*.pc
%{_includedir}/*
%{_datadir}/gtk-doc/html/*

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/lib*.so.*
%{_libdir}/bonobo/*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/lib*.so
%endif

%changelog
* Tue Dec 31 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.1-3
- rebuild with VineSeed environment
- add Patch11 (libgnome-2.32.1-glib-2.36.x.patch)

* Wed Jun 01 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.32.1-2
- update patch6 to enable {buttons,menus}_have_icons

* Sat Feb 05 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.1-1
- new upstream release

* Sat Oct 02 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.0-1
- new upstream release
- remove BuildRequires: esound-devel
- remove Requires: esound-devel (devel package)
- add BuildRequires: libcanberra-devel
- add Requires: libcanberra-devel (devel package)

* Tue Sep 21 2010 IWAI, Masaharu <iwai@alib.jp> 2.30.0-2
- build with rpm-4.8.1-1 for pkg-config file

* Wed Mar 31 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.0-1
- new upstream release

* Sat Oct 31 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.28.0-1
- new upstream release

* Sun Jul 12 2009 NAKAMURA Kenta <kenta@vinelinux.org> 2.26.0-4
- added compat32 package for x86_64 arch support

* Tue May 19 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.0-3
- add Requires: popt-devel to -devel

* Mon Apr 13 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.0-2
- update Patch1 to set "zoom" for picture_options instead of "stretched"

* Sat Mar 21 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.0-1
- new upstream release
- disable static libs

* Tue Sep 23 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.24.1-1
- new upstream release

* Tue Sep 23 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.24.0-1
- new upstream release

* Wed Apr  2 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.22.0-2vl5
- added Patch6, dropped Patch10

* Sat Mar 22 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.22.0-1vl5
- new upstream release
- dropped Patch6 (was merged into new upstream)

* Tue Dec 11 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.20.1.1-0vl1
- new upstream release
- updated Patch0 and 1

* Wed Apr 25 2007 Daisuke SUZUKI <daisuke@linux.or.jp> 2.18.0-0vl1
- new upstream release

* Wed Feb  7 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.14.1-0vl3
- remove bonobo-activation-devel dependancy <BTS:464>

* Fri Jun 30 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.14.1-0vl2
- add bindtextdomain/bindtextdomain_codeset before initilize help
  options to fix corruption of help option message.

* Wed Apr 12 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.14.1-0vl1
- new upstream release

* Mon Mar 06 2006 Daisuke SUZUKI <daisuke@linux.or.jp> 2.13.90-0vl1
- new upstream release

* Sun Sep 18 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.12.0.1-0vl1
- new upstream release

* Sun Aug 28 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.11.3-0vl1
- new upstream release

* Fri Aug 05 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.11.2-0vl1
- new upstream release

* Tue Aug 02 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.11.1-0vl1
- new upstream release

* Mon Jul 11 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.10.1-0vl1
- new upstream release

* Mon Mar 28 2005 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.10.0-0vl2
- patch100 disabled (no va_list problem on current gcc)

* Mon Mar 21 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.10.0-0vl1
- new upstream version

* Sun Mar 20 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.1-0vl5
- change default {icons,cursor,gtk} theme to Vine.

* Sun Mar 06 2005 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.8.1-0vl4
- added patch100 for ppc
- (FYI: Inagaki-san's 2.8.1-0vl1 was actually 0vl3)

* Thu Feb 24 2005 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.8.1-0vl1
- new upstream release

* Thu Nov 11 2004 MATSUBAYASHI Kohji <shaolin@vinelinux.org> 2.8.0-0vl3
- gnome_vfs2_version macro set to 2.5.3

* Sun Nov 07 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.0-0vl2
- update Vine default patches for gnome-2.8

* Sun Nov 07 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.8.0-0vl1
- new upstream release

* Tue Mar  9 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.0-0vl3
- change default wallpaper to default.jpg
- add Requires: vine-backgrouonds >= 2.0

* Mon Sep 08 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.0-0vl2
- fix default-theme patch

* Wed Sep 03 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.4.0-0vl1
- new upstream release

* Tue Aug 19 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.2.3-0vl1
- new upstream release

* Wed Jun 25 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.2-0vl2
- update patch0 to use NeoVine as default gtk theme

* Tue Jun 24 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.2-0vl1
- new upstream release

* Tue Jun 03 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.1-0vl1
- new upstream release

* Fri Jan 24 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.0.1-0vl1
- new upstream release

* Wed Jan 22 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.2.0-0vl1
- new upstream release

* Fri Jan 10 2003 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.90-0vl1
- new upstream release

* Wed Dec 25 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.5-0vl1
- new upstream release

* Sat Dec 14 2002 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.4-0vl1
- build for Vine Linux
- new upstream release (gnome-2.1.4)

* Wed Aug 28 2002 Matt Wilson <msw@redhat.com> 2.0.2-5
- added libgnome-2.0.2-program-init.patch to enable correct module
  initialization when gnome_program_init is called after
  gnome_program_module_register

* Wed Aug 21 2002 Elliot Lee <sopwith@redhat.com> 2.0.2-4
- Fix #64908 with patch3 (scoreloc)
- Add smp_mflags

* Mon Aug 12 2002 Havoc Pennington <hp@redhat.com>
- s/Wonderland/Bluecurve/

* Thu Aug  8 2002 Havoc Pennington <hp@redhat.com>
- change default background to new spec from garrett

* Wed Aug  7 2002 Havoc Pennington <hp@redhat.com>
- 2.0.2

* Wed Jul 24 2002 Owen Taylor <otaylor@redhat.com>
- Add schema for monospaced font

* Wed Jun 26 2002 Owen Taylor <otaylor@redhat.com>
- Fix find_lang

* Sun Jun 16 2002 Havoc Pennington <hp@redhat.com>
- 2.0.1
- put bonobo monikers in file list (don't know what they 
  do, but assuming they do something)
- include /etc/sound in file list

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

* Mon Jun 10 2002 Havoc Pennington <hp@redhat.com>
- change default gtk theme to Wonderland

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

* Wed Jun  5 2002 Havoc Pennington <hp@redhat.com>
- 1.117.2
- add ldconfig calls

* 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 build requires

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

* Fri May  3 2002 Havoc Pennington <hp@redhat.com>
- 1.116.0

* Thu Apr  4 2002 Jeremy Katz <katzj@redhat.com>
- 1.114.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>
- remove bogus dependency on libdb1

* Thu Jan  3 2002 Havoc Pennington <hp@redhat.com>
- fix the post script

* Thu Jan  3 2002 Havoc Pennington <hp@redhat.com>
- 1.108.0.90 cvs snap

* Tue Nov 27 2001 Havoc Pennington <hp@redhat.com>
- fix .schemas in post

* Tue Nov 27 2001 Havoc Pennington <hp@redhat.com>
- update CVS snap to 1.107.0.90, glib 1.3.11
- add libxslt dep
- require specific versions of dependent libs
- add bunch of missing stuff to file list
- install gconf schemas in post

* Sun Oct 28 2001 Havoc Pennington <hp@redhat.com>
- well, you only get the new CVS snap if you actually change the version in the spec file, doh

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

* Fri Sep 21 2001 Havoc Pennington <hp@redhat.com>
- new CVS snap, rebuild in 7.2-gnome

* Tue Sep 18 2001 Havoc Pennington <hp@redhat.com>
- Initial build.
- remove gtk2 dependency, doh
