[Python-modules-commits] r11361 - in packages/python-ctypeslib/trunk (16 files)

mrbeige-guest at users.alioth.debian.org mrbeige-guest at users.alioth.debian.org
Wed Jan 27 17:02:23 UTC 2010


    Date: Wednesday, January 27, 2010 @ 17:02:20
  Author: mrbeige-guest
Revision: 11361

[svn-inject] Applying Debian modifications to trunk

Added:
  packages/python-ctypeslib/trunk/debian/
  packages/python-ctypeslib/trunk/debian/README.Debian
  packages/python-ctypeslib/trunk/debian/README.source
  packages/python-ctypeslib/trunk/debian/TODO
  packages/python-ctypeslib/trunk/debian/changelog
  packages/python-ctypeslib/trunk/debian/clean
  packages/python-ctypeslib/trunk/debian/compat
  packages/python-ctypeslib/trunk/debian/control
  packages/python-ctypeslib/trunk/debian/copyright
  packages/python-ctypeslib/trunk/debian/ctypeslib.debhelper.log
  packages/python-ctypeslib/trunk/debian/ctypeslib.postinst.debhelper
  packages/python-ctypeslib/trunk/debian/ctypeslib.prerm.debhelper
  packages/python-ctypeslib/trunk/debian/ctypeslib.substvars
  packages/python-ctypeslib/trunk/debian/examples.Debian
  packages/python-ctypeslib/trunk/debian/python-ctypeslib.docs
  packages/python-ctypeslib/trunk/debian/rules


Property changes on: packages/python-ctypeslib/trunk/debian
___________________________________________________________________
Added: mergeWithUpstream
   + 1

Added: packages/python-ctypeslib/trunk/debian/README.Debian
===================================================================
--- packages/python-ctypeslib/trunk/debian/README.Debian	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/README.Debian	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,28 @@
+ctypeslib for Debian
+--------------------
+
+Ctypeslib is unreleased as of yet, however worked very well for its
+stated usage of automatically generating ctypes interfaces from C or
+C++ header files.
+
+As far as I can tell, there are not a large number of users of
+ctypeslib yet.  I hope that this Debian package will build a userbase
+and get bugs worked out and features added as needed.
+
+
+There are other similar modules.  I have found:
+
+ctypeslib (this package)
+    By the ctypes author, uses gccxml.
+
+ctypesgen
+    http://code.google.com/p/ctypesgen/
+    Pure python, writes it's own C parser.
+
+pyclibrary
+    http://pyparsing.wikispaces.com/message/view/home/18775771
+    http://launchpad.net/pyclibrary
+    Also seems to be pure Python implementation.
+
+
+ -- Richard Darst <rkd at zgib.net>  Wed, 18 Nov 2009 03:42:25 -0500

Added: packages/python-ctypeslib/trunk/debian/README.source
===================================================================
--- packages/python-ctypeslib/trunk/debian/README.source	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/README.source	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,9 @@
+ctypeslib for Debian
+--------------------
+
+<this file describes information about the source package, see Debian policy
+manual section 4.14. You WILL either need to modify or delete this file>
+
+
+
+

Added: packages/python-ctypeslib/trunk/debian/TODO
===================================================================
--- packages/python-ctypeslib/trunk/debian/TODO	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/TODO	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,3 @@
+- Manual pages for h2xml and xml2py
+- Fix setup.py so that "tests" command returns false on test failures
+- debian/copyright
\ No newline at end of file

Added: packages/python-ctypeslib/trunk/debian/changelog
===================================================================
--- packages/python-ctypeslib/trunk/debian/changelog	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/changelog	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,5 @@
+python-ctypeslib (0.0.0+svn20100125-1) UNRELEASED; urgency=low
+
+  * Initial release (Closes: #566905)
+
+ -- Richard Darst <rkd at zgib.net>  Mon, 25 Jan 2010 14:10:02 -0500

Added: packages/python-ctypeslib/trunk/debian/clean
===================================================================
--- packages/python-ctypeslib/trunk/debian/clean	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/clean	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,2 @@
+_stdio_gen.py
+_stdio_gen.xml

Added: packages/python-ctypeslib/trunk/debian/compat
===================================================================
--- packages/python-ctypeslib/trunk/debian/compat	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/compat	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1 @@
+7

Added: packages/python-ctypeslib/trunk/debian/control
===================================================================
--- packages/python-ctypeslib/trunk/debian/control	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/control	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,23 @@
+Source: python-ctypeslib
+Section: python
+Priority: optional
+Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Uploaders: Richard Darst <rkd at zgib.net>
+Build-Depends: debhelper (>= 7), python-all, python-support, gccxml
+Standards-Version: 3.8.3
+Homepage: http://starship.python.net/crew/theller/ctypes/
+Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-ctypeslib/trunk
+Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-ctypeslib/trunk
+
+
+Package: python-ctypeslib
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, gccxml
+Description: code generator to convert header files into ctypes interfaces
+ ctypeslib is a code generator capable of converting C header files
+ into xml files (using gccxml), and then converting the xmlfiles into
+ Python modules which define a ctypes interface to the corresponding C
+ library.
+ .
+ If you use ctypes a lot, and are tired of setting argtypes and restype
+ of the called functions, you should look into ctypeslib.

Added: packages/python-ctypeslib/trunk/debian/copyright
===================================================================
--- packages/python-ctypeslib/trunk/debian/copyright	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/copyright	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,40 @@
+This work was packaged for Debian by:
+
+    Richard Darst <rkd at zgib.net> on Wed, 18 Nov 2009 03:42:25 -0500
+
+It was downloaded from http://starship.python.net/crew/theller/ctypes/
+
+Upstream Author(s):
+
+    Thomas Heller <theller at ctypes.org>
+
+Copyright:
+
+    Copyright (C) 2006-2010 Thomas Heller
+
+License:
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+    
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+    
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+The Debian packaging is:
+
+    Copyright (C) 2009 Richard Darst <rkd at zgib.net>
+
+and is licensed under the same terms as above.

Added: packages/python-ctypeslib/trunk/debian/ctypeslib.debhelper.log
===================================================================
--- packages/python-ctypeslib/trunk/debian/ctypeslib.debhelper.log	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/ctypeslib.debhelper.log	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,45 @@
+dh_auto_configure
+dh_auto_build
+dh_auto_test
+dh_prep
+dh_installdirs
+dh_auto_install
+dh_install
+dh_installdocs
+dh_installchangelogs
+dh_installexamples
+dh_installman
+dh_installcatalogs
+dh_installcron
+dh_installdebconf
+dh_installemacsen
+dh_installifupdown
+dh_installinfo
+dh_pysupport
+dh_installinit
+dh_installmenu
+dh_installmime
+dh_installmodules
+dh_installlogcheck
+dh_installlogrotate
+dh_installpam
+dh_installppp
+dh_installudev
+dh_installwm
+dh_installxfonts
+dh_bugfiles
+dh_lintian
+dh_gconf
+dh_icons
+dh_perl
+dh_usrlocal
+dh_link
+dh_compress
+dh_fixperms
+dh_strip
+dh_makeshlibs
+dh_shlibdeps
+dh_installdeb
+dh_gencontrol
+dh_md5sums
+dh_builddeb

Added: packages/python-ctypeslib/trunk/debian/ctypeslib.postinst.debhelper
===================================================================
--- packages/python-ctypeslib/trunk/debian/ctypeslib.postinst.debhelper	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/ctypeslib.postinst.debhelper	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,5 @@
+# Automatically added by dh_pysupport
+if which update-python-modules >/dev/null 2>&1; then
+	update-python-modules  ctypeslib.public
+fi
+# End automatically added section

Added: packages/python-ctypeslib/trunk/debian/ctypeslib.prerm.debhelper
===================================================================
--- packages/python-ctypeslib/trunk/debian/ctypeslib.prerm.debhelper	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/ctypeslib.prerm.debhelper	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,5 @@
+# Automatically added by dh_pysupport
+if which update-python-modules >/dev/null 2>&1; then
+	update-python-modules -c  ctypeslib.public
+fi
+# End automatically added section

Added: packages/python-ctypeslib/trunk/debian/ctypeslib.substvars
===================================================================
--- packages/python-ctypeslib/trunk/debian/ctypeslib.substvars	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/ctypeslib.substvars	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,3 @@
+python:Versions=2.5, 2.6
+python:Depends=python (<< 2.7), python (>= 2.5), python-support (>= 0.90.0)
+misc:Depends=

Added: packages/python-ctypeslib/trunk/debian/examples.Debian
===================================================================
--- packages/python-ctypeslib/trunk/debian/examples.Debian	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/examples.Debian	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,79 @@
+# Process math.h
+#
+# (note: this requires py2.6, since that is when c_longdouble first appeared)
+#
+# Looking in math_c.py, we see some useful definitions, but not all
+# that much, yet...
+
+h2xml /usr/include/math.h -o math_c.xml
+xml2py math_c.xml -o math_c.py
+
+
+
+# Add the -c argument : include C preprocessor headers
+#
+# Now, we see a lot more defined in the math_c.py .  For example,
+# M_PI, as defined in math.h, is included.
+
+h2xml /usr/include/math.h -c -o math_c.xml
+xml2py math_c.xml -o math_c.py
+
+
+
+# -l: auto-load a library
+#
+# When you pass the -l argument, it will scan the libary for
+# executable symbols.  If it finds them, it will automatically set up
+# to run, using ctypes, from that library.
+
+h2xml /usr/include/math.h -c -o math_c.xml
+xml2py math_c.xml -o math_c.py -l /lib/libm.so.6
+
+
+
+########################################
+
+
+# Let's work on time.h:
+#
+# We get a lot of stuff, for example, the definition of the C structure 
+# "struct tm" is automatically created, for example:
+#
+# class tm(Structure):
+#     pass
+# tm._fields_ = [
+#     ('tm_sec', c_int),
+#     ('tm_min', c_int),
+#     ('tm_hour', c_int),
+#     ('tm_mday', c_int),
+#     ('tm_mon', c_int),
+#     ('tm_year', c_int),
+#     ('tm_wday', c_int),
+#     ('tm_yday', c_int),
+#     ('tm_isdst', c_int),
+#     ('tm_gmtoff', c_long),
+#     ('tm_zone', STRING),
+
+# We use '-l /lib/libc.so.6', so that we automaticall set up to run
+# defined functions from libc.so.6, using ctypes
+
+h2xml /usr/include/time.h -o time_c.xml
+xml2py time_c.xml -o time_c.py -l /lib/libc.so.6
+
+man strptime
+python
+>>> import time_c
+#  Initialize a `struct tm` object to use as the return values of our
+#  function call.
+>>> tm = time_c.tm()
+>>> time_c.strptime("Dec 19, 1985", "%b %d, %Y", tm)
+''
+>>> tm.tm_yday
+352
+>>> tm.tm_year
+85
+>>> tm.tm_wday
+4
+
+# In short, anything in a C header file, we can now do from Python
+# using ctypes, without having to define a ctypes interface manually.

Added: packages/python-ctypeslib/trunk/debian/python-ctypeslib.docs
===================================================================
--- packages/python-ctypeslib/trunk/debian/python-ctypeslib.docs	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/python-ctypeslib.docs	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,3 @@
+docs/codegen.txt
+TODO
+debian/examples.Debian

Added: packages/python-ctypeslib/trunk/debian/rules
===================================================================
--- packages/python-ctypeslib/trunk/debian/rules	                        (rev 0)
+++ packages/python-ctypeslib/trunk/debian/rules	2010-01-27 17:02:20 UTC (rev 11361)
@@ -0,0 +1,49 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+PYVERS=$(shell pyversions -vr debian/control)
+SRC_VERSION = $(shell dpkg-parsechangelog --count 1 | \
+                     grep 'Version: ' | \
+                     sed --regexp-extended 's/Version: ([^-]+)-.+/\1/' )
+SVN_VERSION = $(shell echo $(SRC_VERSION | \
+                     sed --regexp-extended 's/Version: .*+svn([0-9]+).*/\1/' )
+TARBALL = python-ctypeslib_$(SRC_VERSION).orig.tar.gz
+
+get-orig-source:
+	rm -rf get-orig-source
+	mkdir get-orig-source
+	svn export --revision '{20100125}' \
+	    http://svn.python.org/projects/ctypes/trunk/ctypeslib/ \
+	    get-orig-source/python-ctypeslib_$(SRC_VERSION).orig/
+	GZIP=--best tar czf python-ctypeslib_$(SRC_VERSION).orig.tar.gz \
+	               -C get-orig-source python-ctypeslib_$(SRC_VERSION).orig/
+	rm -rf get-orig-source
+	echo "  $(TARBALL) created, move it where you want."
+
+build:
+	dh build
+#	 `setup.py test` doesn't return false on failure yet, needs to be fixed
+	for VER in $(PYVERS) ; do \
+	    python$${VER} setup.py test ; \
+	done
+
+binary:
+	dh binary --until dh_pysupport
+#	python -c 'print "x"*5000'
+	dh_install
+	mv debian/python-ctypeslib/usr/bin/h2xml.py \
+           debian/python-ctypeslib/usr/bin/h2xml
+	mv debian/python-ctypeslib/usr/bin/xml2py.py \
+           debian/python-ctypeslib/usr/bin/xml2py
+	dh binary
+
+%:
+	dh $@


Property changes on: packages/python-ctypeslib/trunk/debian/rules
___________________________________________________________________
Added: svn:executable
   + *




More information about the Python-modules-commits mailing list