[Python-modules-commits] r3655 - in /packages/pyicu/trunk/debian: patches/00list patches/make-python-config.dpatch patches/make-test.dpatch patches/setup.py.dpatch pyversions rules

bzed-guest at users.alioth.debian.org bzed-guest at users.alioth.debian.org
Sat Nov 17 17:30:53 UTC 2007


Author: bzed-guest
Date: Sat Nov 17 17:30:53 2007
New Revision: 3655

URL: http://svn.debian.org/wsvn/python-modules/?sc=1&rev=3655
Log:
using setup.py instead of the -just-not-working- Makefile from upstream.

Added:
    packages/pyicu/trunk/debian/patches/setup.py.dpatch   (with props)
Removed:
    packages/pyicu/trunk/debian/patches/make-python-config.dpatch
    packages/pyicu/trunk/debian/patches/make-test.dpatch
Modified:
    packages/pyicu/trunk/debian/patches/00list
    packages/pyicu/trunk/debian/pyversions
    packages/pyicu/trunk/debian/rules

Modified: packages/pyicu/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/python-modules/packages/pyicu/trunk/debian/patches/00list?rev=3655&op=diff
==============================================================================
--- packages/pyicu/trunk/debian/patches/00list (original)
+++ packages/pyicu/trunk/debian/patches/00list Sat Nov 17 17:30:53 2007
@@ -1,3 +1,2 @@
 64bit-fix
-make-test
-make-python-config
+setup.py

Added: packages/pyicu/trunk/debian/patches/setup.py.dpatch
URL: http://svn.debian.org/wsvn/python-modules/packages/pyicu/trunk/debian/patches/setup.py.dpatch?rev=3655&op=file
==============================================================================
--- packages/pyicu/trunk/debian/patches/setup.py.dpatch (added)
+++ packages/pyicu/trunk/debian/patches/setup.py.dpatch Sat Nov 17 17:30:53 2007
@@ -1,0 +1,35 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## setup.py.dpatch by Bernd Zeimetz <bernd at bzed.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad pyicu~/setup.py pyicu/setup.py
+--- pyicu~/setup.py	1970-01-01 01:00:00.000000000 +0100
++++ pyicu/setup.py	2007-11-17 17:40:54.000000000 +0100
+@@ -0,0 +1,24 @@
++import os
++from distutils.core import setup, Extension
++if not os.environ.has_key('CC'):
++    os.environ['CC']='g++'
++
++
++
++__cpp_files__ = ['bases.cpp', 'calendar.cpp', 'charset.cpp',
++                 'collator.cpp', 'common.cpp', 'dateformat.cpp',
++                 'errors.cpp', 'format.cpp', 'iterators.cpp',
++                 'locale.cpp', 'numberformat.cpp', '_PyICU.cpp']
++
++__pyicu_version__ = '0.6'
++
++setup(name="PyICU",
++      version=__pyicu_version__,
++      ext_modules=[Extension('_PyICU',
++                             __cpp_files__,
++                             libraries=['icui18n', 'icuuc', 'icudata'],
++                             define_macros=[('PYICU_VER', '"%s"' % __pyicu_version__ )]
++                            )
++                  ],
++      py_modules=['PyICU']
++     )

Propchange: packages/pyicu/trunk/debian/patches/setup.py.dpatch
------------------------------------------------------------------------------
    svn:executable = *

Modified: packages/pyicu/trunk/debian/pyversions
URL: http://svn.debian.org/wsvn/python-modules/packages/pyicu/trunk/debian/pyversions?rev=3655&op=diff
==============================================================================
--- packages/pyicu/trunk/debian/pyversions (original)
+++ packages/pyicu/trunk/debian/pyversions Sat Nov 17 17:30:53 2007
@@ -1,1 +1,1 @@
-2.5-
+2.3-

Modified: packages/pyicu/trunk/debian/rules
URL: http://svn.debian.org/wsvn/python-modules/packages/pyicu/trunk/debian/rules?rev=3655&op=diff
==============================================================================
--- packages/pyicu/trunk/debian/rules (original)
+++ packages/pyicu/trunk/debian/rules Sat Nov 17 17:30:53 2007
@@ -4,67 +4,76 @@
 #export DH_VERBOSE=1
 
 PKGNAME:=python-pyicu
-PYVERS:=$(shell pyversions -rv 2>/dev/null)
+PYVERS:=$(shell pyversions -vr)
 
