[Python-modules-commits] r19037 - in packages/python-crypto/trunk/debian (9 files)

sramacher-guest at users.alioth.debian.org sramacher-guest at users.alioth.debian.org
Sun Oct 23 10:03:09 UTC 2011


    Date: Sunday, October 23, 2011 @ 10:03:07
  Author: sramacher-guest
Revision: 19037

Package new upstream release.
 * Build extensions for Python 3.x.
 * Drop epydoc-exclude-introspect.path and no-usr-local.patch (applied
   upstream).
 * Drop setup-dont-check-gmp.patch (not needed anymore).
 * Add dont-drop-g.patch to build the extension modules with -g.

Added:
  packages/python-crypto/trunk/debian/patches/dont-drop-g.patch
Modified:
  packages/python-crypto/trunk/debian/changelog
  packages/python-crypto/trunk/debian/clean
  packages/python-crypto/trunk/debian/control
  packages/python-crypto/trunk/debian/patches/series
  packages/python-crypto/trunk/debian/rules
Deleted:
  packages/python-crypto/trunk/debian/patches/epydoc-exclude-introspect.patch
  packages/python-crypto/trunk/debian/patches/no-usr-local.patch
  packages/python-crypto/trunk/debian/patches/setup-dont-check-gmp.patch

Modified: packages/python-crypto/trunk/debian/changelog
===================================================================
--- packages/python-crypto/trunk/debian/changelog	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/changelog	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,3 +1,19 @@
+python-crypto (2.4-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+  * debian/rules: export CFLAGS and LDFLAGS to build with hardening flags.
+  * debian/patches:
+    - Add dont-drop-g.patch to compile non debug builds with -g.
+    - Remove epydoc-exclude-introspect.patch, fix-RSA-generate-exception.patch
+      and no-usr-local.patch: all applied upstream.
+    - Remove setup-dont-check-gmp.patch: not needed anymore.
+  * Add python3-crypto and python3-crypto-dbg packages.
+    - debian/rules: build, install and test for all available versions of
+      Python 2 and Python 3.
+    - debian/control: add Build-Dep on python3-all-dev and python3-all-dbg.
+
+ -- Sebastian Ramacher <s.ramacher at gmx.at>  Sun, 23 Oct 2011 11:40:27 +0200
+
 python-crypto (2.3-3) unstable; urgency=low
 
   * Add patch setup-dont-check-gmp.patch to build _fastmath.so even with

Modified: packages/python-crypto/trunk/debian/clean
===================================================================
--- packages/python-crypto/trunk/debian/clean	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/clean	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1 +1,4 @@
 Doc/apidoc/*
+src/config.h
+config.log
+config.status

Modified: packages/python-crypto/trunk/debian/control
===================================================================
--- packages/python-crypto/trunk/debian/control	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/control	2011-10-23 10:03:07 UTC (rev 19037)
@@ -5,8 +5,10 @@
 Uploaders: Andreas Rottmann <rotty at debian.org>,
  Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
 Build-Depends: debhelper (>= 8.1.0~), python-all-dev (>= 2.6.6-3~),
- python-all-dbg, libgmp-dev, python-epydoc, python-docutils
+ python-all-dbg, libgmp-dev, python-epydoc, python-docutils,
+ python3-all-dev, python3-all-dbg
 X-Python-Version: >= 2.1
+X-Python3-Version: >= 3.0
 Standards-Version: 3.9.2
 Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/python-crypto/trunk/
 Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/python-crypto/trunk/
@@ -28,7 +30,7 @@
   * Stream encryption algorithms: ARC4, simple XOR.
   * Public-key algorithms: RSA, DSA, ElGamal, qNEW.
   * Protocols: All-or-nothing transforms, chaffing/winnowing.
-  * Miscellaneous: RFC1751 module for converting 128-key keys 
+  * Miscellaneous: RFC1751 module for converting 128-key keys
     into a set of English words, primality testing, random number gereration.
 
 Package: python-crypto-dbg
@@ -44,6 +46,36 @@
  .
  This package contains the extensions built for the Python debug interpreter.
 
+Package: python3-crypto
+Architecture: any
+Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Provides: ${python3:Provides}
+Suggests: python3-crypto-dbg, python-crypto-doc
+Description: cryptographic algorithms and protocols for Python 3
+ A collection of cryptographic algorithms and protocols, implemented
+ for use from Python 3. Among the contents of the package:
+ .
+  * Hash functions: HMAC, MD2, MD4, MD5, RIPEMD160, SHA, SHA256.
+  * Block encryption algorithms: AES, ARC2, Blowfish, CAST, DES, Triple-DES.
+  * Stream encryption algorithms: ARC4, simple XOR.
+  * Public-key algorithms: RSA, DSA, ElGamal, qNEW.
+  * Protocols: All-or-nothing transforms, chaffing/winnowing.
+  * Miscellaneous: RFC1751 module for converting 128-key keys
+    into a set of English words, primality testing, random number gereration.
+
+Package: python3-crypto-dbg
+Section: debug
+Priority: extra
+Architecture: any
+Depends: python3-crypto (= ${binary:Version}), ${shlibs:Depends},
+ ${misc:Depends}, ${python3:Depends}
+Provides: ${python3:Provides}
+Description: cryptographic algorithms and protocols for Python 3 (debug extension)
+ A collection of cryptographic algorithms and protocols, implemented
+ for use from Python 3.
+ .
+ This package contains the extensions built for the Python 3 debug interpreter.
+
 Package: python-crypto-doc
 Section: doc
 Architecture: all

Added: packages/python-crypto/trunk/debian/patches/dont-drop-g.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/dont-drop-g.patch	                        (rev 0)
+++ packages/python-crypto/trunk/debian/patches/dont-drop-g.patch	2011-10-23 10:03:07 UTC (rev 19037)
@@ -0,0 +1,19 @@
+Description: don't drop -g from the call to gcc
+ The binaries will be stripped later anyway.
+Origin: Sebastian Ramacher <s.ramacher at gmx.at>
+Last-Update: 2011-10-12
+Forwarded: no
+
+diff --git a/setup.py b/setup.py
+index 09fbc09..d0c6201 100644
+--- a/setup.py
++++ b/setup.py
+@@ -177,8 +177,6 @@ class PCTBuildExt (build_ext):
+                 # especially helps the DES modules.
+                 self.__add_compiler_option("-O3")
+                 self.__add_compiler_option("-fomit-frame-pointer")
+-                # Don't include debug symbols unless debugging
+-                self.__remove_compiler_option("-g")
+                 # Don't include profiling information (incompatible with
+                 # -fomit-frame-pointer)
+                 self.__remove_compiler_option("-pg")

Deleted: packages/python-crypto/trunk/debian/patches/epydoc-exclude-introspect.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/epydoc-exclude-introspect.patch	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/patches/epydoc-exclude-introspect.patch	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,13 +0,0 @@
-Description: update exclude-introspect in epydoc.config to match the new module
- locations.
-Origin: Sebastian Ramacher <s.ramacher at gmx.at>
-Last-Update: 2011-04-09
-
---- python-crypto-2.3.orig/Doc/epydoc-config
-+++ python-crypto-2.3/Doc/epydoc-config
-@@ -15,4 +15,4 @@ link: <a href="http://www.pycrypto.org/"
- 
- # The documentation is usually built on a Linux machine; nt.py tries to
- # import the winrandom module.
--exclude-introspect: ^Crypto\.Util\.osentropy\.nt$
-+exclude-introspect: ^Crypto\.Random\.OSRNG\.nt|Crypto\.Util\.winrandom$

Deleted: packages/python-crypto/trunk/debian/patches/no-usr-local.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/no-usr-local.patch	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/patches/no-usr-local.patch	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,13 +0,0 @@
-Description: Remove #!/usr/local/bin/python shebang line.
-Author: James Cook <zealcook at gmail.com>
-Last-Update: 2011-03-18
-
-Index: pycrypto-2.1.0/lib/Crypto/Util/RFC1751.py
-===================================================================
---- pycrypto-2.1.0.orig/lib/Crypto/Util/RFC1751.py	2010-02-28 11:01:06.000000000 +0800
-+++ pycrypto-2.1.0/lib/Crypto/Util/RFC1751.py	2010-02-28 11:01:16.000000000 +0800
-@@ -1,4 +1,3 @@
--#!/usr/local/bin/python
- # rfc1751.py : Converts between 128-bit strings and a human-readable
- # sequence of words, as defined in RFC1751: "A Convention for
- # Human-Readable 128-bit Keys", by Daniel L. McDonald.

Modified: packages/python-crypto/trunk/debian/patches/series
===================================================================
--- packages/python-crypto/trunk/debian/patches/series	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/patches/series	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,4 +1 @@
-no-usr-local.patch
-epydoc-exclude-introspect.patch
-fix-RSA-generate-exception.patch
-setup-dont-check-gmp.patch
+dont-drop-g.patch

Deleted: packages/python-crypto/trunk/debian/patches/setup-dont-check-gmp.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/setup-dont-check-gmp.patch	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/patches/setup-dont-check-gmp.patch	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,23 +0,0 @@
-Description: Don't check if gmp is available.
- Since gmp has been multiarch-ified recently libgmp.so is to be found in
- /usr/lib/<triplet>. But setup.py only checks /lib and /usr/lib.
-Origin: Sebastian Ramacher <s.ramacher at gmx.at>
-Last-Update: 2011-09-24
-
-diff --git a/setup.py b/setup.py
-index 37aedef..88c87e9 100644
---- a/setup.py
-+++ b/setup.py
-@@ -156,12 +156,6 @@ class PCTBuildExt (build_ext):
-         if self.compiler.compiler_type == 'msvc':
-             self.compiler.include_dirs.insert(0, "src/inc-msvc/")
-
--        # Detect libgmp and don't build _fastmath if it is missing.
--        lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
--        if not (self.compiler.find_library_file(lib_dirs, 'gmp')):
--            print >>sys.stderr, "warning: GMP library not found; Not building Crypto.PublicKey._fastmath."
--            self.__remove_extensions(["Crypto.PublicKey._fastmath"])
--
-     def __remove_extensions(self, names):
-         """Remove the specified extension from the list of extensions to build"""
-         i = 0

Modified: packages/python-crypto/trunk/debian/rules
===================================================================
--- packages/python-crypto/trunk/debian/rules	2011-10-23 02:50:07 UTC (rev 19036)
+++ packages/python-crypto/trunk/debian/rules	2011-10-23 10:03:07 UTC (rev 19037)
@@ -1,45 +1,85 @@
 #!/usr/bin/make -f
 
 # Get the supported Python versions
-PYVERS = $(shell pyversions -r -v)
+PYVERS = $(shell pyversions -vr)
 # Get the default Python version
-PYVERSION = $(shell pyversions -d -v)
+PYVERSION = $(shell pyversions -vd)
+# Get the supported Python3 versions
+PY3VERS = $(shell py3versions -vr)
 
 # Callable functions to determine the correct PYTHONPATH
 pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))
 pythonpath_dbg = $$(ls -d $(CURDIR)/build/lib_d.*-$(1) 2>/dev/null || ls -d $(CURDIR)/build/lib.*$(1)-pydebug)
 
+export CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
+export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
+
 %:
-	dh $@ --with=python2
+	dh $@ --with=python2,python3
 
 override_dh_clean:
+	set -e && for pyvers in $(PYVERS); do \
+		python$$pyvers setup.py clean -a; \
+		python$$pyvers-dbg setup.py clean -a; \
+	done
+	set -e && for pyvers in $(PY3VERS); do \
+		python$$pyvers setup.py clean -a; \
+		python$$pyvers-dbg setup.py clean -a; \
+	done
 	# Keep LEGAL/copy/LICENSE.orig
 	dh_clean -XLEGAL/copy/LICENSE.orig
 
+override_dh_auto_build:
+	set -e && for pyvers in $(PYVERS); do \
+		python$$pyvers setup.py build; \
+		python$$pyvers-dbg setup.py build; \
+	done
+	set -e && for pyvers in $(PY3VERS); do \
+		python$$pyvers setup.py build; \
+		python$$pyvers-dbg setup.py build; \
+	done
+
+override_dh_auto_install:
+	set -e && for pyvers in $(PYVERS); do \
+		python$$pyvers setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \
+		python$$pyvers-dbg setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \
+	done
+	set -e && for pyvers in $(PY3VERS); do \
+		python$$pyvers setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \
+		python$$pyvers-dbg setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \
+	done
+	dh_install
+
 override_dh_installdocs:
 	# Build documentation
 	PYTHONPATH=$(call pythonpath,${PYVERSION}) epydoc --config Doc/epydoc-config
 	dh_installdocs
 
 override_dh_install:
-	# Install everything excluding the *_d.so debug extensions to python-foo
-	dh_install -X"*_d.so" "debian/tmp/*" -p python-crypto
-	# Install the debug extensions to python-foo-dbg
-	find debian/tmp -name "*_d.so" -exec dh_install '{}' -p python-crypto-dbg \;
+	# Install everything excluding the *_d.so/*dmu.so debug extensions to python(3)-crypto
+	dh_install -X"_d.so" -X"python3" "debian/tmp/*" -p python-crypto
+	dh_install -X"dmu.so" -X"python2" "debian/tmp/*" -p python3-crypto
+	# Install the debug extensions to python(3)-crypto-dbg
+	find debian/tmp/ -name "*_d.so" -exec dh_install '{}' -p python-crypto-dbg \;
+	find debian/tmp/ -name "*dmu.so" -exec dh_install '{}' -p python3-crypto-dbg \;
 	# Continue with regular dh_install
 	dh_install
 
 override_dh_auto_test:
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-		set -e -x; \
-		for py in $(PYVERS); do \
-			PYTHONPATH=$(call pythonpath,$$py) python$$py setup.py test ;\
-			PYTHONPATH=$(call pythonpath_dbg,$$py) python$$py-dbg setup.py test ;\
-		done
+	set -e && for py in $(PYVERS); do \
+		PYTHONPATH=$(call pythonpath,$$py) python$$py setup.py test ;\
+		PYTHONPATH=$(call pythonpath_dbg,$$py) python$$py-dbg setup.py test ;\
+	done
+	set -e && for py in $(PY3VERS); do \
+		PYTHONPATH=$(call pythonpath,$$py) python$$py setup.py test ;\
+		PYTHONPATH=$(call pythonpath_dbg,$$py) python$$py-dbg setup.py test ;\
+	done
 endif
 
 override_dh_strip:
 # ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
-	dh_strip --dbg-package=python-crypto-dbg
+	dh_strip -X"python3" --dbg-package=python-crypto-dbg
+	dh_strip -X"python2" --dbg-package=python3-crypto-dbg
 #	cd debian/*-dbg/usr/lib/debug/usr/lib && mv pyshared pymodules
 # endif




More information about the Python-modules-commits mailing list