Permalink
Browse files

Simplify component XML generation using sed

  • Loading branch information...
1 parent 13f59eb commit c8cac9dc5c888d2d46484fd9ab2e70d89254ddcf @ueno committed Mar 8, 2013
Showing with 22 additions and 28 deletions.
  1. +0 −18 Makefile.am
  2. +0 −1 configure.ac
  3. +17 −4 src/Makefile.am
  4. +5 −5 { → src}/skk.xml.in.in
View
@@ -28,21 +28,8 @@ SUBDIRS = \
ACLOCAL_AMFLAGS = -I m4
-component_DATA = skk.xml
-componentdir = $(datadir)/ibus/component
-
-skk.xml: skk.xml.in
- $(AM_V_GEN) \
- ( \
- libexecdir=${libexecdir}; \
- pkgdatadir=${pkgdatadir}; \
- s=`cat $<`; \
- eval "echo \"$${s}\""; \
- ) > $@
-
EXTRA_DIST = \
autogen.sh \
- skk.xml.in.in \
ibus-skk.spec.in \
$(NULL)
@@ -60,12 +47,7 @@ GITIGNOREFILES = \
mkinstalldirs \
$(NULL)
-CLEANFILES = \
- skk.xml \
- $(NULL)
-
DISTCLEANFILES = \
- skk.xml.in \
po/stamp-it \
$(NULL)
View
@@ -86,7 +86,6 @@ AM_GLIB_GNU_GETTEXT
AC_CONFIG_FILES([ po/Makefile.in
Makefile
ibus-skk.spec
-skk.xml.in
src/Makefile
src/ibus-skk-preferences.ui
icons/Makefile
View
@@ -71,20 +71,30 @@ ibus_setup_skk_SOURCES = \
setupdir = $(pkgdatadir)/setup
setup_DATA = ibus-skk-preferences.ui
+edit = sed \
+ -e 's|@VERSION[@]|$(VERSION)|g' \
+ -e 's|@libexecdir[@]|$(libexecdir)|g' \
+ -e 's|@pkgdatadir[@]|$(pkgdatadir)|g'
+
desktop_in_in_files = ibus-setup-skk.desktop.in.in
desktop_in_files = $(desktop_in_in_files:.in.in=.in)
$(desktop_in_files): %.desktop.in: %.desktop.in.in Makefile
- $(AM_V_GEN) sed \
- -e "s|\@libexecdir\@|$(libexecdir)|" \
- -e "s|\@pkgdatadir\@|$(pkgdatadir)|" \
- $< > $@.tmp && mv $@.tmp $@
+ $(AM_V_GEN) $(edit) $< > $@.tmp && mv $@.tmp $@
desktopdir=$(datadir)/applications
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
+component_DATA = skk.xml
+componentdir = $(datadir)/ibus/component
+
+skk.xml.in: skk.xml.in.in
+ $(AM_V_GEN) $(edit) $< > $@.tmp && mv $@.tmp $@
+
+@INTLTOOL_XML_NOMERGE_RULE@
+
GITIGNOREFILES = \
$(libutil_la_SOURCES:.vala=.c) \
$(ibus_engine_skk_SOURCES:.vala=.c) \
@@ -99,6 +109,8 @@ CLEANFILES = \
ibus-skk.vapi \
$(desktop_DATA) \
$(desktop_in_files) \
+ skk.xml.in \
+ skk.xml \
$(NULL)
EXTRA_DIST = \
@@ -108,6 +120,7 @@ EXTRA_DIST = \
ibus-1.0.deps \
ibus-skk-preferences.ui.in \
$(desktop_in_in_files) \
+ skk.xml.in.in \
$(NULL)
DISTCLEANFILES = \
@@ -1,9 +1,9 @@
-<?xml version=\"1.0\" encoding=\"utf-8\"?>
+<?xml version="1.0" encoding="utf-8"?>
<!-- filename: skk.xml -->
<component>
<name>org.freedesktop.IBus.SKK</name>
<description>SKK Component</description>
- <exec>${libexecdir}/ibus-engine-skk --ibus</exec>
+ <exec>@libexecdir@/ibus-engine-skk --ibus</exec>
<version>@VERSION@</version>
<author>Daiki Ueno &lt;ueno@unixuser.org&gt;</author>
<license>GPL</license>
@@ -17,10 +17,10 @@
<language>ja</language>
<license>GPL</license>
<author>Daiki Ueno &lt;ueno@unixuser.org&gt;</author>
- <icon>${pkgdatadir}/icons/ibus-skk.svg</icon>
+ <icon>@pkgdatadir@/icons/ibus-skk.svg</icon>
<layout>jp</layout>
- <longname>SKK</longname>
- <description>SKK Input Method</description>
+ <_longname>SKK</_longname>
+ <_description>SKK Input Method</_description>
<rank>70</rank>
<symbol>&#x3042;</symbol>
</engine>

0 comments on commit c8cac9d

Please sign in to comment.