[Python-modules-commits] r26300 - in packages/python-babel/trunk/debian (10 files)

zigo at users.alioth.debian.org zigo at users.alioth.debian.org
Mon Oct 28 06:46:03 UTC 2013


    Date: Monday, October 28, 2013 @ 06:46:00
  Author: zigo
Revision: 26300

* Now repacks upstream tarball to make it DFSG-Free (Closes: #727615).
* Adds a python-babel-localedata package containing the data files for both python-babel and python3-babel (Closes: #727617).
* Runs the test suite at build time (Closes: #727616).

Added:
  packages/python-babel/trunk/debian/python-babel-localedata.install
  packages/python-babel/trunk/debian/python-babel.preinst
  packages/python-babel/trunk/debian/python3-babel.preinst
  packages/python-babel/trunk/debian/repack
  packages/python-babel/trunk/debian/source/options
Modified:
  packages/python-babel/trunk/debian/changelog
  packages/python-babel/trunk/debian/control
  packages/python-babel/trunk/debian/python-babel.prerm
  packages/python-babel/trunk/debian/rules
  packages/python-babel/trunk/debian/watch

Modified: packages/python-babel/trunk/debian/changelog
===================================================================
--- packages/python-babel/trunk/debian/changelog	2013-10-27 17:04:58 UTC (rev 26299)
+++ packages/python-babel/trunk/debian/changelog	2013-10-28 06:46:00 UTC (rev 26300)
@@ -1,6 +1,11 @@
-python-babel (1.3-3) UNRELEASED; urgency=low
+python-babel (1.3+dfsg.1-1) unstable; urgency=low
 
   * Updates the VCS fields URLs.
+  * Now repacks upstream tarball to make it DFSG-Free: added a
+    get-orig-source and a debian/repack script (Closes: #727615).
+  * Adds a python-babel-localedata package containing the data files for both
+    python-babel and python3-babel (Closes: #727617).
+  * Runs the test suite at build time (Closes: #727616).
 
  -- Thomas Goirand <zigo at debian.org>  Wed, 23 Oct 2013 05:29:57 +0000
 

Modified: packages/python-babel/trunk/debian/control
===================================================================
--- packages/python-babel/trunk/debian/control	2013-10-27 17:04:58 UTC (rev 26299)
+++ packages/python-babel/trunk/debian/control	2013-10-28 06:46:00 UTC (rev 26300)
@@ -5,12 +5,13 @@
 Uploaders: Christoph Haas <haas at debian.org>, Thomas Goirand <zigo at debian.org>
 Build-Depends: debhelper (>= 9),
                python-all (>= 2.6.6-3),
+               python-pytest,
                python-setuptools,
+               python-sphinx | python3-sphinx,
                python-tz,
                python3-all,
                python3-setuptools,
-               python3-tz,
-               python-sphinx
+               python3-tz
 Standards-Version: 3.9.4
 Homepage: http://babel.pocoo.org/
 Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-babel/trunk/
@@ -30,7 +31,7 @@
 
 Package: python-babel
 Architecture: all
-Depends: python-pkg-resources, ${misc:Depends}, ${python:Depends}
+Depends: python-babel-localedata (= ${source:Version}), python-pkg-resources, ${misc:Depends}, ${python:Depends}
 Recommends: ${python:Recommends}
 Description: tools for internationalizing Python applications - Python 2.x
  Babel is composed of two major parts. First tools to build and work with
@@ -42,7 +43,7 @@
 
 Package: python3-babel
 Architecture: all
-Depends: python3-pkg-resources, ${misc:Depends}, ${python3:Depends}
+Depends: python-babel-localedata (= ${source:Version}), python3-pkg-resources, ${misc:Depends}, ${python3:Depends}
 Recommends: ${python3:Recommends}
 Description: tools for internationalizing Python applications - Python 3.x
  Babel is composed of two major parts. First tools to build and work with
@@ -52,12 +53,24 @@
  .
  This package provides the Python 3.x module.
 
+Package: python-babel-localedata
+Architecture: all
+Depends: ${misc:Depends}
+Description: tools for internationalizing Python applications - locale data files
+ Babel is composed of two major parts. First tools to build and work with
+ gettext message catalogs. Second a Python interface to the CLDR (Common
+ Locale Data Repository), providing access to various locale display
+ names, localized number and date formatting, etc.
+ .
+ This package contains the locale data files used by both python-babel and
+ python3-babel.
+
 Package: python-babel-doc
 Architecture: all
 Section: doc
 Breaks: python-babel (<< 1.3-1)
 Replaces: python-babel (<< 1.3-1)
-Depends: ${sphinxdoc:Depends}, ${misc:Depends}
+Depends: ${misc:Depends}, ${sphinxdoc:Depends}
 Description: tools for internationalizing Python applications - documentation
  Babel is composed of two major parts. First tools to build and work with
  gettext message catalogs. Second a Python interface to the CLDR (Common

Added: packages/python-babel/trunk/debian/python-babel-localedata.install
===================================================================
--- packages/python-babel/trunk/debian/python-babel-localedata.install	                        (rev 0)
+++ packages/python-babel/trunk/debian/python-babel-localedata.install	2013-10-28 06:46:00 UTC (rev 26300)
@@ -0,0 +1,2 @@
+babel/localedata/*	usr/share/python-babel-localedata/localedata
+babel/global.dat	usr/share/python-babel-localedata

Added: packages/python-babel/trunk/debian/python-babel.preinst
===================================================================
--- packages/python-babel/trunk/debian/python-babel.preinst	                        (rev 0)
+++ packages/python-babel/trunk/debian/python-babel.preinst	2013-10-28 06:46:00 UTC (rev 26300)
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "upgrade" ] ; then
+	# What's below is needed for upgrading from packages before localedata was in an independent python-babel-localedata package.
+	for i in /usr/lib/python2.* ; do
+		if [ ! -h $i/dist-packages/babel/localedata ] && [ -d $i/dist-packages/babel/localedata ] ; then
+			rm -f $i/dist-packages/babel/localedata/*.dat
+			rmdir $i/dist-packages/babel/localedata
+		fi
+	done
+fi
+
+#DEBHELPER#
+
+exit 0

Modified: packages/python-babel/trunk/debian/python-babel.prerm
===================================================================
--- packages/python-babel/trunk/debian/python-babel.prerm	2013-10-27 17:04:58 UTC (rev 26299)
+++ packages/python-babel/trunk/debian/python-babel.prerm	2013-10-28 06:46:00 UTC (rev 26300)
@@ -7,3 +7,5 @@
 fi
 
 #DEBHELPER#
+
+exit 0

Added: packages/python-babel/trunk/debian/python3-babel.preinst
===================================================================
--- packages/python-babel/trunk/debian/python3-babel.preinst	                        (rev 0)
+++ packages/python-babel/trunk/debian/python3-babel.preinst	2013-10-28 06:46:00 UTC (rev 26300)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "upgrade" ] ; then
+	# What's below is needed for upgrading from packages before localedata was in an independent python-babel-localedata package.
+	if [ ! -h /usr/lib/python3/dist-packages/babel/localedata ] && [ -d /usr/lib/python3/dist-packages/babel/localedata ]; then
+		rm -f /usr/lib/python3/dist-packages/babel/localedata/*.dat
+		rmdir /usr/lib/python3/dist-packages/babel/localedata
+	fi
+fi
+
+#DEBHELPER#
+
+exit 0

Added: packages/python-babel/trunk/debian/repack
===================================================================
--- packages/python-babel/trunk/debian/repack	                        (rev 0)
+++ packages/python-babel/trunk/debian/repack	2013-10-28 06:46:00 UTC (rev 26300)
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+set -e
+set -x
+
+usage() {
+	progname=$(basename $0)
+	echo "$progname --upstream-version <UPSTREAM-VERSION> <UPSTREAM-TARBALL>"
+}
+
+
+if [ "$#" -ne "3" ] ; then
+	usage
+	exit 1
+fi
+
+UPSTREAM_VERS="$2"
+UPSTREAM_TAR="$3"
+DEST_DIR=`dirname $3`
+
+PKG_NAME=`dpkg-parsechangelog | sed -n -e 's/^Source: //p'`
+DEB_RELEASE=`dpkg-parsechangelog | sed -n -e 's/^Version: //p'`
+DFSG_VERSION=`echo "${DEB_RELEASE}" | sed -e 's/^[[:digit:]]\+://' -e 's/[-][^-]\+//'`
+UNPACK_DIR="${PKG_NAME}-${DFSG_VERSION}"
+
+TEMP_DIR=$(mktemp -d -t)
+echo "Unpacking upstream tarball..."
+tar -xzf ${UPSTREAM_TAR} --directory ${TEMP_DIR}
+UPSTREAM_SRC=`ls ${TEMP_DIR}`
+mv ${TEMP_DIR}/${UPSTREAM_SRC} ${TEMP_DIR}/${UNPACK_DIR}
+rm ${TEMP_DIR}/${UNPACK_DIR}/babel/global.dat
+rm ${TEMP_DIR}/${UNPACK_DIR}/babel/localedata/*.dat
+
+wget -P ${TEMP_DIR} http://unicode.org/Public/cldr/23.1/core.zip && \
+	unzip ${TEMP_DIR}/core.zip -d ${TEMP_DIR}/${UNPACK_DIR}
+tar -C ${TEMP_DIR} --owner=root --group=root --mode=a+rX -c ${UNPACK_DIR} | xz -6 >${DEST_DIR}/${PKG_NAME}_${DFSG_VERSION}.orig.tar.xz
+rm -r ${TEMP_DIR}


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

Modified: packages/python-babel/trunk/debian/rules
===================================================================
--- packages/python-babel/trunk/debian/rules	2013-10-27 17:04:58 UTC (rev 26299)
+++ packages/python-babel/trunk/debian/rules	2013-10-28 06:46:00 UTC (rev 26300)
@@ -6,6 +6,16 @@
 %:
 	dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc
 
+override_dh_auto_build:
+	dh_auto_build -O--buildsystem=python_distutils
+	# Generate the localedata folder data out of the xml files
+	# downloaded in debian/repack
+	scripts/import_cldr.py common
+
+override_dh_clean:
+	dh_clean -O--buildsystem=python_distutils
+	rm -rf babel/localedata/*.dat babel/global.dat
+
 override_dh_auto_install:
 	set -e && for pyvers in $(PYTHONS); do \
 		python$$pyvers setup.py install --install-layout=deb \
@@ -18,6 +28,26 @@
 	mv debian/python-babel/usr/bin/pybabel debian/python-babel/usr/bin/pybabel-python2
 	mv debian/python3-babel/usr/bin/pybabel debian/python3-babel/usr/bin/pybabel-python3
 
+override_dh_python2:
+	dh_python2 -O--buildsystem=python_distutils
+	set -e && for pyvers in $(PYTHONS); do \
+		rm debian/python-babel/usr/lib/python$$pyvers/dist-packages/babel/localedata/*.dat ; \
+		rmdir debian/python-babel/usr/lib/python$$pyvers/dist-packages/babel/localedata ; \
+		ln -s ../../../../share/python-babel-localedata/localedata debian/python-babel/usr/lib/python$$pyvers/dist-packages/babel/localedata ; \
+		rm debian/python-babel/usr/lib/python$$pyvers/dist-packages/babel/global.dat ; \
+		ln -s ../../../../share/python-babel-localedata/global.dat debian/python-babel/usr/lib/python$$pyvers/dist-packages/babel/global.dat ; \
+	done
+	rm debian/python-babel/usr/share/pyshared/babel/localedata/*.dat
+	rmdir debian/python-babel/usr/share/pyshared/babel/localedata
+	rm debian/python-babel/usr/share/pyshared/babel/global.dat
+
+override_dh_python3:
+	dh_python3 -O--buildsystem=python_distutils
+	rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/localedata ; \
+	ln -s ../../../../share/python-babel-localedata/localedata debian/python3-babel/usr/lib/python3/dist-packages/babel/localedata ; \
+	rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \
+	ln -s ../../../../share/python-babel-localedata/global.dat debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \
+
 override_dh_installdocs:
 	sphinx-build docs docs/_build
 	dh_installdocs -O--buildsystem=python_distutils
@@ -32,6 +62,9 @@
 	rm -rf docs/_build build Babel.egg-info
 	dh_auto_clean -O--buildsystem=python_distutils
 
+get-orig-source:
+	uscan --noconf --force-download --rename --download-current-version
+
 #ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 #	set -e; \
 #	for python in $(PYVERS); do  \

Added: packages/python-babel/trunk/debian/source/options
===================================================================
--- packages/python-babel/trunk/debian/source/options	                        (rev 0)
+++ packages/python-babel/trunk/debian/source/options	2013-10-28 06:46:00 UTC (rev 26300)
@@ -0,0 +1 @@
+extend-diff-ignore = "^.*\.(po|pot)$"

Modified: packages/python-babel/trunk/debian/watch
===================================================================
--- packages/python-babel/trunk/debian/watch	2013-10-27 17:04:58 UTC (rev 26299)
+++ packages/python-babel/trunk/debian/watch	2013-10-28 06:46:00 UTC (rev 26300)
@@ -1,2 +1,3 @@
 version=3
-https://pypi.python.org/packages/source/B/Babel/Babel-(.*)\.tar\.gz
+opts="dversionmangle=s/\+dfsg\.\d+$//" \
+https://pypi.python.org/packages/source/B/Babel/Babel-([\d\.]+)\.tar\.gz debian debian/repack




More information about the Python-modules-commits mailing list