# sitelib for noarch packages, sitearch for others (remove the unneeded one)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
# Tarfile created using svn
# svn co svn checkout http://pybox2d.googlecode.com/svn/trunk/ pybox2d
# cd pybox2d
# svn export -r %{svnrevision} . %{name}-%{version}
# tar -cjvf ~/%{name}-%{version}-%{svndate}.tar.bz2 %{name}-%{version}
%global svndate 20100110
%global svnrevision 244
%global tarfile %{name}-%{version}-%{svndate}.tar.bz2
Name: pybox2d
Version: 2.0.2
Release: 3.%{svndate}svn%{?dist}
Summary: A 2D rigid body simulation library for Python
Group: Development/Libraries
License: zlib
URL: http://code.google.com/p/pybox2d/
Source0: %{tarfile}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: swig
%description
Programmer's can use Box2D in their games to make objects move in
believable ways and make the world seem more interactive. From the
game's point of view a physics engine is just a system for procedural
animation. Rather than paying (or begging) an animator to move your
actors around, you can let Sir Isaac Newton do the directing.
%prep
%setup -q
# calm rpmlint down
sed -i LICENSE README -e 's/\r//'
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
# copy missing files
cp Box2D.py $RPM_BUILD_ROOT%{python_sitearch}/Box2D/
# calm rpmlint down
sed -i $RPM_BUILD_ROOT%{python_sitearch}/Box2D/__init__.py -e 1d
sed -i $RPM_BUILD_ROOT%{python_sitearch}/Box2D/__init__.py -e 's/\r//'
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE README doc/*
%{python_sitearch}/*
%changelog
* Mon Jan 11 2009 Sebastian Dziallas <sebastian@when.com> - 2.0.2-3.20100110svn
- implement comments from the review
* Sun Jan 10 2009 Sebastian Dziallas <sebastian@when.com> - 2.0.2-2.20100110svn
- add setuptools build dependency
- make sure to include box2d.py
* Sun Jan 10 2009 Sebastian Dziallas <sebastian@when.com> - 2.0.2-1.20100110svn
- initial packaging