The Debian packaging of OCRmyPDF is maintained using dgit.  For the
sake of an efficient workflow, Debian modifications to the upstream
source are squashed into a single diff, rather than a series of quilt
patches.  To obtain a patch queue for package version 1.2.3-1:

    # apt-get install dgit
    % dgit clone ocrmypdf
    % cd ocrmypdf
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

See dgit(1), dgit(7) and dgit-maint-merge(7) for more information.
--- ocrmypdf-9.6.0+dfsg.orig/docs/conf.py
+++ ocrmypdf-9.6.0+dfsg/docs/conf.py
@@ -87,7 +87,7 @@ if on_rtd:
 from pkg_resources import get_distribution, DistributionNotFound
 
 # The full version, including alpha/beta/rc tags.
-release = get_distribution('ocrmypdf').version
+release = os.environ['DEB_VERSION_UPSTREAM']
 version = '.'.join(release.split('.')[:2])
 
 # The language for content autogenerated by Sphinx. Refer to documentation
--- ocrmypdf-9.6.0+dfsg.orig/docs/index.rst
+++ ocrmypdf-9.6.0+dfsg/docs/index.rst
@@ -13,7 +13,6 @@ image processing and OCR to existing PDF
 
    introduction
    release_notes
-   installation
    optimizer
    languages
    jbig2
--- ocrmypdf-9.6.0+dfsg.orig/docs/languages.rst
+++ ocrmypdf-9.6.0+dfsg/docs/languages.rst
@@ -13,9 +13,6 @@ languages <https://github.com/tesseract-
 For Linux users, you can often find packages that provide language
 packs:
 
-Debian and Ubuntu users
-=======================
-
 .. code-block:: bash
 
    # Display a list of all Tesseract language packs
@@ -28,37 +25,3 @@ You can then pass the ``-l LANG`` argume
 to what languages it should search for. Multiple languages can be
 requested using either ``-l eng+fre`` (English and French) or
 ``-l eng -l fre``.
-
-Fedora users
-============
-
-.. code-block:: bash
-
-   # Display a list of all Tesseract language packs
-   dnf search tesseract
-
-   # Install Chinese Simplified language pack
-   dnf install tesseract-langpack-chi_sim
-
-You can then pass the ``-l LANG`` argument to OCRmyPDF to give a hint as
-to what languages it should search for. Multiple languages can be
-requested using either ``-l eng+fre`` (English and French) or
-``-l eng -l fre``.
-
-macOS users
-===========
-
-You can install additional language packs by
-:ref:`installing Tesseract using Homebrew with all language packs <macos-all-languages>`.
-
-Docker users
-============
-
-Users of the OCRmyPDF Docker image should install language packs into a
-derived Docker image as
-:ref:`described in that section <docker-lang-packs>`.
-
-Windows users
-=============
-
-The Tesseract installer provided by Chocolatey already includes 100 languages.
--- ocrmypdf-9.6.0+dfsg.orig/setup.py
+++ ocrmypdf-9.6.0+dfsg/setup.py
@@ -90,7 +90,6 @@ setup(
         'cffi >= 1.9.1',  # to build the leptonica module
         'pytest-runner',  # to enable python setup.py test
         'setuptools_scm',  # so that version will work
-        'setuptools_scm_git_archive',  # enable version from github tarballs
     ],
     use_scm_version={'version_scheme': 'post-release'},
     cffi_modules=['src/ocrmypdf/lib/compile_leptonica.py:ffibuilder'],
--- ocrmypdf-9.6.0+dfsg.orig/src/ocrmypdf/cli.py
+++ ocrmypdf-9.6.0+dfsg/src/ocrmypdf/cli.py
@@ -93,17 +93,17 @@ your PDF, use --output-type pdf.
 
 If OCRmyPDF is given an image file as input, it will attempt to convert the
 image to a PDF before processing.  For more control over the conversion of
-images to PDF, use the Python package img2pdf or other image to PDF software.
+images to PDF, use img2pdf, or other image to PDF software.
 
 For example, this command uses img2pdf to convert all .png files beginning
 with the 'page' prefix to a PDF, fitting each image on A4-sized paper, and
-sending the result to OCRmyPDF through a pipe.  img2pdf is a dependency of
-ocrmypdf so it is already installed.
+sending the result to OCRmyPDF through a pipe.
 
     img2pdf --pagesize A4 page*.png | ocrmypdf - myfile.pdf
 
-Online documentation is located at:
-    https://ocrmypdf.readthedocs.io/en/latest/introduction.html
+HTML documentation is located at:
+    /usr/share/doc/ocrmypdf/html/index.html
+after installing the ocrmypdf-doc package.
 
 """,
 )
--- ocrmypdf-9.6.0+dfsg.orig/tests/test_metadata.py
+++ ocrmypdf-9.6.0+dfsg/tests/test_metadata.py
@@ -310,34 +310,3 @@ def test_metadata_fixup_warning(resource
     context = PDFContext(options, outdir, outdir / 'graph_mod.pdf', None)
     metadata_fixup(working_file=outdir / 'graph.pdf', context=context)
     assert any(record.levelname == 'WARNING' for record in caplog.records)
-
-
-def test_prevent_gs_invalid_xml(resources, outdir):
-    from ocrmypdf.__main__ import parser
-    from ocrmypdf._pipeline import convert_to_pdfa
-    from ocrmypdf.pdfa import generate_pdfa_ps
-    from ocrmypdf.pdfinfo import PdfInfo
-
-    generate_pdfa_ps(outdir / 'pdfa.ps')
-    copyfile(resources / 'enron1.pdf', outdir / 'layers.rendered.pdf')
-
-    options = parser.parse_args(
-        args=['-j', '1', '--output-type', 'pdfa-2', 'a.pdf', 'b.pdf']
-    )
-    pdfinfo = PdfInfo(resources / 'enron1.pdf')
-    context = PDFContext(options, outdir, resources / 'enron1.pdf', pdfinfo)
-
-    convert_to_pdfa(
-        str(outdir / 'layers.rendered.pdf'), str(outdir / 'pdfa.ps'), context
-    )
-
-    with open(outdir / 'pdfa.pdf', 'r+b') as f:
-        with mmap.mmap(f.fileno(), 0) as mm:
-            # Since the XML may be invalid, we scan instead of actually feeding it
-            # to a parser.
-            XMP_MAGIC = b'W5M0MpCehiHzreSzNTczkc9d'
-            xmp_start = mm.find(XMP_MAGIC)
-            xmp_end = mm.rfind(b'<?xpacket end', xmp_start)
-            assert 0 < xmp_start < xmp_end
-            assert mm.find(b'&#0;', xmp_start, xmp_end) == -1, "found escaped nul"
-            assert mm.find(b'\x00', xmp_start, xmp_end) == -1
