rpms/pymunk/devel import.log, NONE, 1.1 pymunk-sharedlib.patch, NONE, 1.1 pymunk.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

rspanton rspanton at fedoraproject.org
Mon Nov 16 20:08:42 UTC 2009


Author: rspanton

Update of /cvs/pkgs/rpms/pymunk/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29486/devel

Modified Files:
	.cvsignore sources 
Added Files:
	import.log pymunk-sharedlib.patch pymunk.spec 
Log Message:
Initial import of pymunk 0.8.4



--- NEW FILE import.log ---
pymunk-0_8_4-2_fc11:HEAD:pymunk-0.8.4-2.fc11.src.rpm:1258401974

pymunk-sharedlib.patch:
 pymunk.egg-info/SOURCES.txt |    2 --
 pymunk/libload.py           |   34 ++--------------------------------
 setup.py                    |    6 ------
 3 files changed, 2 insertions(+), 40 deletions(-)

--- NEW FILE pymunk-sharedlib.patch ---
>From 12bee2a0828e2b6ec90e0641b7993c511b7e4c97 Mon Sep 17 00:00:00 2001
From: Robert Spanton <rspanton at zepler.net>
Date: Thu, 18 Jun 2009 19:48:01 +0100
Subject: [PATCH] Use the chipmunk shared library from the chipmunk package.

---
 pymunk/libload.py |   33 ++-------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/pymunk/libload.py b/pymunk/libload.py
index e63c157..659525a 100644
--- pymunk/libload.py
+++ pymunk/libload.py
@@ -4,37 +4,8 @@ import sys, imp, os
 import ctypes
  
 def load_library(libname, print_path=True):
-    # lib gets loaded from:
-    # pymunk/libchipmunk.so, libchipmunk.dylib or chipmunk.dll
-     
-    s = platform.system()
-    arch, _ = platform.architecture()
- 
-    path = os.path.dirname(os.path.abspath(__file__))
-    
-    try:
-        if hasattr(sys, "frozen") or \
-            hasattr(sys, "importers") or \
-            hasattr(imp, "is_frozen") and imp.is_forzen("__main__"):
-            if 'site-packages.zip' in __file__:
-                path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks')
-            else:
-                path = os.path.dirname(os.path.abspath(sys.executable))
-    except:
-        pass
-    
-    if s == 'Linux':
-        libfn = "lib%s.so" % libname
-
-    elif s == 'Windows' or s == 'Microsoft':
-        libfn = "%s.dll" % libname
-
-    elif s == 'Darwin':
-        libfn = "lib%s.dylib" % libname
-        
-    libfn = os.path.join(path, libfn)
+    # Library is always in this location on Fedora
+    libfn = "/usr/lib/libchipmunk.so"
     
-    if print_path:
-        print ("Loading chipmunk for %s (%s) [%s]" % (s, arch, libfn))
     lib = ctypes.cdll.LoadLibrary(libfn)
     return lib
-- 
1.6.2.2

--- setup.py.orig	2009-11-05 02:54:18.000000000 +0000
+++ setup.py	2009-11-05 02:54:10.000000000 +0000
@@ -73,12 +73,6 @@
     , description='A wrapper for the 2d physics library Chipmunk'
     , long_description=long_description
     , packages=['pymunk'] #find_packages(exclude=['*.tests']),
-    , package_data = {'pymunk': ['chipmunk.dll'
-                                , 'libchipmunk.so'
-                                , 'libchipmunk.dylib']}
-    , eager_resources = [os.path.join('pymunk','chipmunk.dll')
-                            , os.path.join('pymunk','libchipmunk.so')
-                            , os.path.join('pymunk','libchipmunk.dylib')]
     #, platforms=['win32']
     , license='MIT License'
     , classifiers=classifiers
--- pymunk.egg-info/SOURCES.txt~	2009-11-05 02:58:38.000000000 +0000
+++ pymunk.egg-info/SOURCES.txt	2009-11-05 02:58:29.000000000 +0000
@@ -62,8 +62,6 @@
 examples/pymunx_demo8_gravityfun.py
 pymunk/__init__.py
 pymunk/_chipmunk.py
-pymunk/chipmunk.dll
-pymunk/libchipmunk.so
 pymunk/libload.py
 pymunk/util.py
 pymunk/vec2d.py


--- NEW FILE pymunk.spec ---
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

Name:		pymunk
Version:	0.8.4
Release:	2%{?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
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 >= 4.1.0
BuildArch:	noarch

%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
# 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
* Thu Nov 5 2009 Robert Spanton <rspanton at zepler.net> - 0.8.4-2
- Conserve file timestamps when converting newlines

* Thu Nov 5 2009 Robert Spanton <rspanton at 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 at zepler.net> - 0.8.2-3
- Put the text files, e.g. LICENSE, in the main package.

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

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


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/pymunk/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	6 Nov 2009 20:24:04 -0000	1.1
+++ .cvsignore	16 Nov 2009 20:08:42 -0000	1.2
@@ -0,0 +1 @@
+pymunk-0.8.4.zip


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/pymunk/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	6 Nov 2009 20:24:04 -0000	1.1
+++ sources	16 Nov 2009 20:08:42 -0000	1.2
@@ -0,0 +1 @@
+f373e7e7cf416512984c633113acfd2f  pymunk-0.8.4.zip




More information about the fedora-extras-commits mailing list