summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <didier@raboud.com>2010-08-18 13:38:43 +0200
committerDidier Raboud <didier@raboud.com>2010-08-18 13:38:43 +0200
commita6cf6a4b2c668370cc038405aed2b8e7e3811fe7 (patch)
tree43785a88460ebbe840339dfa55a572c2dc7f72d2
parent16a0fdbe930bae0222d080df1ebd325d76a8a99b (diff)
Substitute the fallacious use of dpkg-vendor in the postinst by build-time distro detection.
-rw-r--r--debian/changelog7
-rw-r--r--debian/foomatic-filters.postinst.in (renamed from debian/foomatic-filters.postinst)11
-rwxr-xr-xdebian/rules12
3 files changed, 24 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 548b791..87ee0ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+foomatic-filters (4.0.5-0ubuntu3) UNRELEASED; urgency=low
+
+ * Substitute the fallacious use of dpkg-vendor in the postinst by build-time
+ distro detection.
+
+ -- Didier Raboud <didier@raboud.com> Wed, 18 Aug 2010 13:27:54 +0200
+
foomatic-filters (4.0.5-0ubuntu2) maverick; urgency=low
[ Didier Raboud ]
diff --git a/debian/foomatic-filters.postinst b/debian/foomatic-filters.postinst.in
index 687523a..2a5d21d 100644
--- a/debian/foomatic-filters.postinst
+++ b/debian/foomatic-filters.postinst.in
@@ -47,12 +47,11 @@ else
ps_accounting="ps_accounting: 0"
fi
-# Since foomatic-filters 3.0.2-20070719-0ubuntu1 in Ubuntu and
-# since foomatic-filters 4.0.5-1 in Debian, the default for inserting
-# PostScript code for CUPS' page accounting changed. This functionality
-# is now activated by default as for problematic drivers it can be
-# deactivated individually
-if dpkg --compare-versions "$2" lt-nl "4.0.5-1" || (dpkg --compare-versions "$2" lt-nl "3.0.2-20070719-0ubuntu1" && dpkg-vendor --derives-from Ubuntu); then
+# Since foomatic-filters #FF_PS_DEFAULT_CHANGE_VERSION# in #MOTHER_DISTRO#,
+# the default for inserting PostScript code for CUPS' page accounting changed.
+# This functionality is now activated by default as for problematic drivers it
+# can be deactivated individually.
+if dpkg --compare-versions "$2" lt-nl "#FF_PS_DEFAULT_CHANGE_VERSION#"; then
ps_accounting="ps_accounting: 1"
RET=true
db_set foomatic-filters/ps_accounting true
diff --git a/debian/rules b/debian/rules
index 81e1f00..5a2eaf6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,3 +22,15 @@ override_dh_install:
ifeq ($(derives_from_ubuntu),yes)
install -D -m 644 debian/ubuntu/apport-hook.py $(CURDIR)/debian/foomatic-filters/usr/share/apport/package-hooks/source_foomatic-filters.py
endif
+
+ # Prepare the postinst with distro-specific versions
+ cp debian/foomatic-filters.postinst.in debian/foomatic-filters.postinst
+ifeq ($(derives_from_ubuntu),yes)
+ # We derive from Ubuntu, the ps_accounting default change was made in version 3.0.2-20070719-0ubuntu1
+ sed -i -e "s/#MOTHER_DISTRO#/Ubuntu/g" debian/foomatic-filters.postinst
+ sed -i -e "s/#FF_PS_DEFAULT_CHANGE_VERSION#/3.0.2-20070719-0ubuntu1/g" debian/foomatic-filters.postinst
+else
+ # We derive from Debian, the ps_accounting default change was made in version 4.0.5-1
+ sed -i -e "s/#MOTHER_DISTRO#/Debian/g" debian/foomatic-filters.postinst
+ sed -i -e "s/#FF_PS_DEFAULT_CHANGE_VERSION#/4.0.5-1/g" debian/foomatic-filters.postinst
+endif