[gnome-dictionary] build: Move the service file template out of Makefile



commit cebc16458c6ba7c004664ac74942885ec094361c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 11 17:16:34 2017 +0100

    build: Move the service file template out of Makefile
    
    We can use a template file in tree, instead of a generation rule
    embedded into the Makefile.am.

 configure.ac                         |    1 +
 data/Makefile.am                     |   11 +++++------
 data/org.gnome.Dictionary.service.in |    3 +++
 3 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9e1098e..997e6f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,6 +22,7 @@ AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_HEADER_STDC
 PKG_PROG_PKG_CONFIG([0.22])
+AC_PROG_SED
 
 IT_PROG_INTLTOOL([0.40])
 
diff --git a/data/Makefile.am b/data/Makefile.am
index 9408c6e..449fab2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -15,14 +15,13 @@ CLEANFILES += $(gdictapp_DATA)
 @INTLTOOL_DESKTOP_RULE@
 
 dbusservicedir = $(datadir)/dbus-1/services
-dbusservice_DATA = org.gnome.Dictionary.service
+dbusservice_in_files = org.gnome.Dictionary.service.in
+dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
 
-org.gnome.Dictionary.service: Makefile
-       $(AM_V_GEN) (echo '[D-BUS Service]'; \
-                    echo 'Name=org.gnome.Dictionary'; \
-                    echo 'Exec=${bindir}/gnome-dictionary --gapplication-service') > $@.tmp && \
-                    mv $@.tmp $@
+org.gnome.Dictionary.service: $(dbusservice_in_files) Makefile
+       $(AM_V_GEN) $(SED) -e 's|\@bindir\@|@bindir@|' $< > $@
 
+EXTRA_DIST += $(dbusservice_in_files)
 CLEANFILES += $(dbusservice_DATA)
 
 @INTLTOOL_XML_RULE@
diff --git a/data/org.gnome.Dictionary.service.in b/data/org.gnome.Dictionary.service.in
new file mode 100644
index 0000000..e33fc01
--- /dev/null
+++ b/data/org.gnome.Dictionary.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Dictionary
+Exec=@bindir@/gnome-dictionary --gapplication-service


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