Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37705136
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 

%define ver_major 2.10
%define binary_ver 2.10.0

# with_x means building with X11, without_x means building with directfb

%def_with x

%def_disable static
%if_with x
%def_enable xkb
%endif
%def_enable gtk_doc
%def_enable man

# The name used by upstream.

%define _name gtk+
%define bname libgtk+2

%if_with x
%define package_name libgtk+2
%else
%define package_name libgtk+2-directfb
%endif

Name: %package_name
Version: %ver_major.14
Release: alt1

%if_with x
Summary: The GIMP ToolKit (GTK+) - X11 part
%else
Summary: The GIMP ToolKit (GTK+) - DirectFB part
%endif
License: LGPL
Group: System/Libraries

%if_without x
Provides: %bname = %version-%release
%endif
Provides: libgtk2 = %version-%release
Obsoletes: gtk2 < 2.10, gtk+-gtkbeta < 2.10, gtk+2 < 2.10
Provides: gtk2 = %version-%release, gtk+2 = %version-%release
Obsoletes: gtk-engines-pixmap < 2.5.6
Provides: gtk-engines-pixmap = %version-%release

Icon: gtk+-logo.xpm
Url: http://www.gtk.org
Source: ftp://ftp.gnome.org/pub/gnome/sources/%_name/%ver_major/%_name-%version.tar.bz2

# These should be prepared for each major version.

Source1: %bname-%ver_major-gdk.map
Source2: %bname-%ver_major-gdk_pixbuf.map
Source3: %bname-%ver_major-gtk.map
# These two were missing from the official 2.10.6 tarball
Source11: gtkplug-stub.c
Source12: gtksocket-stub.c

Patch: gtk+-2.6.5-Lai-gtkfilesel.patch.bz2
Patch1: gtk+-2.2.4-Lai-images_types-2004.04.04.patch.gz
Patch2: %bname-2.8.14-fix-link-as-needed.patch
Patch3: %bname-2.8-fix-linux-fb-compilation.patch
Patch4: %bname-2.8-fix-gdkpango-get-for-screen.patch
Patch5: %bname-2.9-sensitivity.patch
Patch6: %bname-2.10.6-fix-drop-gdk_colormap_change.patch
Patch7: %bname-2.10.6-fix-makefile.patch

%define glib_ver 2.12.0
%define cairo_ver 1.2.0
%define pango_ver 1.12.0
%define atk_ver 1.9.0
%define directfb_ver 0.9.24
%define fontconfig_ver 2.2.1-alt2
%define gtk_doc_ver 1.4
%define shared_mime_info_ver 0.16

# We need to prereq these so we can run gtk-query-immodules-2.0 in post

PreReq: glib2 >= %glib_ver
PreReq: libpango >= %pango_ver
PreReq: libatk >= %atk_ver
PreReq: %bname-common = %version-%release

BuildPreReq: glib2-devel >= %glib_ver
BuildPreReq: libcairo-devel >= %cairo_ver
BuildPreReq: libpango-devel >= %pango_ver
BuildPreReq: libatk-devel >= %atk_ver
BuildPreReq: fontconfig-devel >= %fontconfig_ver
BuildPreReq: gtk-doc >= %gtk_doc_ver

BuildRequires: docbook-dtds docbook-style-xsl indent libjpeg-devel libpng-devel libtiff-devel xsltproc zlib-devel

%if_with x
# X.org 7.0 packages
BuildRequires: libX11-devel libXcursor-devel libXext-devel libXfixes-devel libXi-devel libXinerama-devel libXrandr-devel libXrender-devel libXt-devel xorg-x11-proto-devel
%else
BuildRequires: libdirectfb-devel
%endif

%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_with x
This package contains X11 part of GTK+. It is required for GNOME 2 desktop
and programs.
%else
This package contains DirectFB part of GTK+. Usually you do not need it,
unless you are dealing with embedded platforms or non-X11 installations.
%endif

%if_with x
%package -n %bname-common
Summary: The GIMP ToolKit (GTK+) - common part
Group: System/Libraries

Requires: common-licenses
Requires: shared-mime-info >= %shared_mime_info_ver

%description -n %bname-common
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.

This package contains the part of GTK+ that is common for X11 and DirectFB
versions. For actual use of GTK+, you need to install either of %bname-x11
and %bname-directfb packages.

%package -n %bname-common-devel
Summary: Development files and tools for GTK+ applications - common part
Group: Development/GNOME and GTK+
Requires: %bname-common = %version-%release

%description -n %bname-common-devel
This package contains development files common to X11 and DirectFB versions
of GTK+. You'll need to install either %bname-x11-devel or
%bname-directfb-devel package to develop programs with GTK+.
%endif

%package devel
Summary: Development files and tools for GTK+ applications - common part
Group: Development/GNOME and GTK+
Icon: gtk+-devel-logo.xpm
%if_with x
Obsoletes: gtk2-devel < 2.10, gtk+-gtkbeta-devel, gtk+2-devel < 2.10, libgtk+2-devel-static < 2.10
Provides: gtk2-devel = %version-%release, gtk+2-devel = %version-%release, libgtk+2-devel-static = %version-%release
Provides: libgtk2-devel = %version-%release
%else
Conflicts: %bname-devel
%endif
Requires: %package_name = %version-%release
Requires: %bname-common-devel = %version-%release

