Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37407390
en ru br
ALT Linux repos
S:2.24.33-alt1
5.0: 2.16.1-alt1
4.1: 2.12.12-alt0.M41.4
4.0: 2.10.14-alt1
3.0: 2.6.7-alt1

Group :: System/Libraries
RPM: libgtk+2

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%def_disable snapshot

%define _name gtk+
%define api_ver 2.0
%define binary_ver 2.10.0
%define ver_major 2.24

%def_enable xkb

%if_enabled snapshot
%def_enable gtk_doc
%else
%def_disable gtk_doc
%endif

%def_enable man
%def_disable introspection
%def_disable debug

Name: libgtk+2
Version: %ver_major.33
Release: alt1

Summary: The GIMP ToolKit (GTK+), a library for creating GUIs
License: LGPL-2.0
Group: System/Libraries
Url: http://www.gtk.org
Icon: gtk+-logo.xpm

Provides: libgtk2 = %version gtk2 = %version gtk+2 = %version gtk-engines-pixmap = %version
Obsoletes: libgtk2 < %version gtk2 < %version gtk+2 < %version gtk-engines-pixmap < %version
Provides: %name-common = %version
Obsoletes: %name-common <= %version

%if_enabled snapshot
Source: %_name-%version.tar
%else
Source: %gnome_ftp/%_name/%ver_major/%_name-%version.tar.xz
%endif

Source1: %name-gdk.map
Source2: %name-gdk.lds
Source3: %name-gtk.map
Source4: %name-gtk.lds

Patch1: gtk+-2.16.5-alt-stop-spam.patch
Patch6: gtk+-2.10.6-fix-drop-gdk_colormap_change.patch

# https://bugzilla.gnome.org/show_bug.cgi?id=583273

Patch10: gtk+-2.24.30-icon-padding.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=599618
Patch12: gtk+-2.24.30-tooltip-positioning.patch

%define glib_ver 2.28.0
%define cairo_ver 1.6
%define pango_ver 1.28.3
%define atk_ver 1.32.0
%define directfb_ver 0.9.24
%define fontconfig_ver 2.2.1-alt2
%define gtk_doc_ver 1.6

Requires: %name-locales = %version
Requires: gtk-update-icon-cache
Requires: icon-theme-hicolor

BuildRequires(pre): rpm-build-gnome rpm-build-python3
BuildRequires: glib2-devel >= %glib_ver
BuildRequires: libcairo-devel >= %cairo_ver
BuildRequires: libpango-devel >= %pango_ver
BuildRequires: libatk-devel >= %atk_ver
BuildRequires: fontconfig-devel >= %fontconfig_ver
BuildRequires: gtk-doc >= %gtk_doc_ver
BuildRequires: libgio-devel libgdk-pixbuf-devel libcairo-gobject-devel libcups-devel gcc-c++ indent zlib-devel
%if_enabled introspection
BuildRequires(pre): rpm-build-gir
BuildRequires: gobject-introspection-devel libpango-gir-devel libatk-gir-devel >= %atk_ver libgdk-pixbuf-gir-devel
%endif
BuildRequires: libXdamage-devel libXcomposite-devel libX11-devel libXcursor-devel
BuildRequires: libXext-devel libXfixes-devel libXi-devel libXinerama-devel libXrandr-devel libXrender-devel

%description
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
%if_enabled debug

The library in this package has been built with --enable-debug;
for debugging, set GTK_DEBUG environment variable to an appropriate value.
%endif

%package locales
Summary: Internationalization for GTK+
Group: System/Internationalization
Conflicts: %name < %EVR
BuildArch: noarch

%description locales
This package provides internationalization support for GTK+,
the GIMP toolkit.

%package -n gtk-builder-convert
Summary: Glade file conversion utility
Group: Development/GNOME and GTK+
BuildArch: noarch

%description -n gtk-builder-convert
gtk-builder-convert converts glade files into XML files which can be
loaded with GtkBuilder.

%package devel
Summary: Development files and tools for GTK+ applications
Group: Development/GNOME and GTK+
Icon: gtk+-devel-logo.xpm
Requires: %name = %EVR
Requires: gtk-builder-convert = %version
Provides: libgtk2-devel = %version gtk2-devel = %version gtk+2-devel = %version
Obsoletes: libgtk2-devel < %version gtk2-devel < %version gtk+2-devel < %version
Provides: %name-common-devel = %version
Obsoletes: %name-common-devel <= %version

