File gtk2.spec of Package gtk

#
# spec file for package gtk2 (Version 2.8.11)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           gtk2
BuildRequires:  atk-devel cairo-devel gcc-c++ gnome-patch-translation gtkdoc libtiff-devel pango-devel
Url:            http://www.gtk.org/
%define prefix /opt/gnome
%define sysconfdir /etc%prefix
License:        LGPL v2.1 or later
Group:          System/Libraries
Provides:       gtk2+ 
AutoReqProv:    on
Requires:       gnome-filesystem
PreReq:         /usr/bin/touch /bin/rm /bin/rmdir
Version:        2.12.3
Release:        1.0
Summary:        Library for Creation of Graphical User Interfaces
Source:         ftp://ftp.gnome.org/pub/GNOME/sources/gtk+/2.12/gtk+-%{version}.tar.bz2
Source1:        SuSEconfig.gtk2
Source2:        README.SuSE
Source3:        gtkrc
Patch:          gtk+-strict-aliasing.patch
Patch1:         gtk2-uninitialized.patch
Patch4:         gtk2-filesel-navbuttons.patch
Patch6:         gtk+-mac_ctree.patch
Patch8:         gtk64.patch
Patch12:        gdk-modules-information.diff
#Patch13:        gtk2-esc-closes.diff
#Patch14:        gtktextview.c.diff
#Patch15:        gtk2-gtkicontheme-autoupdate.patch
#Patch17:        gtk2-remove-empty-cache.patch
#Patch21:        gtk2-file-chooser-consistent-home-folder-name.diff
#Patch22:        bugzilla-129753-gtk+-2.8.9-localize-font-style-name.diff
#Patch23:        bugzilla-131498-allow-xim-for-all-languages.patch
#Patch24:        gtk+-2.8.6-fontsel.patch
#Patch25:        gtk2-153213-filechooser-tilde.diff
#Patch29:        gtk2-117163-cairo-repeat-pattern-workaround.diff
#Patch30:        gtk2-filechooser-new-features.diff
#Patch31:        gtk+-2.8.6-fontsel-fix.patch
#Patch32:        gtk2-set-invisible-char-to-circle.patch
#Patch33:        gtk+-context-translation.patch
#Patch34:        gtk2-filechooserbutton-signal-disconnect-fix.patch
#Patch35:        gtk2-179040-file-chooser-location-entry-folder.diff
#Patch36:        gtk2-161043-calendar-sane-timer.diff
#Patch37:        gtk2-184875-filechooser-location-entry-set-path.diff
#Patch38:        gtk2-dragging-icons.patch
#Patch39:        gtk2-expand-file-chooser.diff
#Patch40:        gdk-pixbuf-226710.patch
#Patch41:        gtk2-235661-pixbuf-loader-error-checking.diff
#Patch42:        gtk2-selection-end-on-focus-out.patch
#Patch43:        gtk2-191223-java-selection-fix.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       cairo >= 0.9.2

%description
This fast and versatile library is used all over the world for all
GNOME applications, the GIMP, and several others. Originally it was
written for the GIMP and hence has the name GIMP ToolKit. Many people
like it because it is small, efficient, and very configurable.



Authors:
--------
    Peter Mattis <petm@xcf.berkeley.edu>
    Spencer Kimball <spencer@xcf.berkeley.edu>
    Josh MacDonald <jmacd@xcf.berkeley.edu>
    Shawn T. Amundson <amundson@gtk.org>
    Jerome Bolliet <bolliet@gtk.org>
    Damon Chaplin <damon@gtk.org>
    Tony Gale <gale@gtk.org>
    Jeff Garzik <jgarzik@gtk.org>
    Lars Hamann <lars@gtk.org>
    Raja R Harinath <harinath@gtk.org>
    Carsten Haitzler <raster@gtk.org>
    Tim Janik <timj@gtk.org>
    Stefan Jeske <stefan@gtk.org>
    Elliot Lee <sopwith@gtk.org>
    Raph Levien <raph@gtk.org>
    Ian Main <imain@gtk.org>
    Federico Mena <quartic@gtk.org>
    Paolo Molaro <lupus@gtk.org>
    Jay Painter <jpaint@gtk.org>
    Manish Singh <manish@gtk.org>
    Owen Taylor <otaylor@gtk.org>