%description devel
%if_with x
This package contains development files for GTK+, X11 version. Use this to
build programs that use GTK+.
%else
This package contains development files for GTK+, DirectFB version. You
do not usually need this package, unless you are trying to build some
program especially for usage with DirectFB. The work on DirectFB backend is
in progress, and its API/ABI are far from stable.
%endif

%if_with x
%package -n gtk-demo
Summary: GTK+ widgets demonstration program
Group: Development/GNOME and GTK+

%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 -n %bname-devel-doc
Summary: Development documentation for GTK+
Group: Development/GNOME and GTK+
Conflicts: %bname < %version-%release

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

%if_enabled static
%package -n %bname-devel-static
Summary: Static libraries for GTK+ (GIMP ToolKit) applications
Group: Development/GNOME and GTK+
Requires: %bname = %version-%release
Obsoletes: gtk2-devel-static, gtk+-gtkbeta-devel, gtk+2-devel-static
Provides: gtk2-devel-static = %version, gtk+2-devel-static = %version

%description -n %bname-devel-static
GTK+ is a multi-platform toolkit for creating graphical user interfaces.
This package contains the static libraries for GTK+.
%endif
%endif

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

%prep
%setup -q -n %_name-%version
install -p -m644 %SOURCE1 gdk/symver.map
install -p -m644 %SOURCE2 gdk-pixbuf/symver.map
install -p -m644 %SOURCE3 gtk/symver.map
# These two were missing from the official 2.10.6 tarball
cp %SOURCE11 gtk/
cp %SOURCE12 gtk/

#patch -p1

#patch1 -p1
#patch2 -p0
#patch3 -p0
#patch4 -p0
%patch5 -p0
%patch6 -p0
#patch7 -p0

%build
%__autoreconf
%{?_disable_static:export lt_cv_prog_cc_static_works=no}
%{?_enable_static:export lt_cv_prog_cc_static_works=yes}

export CFLAGS="$CFLAGS $(freetype-config --cflags)"
export LDLIBS="$LDLIBS $(freetype-config --libs)"

%configure \
   %{subst_enable xkb} \
   %{subst_enable man} \
   %{subst_enable static} \
   %{?_with_x:--with-gdktarget=x11} \
   %{?_without_x:--with-gdktarget=directfb} \
   %{subst_with x} \
%{?_with_x:--with-xinput=yes} \
   %{?_enable_gtk_doc:--enable-gtk-doc} \
   %{?_disable_gtk_doc:--disable-gtk-doc}

# SMP-incompatible build

%make LIBTOOL_EXPORT_OPTIONS=-Wl,--version-script=symver.map

%install
%makeinstall
install -d %buildroot{%_sysconfdir/gtk-2.0,%_libdir/gtk-2.0/%binary_ver/engines}

# system wide gtkrc

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

# The license

ln -sf %_licensedir/LGPL-2 COPYING

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

# Update icon cache daily.

mkdir -p %buildroot%_sysconfdir/cron.daily
cat <<__CRON__ >gtk+2.cron
#!/bin/sh
# Update icon cache (disabled by default)

#%_bindir/gtk-update-icon-cache --force --quiet %_iconsdir

#%_bindir/gtk-update-icon-cache --force --quiet %_datadir/pixmaps
__CRON__

install -m755 gtk+2.cron %buildroot%_sysconfdir/cron.daily/gtk+2

bzip2 -9f ChangeLog NEWS

%post
%post_ldconfig
%_bindir/gtk-query-immodules-2.0 > %_sysconfdir/gtk-2.0/gtk.immodules
%_bindir/gdk-pixbuf-query-loaders > %_sysconfdir/gtk-2.0/gdk-pixbuf.loaders
#%_bindir/gtk-update-icon-cache --force --quiet %_iconsdir
#%_bindir/gtk-update-icon-cache --force --quiet %_datadir/pixmaps

%postun -p %postun_ldconfig

%triggerpostun -- %package_name <= 2.0.6-alt0.7
[ $2 != 0 ] || exit 0
%_bindir/gtk-query-immodules-2.0 > %_sysconfdir/gtk-2.0/gtk.immodules

# -common subpackage is only generated when compiling with X. This is