-#this will change to libicu-dev, preparing everything to make the package
-#binNMUable when libicu-dev moves from experimental to unstable.
-LIBICUDEV:=libicu36-dev
-ICU_VER:=$(shell dpkg -s $(LIBICUDEV) | \
-                 grep '^Version'      | \
-                 sed 's,Version: ,,;s,-.*,,g')
 
 include /usr/share/dpatch/dpatch.make
-
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-MAKETEST = all test
-endif
 
 build: patch build-stamp
 build-stamp:
 	dh_testdir
+
+	set -e; \
+	for py in $(PYVERS); do  \
+	    python$$py setup.py build; \
+	    python$$py-dbg setup.py build; \
+	done
+
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 	set -e ;\
-	for pyver in $(PYVERS); do \
-	    make $(MAKETEST) PREFIX=/usr PREFIX_PYTHON=/usr PREFIX_ICU=/usr \
-	         PYTHON=/usr/bin/python$$pyver PYTHON_VER=$$pyver   \
-	         ICU_VER=$(ICU_VER) ;\
-	    make install PREFIX_PYTHON=$(CURDIR)/debian/$(PKGNAME)/usr ;\
-	    make clean ;\
-	    make $(MAKETEST) PREFIX=/usr PREFIX_PYTHON=/usr PREFIX_ICU=/usr \
-	         PYTHON=/usr/bin/python$$pyver-dbg PYTHON_VER=$$pyver   \
-	         ICU_VER=$(ICU_VER) DEBUG=1 ;\
-	    make install PREFIX_PYTHON=$(CURDIR)/debian/$(PKGNAME)-dbg/usr \
-	         DEBUG=1 ;\
-	    make clean DEBUG=1 ;\
+	for test in `ls test/*.py`; do \
+	  for py in $(PYVERS); do  \
+	    PYTHONPATH=$(CURDIR)/build/lib.$(DEB_BUILD_ARCH_OS)-$(DEB_BUILD_GNU_CPU)-$$py \
+	      python$$py $$test ;\
+	    PYTHONPATH=$(CURDIR)/build/lib_d.$(DEB_BUILD_ARCH_OS)-$(DEB_BUILD_GNU_CPU)-$$py \
+	      python$$py-dbg $$test ;\
+	  done ;\
 	done
-	find $(CURDIR)/debian/$(PKGNAME)-dbg/usr -name PyICU.py -print0 | \
-	    xargs -0 rm -f
-	find $(CURDIR)/debian/$(PKGNAME)/usr -name PyICU.py -print0 | \
-	    xargs -0 chmod 644
+endif
+
 	touch $@
 
 clean: clean-patched unpatch
 clean-patched: patch-stamp
 	dh_testdir
 	dh_testroot
-	
-	rm -f build-stamp
-	make clean
-	make clean DEBUG=1
+	rm -f install-stamp build-stamp
+	-for py in $(PYVERS); do  \
+	    $$py setup.py clean; \
+	done
+	find . -name \*.pyc | xargs rm -f
+	rm -rf build
 	dh_clean 
 
-
-binary-indep: build
-#nothing to do here.
-
-binary-arch: build
+install: install-stamp
+install-stamp:
 	dh_testdir
 	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	set -e; \
+	for py in $(PYVERS); do  \
+	    python$$py setup.py install --root=debian/$(PKGNAME) ;\
+	    python$$py-dbg setup.py install --root=debian/$(PKGNAME)-dbg ;\
+	done
+
 	dh_installdocs
-	dh_installchangelogs CHANGES
-	dh_compress
+	dh_installexamples
+	touch install-stamp
+
+binary-indep: build install
+# We have nothing to do by default.
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_compress -X.py
+	dh_strip -p$(PKGNAME) --dbg-package=$(PKGNAME)-dbg
 	dh_fixperms
-	dh_strip -ppython-pyicu --dbg-package=python-pyicu-dbg
 	dh_pysupport
+	rm -rf debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
+	ln -s $(PKGNAME) debian/$(PKGNAME)-dbg/usr/share/doc/$(PKGNAME)-dbg
 	dh_installdeb
 	# Ignore libpython dependencies
 	( for i in $(PYVERS); do echo libpython$$i 1.0; done ) > debian/shlibs.local
@@ -74,6 +83,6 @@
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary \
+.PHONY: build clean binary-indep binary-arch binary install \
         clean-patched patch unpatch
 




More information about the Python-modules-commits mailing list