From 53ddd4d2e3b1e1f90a0f1c4444a62e7e76429ab1 Mon Sep 17 00:00:00 2001
From: Cedric Ware <cedric.ware@telecom-paristech.fr>
Date: Fri, 31 Jul 2020 15:53:19 +0200
Subject: [PATCH] Allow building deb package for older systems.

---
 debian/changelog | 6 ++++++
 debian/control   | 2 +-
 debian/rules     | 7 +++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 280c855..0c02722 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+latex-theme-tpt (0.9.1-2) UNRELEASED; urgency=medium
+
+  * Make dependency on tex-common more explicit, override version.
+
+ -- Cedric Ware <cedric.ware@telecom-paristech.fr>  Fri, 31 Jul 2020 15:50:00 +0200
+
 latex-theme-tpt (0.9.1-1) UNRELEASED; urgency=medium
 
   * Initial debian packaging.
diff --git a/debian/control b/debian/control
index d26e27b..b21862c 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: latex-theme-tpt
 Section: tex
 Priority: optional
 Maintainer: Cedric Ware <cedric.ware@telecom-paristech.fr>
-Build-Depends: debhelper (>= 9.0.0), texlive-pictures (>= 2016), texlive-latex-recommended (>= 2016), texlive-latex-extra (>= 2016), fig2dev, latex-make, latexmk
+Build-Depends: debhelper (>= 9.0.0), tex-common, texlive-pictures (>= 2016), texlive-latex-recommended (>= 2016), texlive-latex-extra (>= 2016), fig2dev, latex-make, latexmk
 Standards-Version: 3.9.3
 
 Package: latex-theme-tpt
diff --git a/debian/rules b/debian/rules
index b0486a9..20f9f17 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,3 +5,10 @@
 override_dh_auto_install:
 	$(MAKE) -f $$(pwd)/debian/packaging.mk prefix=$$(pwd)/debian/latex-theme-tpt/usr install-tex
 	$(MAKE) -f $$(pwd)/debian/packaging.mk prefix=$$(pwd)/debian/latex-theme-tpt-doc-fr/usr install-doc
+
+# dh_installtex adds a dependency to the currently-installed tex-common
+# version, but we may want to install the package onto older systems.
+override_dh_installtex:
+	dh_installtex
+	perl -pi.orig -E 's{(tex-common\s+)\((.*?)\)}{$${1}(>= 6.06)}g' \
+		debian/*.substvars
-- 
GitLab