summaryrefslogtreecommitdiff
path: root/recipes/pmount/pmount-0.9.18/gettext.patch
blob: dbac93f6bac6fa47307340916225a7d5b6d7f01d (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
121
122
123
124
125
126
127
128
129
130
131
132
133
Index: pmount-0.9.17/src/pmount-hal.c
===================================================================
--- pmount-0.9.17.orig/src/pmount-hal.c	2007-07-01 13:58:49.000000000 +0200
+++ pmount-0.9.17/src/pmount-hal.c	2008-10-08 23:39:20.970178412 +0200
@@ -16,7 +16,6 @@
 #include <dirent.h>
 #include <sys/stat.h>
 #include <locale.h>
-#include <libintl.h>
 #include <libhal-storage.h>
 
 #include "policy.h"
@@ -26,7 +25,12 @@
 #include "realpath.h"
 
 /* gettext abbreviation */
+#ifdef ENABLE_NLS
+#include <libintl.h>
 #define _(String) gettext(String)
+#else
+#define _(String) (String)
+#endif
 
 void help() {
     puts( _(
@@ -196,10 +200,12 @@
     char *dmask = NULL;
     char *iocharset = NULL;
 
+#ifdef ENABLE_NLS
     /* initialize locale */
     setlocale( LC_ALL, "" );
     bindtextdomain( "pmount", NULL );
     textdomain( "pmount" );
+#endif
 
     if( argc < 2 ) {
         help();
Index: pmount-0.9.17/src/utils.h
===================================================================
--- pmount-0.9.17.orig/src/utils.h	2007-07-07 09:05:06.000000000 +0200
+++ pmount-0.9.17/src/utils.h	2008-10-08 23:19:09.515475595 +0200
@@ -12,7 +12,12 @@
 #define __utils_h
 
 /* gettext abbreviation */
+#ifdef ENABLE_NLS
+#include <libintl.h>
 #define _(String) gettext(String)
+#else
+#define _(String) (String)
+#endif
 
 /* global flag whether to print debug messages (false by default) */
 extern int enable_debug;
Index: pmount-0.9.17/configure.ac
===================================================================
--- pmount-0.9.17.orig/configure.ac	2007-12-14 20:27:23.000000000 +0100
+++ pmount-0.9.17/configure.ac	2008-10-08 23:19:09.598820915 +0200
@@ -77,10 +77,7 @@
 fi
 AM_CONDITIONAL(PMOUNT_HAL, test -n "$BUILD_HAL")
 													   
-GETTEXT_PACKAGE="pmount"
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT([external])
 
 AC_OUTPUT([
 Makefile
Index: pmount-0.9.17/src/pmount.c
===================================================================
--- pmount-0.9.17.orig/src/pmount.c	2008-10-08 23:36:44.452037557 +0200
+++ pmount-0.9.17/src/pmount.c	2008-10-08 23:37:38.778816969 +0200
@@ -21,9 +21,12 @@
 #include <errno.h>
 #include <locale.h>
 #include <langinfo.h>
-#include <libintl.h>
 #include <sys/stat.h>
 
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#endif
+
 #include "fs.h"
 #include "policy.h"
 #include "utils.h"
@@ -619,10 +622,12 @@
         { NULL, 0, NULL, 0}
     };
 
+#ifdef ENABLE_NLS
     /* initialize locale */
     setlocale( LC_ALL, "" );
     bindtextdomain( "pmount", NULL );
     textdomain( "pmount" );
+#endif
 
     /* If pmount is run without a single argument, print out the list
        of removable devices. Does not require root privileges, just read access
Index: pmount-0.9.17/src/pumount.c
===================================================================
--- pmount-0.9.17.orig/src/pumount.c	2008-10-08 23:38:21.122028300 +0200
+++ pmount-0.9.17/src/pumount.c	2008-10-08 23:38:47.972023678 +0200
@@ -16,9 +16,12 @@
 #include <sys/wait.h>
 #include <limits.h>
 #include <getopt.h>
-#include <libintl.h>
 #include <locale.h>
 
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#endif
+
 #include "policy.h"
 #include "utils.h"
 #include "luks.h"
@@ -172,10 +175,12 @@
         { NULL, 0, NULL, 0}
     };
 
+#ifdef ENABLE_NLS
     /* initialize locale */
     setlocale( LC_ALL, "" );
     bindtextdomain( "pmount", NULL );
     textdomain( "pmount" );
+#endif
 
     /* are we root? */
     if( geteuid() ) {