Blob Blame History Raw
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:		pymunk
Version:	1.0.0
Release:	13%{?dist}
Summary:	Python wrapper for the chipmunk 2D physics engine
Group:		Development/Languages
# pymunx is under GPL+
License:	MIT and GPL+
URL:		http://code.google.com/p/pymunk/
Source0:	http://pymunk.googlecode.com/files/pymunk-%{version}.zip
# Use the shared library provided by the chipmunk package
#Patch0:		pymunk-sharedlib.patch
Patch1:		pymunk-1.0.0-sharedlib.patch
Patch2:		pymunk-1.0.0-sharedlib64.patch
BuildRoot:	%(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildRequires:	python-devel
BuildRequires:	python-setuptools
# Need chipmunk when building to work out the location of the 
# *installed* chipmunk library
BuildRequires:	chipmunk
Requires:	chipmunk >= 5.0.0
BuildArch:	noarch
ExcludeArch:	ppc64

%description
Pymunk is a Python wrapper for the wrapper for the chipmunk 2D physics
engine.  It aims to be easy to use, "Pythonic", and non-intrusive.

%prep
%setup -q
#%patch0 -p0
%ifarch %{ix86}
%patch1 -p0
%else
%patch2 -p0
%endif
# Fix newlines -- preserve timestamps
for file in docs/api/*.{html,txt,css,js} examples/*.py *.txt PKG-INFO; do
  sed -e 's/\r//g' $file > $file.new &&
  touch -r $file $file.new &&
  mv $file.new $file
done

# Use libchipmunk.so.N provided by chipmunk
lib=`ls %{_libdir}/libchipmunk.so.* | head -n 1`
sed -i -e "s|/usr/lib/libchipmunk.so|$lib|" pymunk/libload.py

# This source is superfluous
rm -rf chipmunk_src

%build
%{__python} setup.py build

%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
 
%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%{python_sitelib}/%{name}/
%{python_sitelib}/%{name}-*.egg-info/
%doc docs examples LICENSE.txt PKG-INFO THANKS.txt README.txt

%changelog
* Wed Feb 22 2017 Jon Ciesla <limburgher@gmail.com> - 1.0.0-13
- ExcludeArch ppc64.

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-11
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Mar 04 2013 Jon Ciesla <limb@jcomserv.net> - 1.0.0-6
- Fix shared lib patch for 64-bit.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jul 15 2010 Jon Ciesla <limb@jcomserv.net> - 1.0.0-1
- 1.0.0, supports Chipmunk 5.x.
- Updated sharedlib patch.

* Thu Nov 5 2009 Robert Spanton <rspanton@zepler.net> - 0.8.4-2
- Conserve file timestamps when converting newlines

* Thu Nov 5 2009 Robert Spanton <rspanton@zepler.net> - 0.8.4-1
- Bump up to 0.8.4
- Add chipmunk as a build requirement so that shared object discovery 
  works.
- Stop the .dll and .so being installed in the first place
- Merge docs and main package, since docs are small
- Fix license.  pymunx is GPL+

* Sun Jun 21 2009 Robert Spanton <rspanton@zepler.net> - 0.8.2-3
- Put the text files, e.g. LICENSE, in the main package.

* Sun Jun 21 2009 Robert Spanton <rspanton@zepler.net> - 0.8.2-2
- Point to the correct chipmunk library file.
- Include some more documentation

* Thu Jun 18 2009 Robert Spanton <rspanton@zepler.net> - 0.8.2-1
- Initial packaging