%description devel
This package contains development files for GTK+, X11 version. Use this to
build programs that use GTK+.

%package -n gtk-demo
Summary: GTK+ widgets demonstration program
Group: Development/GNOME and GTK+
Requires: %name = %EVR

%description -n gtk-demo
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
This package contains a program, along with its source code, that
demonstrates GTK+ variety of all its widgets.

%package devel-doc
Summary: Development documentation for GTK+
Group: Development/GNOME and GTK+
Conflicts: %name < %version, %name > %version
BuildArch: noarch

%description devel-doc
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
This package contains documentation needed for developing GTK+ applications.

%package devel-doc-examples
Summary: Examples for developing applications which will use GTK+
Group: Development/GNOME and GTK+
Conflicts: %name < %EVR
BuildArch: noarch

%description devel-doc-examples
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
This package contains sources for example programs.

%package gir
Summary: GObject introspection data for the GTK+ library
Group: System/Libraries
Requires: %name = %EVR

%description gir
GObject introspection data for the GTK+ library

%package gir-devel
Summary: GObject introspection devel data for the GTK+ library
Group: System/Libraries
BuildArch: noarch
Requires: %name-gir = %EVR
Requires: %name-devel = %EVR

%description gir-devel
GObject introspection devel data for the GTK+ library

%package -n libgail
Summary: Accessibility implementation for GTK+ and GNOME libraries
Group: System/Libraries
Requires: %name = %EVR

%description -n libgail
GAIL implements the abstract interfaces found in ATK for GTK+ and GNOME libraries,
enabling accessibility technologies such as at-spi to access those GUIs.

%package -n libgail-devel
Summary: Files to compile applications that use GAIL
Group: Development/GNOME and GTK+
Requires: libgail = %EVR
Requires: %name-devel = %EVR

%description -n libgail-devel
This package contains the files required to develop applications against
the GAIL libraries.

%package -n libgail-devel-doc
Summary: Development documentation for GAIL
Group: Development/GNOME and GTK+
Conflicts: libgail < %EVR
BuildArch: noarch

%description -n libgail-devel-doc
GAIL implements the abstract interfaces found in ATK for GTK+ and GNOME
libraries, enabling accessibility technologies such as at-spi to access
those GUIs.

This package contains development documentation for GAIL.

%define fulllibpath %_libdir/gtk-%api_ver/%binary_ver

%prep
%setup -n %_name-%version
install -p -m644 %_sourcedir/%name-gdk.map gdk/compat.map
install -p -m644 %_sourcedir/%name-gdk.lds gdk/compat.lds
install -p -m644 %_sourcedir/%name-gtk.map gtk/compat.map
install -p -m644 %_sourcedir/%name-gtk.lds gtk/compat.lds

%patch1 -p1
%patch6

%patch10 -p1 -b .icon-padding
%patch12 -p1 -b .tooltip-positioning

bzip2 -9k NEWS

[ ! -d m4 ] && mkdir m4
# switch gtk-builder-convert to Python3
sed -i 's|\(#\!/usr/bin/env python\)|\13|' gtk/gtk-builder-convert

%build
%if_enabled snapshot
NOCONFIGURE=1 ./autogen.sh
%else
%autoreconf
%endif
%configure \
   %{subst_enable xkb} \
   %{subst_enable man} \
   --with-xinput=yes \
   %{?_enable_gtk_doc:--enable-gtk-doc} \
   %{subst_enable introspection} \
   %{?_enable_debug:--enable-debug=yes}
%make_build LIBTOOL_EXPORT_OPTIONS=-Wl,--version-script=compat.map,compat.lds

%install
%makeinstall_std
install -d %buildroot{%_sysconfdir/gtk-%api_ver,%_libdir/gtk-%api_ver/%binary_ver/engines}

touch %buildroot%_libdir/gtk-%api_ver/%binary_ver/immodules.cache

# system wide gtkrc

cat <<__RC__ > %buildroot%_sysconfdir/gtk-%api_ver/gtkrc
# This enables editing of menu accelerators by pressing
# an accelerator over the menu item.
gtk-can-change-accels = 1
__RC__

