aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-12-13 11:57:58 -0600
committerCharles Kerr <charles.kerr@canonical.com>2013-12-13 11:57:58 -0600
commit080af76066c8781b4b6dbfcc447c13fb0d1bb28c (patch)
tree75244ea7d7d3874b211c04da0f12118c2ae519b6
parentbb0c9077bbdf00adf7b737a84730959250d91200 (diff)
downloadayatana-indicator-datetime-080af76066c8781b4b6dbfcc447c13fb0d1bb28c.tar.gz
ayatana-indicator-datetime-080af76066c8781b4b6dbfcc447c13fb0d1bb28c.tar.bz2
ayatana-indicator-datetime-080af76066c8781b4b6dbfcc447c13fb0d1bb28c.zip
ensure that we have 12h and 24h locales installed at build time -- the unit tests need them
-rw-r--r--debian/control1
-rw-r--r--debian/locale-gen31
-rwxr-xr-xdebian/rules3
3 files changed, 35 insertions, 0 deletions
diff --git a/debian/control b/debian/control
index 357b099..ade7f2e 100644
--- a/debian/control
+++ b/debian/control
@@ -25,6 +25,7 @@ Build-Depends: cmake,
libgnome-control-center-dev,
libtimezonemap1-dev,
liburl-dispatcher1-dev,
+ locales,
Standards-Version: 3.9.3
Homepage: https://launchpad.net/indicator-datetime
# If you aren't a member of ~indicator-applet-developers but need to upload
diff --git a/debian/locale-gen b/debian/locale-gen
new file mode 100644
index 0000000..437dec5
--- /dev/null
+++ b/debian/locale-gen
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+LOCPATH=`pwd`/locales
+export LOCPATH
+
+[ -d $LOCPATH ] || mkdir -p $LOCPATH
+
+umask 022
+
+echo "Generating locales..."
+while read locale charset; do
+ case $locale in \#*) continue;; esac
+ [ -n "$locale" -a -n "$charset" ] || continue
+ echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"
+ echo -n ".$charset"
+ echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`
+ echo -n '...'
+ if [ -f $LOCPATH/$locale ]; then
+ input=$locale
+ else
+ input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`
+ fi
+ localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias
+ echo ' done'; \
+done <<EOF
+# Put the list of locales you need here:
+en_GB.utf8 UTF-8
+en_US.utf8 UTF-8
+EOF
+
+echo "Generation complete."
diff --git a/debian/rules b/debian/rules
index 0e7a91f..ea10b93 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,3 +14,6 @@ override_dh_install:
echo "X-Ubuntu-Gettext-Domain=indicator-datetime" >> $$d; \
done;
+override_dh_auto_test:
+ sh debian/locale-gen
+ LOCPATH="$(CURDIR)/locales" dh_auto_test