%define py_ver 2.1 %define pygtk_ver 0.6.6 %define pygnome_ver 1.0.53 Summary: The sources for the PyGTK and PyGNOME Python extension modules. Name: gnome-python Version: %{pygnome_ver} Release: 7 Epoch: 1 Source: ftp://ftp.gnome.org/pub/GNOME/stable/sources/gnome-python/gnome-python-%{pygnome_ver}.tar.gz Patch: gnome-python-%{pygnome_ver}-ehack.patch Copyright: LGPL Group: System Environment/Libraries BuildRoot: %{_tmppath}/gnome-python-root Prefix: %{_prefix} %define py_prefix %{prefix} # Packager: James Henstridge %ifarch ia64 %define DEFCCIA cc %define DEFCC %{DEFCCIA} %else %define DEFCC cc_r %endif %description The gnome-python package contains the source packages for the Python bindings for GTK+ and GNOME (PyGTK and PyGNOME, respectively). PyGTK is an extension module for Python that provides access to the GTK+ widget set. Just about anything (within reason) you can write in C with GTK+, you can write in Python with PyGTK, but with all of Python's benefits. PyGNOME is an extension module for Python that provides access to the base GNOME libraries, so you have access to more widgets, a simple configuration interface, and metadata support. %package -n pygtk Version: %{pygtk_ver} Summary: Python bindings for the GTK+ widget set. Group: Development/Languages Requires: glib, gtk+, imlib, python >= 2.1 %description -n pygtk PyGTK is an extension module for Python that gives you access to the GTK+ widget set. Just about anything you can write in C with GTK+ you can write in Python with PyGTK (within reason), but with all of Python's benefits. PyGTK provides an object-oriented interface at a slightly higher level than the C interface. The PyGTK interface does all of the type casting and reference counting that you'd have to do yourself using the C API. Install pygtk if you need Python bindings for the GTK+ widget set. %package -n pygtk-libglade Version: %{pygtk_ver} Summary: A wrapper for the libglade library for use with PyGTK Group: Development/Languages %description -n pygtk-libglade This module contains a wrapper for the libglade library. Libglade is a library similar to the pyglade module, except that it is written in C (so is faster) and is more complete. %package -n pygnome-libglade Version: %{pygtk_ver} Summary: GNOME support for the libglade python wrapper Group: Development/Languages Requires: pygtk-libglade %description -n pygnome-libglade This module contains GNOME support to suppliment the libglade python wrapper. Libglade is a library similar to the pyglade module, except that it is written in C (so is faster) and is more complete. %package -n pygnome Version: %{pygnome_ver} Summary: Python bindings for the GNOME libraries. Group: Development/Languages Requires: pygtk = %{pygtk_ver} Requires: gnome-libs %description -n pygnome PyGNOME is an extension module for python that gives you access to the base GNOME libraries. This means you have access to more widgets, simple configuration interface, metadata support and many other features. Install pygnome if you need Python bindings for the GNOME libraries. %package -n pygnome-applet Version: %{pygnome_ver} Summary: Python bindings for GNOME Panel applets. Group: Development/Languages Requires: pygnome = %{pygnome_ver} %description -n pygnome-applet This module contains a wrapper that allows GNOME Panel applets to be written in Python. %package -n pygnome-capplet Version: %{pygnome_ver} Summary: Python bindings for GNOME Panel applets. Group: Development/Languages Requires: pygnome = %{pygnome_ver} %description -n pygnome-capplet This module contains a wrapper that allows GNOME Control Center capplets to be in Python. %prep %setup -q %patch -p1 -b .entry %build # Use the default compiler for this platform - gcc otherwise if [[ -z "$CC" ]] then if test "X`type %{DEFCC} 2>/dev/null`" != 'X'; then export CC=%{DEFCC} else export CC=gcc fi fi if test "X$CC" != "Xgcc" then export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's:-fsigned-char::'` export CFLAGS="$RPM_OPT_FLAGS" fi libtoolize --copy --force export LDFLAGS="-Wl,-brtl" CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{py_prefix} find . -name libtool | while read fn do # Hack to work around bug prepending lib_ to module names and # hardcoded noentry which kills the imports /bin/grep -q "need_lib_prefix=unknown" $fn && \ perl -pi -e "s|need_lib_prefix=unknown|need_lib_prefix=no|" $fn /bin/grep -q -- "-bnoentry" $fn && \ perl -pi -e 's|-bnoentry|\\\$\{ENTRY\}|' $fn done make %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install find $RPM_BUILD_ROOT%{py_prefix}/lib/python%{py_ver} -name "*.pyc" -type f | xargs rm -fv python -c "import compileall; compileall.compile_dir('"$RPM_BUILD_ROOT"%{py_prefix}/lib/python%{py_ver}', 4, '%{py_prefix}/lib/python%{py_ver}')" (cd $RPM_BUILD_ROOT for dir in include do mkdir -p usr/$dir cd usr/$dir ln -sf ../..%{_prefix}/$dir/* . cd - done ) %files -n pygtk %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/gtk.py* %{py_prefix}/lib/python%{py_ver}/site-packages/Gtkinter.py* %{py_prefix}/lib/python%{py_ver}/site-packages/GtkExtra.py* %{py_prefix}/lib/python%{py_ver}/site-packages/GTK.py* %{py_prefix}/lib/python%{py_ver}/site-packages/GDK.py* %{py_prefix}/lib/python%{py_ver}/site-packages/GdkImlib.py* %{py_prefix}/lib/python%{py_ver}/site-packages/pyglade/*.py* %{py_prefix}/lib/python%{py_ver}/site-packages/_gtkmodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/_gdkimlibmodule.so* %{py_prefix}/include/pygtk %doc pygtk/AUTHORS pygtk/NEWS pygtk/README pygtk/MAPPING pygtk/ChangeLog %doc pygtk/description.py pygtk/examples %files -n pygtk-libglade %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/libglade.py* %{py_prefix}/lib/python%{py_ver}/site-packages/_libglademodule.so* %files -n pygnome-libglade %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/_gladegnomemodule.so* # the following are only included if gnome-core and control-center were # installed during the build %files -n pygnome-applet %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/_appletmodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/applet.py* %files -n pygnome-capplet %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/_cappletmodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/capplet.py* %files -n pygnome %defattr(-,root,root) %{py_prefix}/lib/python%{py_ver}/site-packages/gettext.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/__init__.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/affine.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/config.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/file.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/help.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/history.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/metadata.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/mime.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/score.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/triggers.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/ui.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/uiconsts.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/url.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/util.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/xmhtml.py* %{py_prefix}/lib/python%{py_ver}/site-packages/gnome/zvt.py* %{py_prefix}/lib/python%{py_ver}/site-packages/_gnomemodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/_gnomeuimodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/_zvtmodule.so* %{py_prefix}/lib/python%{py_ver}/site-packages/_gtkxmhtmlmodule.so* %doc AUTHORS NEWS README ChangeLog %doc pygnome/examples %changelog * Thu Jun 28 2001 Marc Stephenson - Adaptation for AIX Toolbox * Mon Feb 19 2001 Matt Wilson - added a broken hack called _gtk_nuke_rc_mtimes that sets all rcfile mtimes to 0. This will let us switch from a foreign codeset back to iso-8859-1 in the installer. * Thu Feb 08 2001 Florian La Roche - add libtoolize to make porting to new archs easy * Thu Jan 18 2001 Matt Wilson - added a patch to wrap gtk_rc_init * Wed Aug 23 2000 Nalin Dahyabhai - move buildroot to %%{_tmppath} - build modules with the correct directories in them - remove Packager tag * Fri Aug 11 2000 Jonathan Blandford - Up Epoch and release * Thu Jul 13 2000 Prospector - automatic rebuild * Sat Jun 10 2000 Matt Wilson - 1.0.53 * Mon Jun 5 2000 Matt Wilson - defattr * Wed Feb 16 2000 Matt Wilson - 1.0.51 * Fri Jan 21 2000 Matt Wilson - added pygnome-libglade subpackage * Wed Jan 5 2000 Matt Wilson - split applet and capplet modules into their own package