--- pygments-1.1.1+dfsg.orig/debian/watch
+++ pygments-1.1.1+dfsg/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\+dfsg// \
+http://cheeseshop.python.org/packages/source/P/Pygments/Pygments-(.*)\.tar\.gz
--- pygments-1.1.1+dfsg.orig/debian/README.source
+++ pygments-1.1.1+dfsg/debian/README.source
@@ -0,0 +1,2 @@
+This package uses the patch management system quilt as documented in
+/usr/share/doc/quilt/README.source.
--- pygments-1.1.1+dfsg.orig/debian/manpages
+++ pygments-1.1.1+dfsg/debian/manpages
@@ -0,0 +1 @@
+docs/pygmentize.1
--- pygments-1.1.1+dfsg.orig/debian/examples
+++ pygments-1.1.1+dfsg/debian/examples
@@ -0,0 +1 @@
+external/*
--- pygments-1.1.1+dfsg.orig/debian/compat
+++ pygments-1.1.1+dfsg/debian/compat
@@ -0,0 +1 @@
+5
--- pygments-1.1.1+dfsg.orig/debian/changelog
+++ pygments-1.1.1+dfsg/debian/changelog
@@ -0,0 +1,153 @@
+pygments (1.1.1+dfsg-1~bpo50+1) lenny-backports; urgency=low
+
+  * Rebuild for lenny-backports.
+
+ -- Alexander Wirt <formorer@debian.org>  Fri, 02 Oct 2009 06:28:18 +0000
+
+pygments (1.1.1+dfsg-1) unstable; urgency=low
+
+  * New upstream release
+    - upstream tarball repackaged: tests/examplefiles removed (at least one
+      of example files is not DFSG-free and I'm too lazy to review the rest
+      as most of them have different copyright holder and license),
+      get-orig-source target added, debian/watch file updated
+  * use_jinja2_to_generate_docs patch removed (incorporated upstream)
+  * disable_ez_setup.patch no longer needed
+  * make_utf8_default.patch updated
+  * debian/copyright file updated
+  * Standards-Version bumped to 3.8.3 (no changes needed)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sun, 13 Sep 2009 10:13:17 +0200
+
+pygments (1.0-3) unstable; urgency=low
+
+  * Add use_jinja2_to_generate_docs patch and replace python-jinja with
+    python-jinja2 build dependency
+  * Standards-Version bumped to 3.8.2 (no changes needed)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Thu, 09 Jul 2009 22:30:15 +0200
+
+pygments (1.0-2) unstable; urgency=low
+
+  * Add description to the patches
+  * Remove brainf*ck from long description (LP: #302898)
+  * Upload to unstable
+
+ -- Piotr Ożarowski <piotr@debian.org>  Tue, 10 Feb 2009 19:14:36 +0100
+
+pygments (1.0-1) experimental; urgency=low
+
+  [ Sandro Tosi ]
+  * Switch Vcs-Browser field to viewsvn
+
+  [ Piotr Ożarowski ]
+  * New upstream release (upload to experimental due to Lenny freeze, to ease
+    testing rev. dependencies)
+  * Install scripts from external directory as examples (closes: #497532)
+  * debian/copyright: list of copyright holders updated
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sun, 23 Nov 2008 20:14:31 +0100
+
+pygments (0.11.1-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Lenny freeze, to ease
+    testing rev. dependencies)
+  * Standards-Version bumped to 3.8.0:
+    + debian/README.source file added
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sun, 31 Aug 2008 16:48:09 +0200
+
+pygments (0.10-1) unstable; urgency=low
+
+  * New upstream release
+  * Add make_utf8_default patch - useful while using pygmentize with pipes
+    (use: pygmentize -P 'encoding=ascii' if you want old behaviour)
+  * Install debian/pygmentize instead of script created by setuptools
+  * Change Debian packaging licence to match upstream
+
+ -- Piotr Ożarowski <piotr@debian.org>  Wed, 07 May 2008 20:38:26 +0200
+
+pygments (0.9-3) unstable; urgency=low
+
+  [ Sandro Tosi ]
+  * debian/control
+    - uniforming Vcs-Browser field
+
+  [ Piotr Ożarowski ]
+  * Switch to python-support
+  * Replace python-setuptools runtime dependency with new python-pkg-resources
+    (closes: 468710)
+  * Compress binary package with bzip2
+  * Strip the "-1" from quilt's and setuptools' required build versions
+
+ -- Piotr Ożarowski <piotr@debian.org>  Sat, 01 Mar 2008 13:37:39 +0100
+
+pygments (0.9-2) unstable; urgency=low
+
+  * Install original pygmentize script (not touched by setuptools)
+    (closes: 455222)
+  * Bump Standards-Version to 3.7.3 (no changes needed)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 10 Dec 2007 19:59:55 +0100
+
+pygments (0.9-1) unstable; urgency=low
+
+  * New upstream release
+  * Add patch that disables ez_setup at build time
+    - quilt added to Build-Depends
+  * Homepage field added
+  * Rename XS-Vcs-* fields to Vcs-* (dpkg supports them now)
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 15 Oct 2007 22:37:08 +0200
+
+pygments (0.8.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Piotr Ożarowski <piotr@debian.org>  Thu, 28 Jun 2007 15:08:22 +0200
+
+pygments (0.8-1) unstable; urgency=low
+
+  * New upstream release
+  * Bump required Jinja version (build dependency)
+  * Added python-setuptools to Recommends
+
+ -- Piotr Ożarowski <piotr@debian.org>  Wed, 30 May 2007 19:33:29 +0200
+
+pygments (0.7.1-2) unstable; urgency=low
+
+  * Upload to unstable
+  * debian/copyright file updated
+  * Changed my address to piotr@debian.org
+
+ -- Piotr Ożarowski <piotr@debian.org>  Mon, 09 Apr 2007 20:18:54 +0200
+
+pygments (0.7.1-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Thu, 15 Feb 2007 21:17:10 +0100
+
+pygments (0.7-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+  * Some debian/rules cleanups
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Wed, 14 Feb 2007 21:52:50 +0100
+
+pygments (0.6-1) experimental; urgency=low
+
+  * New upstream release (upload to experimental due to Etch freeze)
+  * Added XS-Vcs-Svn and XS-Vcs-Browser fields to debian/control
+  * Added python-chardet to Recommends: (guessing input encoding added)
+  * debian/copyright updated (license change to BSD)
+  * Removed debian/pygmentize.1 manpage (it's in upstream sources now)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Thu, 21 Dec 2006 16:20:10 +0100
+
+pygments (0.5.1-1) unstable; urgency=low
+
+  * Initial release (closes: #395064)
+
+ -- Piotr Ozarowski <ozarow@gmail.com>  Mon, 30 Oct 2006 17:19:10 +0100
+
--- pygments-1.1.1+dfsg.orig/debian/rules
+++ pygments-1.1.1+dfsg/debian/rules
@@ -0,0 +1,58 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+PYVERS ?= $(shell pyversions -vr)
+
+include /usr/share/quilt/quilt.make
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -rf build Pygments.egg-info
+	find . -name "*\.py[co]" -delete
+	dh_clean build-indep $(PYVERS:%=install-python%-stamp)
+
+build: patch build-indep
+
+build-indep:
+	dh_testdir
+	dh_installdirs
+	PYTHONPATH='.' python docs/generate.py html debian/python-pygments/usr/share/doc/python-pygments/
+	touch $@
+
+install: build $(PYVERS:%=install-python%-stamp)
+install-python%-stamp:
+	python$* setup.py install --single-version-externally-managed \
+		--root debian/python-pygments
+	touch $@
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs -i CHANGES
+	dh_installexamples -i
+	dh_installdocs -i
+	dh_installman -i
+	dh_install -i debian/pygmentize /usr/bin/
+	dh_pysupport -i
+	dh_compress -i -X.py
+	dh_fixperms -i
+	dh_installdeb -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i -- -Z bzip2
+
+binary-arch:
+
+binary: binary-indep binary-arch
+
+get-orig-source:
+	VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^+]+).*,\1,p');\
+	uscan --force-download --rename --download-version=$$VER --destdir=.;\
+	tar -zx --exclude=tests/examplefiles --exclude=test/test_examplefiles.py -f pygments_$$VER.orig.tar.gz;\
+	tar	-zcf ./pygments_$$VER+dfsg.orig.tar.gz Pygments-$$VER;\
+	rm -f ./pygments_$$VER.orig.tar.gz;\
+	rm -rf Pygments-$$VER
+
+.PHONY: build clean binary-indep binary-arch binary install
--- pygments-1.1.1+dfsg.orig/debian/pygmentize
+++ pygments-1.1.1+dfsg/debian/pygmentize
@@ -0,0 +1,3 @@
+#! /usr/bin/python
+import pygments.cmdline
+pygments.cmdline.main()
--- pygments-1.1.1+dfsg.orig/debian/control
+++ pygments-1.1.1+dfsg/debian/control
@@ -0,0 +1,30 @@
+Source: pygments
+Section: python
+Priority: optional
+Maintainer: Piotr Ożarowski <piotr@debian.org>
+Uploaders: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
+Build-Depends: debhelper (>= 5), quilt (>=0.40)
+Build-Depends-Indep: python (>= 2.3.5-11), python-all-dev, python-support (>= 0.6.4),
+ python-setuptools (>= 0.6b3), python-docutils, python-jinja2
+Standards-Version: 3.8.3
+Homepage: http://pygments.pocoo.org/
+XS-Python-Version: >= 2.3
+Vcs-Svn: svn://svn.debian.org/python-modules/packages/pygments/trunk/
+Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/pygments/trunk/
+
+Package: python-pygments
+Architecture: all
+Depends: ${python:Depends}
+Recommends: python-chardet, python-pkg-resources
+XB-Python-Version: ${python:Versions}
+Description: syntax highlighting package written in Python
+ Pygments aims to be a generic syntax highlighter for general use in all kinds
+ of software such as forum systems, wikis or other applications that need to
+ prettify source code.
+ .
+ Highlights are:
+   * a wide range of common languages and markup formats is supported
+   * special attention is paid to details, increasing quality by a fair amount
+   * support for new languages and formats are added easily
+   * a number of output formats, presently HTML, LaTeX and ANSI sequences
+   * it is usable as a command-line tool and as a library
--- pygments-1.1.1+dfsg.orig/debian/docs
+++ pygments-1.1.1+dfsg/debian/docs
@@ -0,0 +1,2 @@
+AUTHORS
+TODO
--- pygments-1.1.1+dfsg.orig/debian/copyright
+++ pygments-1.1.1+dfsg/debian/copyright
@@ -0,0 +1,47 @@
+This package was debianized by Piotr Ożarowski <piotr@debian.org> on
+Tue, 24 Oct 2006 17:54:36 +0200.
+
+It was downloaded from http://pygments.pocoo.org/download/
+
+Upstream Author: Georg Brandl <georg@python.org>
+
+Copyright: 2006-2009 by the Pygments team, see AUTHORS
+
+License:
+
+ Copyright (c) 2006-2009 by the respective authors (see AUTHORS file).
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ 
+     * Redistributions of source code must retain the above copyright
+       notice, this list of conditions and the following disclaimer.
+ 
+     * Redistributions in binary form must reproduce the above
+       copyright notice, this list of conditions and the following
+       disclaimer in the documentation and/or other materials provided
+       with the distribution.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+File with different copyright holders:
+
+ scripts/vim2pygments.py:
+	2006 by Armin Ronacher.
+
+The Debian packaging is © 2006-2009, Piotr Ożarowski <piotr@debian.org> and
+is licensed under the same licence as Pygments.
+
--- pygments-1.1.1+dfsg.orig/debian/dirs
+++ pygments-1.1.1+dfsg/debian/dirs
@@ -0,0 +1 @@
+/usr/share/doc/python-pygments
--- pygments-1.1.1+dfsg.orig/debian/patches/make_utf8_default.patch
+++ pygments-1.1.1+dfsg/debian/patches/make_utf8_default.patch
@@ -0,0 +1,104 @@
+use UTF-8 by default
+`echo "Ożarowski" | pygmentize -l diff` works fine now :-)
+
+upstream knows about this patch (will not apply it as not all distributions are
+using UTF-8 by defauly, like Debian does)
+
+Index: pygments-1.1/pygments/cmdline.py
+===================================================================
+--- pygments-1.1.orig/pygments/cmdline.py
++++ pygments-1.1/pygments/cmdline.py
+@@ -394,20 +394,20 @@ def main(args=sys.argv):
+         else:
+             code = sys.stdin.read()
+ 
+-    # No encoding given? Use latin1 if output file given,
++    # No encoding given? Use utf-8 if output file given,
+     # stdin/stdout encoding otherwise.
+     # (This is a compromise, I'm not too happy with it...)
+     if 'encoding' not in parsed_opts and 'outencoding' not in parsed_opts:
+         if outfn:
+             # encoding pass-through
+-            fmter.encoding = 'latin1'
++            fmter.encoding = 'utf-8'
+         else:
+             if sys.version_info < (3,):
+                 # use terminal encoding; Python 3's terminals already do that
+                 lexer.encoding = getattr(sys.stdin, 'encoding',
+-                                         None) or 'ascii'
++                                         None) or 'utf-8'
+                 fmter.encoding = getattr(sys.stdout, 'encoding',
+-                                         None) or 'ascii'
++                                         None) or 'utf-8'
+ 
+     # ... and do it!
+     try:
+Index: pygments-1.1/pygments/formatters/latex.py
+===================================================================
+--- pygments-1.1.orig/pygments/formatters/latex.py
++++ pygments-1.1/pygments/formatters/latex.py
+@@ -299,6 +299,6 @@ class LatexFormatter(Formatter):
+                 dict(docclass  = self.docclass,
+                      preamble  = self.preamble,
+                      title     = self.title,
+-                     encoding  = self.encoding or 'latin1',
++                     encoding  = self.encoding or 'utf-8',
+                      styledefs = self.get_style_defs(),
+                      code      = outfile.getvalue()))
+Index: pygments-1.1/pygments/lexer.py
+===================================================================
+--- pygments-1.1.orig/pygments/lexer.py
++++ pygments-1.1/pygments/lexer.py
+@@ -56,7 +56,7 @@ class Lexer(object):
+     ``encoding``
+         If given, must be an encoding name. This encoding will be used to
+         convert the input string to Unicode, if it is not already a Unicode
+-        string (default: ``'latin1'``).
++        string (default: ``'utf-8'``).
+         Can also be ``'guess'`` to use a simple UTF-8 / Latin1 detection, or
+         ``'chardet'`` to use the chardet library, if it is installed.
+     """
+@@ -83,7 +83,7 @@ class Lexer(object):
+         self.stripnl = get_bool_opt(options, 'stripnl', True)
+         self.stripall = get_bool_opt(options, 'stripall', False)
+         self.tabsize = get_int_opt(options, 'tabsize', 0)
+-        self.encoding = options.get('encoding', 'latin1')
++        self.encoding = options.get('encoding', 'utf-8')
+         # self.encoding = options.get('inencoding', None) or self.encoding
+         self.filters = []
+         for filter_ in get_list_opt(options, 'filters', ()):
+@@ -134,7 +134,7 @@ class Lexer(object):
+                     if text.startswith(u'\ufeff'):
+                         text = text[len(u'\ufeff'):]
+                 except UnicodeDecodeError:
+-                    text = text.decode('latin1')
++                    text = text.decode('utf-8')
+             elif self.encoding == 'chardet':
+                 try:
+                     import chardet
+Index: pygments-1.1/pygments/lexers/__init__.py
+===================================================================
+--- pygments-1.1.orig/pygments/lexers/__init__.py
++++ pygments-1.1/pygments/lexers/__init__.py
+@@ -105,7 +105,7 @@ def get_lexer_for_filename(_fn, code=Non
+ 
+     if sys.version_info > (3,) and isinstance(code, bytes):
+         # decode it, since all analyse_text functions expect unicode
+-        code = code.decode('latin1')
++        code = code.decode('utf-8')
+ 
+     def get_rating(cls):
+         # The class _always_ defines analyse_text because it's included in
+Index: pygments-1.1/pygments/formatters/other.py
+===================================================================
+--- pygments-1.1.orig/pygments/formatters/other.py
++++ pygments-1.1/pygments/formatters/other.py
+@@ -64,7 +64,7 @@ class RawTokenFormatter(Formatter):
+         if self.encoding:
+             raise OptionError('the raw formatter does not support the '
+                               'encoding option')
+-        self.encoding = 'ascii'  # let pygments.format() do the right thing
++        self.encoding = 'utf-8'  # let pygments.format() do the right thing
+         self.compress = get_choice_opt(options, 'compress',
+                                        ['', 'none', 'gz', 'bz2'], '')
+         self.error_color = options.get('error_color', None)
--- pygments-1.1.1+dfsg.orig/debian/patches/series
+++ pygments-1.1.1+dfsg/debian/patches/series
@@ -0,0 +1 @@
+make_utf8_default.patch
