%define lcport @LCPORT@
%define tarname @TARNAME@
%define version @VERSION@
-%define ver2 2.3
+%define ver2 @VER2@
%define release 1
%define wxpref %{pref}/lib/wxPython
+# Should --enable-debug_flag be used in release builds?
+%define debug_flag 1
+
+
%if %{debug}
%define name wxPython%{port}-py%{pyver}-dbg
%define othername wxPython%{port}-py%{pyver}
%endif
+%if %{debug} || %{debug_flag}
+ %define wxconfigname %{wxpref}/bin/wx%{lcport}d-%{ver2}-config
+%else
+ %define wxconfigname %{wxpref}/bin/wx%{lcport}-%{ver2}-config
+%endif
+
+
#----------------------------------------------------------------
Summary: Cross platform GUI toolkit for Python using wx%{port}
Name: %{name}
Source0: %{tarname}-%{version}.tar.gz
License: wxWindows Library Licence, Version 3
URL: http://wxPython.org/
-Packager: Robin Dunn <robind@alldunn.com>
+Packager: Robin Dunn <robin@alldunn.com>
Group: Development/Python
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{pref}
--enable-debug \
%else
--enable-optimise \
+%if %{debug_flag}
+ --enable-debug_flag \
+%endif
%endif
--with-libjpeg=builtin \
--with-libpng=builtin \
cd ../wxPython
%{python} setup.py \
IN_CVS_TREE=1 \
+ NO_SCRIPTS=1 \
WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
build
#----------------------------------------------------------------
%install
-## ** [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%find_lang wxstd
cd wxPython
%{python} setup.py \
IN_CVS_TREE=1 \
+ NO_SCRIPTS=1 \
WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
install \
--root=$RPM_BUILD_ROOT
+# Since I want this RPM to be as generic as possible I won't let
+# distutils copy the scripts, since it will mangle the #! line
+# to use the real python pathname. Since some distros install
+# python 2.2 as python2 and others as python, then I can't let
+# it do that otherwise the dependencies will be fouled up. Copy
+# them manually instead:
+
+mkdir -p $RPM_BUILD_ROOT/usr/bin
+for s in \
+ img2png \
+ img2py \
+ img2xpm \
+ pycrust \
+ pyshell \
+ xrced; do
+ cp scripts/$s $RPM_BUILD_ROOT/usr/bin
+done
+
+
#----------------------------------------------------------------
%clean
-#[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
#----------------------------------------------------------------
%{wxpref}/lib/libwx*
%{pref}/lib/python*
%{wxpref}/share/
-
+%{pref}/bin/*
%files devel
%defattr(-,root,root)
%{wxpref}/include/wx
%{wxpref}/lib/wx
-%if %{debug}
- %{wxpref}/bin/wx%{lcport}d-%{ver2}-config
-%else
- %{wxpref}/bin/wx%{lcport}-%{ver2}-config
-%endif
+%{wxconfigname}
%{wxpref}/bin/wx-config