File python-wxWidgets-2_9.spec of Package python-wxWidgets-2_9
#
# spec file for package python-wxWidgets
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-wxWidgets-2_9
%define srcname wxPython
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: python-devel
BuildRequires: python-xml
BuildRequires: wxWidgets-2_9-devel
Version: 2.9.4.0
Release: 0
%define wx_version %(echo %{version} | sed 's/\.[0-9][0-9]*\.[0-9][0-9]*$//')
%define wx_release %(echo %{version} | sed 's/\.[0-9][0-9]*$//')
Summary: Python Bindings for wxWidgets
License: GPL-2.0+
Group: System/Libraries
# Trick: OSC checks for the first one, RPM for the second one.
%if 0
# Source from http://www.wxpython.org/ contains complete wxWidgets
# source tree and proprietary Microsoft Visual Studio DLLs.
# We will repackage only a needed subset of files.
Source: http://downloads.sourceforge.net/wxpython/%{srcname}-src-%{version}.tar.bz2
%else
# WARNING: This is not a comment, but the real command to repack souce:
#%(sh %{_sourcedir}/%{name}-extract-source %{srcname}-src-%{version}.tar.bz2)
Source: %{srcname}-%{version}.tar.bz2
%endif
Source1: rpmlintrc
Source2: %{name}-extract-source
Url: http://www.wxpython.org/
# Used up to openSUSE 11.3:
Provides: python-wxGTK = %{version}
Obsoletes: python-wxGTK < %{version}
# Upstream name, never used in SUSE:
Provides: wxPython = %{version}
# Third party packages name, never used in SUSE:
Provides: wxPython%{wx_version}-gtk2-unicode = %{version}
# In fact it should be >= %{version} but only version < 3.1
Recommends: python-wxWidgets-2_9-lang = %{version}
Provides: python-wxWidgets = %{version}
Conflicts: python-wxWidgets < %{version}
# Stable name of this branch will be 3.0:
Provides: python-wxWidgets-3_0 = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# PATCH-FIX-UPSTREAM wxPython-platlib.patch widgets#14779 jmatejek@suse.cz -- Do not expect platform dependent and platform independent paths being equal. http://trac.wxwidgets.org/ticket/14779
Patch10: wxPython-platlib.patch
%py_requires
%define _use_internal_dependency_generator 0
%define __find_requires %wx_requires
%description
wxWidgets is a free C++ library for cross-platform GUI. This package contains python bindings for wxWidgets.
%package devel
Summary: Everything needed for development with wxGTK
Group: Development/Libraries/GNOME
Provides: python-wxWidgets-devel = %{version}
Conflicts: python-wxWidgets-devel < %{version}
# Stable name of this branch will be 3.0:
Provides: python-wxWidgets-3_0-devel = %{version}
%description devel
wxWidgets is a free C++ library for cross-platform GUI development.
With wxWidgets, you can create applications for different GUIs (GTK+,
Motif, MS Windows, MacOS X, Windows CE, GPE) from the same source code.
This package contains all files needed for developing with python
bindings for wxGTK.
%package lang
# We cannot use %%lang_package here. Editra translations use noarch incompatible path.
Summary: Languages for package python-wxWidgets
Group: System/Localization
Requires: %{name} = %{version}
Provides: %{name}-lang-all = %{version}
Supplements: packageand(bundle-lang-other:%{name})
%description lang
Provides translations to the package %{name}
%prep
# osc does not support BuildRequires with exact version defined by macro. Check it now.
if test "`rpm -q --queryformat=%{VERSION} wxWidgets-2_9-devel`" != "%{wx_release}" ; then
echo "To compile %{name} = %{version}, you need wxWidgets-2_9-devel = %{wx_version}"
# exit 1
fi
%setup -q -n %{srcname}-src-%{version}
%patch10
cp %{S:1} .
%build
cd wxPython
python setup.py\
build
%install
# python-wxWidgets requires exact release of wxWidgets (bnc#740950).
cat >pywx_requires <<EOF
#!/bin/sh
%wx_requires |
while read ; do
case "\$REPLY" in
libwx_* ) echo "\$REPLY" = %{wx_release} ;;
* ) echo "\$REPLY" ;;
esac
done
EOF
chmod +x pywx_requires
%define __find_requires %{_builddir}/%{srcname}-src-%{version}/pywx_requires
cd wxPython
python setup.py\
install\
--prefix=%{_prefix}\
--root=$RPM_BUILD_ROOT
cd ..
# Create %%lang tags for mo files in non-standard path:
echo "%%defattr(-, root, root)" >Editra.lang
for LNG_DIR in $RPM_BUILD_ROOT%{py_sitedir}/wx*/wx/tools/Editra/locale/* ; do
LNG=${LNG_DIR##*/}
echo "%%lang($LNG) %%{py_sitedir}${LNG_DIR#$RPM_BUILD_ROOT%{py_sitedir}}" >>Editra.lang
done
%fdupes $RPM_BUILD_ROOT%{_libdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc wxPython/docs/*.txt wxPython/docs/*.html wxPython/docs/screenshots wxPython/licence
%{_bindir}/*
%if %suse_version > 1110
%{python_sitearch}/*
%{python_sitelib}/*
%exclude %{python_sitearch}/wx*/wx/tools/Editra/locale/*
%else
%{py_sitedir}/*
%exclude %{py_sitedir}/wx*/wx/tools/Editra/locale/*
%endif
%files lang -f Editra.lang
%files devel
%defattr(-, root, root)
%{_includedir}/wx-%{wx_version}/wx/wxPython
%changelog