%package devel
Summary:        Include Files and Libraries mandatory for Development.
Group:          Development/Libraries/X11
AutoReqProv:    on
Requires:       %{name} = %{version}
Requires:       glibc-devel glib2-devel pango-devel atk-devel %(rpm -q --whatprovides XFree86-devel --queryformat '%{NAME}')
Requires:       cairo-devel

%description devel
This fast and versatile library is used all over the world for all
GNOME applications, the GIMP, and several other applications.
Originally it was written for the GIMP and hence has the name Gimp
ToolKit. Many people like it because it is small, efficient, and very
configurable.



Authors:
--------
    Peter Mattis <petm@xcf.berkeley.edu>
    Spencer Kimball <spencer@xcf.berkeley.edu>
    Josh MacDonald <jmacd@xcf.berkeley.edu>
    Shawn T. Amundson <amundson@gtk.org>
    Jerome Bolliet <bolliet@gtk.org>
    Damon Chaplin <damon@gtk.org>
    Tony Gale <gale@gtk.org>
    Jeff Garzik <jgarzik@gtk.org>
    Lars Hamann <lars@gtk.org>
    Raja R Harinath <harinath@gtk.org>
    Carsten Haitzler <raster@gtk.org>
    Tim Janik <timj@gtk.org>
    Stefan Jeske <stefan@gtk.org>
    Elliot Lee <sopwith@gtk.org>
    Raph Levien <raph@gtk.org>
    Ian Main <imain@gtk.org>
    Federico Mena <quartic@gtk.org>
    Paolo Molaro <lupus@gtk.org>
    Jay Painter <jpaint@gtk.org>
    Manish Singh <manish@gtk.org>
    Owen Taylor <otaylor@gtk.org>

%package doc
Summary:        Additional Package Documentation.
Group:          Development/Libraries/X11
Requires:       %{name} = %{version}

%description doc
This fast and versatile library is used all over the world for all
GNOME applications, the GIMP, and several other applications.
Originally it was written for the GIMP and hence has the name Gimp
ToolKit. Many people like it because it is small, efficient, and very
configurable.



Authors:
--------
    Peter Mattis <petm@xcf.berkeley.edu>
    Spencer Kimball <spencer@xcf.berkeley.edu>
    Josh MacDonald <jmacd@xcf.berkeley.edu>
    Shawn T. Amundson <amundson@gtk.org>
    Jerome Bolliet <bolliet@gtk.org>
    Damon Chaplin <damon@gtk.org>
    Tony Gale <gale@gtk.org>
    Jeff Garzik <jgarzik@gtk.org>
    Lars Hamann <lars@gtk.org>
    Raja R Harinath <harinath@gtk.org>
    Carsten Haitzler <raster@gtk.org>
    Tim Janik <timj@gtk.org>
    Stefan Jeske <stefan@gtk.org>
    Elliot Lee <sopwith@gtk.org>
    Raph Levien <raph@gtk.org>
    Ian Main <imain@gtk.org>
    Federico Mena <quartic@gtk.org>
    Paolo Molaro <lupus@gtk.org>
    Jay Painter <jpaint@gtk.org>
    Manish Singh <manish@gtk.org>
    Owen Taylor <otaylor@gtk.org>

%prep
%setup -q -n gtk+-%{version} 
gnome-patch-translation-prepare
%patch -p1
%patch1
%patch4 -p1
%patch6 -p1
cp -a %{S:1} .
%if "%_lib" == "lib64"
cp -a %{S:2} .
# WARNING: This patch does not patch not installed demos and tests.
%patch8 -p1
%endif
%patch12 -p1
#%patch13 -p1
#%patch43 -p1
gnome-patch-translation-update

%build
%{?suse_update_config:%{suse_update_config -f}}
libtoolize --force
aclocal -I m4macros
automake
autoconf 
## HACK ALERT BEGIN
# work around 9.2 deficiency
if test -f /usr/X11R6/%_lib/libXfixes.a -a ! -f /usr/X11R6/%_lib/libXfixes.so ; then
    ln -sf /usr/X11R6/%_lib/libXfixes.so.? gdk/libXfixes.so
    export LDFLAGS="-L."