# a hack that fixes problems with binaries from -common that depend on
# libraries from backend packages.
%if_with x
%files -n %bname-common -f gtk20.lang
%_bindir/gtk-query-immodules-2.0
%_bindir/gtk-update-icon-cache
%_bindir/gdk-pixbuf-query-loaders
%_libdir/libgdk_pixbuf-2.0.so.*
%_libdir/libgtk*.so.*
%dir %_libdir/gtk-2.0
%dir %_libdir/gtk-2.0/%binary_ver
%dir %fulllibpath/engines
%fulllibpath/engines/libpixmap.so
%dir %fulllibpath/immodules
%fulllibpath/immodules/im-am-et.so
%fulllibpath/immodules/im-cedilla.so
%fulllibpath/immodules/im-cyrillic-translit.so
%fulllibpath/immodules/im-inuktitut.so
%fulllibpath/immodules/im-ipa.so
%fulllibpath/immodules/im-thai.so
%fulllibpath/immodules/im-ti-er.so
%fulllibpath/immodules/im-ti-et.so
%fulllibpath/immodules/im-viqr.so
%dir %fulllibpath/loaders
%fulllibpath/loaders/libpixbufloader-*.so
%dir %fulllibpath/printbackends
%fulllibpath/printbackends/libprintbackend-*.so
%dir %_datadir/themes
%dir %_datadir/themes/*
%dir %_datadir/themes/*/gtk-2.0*
%_datadir/themes/*/gtk-2.0*/gtkrc
%dir %_sysconfdir/gtk-2.0
%config(noreplace) %_sysconfdir/gtk-2.0/gtkrc
%config(missingok, noreplace) %attr(0755,root,root)%_sysconfdir/cron.daily/*
%ghost %_sysconfdir/gtk-2.0/gtk.immodules
%ghost %_sysconfdir/gtk-2.0/gdk-pixbuf.loaders
%_man1dir/gdk-pixbuf-query-loaders.*
%_man1dir/gtk-query-immodules*
%_man1dir/gtk-update-icon-cache.*
%doc --no-dereference COPYING
%doc AUTHORS NEWS.bz2 README ChangeLog.bz2 ChangeLog.gtk*
%endif

%files
%if_with x
%fulllibpath/immodules/im-xim.so
%_libdir/libgdk-x11-2.0.so.*
%_libdir/libgdk_pixbuf_xlib-2.0.so.*
%_libdir/libgtk-x11-2.0.so.*
%else
%_libdir/libgdk-directfb-2.0.so.*
%_libdir/libgtk-directfb-2.0.so.*
%endif

%if_with x
%files -n %bname-common-devel
%_bindir/gdk-pixbuf-csource
%dir %_includedir/gtk-2.0
%dir %_includedir/gtk-2.0/gdk
%_includedir/gtk-2.0/gdk/*.h
%dir %_includedir/gtk-2.0/gdk-pixbuf
%_includedir/gtk-2.0/gdk-pixbuf/*.h
%dir %_includedir/gtk-2.0/gtk
%_includedir/gtk-2.0/gtk/*.h
%dir %_includedir/gtk-unix-print-2.0
%dir %_includedir/gtk-unix-print-2.0/gtk
%_includedir/gtk-unix-print-2.0/gtk/*.h
%dir %_libdir/gtk-2.0/include
%_libdir/libgdk_pixbuf-2.0.so
%dir %_datadir/gtk-2.0
%_datadir/aclocal/gtk-2.0.m4
%_man1dir/gdk-pixbuf-csource.1.*
%exclude %_datadir/gtk-2.0/demo
%endif

%files devel
# Common (by filenames) part. %bname-x11-devel and %bname-directfb-devel
# are conflicting due to these files.
%_pkgconfigdir/gdk-2.0.pc
%_pkgconfigdir/gdk-pixbuf-2.0.pc
%_pkgconfigdir/gtk+-2.0.pc
%_pkgconfigdir/gtk+-unix-print-2.0.pc
%_libdir/gtk-2.0/include/gdkconfig.h
# Backend-specific parts
%if_with x
%dir %_includedir/gtk-2.0/gdk-pixbuf-xlib
%_includedir/gtk-2.0/gdk-pixbuf-xlib/*.h
%_includedir/gtk-2.0/gdk/gdkx.h
%_libdir/libgdk-x11-2.0.so
%_libdir/libgdk_pixbuf_xlib-2.0.so
%_libdir/libgtk-x11-2.0.so
%_pkgconfigdir/gdk-x11-2.0.pc
%_pkgconfigdir/gdk-pixbuf-xlib-2.0.pc
%_pkgconfigdir/gtk+-x11-2.0.pc
%else
%_includedir/gtk-2.0/gdk/gdkdirectfb.h
%_includedir/gtk-2.0/gdk/gdkprivate-directfb.h
%_libdir/libgdk-directfb-2.0.so
%_libdir/libgtk-directfb-2.0.so
%_pkgconfigdir/gdk-directfb-2.0.pc
%_pkgconfigdir/gtk+-directfb-2.0.pc
%endif

%if_with x
%files -n gtk-demo
%_bindir/gtk-demo
%dir %_datadir/gtk-2.0/demo
%_datadir/gtk-2.0/demo/*

%if_enabled gtk_doc
%files -n %bname-devel-doc
%_datadir/gtk-doc/html/*
%endif

%if_enabled static
%files -n %bname-devel-static
%_libdir/*.a
%fulllibpath/*/*.a
%endif
%endif

%exclude %fulllibpath/*/*.la

%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