[Python-modules-commits] r7900 - in packages/tagpy/trunk/debian (8 files)

nijel at users.alioth.debian.org nijel at users.alioth.debian.org
Wed Mar 18 14:05:25 UTC 2009


    Date: Wednesday, March 18, 2009 @ 14:05:22
  Author: nijel
Revision: 7900

* Convert debian/rules to dh.
* Add patch to simplify handling of build for more python versions.

Added:
  packages/tagpy/trunk/debian/patches/
  packages/tagpy/trunk/debian/patches/optional-siteconf.patch
  packages/tagpy/trunk/debian/patches/series
  packages/tagpy/trunk/debian/python-tagpy.examples
Modified:
  packages/tagpy/trunk/debian/changelog
  packages/tagpy/trunk/debian/compat
  packages/tagpy/trunk/debian/control
  packages/tagpy/trunk/debian/rules

Modified: packages/tagpy/trunk/debian/changelog
===================================================================
--- packages/tagpy/trunk/debian/changelog	2009-03-18 13:34:59 UTC (rev 7899)
+++ packages/tagpy/trunk/debian/changelog	2009-03-18 14:05:22 UTC (rev 7900)
@@ -1,11 +1,12 @@
-tagpy (0.94.5-4) UNRELEASED; urgency=low
+tagpy (0.94.5-4) unstable; urgency=low
 
-  * NOT RELEASED YET
   * Switch to boost 1.37.
   * Bump standards to 3.8.1 (no changes needed).
   * Switch from pycentral to pysupport.
+  * Convert debian/rules to dh.
+  * Add patch to simplify handling of build for more python versions.
 
- -- Michal ÄŒihaÅ™ <nijel at debian.org>  Wed, 18 Mar 2009 14:34:52 +0100
+ -- Michal ÄŒihaÅ™ <nijel at debian.org>  Wed, 18 Mar 2009 15:05:07 +0100
 
 tagpy (0.94.5-3) unstable; urgency=low
 

Modified: packages/tagpy/trunk/debian/compat
===================================================================
--- packages/tagpy/trunk/debian/compat	2009-03-18 13:34:59 UTC (rev 7899)
+++ packages/tagpy/trunk/debian/compat	2009-03-18 14:05:22 UTC (rev 7900)
@@ -1 +1 @@
-5
+7

Modified: packages/tagpy/trunk/debian/control
===================================================================
--- packages/tagpy/trunk/debian/control	2009-03-18 13:34:59 UTC (rev 7899)
+++ packages/tagpy/trunk/debian/control	2009-03-18 14:05:22 UTC (rev 7900)
@@ -3,12 +3,13 @@
 Priority: extra
 Maintainer: Michal ÄŒihaÅ™ <nijel at debian.org>
 Uploaders: Python Modules Packaging Team <python-modules-team at lists.alioth.debian.org>
-Build-Depends: debhelper (>= 5.0.38), 
+Build-Depends: debhelper (>= 7.0.14),
     python-support (>= 0.5.3),
     python-all-dev (>= 2.3.5-11), 
     libtag1-dev, 
     libboost-python1.37-dev,
     pkg-config,
+    quilt (>= 0.40),
     python-setuptools
 Standards-Version: 3.8.1
 XS-Python-Version: all

