[gupnp-tools] Update autotools for i18n support



commit d90ffee6352619f461f329b33e1f5599b7abdc96
Author: Jiro Matsuzawa <jmatsuzawa gnome org>
Date:   Sat Dec 22 13:15:52 2012 +0900

    Update autotools for i18n support

 Makefile.am                            |    7 ++++-
 autogen.sh                             |    8 ++++-
 configure.ac                           |    4 ++
 data/Makefile.am                       |    4 +--
 data/gupnp-av-cp.desktop.in.in         |    4 +-
 data/gupnp-network-light.desktop.in.in |    4 +-
 data/gupnp-universal-cp.desktop.in.in  |    4 +-
 m4/as-ac-expand.m4                     |   49 ++++++++++++++++++++++++++++++
 po/POTFILES.in                         |   52 ++++++++++++++++++++++++++++++++
 po/POTFILES.skip                       |    5 +++
 10 files changed, 129 insertions(+), 12 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 401b3eb..a282df6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,9 +1,14 @@
 ACLOCAL_AMFLAGS=-I m4 ${ACLOCAL_FLAGS}
-SUBDIRS = src data
+SUBDIRS = src data po
 
 # Extra clean files so that maintainer-clean removes *everything*
 MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing config.h.in
 
+DISTCLEANFILES = \
+	intltool-extract \
+	intltool-merge \
+	intltool-update
+
 dist-hook:
 	@if test -d "$(srcdir)/.git"; \
 		then \
diff --git a/autogen.sh b/autogen.sh
index 906c14e..7433ba9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -11,9 +11,13 @@ if test -z $AUTORECONF; then
         echo "*** No autoreconf found, please install it ***"
         exit 1
 fi
+INTLTOOLIZE=`which intltoolize`
+if test -z $INTLTOOLIZE; then
+        echo "*** No intltoolize found, please install the intltool package ***"
+        exit 1
+fi
 
-mkdir -p m4
-
+intltoolize --force --copy --automake || exit $?
 autoreconf --force --install --verbose || exit $?
 
 cd "$olddir"
diff --git a/configure.ac b/configure.ac
index 018ab9a..313d83d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,7 @@ fi
 AM_CONDITIONAL([UNINSTALLED], [test "x$enable_uninstalled" = "xyes"])
 
 # Gettext
+IT_PROG_INTLTOOL([0.40.6])
 GETTEXT_PACKAGE=gupnp-tools
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
@@ -126,6 +127,8 @@ ALL_LINGUAS=""
 AM_GLIB_GNU_GETTEXT
 AM_GLIB_DEFINE_LOCALEDIR([LOCALEDIR])
 
+AS_AC_EXPAND(PKGDATADIR, "${datadir}/${PACKAGE}")
+
 AC_CONFIG_FILES([
 Makefile
 src/Makefile
@@ -142,5 +145,6 @@ data/gupnp-av-cp.ui
 data/gupnp-network-light.desktop.in
 data/pixmaps/Makefile
 data/xml/Makefile
+po/Makefile.in
 ])
 AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
index 68224a7..28e25eb 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -15,9 +15,7 @@ shared_DATA = gupnp-av-cp.ui
 desktop_in_files += gupnp-av-cp.desktop.in
 endif
 
-# Rule to create the .desktop files
-$(desktop_DATA): $(desktop_in_files) Makefile
-	@sed -e "s,\$${prefix},${prefix},g" $(@:.desktop=.desktop.in) > $@
+ INTLTOOL_DESKTOP_RULE@
 
 EXTRA_DIST = $(desktop_in_files:.desktop.in=.desktop.in.in) gupnp-av-cp.ui.in
 
diff --git a/data/gupnp-av-cp.desktop.in.in b/data/gupnp-av-cp.desktop.in.in
index 1bf283d..4778af9 100644
--- a/data/gupnp-av-cp.desktop.in.in
+++ b/data/gupnp-av-cp.desktop.in.in
@@ -1,9 +1,9 @@
 [Desktop Entry]
 Encoding=UTF-8
-Name=UPnP AV Control Point
+_Name=UPnP AV Control Point
 Categories=GTK;Development;
 Exec=gupnp-av-cp