fi
## HACK ALERT END
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%if %suse_version > 1000
export CFLAGS="$CFLAGS -fstack-protector"
%endif
%ifarch ppc64
export CFLAGS="$CFLAGS -mminimal-toc"
%endif
# Do not believe glibc first weekday:
# https://bugzilla.novell.com/show_bug.cgi?id=130787
# https://bugzilla.novell.com/show_bug.cgi?id=104417
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=2388
sed -i /HAVE__NL_TIME_FIRST_WEEKDAY/d config.h.in
./configure --prefix=%{prefix} \
	    --libdir=%{prefix}/%_lib \
	    --with-native-locale=yes \
	    --with-xinput=xfree \
	    --mandir=%{prefix}/share/man \
	    --infodir=%{prefix}/share/info \
	    --sysconfdir=%{sysconfdir} \
	    --enable-shm \
	    --enable-xim \
	    --enable-fbmanager \
	    --with-gdktarget=x11
make %{?jobs:-j%jobs}

%install
rm -rf $RPM_BUILD_ROOT
export LIBRARY_PATH=$RPM_BUILD_ROOT/usr/%_lib:$RPM_BUILD_ROOT/usr/%_lib/gtk-2.0/%{version}/loaders:$RPM_BUILD_ROOT/usr/%_lib/gtk-2.0/%{version}
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/sbin/conf.d
mkdir -p $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0
install -m 755 SuSEconfig.gtk2 $RPM_BUILD_ROOT/sbin/conf.d
touch $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gtk.immodules $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gdk-pixbuf.loaders
install %{SOURCE3} $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0
mkdir -p $RPM_BUILD_ROOT/var%{prefix}/cache/gtk-2.0
touch $RPM_BUILD_ROOT/var%{prefix}/cache/gtk-2.0/icon-theme.cache-list
mkdir -p $RPM_BUILD_ROOT%{prefix}/%_lib/gtk-2.0/modules
mkdir -p $RPM_BUILD_ROOT%{prefix}/%_lib/gtk-2.0/immodules
mkdir -p $RPM_BUILD_ROOT%{prefix}/%_lib/gtk-2.0/2.4.0/engines
mkdir -p $RPM_BUILD_ROOT%{prefix}/%_lib/gtk-2.0/2.4.0/filesystems
%find_lang gtk20
%find_lang gtk20-properties gtk20.lang
%if "%_lib" == "lib64"
mv $RPM_BUILD_ROOT%{prefix}/bin/gdk-pixbuf-query-loaders\
 $RPM_BUILD_ROOT%{prefix}/bin/gdk-pixbuf-query-loaders-64
mv $RPM_BUILD_ROOT%{prefix}/bin/gtk-query-immodules-2.0\
 $RPM_BUILD_ROOT%{prefix}/bin/gtk-query-immodules-2.0-64
mv $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gtk.immodules\
 $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gtk64.immodules
mv $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gdk-pixbuf.loaders\
 $RPM_BUILD_ROOT%{sysconfdir}/gtk-2.0/gdk-pixbuf64.loaders