cat <<__SH__ >%name.sh
export GTK_PATH=\`getconf LIBDIR\`/gtk-%api_ver/%binary_ver
__SH__

cat <<__CSH__ >%name.csh
setenv GTK_PATH \`getconf LIBDIR\`/gtk-%api_ver/%binary_ver
__CSH__

install -pD -m755 %name.sh %buildroot%_sysconfdir/profile.d/%name.sh
install -pD -m755 %name.csh %buildroot%_sysconfdir/profile.d/%name.csh

%find_lang --output=gtk20.lang gtk20 gtk20-properties

# examples

mkdir -p %buildroot/%_docdir/%name-devel-%version
cp -a examples/ %buildroot/%_docdir/%name-devel-%version/

# rpm posttrans filetrigger to update immodules cache

cat <<EOF > filetrigger
#!/bin/sh -e

dir=%fulllibpath/immodules
grep -qs '^'\$dir'' && %_bindir/gtk-query-immodules-%api_ver --update-cache ||:
EOF

install -pD -m 755 filetrigger %buildroot%_rpmlibdir/gtk-%api_ver-immodules-cache.filetrigger

%files
%doc AUTHORS NEWS.bz2 README
%_libdir/libgdk-x11-%api_ver.so.*
%_libdir/libgtk-x11-%api_ver.so.*
%dir %_libdir/gtk-%api_ver
%dir %_libdir/gtk-%api_ver/modules
%dir %fulllibpath
%dir %fulllibpath/engines
%fulllibpath/engines/libpixmap.so
%dir %fulllibpath/immodules
%fulllibpath/immodules/im-*.so
%dir %fulllibpath/printbackends
%fulllibpath/printbackends/libprintbackend-*.so
%exclude %fulllibpath/*/*.la
%dir %_datadir/themes
%_datadir/themes/Default
%_datadir/themes/Emacs
%_datadir/themes/Raleigh
%dir %_datadir/gtk-%api_ver
%dir %_sysconfdir/gtk-%api_ver
%config(noreplace) %_sysconfdir/gtk-%api_ver/gtkrc
%config(noreplace) %_sysconfdir/gtk-%api_ver/im-multipress.conf
%ghost %_libdir/gtk-%api_ver/%binary_ver/immodules.cache
%_bindir/gtk-query-immodules-%api_ver
%{?_enable_man:%_man1dir/gtk-query-immodules*}
%_rpmlibdir/gtk-%api_ver-immodules-cache.filetrigger

%files locales -f gtk20.lang

%files -n gtk-builder-convert
%_bindir/gtk-builder-convert
%{?_enable_man:%_man1dir/gtk-builder-convert*}

%files devel
%dir %_includedir/gtk-%api_ver
%dir %_includedir/gtk-%api_ver/gdk
%_includedir/gtk-%api_ver/gdk/*.h
%dir %_includedir/gtk-%api_ver/gtk
%_includedir/gtk-%api_ver/gtk/*.h
%dir %_includedir/gtk-unix-print-%api_ver
%dir %_includedir/gtk-unix-print-%api_ver/gtk
%_includedir/gtk-unix-print-%api_ver/gtk/*.h
%dir %_libdir/gtk-%api_ver/include
%_libdir/gtk-%api_ver/include/*.h
%_libdir/libgdk-x11-%api_ver.so
%_libdir/libgtk-x11-%api_ver.so
%_pkgconfigdir/gdk-%api_ver.pc
%_pkgconfigdir/gtk+-%api_ver.pc
%_pkgconfigdir/gtk+-unix-print-%api_ver.pc
%_pkgconfigdir/gdk-x11-%api_ver.pc
%_pkgconfigdir/gtk+-x11-%api_ver.pc
%_datadir/aclocal/gtk-%api_ver.m4

%files -n gtk-demo
%_bindir/gtk-demo
%dir %_datadir/gtk-%api_ver/demo
%_datadir/gtk-%api_ver/demo/*

%files devel-doc
%_datadir/gtk-doc/html/gdk2
%_datadir/gtk-doc/html/gtk2

%files devel-doc-examples
%doc %_docdir/%name-devel-%version/examples

%files -n libgail
%_libdir/libgailutil.so.*
%_libdir/gtk-%api_ver/modules/libferret.so
%_libdir/gtk-%api_ver/modules/libgail.so
%exclude %_libdir/gtk-%api_ver/modules/*.la

%files -n libgail-devel
%_includedir/gail-1.0
%_libdir/libgailutil.so
%_pkgconfigdir/gail.pc

%files -n libgail-devel-doc
%_datadir/gtk-doc/html/gail-libgail-util

%if_enabled introspection
%files gir
%_typelibdir/*

%files gir-devel
%_girdir/*
%endif

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin