summaryrefslogtreecommitdiff
blob: 5d5af0d9717d9032238e733657fc87fe5633d384 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
From c093ce404bf9868980fe7b83d6aa2ab3ec7831e2 Mon Sep 17 00:00:00 2001
From: Alexandre Rostovtsev <tetromino@gentoo.org>
Date: Sun, 8 Dec 2013 23:44:56 +0100
Subject: [PATCH 5/5] Fix some absolute paths to be appropriate for Gentoo

Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org>
---
 panels/datetime/Makefile.am         | 1 +
 panels/datetime/test-endianess.c    | 4 ++--
 panels/datetime/test-timezone.c     | 2 +-
 panels/datetime/tz.h                | 4 ++--
 panels/printers/Makefile.am         | 3 +++
 panels/printers/cc-printers-panel.c | 4 ++--
 panels/printers/pp-host.c           | 2 +-
 7 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/panels/datetime/Makefile.am b/panels/datetime/Makefile.am
index 43523a6..d8d677d 100644
--- a/panels/datetime/Makefile.am
+++ b/panels/datetime/Makefile.am
@@ -23,6 +23,7 @@ AM_CPPFLAGS =						\
 	$(DATETIME_PANEL_CFLAGS)			\
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\""	\
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\""		\
+	-DREALDATADIR="\"$(datadir)\""                  \
 	$(NULL)
 
 # test-timezone is still too noisy
diff --git a/panels/datetime/test-endianess.c b/panels/datetime/test-endianess.c
index 06b2613..eb52bb6 100644
--- a/panels/datetime/test-endianess.c
+++ b/panels/datetime/test-endianess.c
@@ -26,11 +26,11 @@ test_endianess (void)
 	GDir *dir;
 	const char *name;
 
-	dir = g_dir_open ("/usr/share/i18n/locales/", 0, NULL);
+	dir = g_dir_open (REALDATADIR "/i18n/locales/", 0, NULL);
 	if (dir == NULL) {
 		/* Try with /usr/share/locale/
 		 * https://bugzilla.gnome.org/show_bug.cgi?id=646780 */
-		dir = g_dir_open ("/usr/share/locale/", 0, NULL);
+		dir = g_dir_open (REALDATADIR "/locale/", 0, NULL);
 		if (dir == NULL) {
 			g_assert_not_reached ();
 		}
diff --git a/panels/datetime/test-timezone.c b/panels/datetime/test-timezone.c
index db5c030..7ef5cef 100644
--- a/panels/datetime/test-timezone.c
+++ b/panels/datetime/test-timezone.c
@@ -2,7 +2,7 @@
 #include <gtk/gtk.h>
 #include "cc-timezone-map.h"
 
-#define TZ_DIR "/usr/share/zoneinfo/"
+#define TZ_DIR REALDATADIR "/zoneinfo/"
 
 static GList *
 get_timezone_list (GList *tzs,
diff --git a/panels/datetime/tz.h b/panels/datetime/tz.h
index 93905b3..1ba918c 100644
--- a/panels/datetime/tz.h
+++ b/panels/datetime/tz.h
@@ -28,9 +28,9 @@
 #include <glib.h>
 
 #ifndef __sun
-#  define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"
+#  define TZ_DATA_FILE REALDATADIR "/zoneinfo/zone.tab"
 #else
-#  define TZ_DATA_FILE "/usr/share/lib/zoneinfo/tab/zone_sun.tab"
+#  define TZ_DATA_FILE REALDATADIR "/lib/zoneinfo/tab/zone_sun.tab"
 #endif
 
 typedef struct _TzDB TzDB;
diff --git a/panels/printers/Makefile.am b/panels/printers/Makefile.am
index 512cda5..87726dd 100644
--- a/panels/printers/Makefile.am
+++ b/panels/printers/Makefile.am
@@ -10,6 +10,9 @@ AM_CPPFLAGS = 						\
 	-I$(top_srcdir)/shell/				\
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\""	\
 	-DTEST_SRCDIR=\""$(srcdir)/"\"			\
+	-DREALDATADIR="\"$(datadir)\""                  \
+	-DPREFIX="\"$(prefix)\""                        \
+	-DLIBEXECDIR="\"$(libexecdir)\""                \
 	$(NULL)
 
 noinst_LTLIBRARIES = libprinters.la
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index fb55608..a6dfb90 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -2590,8 +2590,8 @@ test_page_cb (GtkButton *button,
 
   if (printer_name)
     {
-      const gchar  *const dirs[] = { "/usr/share/cups",
-                                     "/usr/local/share/cups",
+      const gchar  *const dirs[] = { REALDATADIR "/cups",
+                                     PREFIX "/local/share/cups",
                                      NULL };
       const gchar  *datadir = NULL;
       http_t       *http = NULL;
diff --git a/panels/printers/pp-host.c b/panels/printers/pp-host.c
index fbfb434..bd00518 100644
--- a/panels/printers/pp-host.c
+++ b/panels/printers/pp-host.c
@@ -254,7 +254,7 @@ _pp_host_get_snmp_devices_thread (GSimpleAsyncResult *res,
   data->devices->devices = NULL;
 
   argv = g_new0 (gchar *, 3);
-  argv[0] = g_strdup ("/usr/lib/cups/backend/snmp");
+  argv[0] = g_strdup (LIBEXECDIR "/cups/backend/snmp");
   argv[1] = g_strdup (priv->hostname);
 
   /* Use SNMP to get printer's informations */
-- 
2.10.1