[gnome-ostree-integration] build: Add --enable-initial-setup option



commit 70fa7f0686f1e4c2b69890fb925da354ba526399
Author: Colin Walters <walters verbum org>
Date:   Fri Jan 18 16:16:08 2013 -0500

    build: Add --enable-initial-setup option
    
    Not on by default yet pending some debugging.

 Makefile-integration.am                            |   16 ++++++++++++++++
 configure.ac                                       |    5 +++++
 ...nome-ostree-initial-setup-by-default.service.in |    8 ++++++++
 src/initial-setup-by-default                       |    6 ++++++
 4 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/Makefile-integration.am b/Makefile-integration.am
index 48a3e15..7c14edd 100644
--- a/Makefile-integration.am
+++ b/Makefile-integration.am
@@ -19,6 +19,8 @@ INSTALL_DATA_HOOKS += integration-install-data-hook
 
 BUILT_SOURCES += system-release os-release
 
+BIN_SUBS = -e "s|@pkglibdir\@|$(pkglibdir)|"
+
 INTEGRATION_SUBS =  -e "s|@OS_NAME\@|$(OS_NAME)|" \
 	-e "s|@OS_ID\@|$(OS_ID)|" \
 	-e "s|@OS_VERSION\@|$(OS_VERSION)|" \
@@ -31,6 +33,20 @@ system-release: Makefile
 os-release: $(srcdir)/src/os-release.in Makefile
 	sed $(INTEGRATION_SUBS) < $< > $  tmp && mv $  tmp $@
 
+gnome-ostree-initial-setup-by-default.service: src/gnome-ostree-initial-setup-by-default.service.in
+	$(AM_V_GEN) sed $(BIN_SUBS) < $< > $  tmp && mv $  tmp $@
+
+units_DATA =
+unitsdir = $(prefix)/lib/systemd/system
+
+integration_SCRIPTS = 
+integrationdir = $(pkglibdir)
+
+if ENABLE_INITIAL_SETUP
+integration_SCRIPTS += src/initial-setup-by-default
+units_DATA += src/gnome-ostree-initial-setup-by-default.service
+endif
+
 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
diff --git a/configure.ac b/configure.ac
index a265430..260f7f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,11 @@ AM_INIT_AUTOMAKE([1.11 -Wno-portability foreign no-define tar-ustar no-dist-gzip
 AM_MAINTAINER_MODE([enable])
 AM_SILENT_RULES([yes])
 
+AC_ARG_ENABLE(initial-setup,
+	    AS_HELP_STRING([--enable-initial-setup], [Enable initial setup by default]),,
+	    enable_initial_setup=no)
+AM_CONDITIONAL(ENABLE_INITIAL_SETUP, test x$enable_initial_setup != xno)
+
 AM_PATH_PYTHON([2.6])
 
 AC_CONFIG_FILES([
diff --git a/src/gnome-ostree-initial-setup-by-default.service.in b/src/gnome-ostree-initial-setup-by-default.service.in
new file mode 100644
index 0000000..d45e2c6
--- /dev/null
+++ b/src/gnome-ostree-initial-setup-by-default.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Enable Initial Setup
+ConditionPathExists=!/var/lib/gdm/completed-initial-setup
+
+[Service]
+ExecStart= pkglibdir@/initial-setup-by-default
+Type=oneshot
+Before=gdm.service
diff --git a/src/initial-setup-by-default b/src/initial-setup-by-default
new file mode 100755
index 0000000..60e6e9b
--- /dev/null
+++ b/src/initial-setup-by-default
@@ -0,0 +1,6 @@
+#!/bin/bash
+# This is a gross hack to invert the GDM default of not
+# running the initial setup.
+
+touch /var/lib/gdm/run-initial-setup
+touch /var/lib/gdm/completed-initial-setup



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