[Python-modules-commits] r3469 - in /packages/python-pyglew/trunk/debian: control patches/00list patches/01_fix_makefile.dpatch patches/10_fix_setup_py.dpatch rules

piotr at users.alioth.debian.org piotr at users.alioth.debian.org
Sun Oct 28 19:10:29 UTC 2007


Author: piotr
Date: Sun Oct 28 19:10:28 2007
New Revision: 3469

URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=3469
Log:
* rewrite 10_fix_setup_py patch (installation of extension file is disabled)
* add 01_fix_makefile patch (Makefile supports building extensions for multiple Python versions now)
* rewrite debian/rules file
* add Vcs-Svn and Vcs-Browser fields
* XS-Python-Version changed to all
* provide pythonX.Y-pyglew packages
* add ${misc:Depends} to Depends

Added:
    packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch   (with props)
Modified:
    packages/python-pyglew/trunk/debian/control
    packages/python-pyglew/trunk/debian/patches/00list
    packages/python-pyglew/trunk/debian/patches/10_fix_setup_py.dpatch
    packages/python-pyglew/trunk/debian/rules

Modified: packages/python-pyglew/trunk/debian/control
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/debian/control?rev=3469&op=diff
==============================================================================
--- packages/python-pyglew/trunk/debian/control (original)
+++ packages/python-pyglew/trunk/debian/control Sun Oct 28 19:10:28 2007
@@ -4,21 +4,21 @@
 Maintainer: Sandro Tosi <matrixhasu at gmail.com>
 Build-Depends: debhelper (>= 5), libglew1.4-dev, python-central (>= 0.5.6), python, dpatch, python-all-dev
 Standards-Version: 3.7.2
-XS-Python-Version: 2.5
 Homepage: http://www.cs.lth.se/home/Calle_Lejdfors/pygpu/
+Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-pyglew/trunk/
+Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/?op=log
+XS-Python-Version: all
 
 Package: python-pyglew
 Architecture: any
-Depends: ${python:Depends}, ${shlibs:Depends}
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
 XB-Python-Version: ${python:Versions}
+Provides: ${python:Provides}
 Description: GLEW bindings for Python
- PyGLEW  is the  Python-bindings  for the  excellent OpenGL  Extension
- Wrangler  (GLEW), a  library  that handles  initiliazation of  OpenGL
- extensions.
+ PyGLEW is the Python-bindings for the excellent OpenGL Extension Wrangler
+ (GLEW), a library that handles initiliazation of OpenGL extensions.
  .
- This Python wrapper  over GLEW will let that  library to initializate
- and check availability of extentions,  and then to freely use them in
- a Python code.
+ This Python wrapper over GLEW will let that library to initializate and check
+ availability of extentions, and then to freely use them in a Python code.
  .
- In addition,  there are many  extentions needed by other  tools, like
- pygpu.
+ In addition, there are many extentions needed by other tools, like pygpu.

Modified: packages/python-pyglew/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/debian/patches/00list?rev=3469&op=diff
==============================================================================
--- packages/python-pyglew/trunk/debian/patches/00list (original)
+++ packages/python-pyglew/trunk/debian/patches/00list Sun Oct 28 19:10:28 2007
@@ -1,1 +1,2 @@
+01_fix_makefile.dpatch
 10_fix_setup_py.dpatch