-Icon= datarootdir@/gupnp-tools/pixmaps/av-cp.png
+Icon= PKGDATADIR@/pixmaps/av-cp.png
 Terminal=false
 Type=Application
 StartupNotify=true
diff --git a/data/gupnp-network-light.desktop.in.in b/data/gupnp-network-light.desktop.in.in
index da02e4c..72985b3 100644
--- a/data/gupnp-network-light.desktop.in.in
+++ b/data/gupnp-network-light.desktop.in.in
@@ -1,9 +1,9 @@
 [Desktop Entry]
 Encoding=UTF-8
-Name=UPnP Network Light
+_Name=UPnP Network Light
 Categories=GTK;Development;
 Exec=gupnp-network-light
-Icon= datarootdir@/gupnp-tools/pixmaps/network-light-256x256.png
+Icon= PKGDATADIR@/pixmaps/network-light-256x256.png
 Terminal=false
 Type=Application
 StartupNotify=true
diff --git a/data/gupnp-universal-cp.desktop.in.in b/data/gupnp-universal-cp.desktop.in.in
index 5dfc042..4552978 100644
--- a/data/gupnp-universal-cp.desktop.in.in
+++ b/data/gupnp-universal-cp.desktop.in.in
@@ -1,9 +1,9 @@
 [Desktop Entry]
 Encoding=UTF-8
-Name=UPnP Universal Control Point
+_Name=UPnP Universal Control Point
 Categories=GTK;Development;
 Exec=gupnp-universal-cp
-Icon= datarootdir@/gupnp-tools/pixmaps/universal-cp.png
+Icon= PKGDATADIR@/pixmaps/universal-cp.png
 Terminal=false
 Type=Application
 StartupNotify=true
diff --git a/m4/as-ac-expand.m4 b/m4/as-ac-expand.m4
new file mode 100644
index 0000000..deebd2b
--- /dev/null
+++ b/m4/as-ac-expand.m4
@@ -0,0 +1,49 @@
+dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..e69de29
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..77f3888
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,52 @@
+# List of source files containing translatable strings.
+# Please keep this file sorted alphabetically.
+[encoding: UTF-8]
+data/gupnp-av-cp.desktop.in.in
+[type: gettext/glade]data/gupnp-av-cp.ui
+data/gupnp-network-light.desktop.in.in
+[type: gettext/glade]data/gupnp-network-light.ui
+data/gupnp-universal-cp.desktop.in.in
+[type: gettext/glade]data/gupnp-universal-cp.ui
+src/av-cp/gui.c
+src/av-cp/gui.h
+src/av-cp/main.c
+src/av-cp/main.h
+src/av-cp/playlist-treeview.c
+src/av-cp/playlist-treeview.h
+src/av-cp/renderer-combo.c
+src/av-cp/renderer-combo.h
+src/av-cp/renderer-controls.c
+src/av-cp/renderer-controls.h
+src/common/icons.c
+src/common/icons.h
+src/common/pretty-print.c
+src/common/pretty-print.h
+src/discover/gssdp-discover.c
+src/network-light/gui.c
+src/network-light/gui.h
+src/network-light/main.c
+src/network-light/main.h
+src/network-light/upnp.c
+src/network-light/upnp.h
+src/universal-cp/action-dialog.c
+src/universal-cp/action-dialog.h
+src/universal-cp/details-treeview.c
+src/universal-cp/details-treeview.h
+src/universal-cp/device-treeview.c
+src/universal-cp/device-treeview.h
+src/universal-cp/event-treeview.c
+src/universal-cp/event-treeview.h
+src/universal-cp/gui.c
+src/universal-cp/gui.h
+src/universal-cp/main.c
+src/universal-cp/main.h
+src/upload/container-search.c
+src/upload/container-search.h
+src/upload/control_point.c
+src/upload/control_point.h
+src/upload/item-creation.c
+src/upload/item-creation.h
+src/upload/main.c
+src/upload/main.h
+src/upload/transfer.c
+src/upload/transfer.h
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644
index 0000000..e9a2df3
--- /dev/null
+++ b/po/POTFILES.skip
@@ -0,0 +1,5 @@
+# List of source files that should *not* be translated.
+# Please keep this file sorted alphabetically.
+data/gupnp-av-cp.desktop.in
+data/gupnp-network-light.desktop.in
+data/gupnp-universal-cp.desktop.in



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]