[gcr] Build .desktop and .service files correctly



commit 5f222e4fb048fedc1b57328c2fd8256486b6879a
Author: Stef Walter <stefw gnome org>
Date:   Fri Mar 30 14:19:21 2012 +0200

    Build .desktop and .service files correctly

 Makefile.decl                |   28 +++++++++++++++++++++++++++-
 configure.ac                 |    4 +---
 gcr/Makefile.am              |    8 ++++----
 gcr/gcr-viewer.desktop.in    |   10 ----------
 gcr/gcr-viewer.desktop.in.in |    2 +-
 5 files changed, 33 insertions(+), 19 deletions(-)
---
diff --git a/Makefile.decl b/Makefile.decl
index 4eaaa42..17af8c7 100644
--- a/Makefile.decl
+++ b/Makefile.decl
@@ -32,4 +32,30 @@ V_ASN1_0 = @echo "  ASN1  " $@;
 .asn.asn.h:
 	$(V_ASN1) $(ASN1PARSER) -o $@ $< && sed -i 's|#include.*|/* \0 */|' $@
 
-SUFFIXES = .asn .asn.h
+V_SED = $(V_SED_$(V))
+V_SED_ = $(V_SED_$(AM_DEFAULT_VERBOSITY))
+V_SED_0 = @echo "  SED  " $@;
+
+SED_SUBST = sed \
+	-e 's,[ ]datadir[@],$(datadir),g' \
+	-e 's,[ ]libexecdir[@],$(libexecdir),g' \
+	-e 's,[ ]libdir[@],$(libdir),g' \
+	-e 's,[ ]includedir[@],$(includedir),g' \
+	-e 's,[ ]datarootdir[@],$(datarootdir),g' \
+	-e 's,[ ]sysconfdir[@],$(sysconfdir),g' \
+	-e 's,[ ]bindir[@],$(bindir),g' \
+	-e 's,[ ]exec_prefix[@],$(exec_prefix),g' \
+	-e 's,[ ]prefix[@],$(prefix),g' \
+	-e 's,[ ]PACKAGE[@],$(PACKAGE),g' \
+	-e 's,[ ]VERSION[@],$(VERSION),g' \
+	$(NULL)
+
+.desktop.in.in.desktop.in:
+	$(V_SED) $(SED_SUBST) $< > $@
+
+ INTLTOOL_DESKTOP_RULE@
+
+.service.in.service:
+	$(V_SED) $(SED_SUBST) $< > $@
+
+SUFFIXES = .asn .asn.h .desktop.in .desktop.in.in .service .service.in
diff --git a/configure.ac b/configure.ac
index 4047770..25464f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ AM_GLIB_GNU_GETTEXT
 # GLib and GTK+ stuff
 
 PKG_CHECK_MODULES(GLIB,
-	glib-2.0 >= 2.30.0
+	glib-2.0 >= 2.32.0
 	gmodule-no-export-2.0
 	gthread-2.0
 	gobject-2.0
@@ -388,8 +388,6 @@ gck/Makefile
 gck/tests/Makefile
 gcr/gcr.pc
 gcr/gcr-base.pc
-gcr/gcr-prompter.desktop.in
-gcr/gcr-viewer.desktop.in
 gcr/Makefile
 gcr/icons/Makefile
 gcr/icons/16x16/Makefile
diff --git a/gcr/Makefile.am b/gcr/Makefile.am
index 8aa7a28..82cbaf4 100644
--- a/gcr/Makefile.am
+++ b/gcr/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/Makefile.decl
+
 SUBDIRS = . icons tests
 
 # ------------------------------------------------------------------
@@ -302,7 +304,6 @@ desktopdir = $(datadir)/applications
 desktop_in_in_files = gcr-viewer.desktop.in.in gcr-prompter.desktop.in.in
 desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
- INTLTOOL_DESKTOP_RULE@
 
 service_in_files = \
 	org.gnome.keyring.SystemPrompter.service.in \
@@ -310,9 +311,6 @@ service_in_files = \
 servicedir       = $(DBUS_SERVICES_DIR)
 service_DATA     = $(service_in_files:.service.in=.service)
 
-$(service_DATA): $(service_in_files) Makefile
-	@sed -e "s|\ libexecdir\@|$(libexecdir)|" $< > $@
-
 # ----------------------------------------------------------------
 # TOOLS
 
@@ -432,6 +430,8 @@ CLEANFILES = \
 	$(BUILT_SOURCES) \
 	$(pkgconfig_DATA) \
 	$(service_DATA) \
+	$(desktop_in_files) \
+	$(desktop_DATA) \
 	gcr-actual.abi \
 	gcr-actual-base.abi \
 	gcr-expected.abi \
diff --git a/gcr/gcr-viewer.desktop.in.in b/gcr/gcr-viewer.desktop.in.in
index a9622ac..91ddaba 100644
--- a/gcr/gcr-viewer.desktop.in.in
+++ b/gcr/gcr-viewer.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Name=View file
 MimeType=application/pkcs12;application/pkcs12+pem;application/pkcs7-mime;application/pkcs7-mime+pem;application/pkcs8;application/pkcs8+pem;application/pkix-cert;application/pkix-cert+pem;application/pkix-crl;application/pkix-crl+pem;application/x-pem-file;application/x-pem-key;application/x-pkcs12;application/x-pkcs7-certificates;application/x-x509-ca-cert;application/x-x509-user-cert;application/pkcs10;application/pkcs10+pem;application/x-spkac;application/x-spkac+base64;
-Exec=gcr-viewer
+Exec= bindir@/gcr-viewer
 Type=Application
 Terminal=false
 NoDisplay=true



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