Added: packages/tagpy/trunk/debian/patches/optional-siteconf.patch
===================================================================
--- packages/tagpy/trunk/debian/patches/optional-siteconf.patch	                        (rev 0)
+++ packages/tagpy/trunk/debian/patches/optional-siteconf.patch	2009-03-18 14:05:22 UTC (rev 7900)
@@ -0,0 +1,134 @@
+Add option to use different config file than siteconf.py.
+This is needed to properly build for more python versions.
+--- a/aksetup_helper.py
++++ b/aksetup_helper.py
+@@ -1,5 +1,10 @@
+ # dealings with ez_setup ------------------------------------------------------
+ import ez_setup
++import os
++try:
++    DEFAULT_SITECONF = os.environ['SITECONF_NAME']
++except KeyError:
++    DEFAULT_SITECONF = 'siteconf.py'
+ 
+ ez_setup.use_setuptools()
+ 
+@@ -24,7 +29,7 @@
+ 
+ 
+ class NumpyExtension(Extension):
+-    # nicked from 
++    # nicked from
+     # http://mail.python.org/pipermail/distutils-sig/2007-September/008253.html
+     # solution by Michael Hoffmann
+     def __init__(self, *args, **kwargs):
+@@ -65,7 +70,7 @@
+ 
+ # tools -----------------------------------------------------------------------
+ def flatten(list):
+-    """For an iterable of sub-iterables, generate each member of each 
++    """For an iterable of sub-iterables, generate each member of each
+     sub-iterable in turn, i.e. a flattened version of that super-iterable.
+ 
+     Example: Turn [[a,b,c],[d,e,f]] into [a,b,c,d,e,f].
+@@ -161,7 +166,7 @@
+ 
+ 
+ class ConfigSchema:
+-    def __init__(self, options, conf_file="siteconf.py", conf_dir="."):
++    def __init__(self, options, conf_file=DEFAULT_SITECONF, conf_dir="."):
+         self.optdict = dict((opt.name, opt) for opt in options)
+         self.options = options
+         self.conf_dir = conf_dir
+@@ -184,9 +189,9 @@
+         self.conf_dir = conf_dir
+ 
+     def get_default_config(self):
+-        return dict((opt.name, opt.default) 
++        return dict((opt.name, opt.default)
+                 for opt in self.options)
+-        
++
+     def read_config_from_pyfile(self, filename):
+         result = {}
+         filevars = {}
+@@ -234,7 +239,7 @@
+         result = self.get_default_config()
+ 
+         import os
+-        
++
+         confignames = []
+         if self.global_conf_file is not None:
+             confignames.append(self.global_conf_file)
+@@ -248,7 +253,7 @@
+ 
+     def have_global_config(self):
+         import os
+-        return (os.access(self.user_conf_file, os.R_OK) or 
++        return (os.access(self.user_conf_file, os.R_OK) or
+                 os.access(self.global_conf_file, os.R_OK))
+ 
+     def have_config(self):
+@@ -330,13 +335,13 @@
+         return result
+ 
+     def value_to_str(self, default):
+-        return default 
++        return default
+ 
+     def add_to_configparser(self, parser, default=None):
+         default = default_or(default, self.default)
+         default_str = self.value_to_str(default)
+         parser.add_option(
+-            "--" + self.as_option(), dest=self.name, 
++            "--" + self.as_option(), dest=self.name,
+             default=default_str,
+             metavar=self.metavar(), help=self.get_help(default))
+ 
+@@ -357,11 +362,11 @@
+             action = "store_false"
+         else:
+             action = "store_true"
+-            
++
+         parser.add_option(
+-            "--" + self.as_option(), 
+-            dest=self.name, 
+-            help=self.get_help(default), 
++            "--" + self.as_option(),
++            dest=self.name,
++            help=self.get_help(default),
+             default=default,
+             action=action)
+ 
+@@ -389,7 +394,7 @@
+ class IncludeDir(StringListOption):
+     def __init__(self, lib_name, default=None, human_name=None, help=None):
+         StringListOption.__init__(self, "%s_INC_DIR" % lib_name, default,
+-                help=help or ("Include directories for %s" 
++                help=help or ("Include directories for %s"
+                 % (human_name or humanize(lib_name))))
+ 
+ class LibraryDir(StringListOption):
+@@ -401,7 +406,7 @@
+ class Libraries(StringListOption):
+     def __init__(self, lib_name, default=None, human_name=None, help=None):
+         StringListOption.__init__(self, "%s_LIBNAME" % lib_name, default,
+-                help=help or ("Library names for %s (without lib or .so)" 
++                help=help or ("Library names for %s (without lib or .so)"
+                 % (human_name or humanize(lib_name))))
+ 
+ 
+@@ -435,9 +440,9 @@
+ 	    help="Ignored")
+     parser.add_option("--enable-shared", help="Ignored", action="store_false")
+     parser.add_option("--disable-static", help="Ignored", action="store_false")
+-    parser.add_option("--update-user", help="Update user config file (%s)" % schema.user_conf_file, 
++    parser.add_option("--update-user", help="Update user config file (%s)" % schema.user_conf_file,
+             action="store_true")
+-    parser.add_option("--update-global", help="Update global config file (%s)" % schema.global_conf_file, 
++    parser.add_option("--update-global", help="Update global config file (%s)" % schema.global_conf_file,
+             action="store_true")
+ 
+     schema.add_to_configparser(parser, schema.read_config())

Added: packages/tagpy/trunk/debian/patches/series
===================================================================
--- packages/tagpy/trunk/debian/patches/series	                        (rev 0)
+++ packages/tagpy/trunk/debian/patches/series	2009-03-18 14:05:22 UTC (rev 7900)
@@ -0,0 +1 @@
+optional-siteconf.patch

Added: packages/tagpy/trunk/debian/python-tagpy.examples
===================================================================
--- packages/tagpy/trunk/debian/python-tagpy.examples	                        (rev 0)
+++ packages/tagpy/trunk/debian/python-tagpy.examples	2009-03-18 14:05:22 UTC (rev 7900)
@@ -0,0 +1 @@
+test/*

Modified: packages/tagpy/trunk/debian/rules
===================================================================
--- packages/tagpy/trunk/debian/rules	2009-03-18 13:34:59 UTC (rev 7899)
+++ packages/tagpy/trunk/debian/rules	2009-03-18 14:05:22 UTC (rev 7900)
@@ -1,43 +1,46 @@
 #!/usr/bin/make -f
 
+include /usr/share/quilt/quilt.make
+
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
 PYVERSIONS=$(shell pyversions -v -r)
 
-build: build-stamp
+override_dh_compress:
+	dh_compress -X examples
 
-build-stamp:
-	dh_testdir
-	set -e; \
-	for v in $(PYVERSIONS) ; do \
-		PYTHON=python$$v ; \
-		$$PYTHON ./configure \
+override_dh_auto_configure-%:
+	SITECONF_NAME=siteconf$*.py python$* ./configure \
 			--taglib-inc-dir=`pkg-config --cflags-only-I taglib | sed 's/-I//'` \
-			--boost-python-libname=boost_python-mt-py`echo $$v | tr -d .`; \
-		$$PYTHON setup.py build ; \
-	done
+			--boost-python-libname=boost_python-mt-py`echo $* | tr -d .`
+
+override_dh_auto_configure: $(PYVERSIONS:%=override_dh_auto_configure-%)
+
+override_dh_auto_build-%:
+	SITECONF_NAME=siteconf$*.py python$* setup.py build -b build$*
+
+override_dh_auto_build: $(PYVERSIONS:%=override_dh_auto_build-%)
+
+override_dh_auto_install-%:
+	SITECONF_NAME=siteconf$*.py python$* setup.py build -b build$* install --no-compile --root=debian/python-tagpy
+
+override_dh_auto_install: $(PYVERSIONS:%=override_dh_auto_install-%)
+
+override_dh_auto_clean:
+	rm -rf build siteconf*.py
+
+build: build-stamp
+
+build-stamp: $(QUILT_STAMPFN)
+	dh build
 	touch $@
 
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp
-	rm -rf build
-	dh_clean 
+clean: unpatch
+	dh clean
 
 install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k 
-	dh_installdirs
-	dh_installexamples test/*
-	set -e; \
-	for v in $(PYVERSIONS) ; do \
-		PYTHON=python$$v ; \
-		PYTMP="debian/python-tagpy" ; \
-		$$PYTHON setup.py install --no-compile --root=$$PYTMP ; \
-	done
+	dh install
 
 # Build architecture-independent files here.
 binary-indep: build install
@@ -45,20 +48,7 @@
 
 # Build architecture-dependent files here.
 binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs 
-	dh_installdocs
-	dh_pysupport
-	dh_strip
-	# Examples are either small scripts or compressed audio data
-	dh_compress -X examples
-	dh_fixperms
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
+	dh binary-arch
 
 binary: binary-indep binary-arch
 .PHONY: build clean binary-indep binary-arch binary install




More information about the Python-modules-commits mailing list