+# Should --enable-debug_flag be used in release builds? Using it
+# defines __WXDEBUG__ and gives us runtime diagnostics that are turned
+# into Python exceptions. (So turning it on is a very helpful thing
+# IMO and is recommended.) The code is still compiled with
+# optimization flags and and without debug info and such when this
+# option is used, it simply turns on some extra code.
+%if %{?debug_flag:0}%{!?debug_flag:1}
+%define debug_flag 1
+%endif
+
+
+# Used to set the Release tag below. I normally use it to define what
+# distro the RPM was built on and also include the version of Python
+# it was built with.
+%if %{?release:0}%{!?release:1}
+%define release 1_py%{pyver}
+%endif
+
+
+# This one is used to control whether the full 4 components of the
+# verseion number are used in the site-packages subdirectory name. By
+# default only 2 or 3 components (depending on stable/unstable status)
+# are used.
+%if %{?fullver:0}%{!?fullver:1}
+%define fullver 0
+%endif
+
+
+# Whether to add --enable-mediactrl to the wxWidgets configure. For
+# some older versions of gstreamer-0.8 it currently incorerctly allows
+# its use eventhough there is a compatibility problem that causes a
+# failed compile.
+%if %{?mediactrl:0}%{!?mediactrl:1}
+%define mediactrl 1
+%endif
+
+
+#----------------------------------------------------------------------
+# Other variables used below
+
+%define pref %{_prefix}
+%define python /usr/bin/python%{pyver}
+%define tarname @TARNAME@
+%define version @VERSION@
+%define ver2 @VER2@
+
+%define chartype %(if [ "%{unicode}" = "1" ]; then echo unicode; else echo ansi; fi)
+%define gtktype %(if [ "%{port}" = "gtk2" ]; then echo 2; fi)
+%define using_gtk1 %(if [ "%{port}" = "gtk" ]; then echo 1; else echo 0; fi)
+
+%define wxprefbase %{pref}/lib/wxPython
+%define wxpref %{wxprefbase}-%{version}-%{port}-%{chartype}
+%define pkgname wxPython
+
+# turn off the generation of debuginfo rpm (RH9) ??
+%define debug_package %{nil}
+
+
+#----------------------------------------------------------------------
+# Package definition
+#----------------------------------------------------------------------
+Name: %{pkgname}%{ver2}
+Summary: Cross platform GUI toolkit for Python
+Version: %{version}
+Release: %{release}
+Source0: %{tarname}-%{version}.tar.bz2
+License: wx Library Licence, Version 3
+URL: http://wxPython.org/
+Packager: Robin Dunn <robin@alldunn.com>
+Group: Development/Python
+BuildRoot: %{_tmppath}/%{pkgname}-buildroot
+Prefix: %{pref}
+
+%description
+Cross platform GUI toolkit for Python
+
+
+
+
+%package -n %{pkgname}%{ver2}-%{port}-%{chartype}
+Summary: Cross platform GUI toolkit for Python
+Group: Development/Python
+Requires: %{pkgname}-common
+Obsoletes: wxPythonGTK%{gtktype}-py%{pyver}, wxPythonGTK%{gtktype}
+Provides: wxPython
+
+
+%description -n %{pkgname}%{ver2}-%{port}-%{chartype}
+wxPython is a GUI toolkit for the Python programming language. It
+allows Python programmers to create programs with a robust, highly
+functional graphical user interface, simply and easily. It is
+implemented as a Python extension module (native code) that wraps the
+popular wxWidgets cross platform GUI library, which is written in C++.
+
+wxPython is a cross-platform toolkit. The same program will usually
+run on multiple platforms without modification. Currently supported
+platforms are 32-bit Microsoft Windows, most Unix or unix-like
+systems, and Macintosh OS X.
+
+This package contains the wxPython runtime files built for the
+wxWidgets %{port} port with %{chartype} character type.
+
+
+
+
+
+%package -n %{pkgname}-common-%{port}-%{chartype}
+Summary: Common files for needed by all wxPython runtimes