summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-08-16 10:10:10 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-08-16 10:10:10 +0100
commit987e944a073f88e3c8f21e0d9bff8d4e9d31ede2 (patch)
treed4cacc0f6b59727e95eb139473c44c2e459a22b8
parent189a50afe3fb137255267becf388b5b2d989e147 (diff)
package build updates in response to upstream commit 56a56a4dcb
-rw-r--r--debian/changelog6
-rwxr-xr-xdebian/rules14
-rwxr-xr-xdocs/conf.py2
3 files changed, 8 insertions, 14 deletions
diff --git a/debian/changelog b/debian/changelog
index 229b7a4a..74e25729 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,12 @@ ocrmypdf (9.0.1+dfsg-1) UNRELEASED; urgency=medium
- tests/resources/link.pdf
* Install new bash & fish completion.
- New build-dep on dh-exec.
+ * In response to upstream commit 56a56a4dcb:
+ - drop d/rules code to prepare an importable copy of ocrmypdf for the
+ docs build
+ - patch docs/conf.py to use os.environ['DEB_VERSION_UPSTREAM'] instead
+ of calling pkg_resources.get_distribution, which won't work before
+ ocrmypdf is installed.
-- Sean Whitton <spwhitton@spwhitton.name> Fri, 16 Aug 2019 09:20:57 +0100
diff --git a/debian/rules b/debian/rules
index 7770c17a..ce929b37 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,7 @@
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
+export DEB_VERSION_UPSTREAM
# needed as we have more than one binary package
export PYBUILD_DESTDIR=debian/ocrmypdf
@@ -19,20 +20,7 @@ export LC_ALL=C.UTF-8
override_dh_installchangelogs:
dh_installchangelogs docs/release_notes.rst
-# upstream's doc build assumes that ocrmypdf is already installed, and
-# tries to find its version with pkg_resources. Here we make our own
-# copy and patch in the version string, and build the docs based on
-# that. Better than a quilt patch which would have to be updated
-# every upstream release
override_dh_auto_build:
- mkdir -p debian/.debhelper
- cp -R src/ocrmypdf debian/.debhelper
- sed -i debian/.debhelper/ocrmypdf/__init__.py -e \
- "s|^__version__ =.*|__version__ = \"$(DEB_VERSION_UPSTREAM)\"|"
-# avoid importing leptonica.py because the cffi setup doesn't work in
-# our debian/.debhelper copy
- sed -i debian/.debhelper/ocrmypdf/__init__.py -e \
- "/^from \\. import leptonica$$/d"
# disabled pending updates to debhelper for 'nodoc' / compat 11
#ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
PYTHONPATH=debian/.debhelper sphinx-build docs html
diff --git a/docs/conf.py b/docs/conf.py
index b78cc050..87d97249 100755
--- a/docs/conf.py
+++ b/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