%endif
gzip -9nf $RPM_BUILD_ROOT%{prefix}/share/man/man?/*.?
mkdir -p $RPM_BUILD_ROOT/etc/profile.d
echo 'if test -z "$GTK_PATH" ; then
    export GTK_PATH="/usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0"
else
    export GTK_PATH="/usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0:$GTK_PATH"
fi' > $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
echo 'if ( ${?GTK_PATH} ) then
    setenv GTK_PATH /usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0:${GTK_PATH}
else
    setenv GTK_PATH /usr/local/lib/gtk-2.0:/opt/gnome/lib/gtk-2.0:/usr/lib/gtk-2.0
endif' > $RPM_BUILD_ROOT/etc/profile.d/%{name}.csh
%if "%_lib" == "lib64"
echo 'if test -z "$GTK_PATH64" ; then
    export GTK_PATH64="/usr/local/%_lib/gtk-2.0:/opt/gnome/%_lib/gtk-2.0:/usr/%_lib/gtk-2.0"
else
    export GTK_PATH64="/usr/local/%_lib/gtk-2.0:/opt/gnome/%_lib/gtk-2.0:/usr/%_lib/gtk-2.0:$GTK_PATH64"
fi' >> $RPM_BUILD_ROOT/etc/profile.d/%{name}.sh
echo 'if ( ${?GTK_PATH64} ) then
    setenv GTK_PATH64 /usr/local/%_lib/gtk-2.0:/opt/gnome/%_lib/gtk-2.0:/usr/%_lib/gtk-2.0:${GTK_PATH64}
else
    setenv GTK_PATH64 /usr/local/%_lib/gtk-2.0:/opt/gnome/%_lib/gtk-2.0:/usr/%_lib/gtk-2.0
endif' >> $RPM_BUILD_ROOT/etc/profile.d/%{name}.csh
%endif
rm $RPM_BUILD_ROOT%{prefix}/%_lib/gtk-2.0/2*/*/*.la

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# Remove orphan files and directories obsolete since 9.0.
rm -f\
 etc/gtk-2.0/gdk-pixbuf.loaders\
 etc/gtk-2.0/gtk.immodules
rmdir\
 etc/gtk-2.0\
 usr/lib/gtk-2.0\
 2>/dev/null || true

%post
%run_ldconfig
touch var/adm/SuSEconfig/run-gtk

%preun
# Remove all old icon cache files created by SuSEconfig.gtk2.
# If it is an update, files will be re-created.
if test -f var/opt/gnome/cache/gtk-2.0/icon-theme.cache-list ; then
    for DIR in $(<var/opt/gnome/cache/gtk-2.0/icon-theme.cache-list) ; do
	rm -f $DIR/icon-theme.cache
	rmdir --ignore-fail-on-non-empty $DIR
    done
    rm var/opt/gnome/cache/gtk-2.0/icon-theme.cache-list
fi

%postun
%run_ldconfig

%files -f %files -f gtk20.lang
%defattr(-,root,root)
%if "%_lib" == "lib64"
%doc AUTHORS COPYING README README.SuSE NEWS ChangeLog 
%ghost %{sysconfdir}/gtk-2.0/gtk64.immodules
%ghost %{sysconfdir}/gtk-2.0/gdk-pixbuf64.loaders
%else
%doc AUTHORS COPYING README NEWS ChangeLog 
%ghost %{sysconfdir}/gtk-2.0/gtk.immodules
%ghost %{sysconfdir}/gtk-2.0/gdk-pixbuf.loaders
%endif
%{sysconfdir}/gtk-2.0/gtkrc
%{prefix}/bin/*query*
%{prefix}/bin/gtk-builder-convert
%{prefix}/bin/gtk-update-icon-cache
%{prefix}/%_lib/lib*.so.*
%dir %{prefix}/%_lib/gtk-2.0
%dir %{prefix}/%_lib/gtk-2.0/[2me]*
%dir %{prefix}/%_lib/gtk-2.0/immodules
%dir %{prefix}/%_lib/gtk-2.0/2*/*
%{prefix}/%_lib/gtk-2.0/2*/*/*.so
%{prefix}/share/themes/*
%dir %{sysconfdir}/gtk-2.0
%dir %{sysconfdir}/gtk-2.0/im-multipress.conf
/etc/profile.d/*
/sbin/conf.d/SuSEconfig.gtk2
%dir /var%{prefix}/cache/gtk-2.0
%ghost /var%{prefix}/cache/gtk-2.0/icon-theme.cache-list

%files devel
%defattr(-,root,root)
%{prefix}/bin/*-demo
%{prefix}/bin/*-csource
%{prefix}/include/gtk-2.0
%{prefix}/include/gtk-unix-print-2.0
%{prefix}/%_lib/lib*.so
%{prefix}/%_lib/lib*a
#%{prefix}/%_lib/gtk-2.0/2*/*/*.la
%{prefix}/%_lib/gtk-2.0/include
%{prefix}/%_lib/pkgconfig/*.pc
%{prefix}/share/gtk-2.0
%{prefix}/share/aclocal/*.m4
%doc %{prefix}/share/man/man*/*

%files doc
%defattr(-,root,root)
%{prefix}/share/gtk-doc/html/*

%changelog
* Fri Dec 21 2007 - psankar@suse.de
- 2.12.3 tarball pushing
openSUSE Build Service is sponsored by