+# Which wxWidgets port to build and use. Current acceptable values
+# are 'gtk' and 'gtk2'.
+%if %{?port:0}%{!?port:1}
+%define port gtk2
+%endif
+
+
+# Build in unicode mode? Can only be used if port is gtk2, acceptable
+# values are '0' and '1'
+%if %{?unicode:0}%{!?unicode:1}
+%define unicode 1
+%endif
+
+
+# Should the builtin image and etc. libs be used, or system libs?
+# Distro specific RPMs should probably set this to 0, generic ones
+# should use 1.
+# NOTE: I'm trying 0 for this next release to see if I can get rid of
+# this...
+%if %{?builtin_libs:0}%{!?builtin_libs:1}
+%define builtin_libs 0
+%endif
+
+
+# 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 build on and also include the version of Python
+# it was built with.
+%if %{?release:0}%{!?release:1}
+%define release 1_py%{pyver}
+%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.gz
+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}
+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