[gnome-ostree] integration: Fix srcdir != builddir



commit 7942fee29a57d796251a3d849a6661259e4b7362
Author: Colin Walters <walters verbum org>
Date:   Mon Sep 17 13:13:07 2012 -0400

    integration: Fix srcdir != builddir
    
    We should just generate files with sed, not with autoconf.  This
    ensures that generated data always ends up in builddir.

 Makefile-integration.am |   19 ++++++++++++++-----
 configure.ac            |    1 -
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/Makefile-integration.am b/Makefile-integration.am
index ed47e03..d0eae41 100644
--- a/Makefile-integration.am
+++ b/Makefile-integration.am
@@ -19,16 +19,25 @@ if SYSTEM_INTEGRATION
 INSTALL_DATA_HOOKS += integration-install-data-hook
 endif
 
-BUILT_SOURCES = system-release
+BUILT_SOURCES += system-release os-release
 
-system-release: config.status
-	$(AM_V_GEN)echo "$(OS_PRETTY_NAME)" > $@
+INTEGRATION_SUBS =  -e "s|@OS_NAME\@|$(OS_NAME)|" \
+	-e "s|@OS_ID\@|$(OS_ID)|" \
+	-e "s|@OS_VERSION\@|$(OS_VERSION)|" \
+	-e "s|@OS_PRETTY_NAME\@|$(OS_PRETTY_NAME)|" \
+	-e "s|@PACKAGE_URL\@|$(PACKAGE_URL)|"
 
-integration-install-data-hook: $(top_srcdir)/src/integration/os-release system-release
+system-release: Makefile
+	$(AM_V_GEN)echo "$(OS_PRETTY_NAME)" > $  tmp && mv $  tmp $@
+
+os-release: $(srcdir)/src/integration/os-release.in Makefile
+	sed $(INTEGRATION_SUBS) < $< > $  tmp && mv $  tmp $@
+
+integration-install-data-hook: os-release system-release
 	mkdir -p $(DESTDIR)$(prefix)/lib/systemd/system
 	ln -sf gdm.service $(DESTDIR)$(prefix)/lib/systemd/system/display-manager.service
 	ln -sf NetworkManager.service $(DESTDIR)$(prefix)/lib/systemd/system/dbus-org.freedesktop.NetworkManager.service
-	install -D $(srcdir)/src/integration/os-release $(DESTDIR)$(sysconfdir)/os-release
+	install -D os-release $(DESTDIR)$(sysconfdir)/os-release
 	install -D $(builddir)/system-release $(DESTDIR)$(sysconfdir)/system-release
 	install -D $(srcdir)/src/integration/lib-passwd $(DESTDIR)$(prefix)/lib/passwd
 	install -D $(srcdir)/src/integration/lib-group $(DESTDIR)$(prefix)/lib/group
diff --git a/configure.ac b/configure.ac
index 1ed4c18..8e5a01b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,6 @@ AC_ARG_ENABLE(system-integration,
 AM_CONDITIONAL(SYSTEM_INTEGRATION, test x$enable_system_integration != xno)
 
 AC_CONFIG_FILES([
-src/integration/os-release
 Makefile
 ])
 AC_OUTPUT



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