Added: packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch?rev=3469&op=file
==============================================================================
--- packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch (added)
+++ packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch Sun Oct 28 19:10:28 2007
@@ -1,0 +1,64 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_makefile.dpatch by Piotr Ożarowski <piotr at debian.org>
+##
+## DP: * respect PYTHON variable
+## DP: * disable .conf file
+
+ at DPATCH@
+diff -urNad python-pyglew-0.1.2~/Makefile python-pyglew-0.1.2/Makefile
+--- python-pyglew-0.1.2~/Makefile	2007-10-28 19:04:32.000000000 +0100
++++ python-pyglew-0.1.2/Makefile	2007-10-28 19:15:06.000000000 +0100
+@@ -5,22 +5,21 @@
+ GLCCS = $(addprefix $(builddir)/, $(addsuffix -gen.cc, $(GLBASE)))
+ GLHHS = $(addprefix include/, pack.hh unpack.hh unpack_ptr.hh pyglew_exception.hh pointer_wrapper.hh)
+ 
+-PYTHON=python2.4
+-
+ all:
+ 
+-include $(shell uname -s).conf
++#include $(shell uname -s).conf
++SOEXT=so
+ 
+-all: exts pyglew.$(SOEXT)
++all: exts $(builddir)/pyglew.$(SOEXT)
+ 
+-test: pyglew.$(SOEXT)
++test: $(builddir)/pyglew.$(SOEXT)
+ 	$(PYTHON) test.py
+ 
+-install: pyglew.$(SOEXT)
++install: $(builddir)/pyglew.$(SOEXT)
+ 	$(PYTHON) setup.py install
+ 
+-pyglew.$(SOEXT): pyglew.o $(GLOBJECTS)
+-	$(LINK) -o $@ $^ $(LIBS)
++$(builddir)/pyglew.$(SOEXT): $(builddir)/pyglew.o $(GLOBJECTS)
++	$(CC) -shared $(CFLAGS) -o $@ $^ -lGLEW -lGL -l$(PYTHON)
+ 
+ $(builddir)/pyglew-gen.hh: $(addprefix $(builddir)/, $(addsuffix -gen.hh, $(GLBASE)))
+ 	cat $^ > $@
+@@ -32,11 +31,11 @@
+ 	rm -f $@ ; 
+ 	for file in $^; do echo "/* " $$file " */" >> $@; cat $$file >> $@; done;
+ 
+-pyglew.o: pyglew.cc $(GLHHS) $(builddir)/pyglew-gen.hh $(builddir)/pyglew-methods.cc $(builddir)/pyglew-constants.cc
+-	$(COMPILE) $(INCLUDES) -Iinclude -I$(builddir) -c $< -o $@
++$(builddir)/pyglew.o: pyglew.cc $(GLHHS) $(builddir)/pyglew-gen.hh $(builddir)/pyglew-methods.cc $(builddir)/pyglew-constants.cc
++	$(CC) -fpic $(CFLAGS) -I/usr/include/$(PYTHON) -Iinclude -I. -Iinclude -I$(builddir) -c $< -o $@
+ 
+ $(builddir)/%-gen.o: $(builddir)/%-gen.cc $(GLHHS)
+-	$(COMPILE) $(INCLUDES)  -c $< -o $@
++	$(CC) -fpic $(CFLAGS) -I/usr/include/$(PYTHON) -Iinclude -I. -c $< -o $@
+ 
+ $(builddir)/%-gen.hh $(builddir)/%-gen.cc $(builddir)/%-constants.cc: extensions/% main.py src/*.cc
+ 	mkdir -p $(builddir)
+@@ -50,7 +49,7 @@
+ 	$(CXX) $(CXXFLAGS) $^ -o $@ -lGLEW -lGL -lSDL
+ 
+ clean:
+-	rm -f pyglew.so test_pbo
++	rm -f test_pbo
+ 	rm -rf $(builddir)
+ 	rm -rf dist
+ 

Propchange: packages/python-pyglew/trunk/debian/patches/01_fix_makefile.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Modified: packages/python-pyglew/trunk/debian/patches/10_fix_setup_py.dpatch
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/debian/patches/10_fix_setup_py.dpatch?rev=3469&op=diff
==============================================================================
--- packages/python-pyglew/trunk/debian/patches/10_fix_setup_py.dpatch (original)
+++ packages/python-pyglew/trunk/debian/patches/10_fix_setup_py.dpatch Sun Oct 28 19:10:28 2007
@@ -1,19 +1,32 @@
 #! /bin/sh /usr/share/dpatch/dpatch-run
-## 10_fix_setup_py.dpatch by Sandro Tosi <matrixhasu at gmail.com>
+## 10_fix_setup_py.dpatch by Piotr Ożarowski <piotr at debian.org>
 ##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
+## DP: disable installation of extension file - we'll do this in debian/rules
+## DP: for all supported Python versions
 
 @DPATCH@
-diff -urNad python-pyglew~/setup.py python-pyglew/setup.py
---- python-pyglew~/setup.py	2007-10-16 09:48:38.000000000 +0200
-+++ python-pyglew/setup.py	2007-10-20 23:53:39.000000000 +0200
-@@ -5,7 +5,7 @@
- if os.name == 'nt': 
-    data_files=[('Lib/site-packages', ['pyglew.dll', 'glew32.dll'])]
- else:
+diff -urNad python-pyglew-0.1.2~/setup.py python-pyglew-0.1.2/setup.py
+--- python-pyglew-0.1.2~/setup.py	2007-10-28 18:10:37.000000000 +0100
++++ python-pyglew-0.1.2/setup.py	2007-10-28 18:12:49.000000000 +0100
+@@ -2,10 +2,10 @@
+ from distutils.core import setup,Extension
+ import os
+ 
+-if os.name == 'nt': 
+-   data_files=[('Lib/site-packages', ['pyglew.dll', 'glew32.dll'])]
+-else:
 -   data_files=[('lib/python2.5/site-packages', ['pyglew.so', 'libGLEW.so'])]
-+   data_files=[('lib/python2.5/site-packages', ['pyglew.so'])]
++#if os.name == 'nt': 
++#   data_files=[('Lib/site-packages', ['pyglew.dll', 'glew32.dll'])]
++#else:
++#   data_files=[('lib/python2.5/site-packages', ['pyglew.so', 'libGLEW.so'])]
  
  setup(name='PyGLEW',
        version='0.1.2',
+@@ -15,5 +15,5 @@
+       url='http://www.cs.lth.se/~calle',
+       packages=[],
+       ext_modules=[],
+-      data_files=data_files)
++      )#data_files=data_files)
+ 

Modified: packages/python-pyglew/trunk/debian/rules
URL: http://svn.debian.org/wsvn/python-modules/packages/python-pyglew/trunk/debian/rules?rev=3469&op=diff
==============================================================================
--- packages/python-pyglew/trunk/debian/rules (original)
+++ packages/python-pyglew/trunk/debian/rules Sun Oct 28 19:10:28 2007
@@ -4,55 +4,48 @@
 
 include /usr/share/dpatch/dpatch.make
 
-PYDEF=$(shell pyversions -d)
-PYVERS=$(shell pyversions -r)
-PYVERSLIST=$(shell pyversions -vs)
+PYVERS=$(shell pyversions -vr)
 
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
-	# Add here commands to configure the package.
-	touch configure-stamp
-
-
-build: build-stamp
-build-stamp: patch-stamp configure-stamp 
-	dh_testdir
-
-	# Add here commands to compile the package.
-	for python in $(PYVERS); do \
-		python=$$(echo $$python | sed "s/$(PYDEF)/python/"); \
-		$(MAKE) PYTHON=$$python; \
-	done
-
-	touch $@
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+  CFLAGS += -O0
+else
+  CFLAGS += -O2
+endif
+export CFLAGS
 
 clean: unpatch
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp
+	[ ! -d build ] || rm -rf build
+	[ ! -d dist ]  || rm -rf dist
+	rm -f *.o *.so
+	rm -f build-ext-* build-stamp
+	-rm debian/shlibs.local
+	dh_clean 
 
-	# Add here commands to clean up after the build process.
-	for python in $(PYVERS); do \
-		python=$$(echo $$python | sed "s/$(PYDEF)/python/"); \
-		$$python setup.py clean; \
-	done
+build-ext-%:
+	dh_testdir
+	[ ! -d build ] || rm -rf build
+	mkdir -p debian/python-pyglew/usr/lib/python$*/site-packages/
+	
+	$(MAKE) PYTHON=python$*
+	dh_install build/pyglew.so /usr/lib/python$*/site-packages/
+	
+	# workaround to let think libpython<VER> is local, so that dh_shlibdebs does not generate
+	# dependencies on them, but only ${python:Depends} will
+	echo libpython$* 1.0 >> debian/shlibs.local
+	touch $@
 
-
-	dh_clean 
+build: build-stamp
+build-stamp: patch-stamp $(PYVERS:%=build-ext-%)
+	dh_testdir
+	touch $@
 
 install: build
 	dh_testdir
 	dh_testroot
-	dh_clean -k 
 	dh_installdirs
-
-	# Add here commands to install the package into debian/python-pyglew.
-	for python in $(PYVERS); do \
-		python=$$(echo $$python | sed "s/$(PYDEF)/python/"); \
-		$$python setup.py install --root=$(CURDIR)/debian/python-pyglew; \
-	done
-
+	python setup.py install --root=$(CURDIR)/debian/python-pyglew
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -63,21 +56,17 @@
 	dh_testdir
 	dh_testroot
 	dh_installchangelogs 
-	dh_installdocs		README
+	dh_installdocs README
 	dh_pycentral
 	dh_installman
-	dh_link
 	dh_strip
 	dh_compress
 	dh_fixperms
 	dh_installdeb
-	# workaround to let think libpython<VER> is local, so that dh_shlibdebs does not generate
-	# dependencies on them, but only ${python:Depends} will
-	( for i in $(PYVERSLIST); do echo libpython$$i 1.0; done ) > debian/shlibs.local
 	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install




More information about the Python-modules-commits mailing list