--- a/debian/control
+++ b/debian/control
@@ -22,6 +22,7 @@ Build-Depends: binutils,
intltool-debian,
javahelper (>= 0.32~),
libapt-pkg-perl,
+ libc-bin (>= 2.13) | locales,
libclass-accessor-perl,
libdpkg-perl,
libdigest-sha-perl,
@@ -37,7 +38,6 @@ Build-Depends: binutils,
libtext-template-perl,
libtimedate-perl,
liburi-perl,
- locales,
xz-lzma | lzma,
man-db,
perl,
--- a/debian/postinst
+++ b/debian/postinst
@@ -17,6 +17,17 @@ gen_locale() {
fi
}
+#DEBHELPER#
+
+# Do nothing if there is a system locale.
+if [ -d '/usr/lib/locale/C.UTF-8' ] ; then
+ if [ "$1" = 'configure' -a -d "$locale_dir/" ] ; then
+ # except clean up our unused private locale
+ rm -rf "$locale_dir"
+ fi
+ exit 0
+fi
+
if [ "$1" = "configure" ]; then
if [ ! -f "$locale_dir/en_US.UTF-8/LC_CTYPE" ] &&
[ -f /usr/share/locale/locale.alias ]; then
@@ -39,4 +50,3 @@ if [ "$1" = "triggered" ]; then
fi
fi
-#DEBHELPER#
diff --git a/debian/prerm b/debian/prerm
index 698ed52..7e21104 100644
--- a/debian/prerm
+++ b/debian/prerm
@@ -3,9 +3,11 @@
set -e
#
-# Remove our generated locale unless we're only upgrading.
+# Remove our generated locale if we are not upgrading or
+# we are upgrading into a system with a libc provided
+# C.UTF-8 (libc-bin >= 2.13-1)
-if [ 'upgrade' != "$1" ] ; then
+if [ 'upgrade' != "$1" -o -d '/usr/lib/locale/C.UTF-8' ] ; then
rm -rf /var/lib/lintian/
fi