[gdm] Make screenshot dir a configure argument
- From: Ray Strode <halfline src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gdm] Make screenshot dir a configure argument
- Date: Thu, 5 Nov 2009 20:40:52 +0000 (UTC)
commit 0596fa2d91760bca520b549dbcfc35bdc98ee098
Author: Ray Strode <rstrode redhat com>
Date: Tue Oct 27 10:40:55 2009 -0400
Make screenshot dir a configure argument
This provides a little more flexibility to distributors,
but more importantly makes it less hard coded in gdm-screenshot.c
configure.ac | 17 +++++++++++++++++
data/Makefile.am | 8 ++++++++
utils/Makefile.am | 1 +
utils/gdm-screenshot.c | 5 +----
4 files changed, 27 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4fe4430..0dd2658 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1237,6 +1237,23 @@ fi
AC_SUBST(GDM_XAUTH_DIR)
dnl ---------------------------------------------------------------------------
+dnl - Directory for greeter screenshot
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_WITH(screenshot-dir,
+ AS_HELP_STRING([--with-screenshot-dir=<dir>],
+ [directory to store greeter screenshot]))
+
+if ! test -z "$with_screenshot_dir"; then
+ GDM_SCREENSHOT_DIR=$with_screenshot_dir
+else
+ GDM_SCREENSHOT_DIR=${localstatedir}/run/gdm
+fi
+
+AC_SUBST(GDM_SCREENSHOT_DIR)
+
+
+dnl ---------------------------------------------------------------------------
dnl - Finish
dnl ---------------------------------------------------------------------------
diff --git a/data/Makefile.am b/data/Makefile.am
index 73fa106..608194d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -13,6 +13,7 @@ predir = $(gdmconfdir)/PreSession
postlogindir = $(gdmconfdir)/PostLogin
workingdir = $(GDM_WORKING_DIR)
xauthdir = $(GDM_XAUTH_DIR)
+screenshotdir = $(GDM_SCREENSHOT_DIR)
cachedir = $(localstatedir)/cache/gdm
Xsession: $(srcdir)/Xsession.in
@@ -123,6 +124,7 @@ uninstall-hook:
-rf \
$(DESTDIR)$(workingdir)/.gconf.mandatory \
$(DESTDIR)$(xauthdir)
+ $(DESTDIR)$(screenshotdir)
install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession gconf.path
if test '!' -d $(DESTDIR)$(gdmconfdir); then \
@@ -204,6 +206,12 @@ install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession gconf.pa
chown root:gdm $(DESTDIR)$(xauthdir) || : ; \
fi
+ if test '!' -d $(DESTDIR)$(screenshotdir); then \
+ $(mkinstalldirs) $(DESTDIR)$(screenshotdir); \
+ chmod 0755 $(DESTDIR)$(screenshotdir); \
+ chown gdm:gdm $(DESTDIR)$(screenshotdir) || : ; \
+ fi
+
if test '!' -d $(DESTDIR)$(workingdir); then \
$(mkinstalldirs) $(DESTDIR)$(workingdir); \
chmod 1770 $(DESTDIR)$(workingdir); \
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 0b6ea04..f1ff331 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -4,6 +4,7 @@ AM_CPPFLAGS = \
-I. \
-I.. \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
+ -DGDM_SCREENSHOT_DIR=\""$(GDM_SCREENSHOT_DIR)"\"\
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
$(UTILS_CFLAGS) \
$(CANBERRA_GTK_CFLAGS) \
diff --git a/utils/gdm-screenshot.c b/utils/gdm-screenshot.c
index f66de46..12102f2 100644
--- a/utils/gdm-screenshot.c
+++ b/utils/gdm-screenshot.c
@@ -163,11 +163,8 @@ screenshot_save (GdkPixbuf *pixbuf)
char *filename;
gboolean res;
GError *error;
- const char *save_dir;
- save_dir = LOCALSTATEDIR "/run/gdm";
-
- filename = g_build_filename (save_dir,
+ filename = g_build_filename (GDM_SCREENSHOT_DIR,
"GDM-Screenshot.png",
NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]