File gtk.spec of Package gtk1

#
# spec file for package gtk
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           gtk
Version:        1.2.10
Release:        0
%define _name gtk+
BuildRequires:  autoconf
BuildRequires:  automake
%if 0%{?suse_version} > 1030
BuildRequires:  fdupes
%endif
Url:            http://www.gtk.org/
BuildRequires:  glib-devel
BuildRequires:  gnome-patch-translation
BuildRequires:  libtool
BuildRequires:  xorg-x11-devel
Provides:       %{_name} = %{version}
Provides:       gtkn
# bug437293
%ifarch ppc64
Obsoletes:      gtk-64bit
%endif
# /bug437293
Summary:        A Library for the Creation of Graphical User Interfaces
License:        LGPL-2.0+
Group:          System/Libraries
Source:         %{_name}-%{version}.tar.bz2
Source1:        gtkrc.unifont
Source99:       baselibs.conf
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         gtk+-%{version}.dif
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch1:         gtk-cvs.dif
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch2:         gtk+-%{version}-nolibtool.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch3:         gtk-fix-dnd-crash.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch4:         gtk-filesel-dirchanged-fix.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch5:         gtk+-1.2.10-acdivert.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch6:         gtk+-1.2.10-gtkrc.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch7:         cflags-gtk-config.dif
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch8:         gtk-autoconf.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch9:         gtk-filesel-navigation-buttons.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch10:        gtk+-%{version}-automake.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch11:        gtk+-%{version}-gtkrc_az.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch12:        gtk+-%{version}-gettext.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch13:        gtk.patch
Requires:       %{name}-lang = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This fast and versatile library was 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.

Most applications which used GTK1 have since switched to gtk2 (GTK2).
Besides a more flexible API, it provides improved text rendering using
pango (Pango) and many other goodies, but GTK+ 2 lacks compatibility
with GTK1, so to switch, programmers have to port applications to it.

Thus, some applications for which GTK1 is sufficient, still to use
GTK1. GTK1 remains faster and less complex than GTK2. To develop
applications with gtk, you need the package gtk-devel.

%package devel
Summary:        Developer Files for GIMP ToolKit
Group:          Development/Libraries/X11
Requires:       glib-devel
Requires:       gtk = %{version}
Requires:       xorg-x11-devel
Obsoletes:      gtkdev
Provides:       gtkdev
Requires(pre):  %install_info_prereq

%description devel
All the files necessary to start your own GTK development. Also see the
gtk package.

%lang_package
%prep
%setup -q -n %{_name}-%{version}
gnome-patch-translation-prepare
cp -a %{SOURCE1} .
%patch0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch6 -p1
%patch7 -p1
%patch8
%patch9 -p1
%patch10
%patch11
%patch12
%patch13
rename no nb po/no.*
sed -i "s/\(ALL_LINGUAS.*\) no /\1 nb /" configure.in
sed -i s/iso-8859-9e/iso-8859-9/ po/az.po
# FIXME: Strange: iconv supports it, msgconv does not
iconv -f TCVN-5712 -t UTF-8 po/vi.po >po/vi.po.new ; mv po/vi.po.new po/vi.po ; sed -i s/TCVN-5712/UTF-8/ po/vi.po
gnome-patch-translation-update

%build
autoreconf -f -i
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure --disable-static --with-pic \
	--with-native-locale=yes\
	--with-xinput=xfree
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install
mkdir -p %{buildroot}%{_libdir}/gtk/themes/engines
rm %{buildroot}%{_infodir}/dir
%find_lang %{_name}
cp -a gtkrc.unifont %{buildroot}%{_sysconfdir}/gtk
cd %{buildroot}%{_sysconfdir}/gtk
test -f gtkrc.zh_TW.big5 -a ! -f gtkrc.zh_TW && ln -s gtkrc.zh_TW.big5 gtkrc.zh_TW
# Locales, which can work with special gtkrc.unifont, but not copy of non-UTF-8 gtkrc.
for rcfile in he hy ka ko ru th uk vi yi zh ; do
    ln -s gtkrc.unifont gtkrc.$rcfile.utf8
done
# Locales, which can work with copy of gtkrc, used for the same non-UTF-8 locales.
for rcfile in gtkrc.?? ; do
    if ! test -e $rcfile.utf8 ; then
	if test -L $rcfile ; then
	    rcdest=$(readlink $rcfile)
# These locales, can work with universal UTF-8 gtkrc (mostly Latin ones).
	    rcrestr=${rcdest%gtkrc.iso8859[12349]}
	    rcrest=${rcdest%gtkrc.iso88591[0345]}
	    if test "$rcdest" != "$rcrest" ; then
		cp -d $rcfile $rcfile.utf8
	    fi
	else
	    ln -s $rcfile $rcfile.utf8
	fi
    fi
done
%if 0%{?suse_version} > 1030
%fdupes %{buildroot}
%endif
%if 0%{?suse_version} > 1110
rm -f %{buildroot}%{_libdir}/*.la
%endif
%{buildroot}%{_bindir}/gtk-config --libs

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gdk.info.gz

%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gdk.info.gz

%files
%defattr(-, root, root)
%doc AUTHORS COPYING README NEWS ChangeLog
%{_libdir}/*.so.*
%dir %{_libdir}/gtk
%dir %{_libdir}/gtk/themes
%dir %{_libdir}/gtk/themes/engines
%{_datadir}/themes/*
%{_sysconfdir}/gtk

%files lang -f %{_name}.lang

%files devel
%defattr(-, root, root)
%{_bindir}/*
%{_datadir}/aclocal/*.m4
%{_includedir}/*
%doc %{_infodir}/*.info*
%doc %{_mandir}/man?/*.*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc
%if 0%{?suse_version} <= 1110
%{_libdir}/*.la
%endif

%changelog
openSUSE Build Service is sponsored by