]>
Commit | Line | Data |
---|---|---|
68eeb855 | 1 | diff -Nur mutt-1.5.11.orig/configure.in mutt-1.5.11/configure.in |
2 | --- mutt-1.5.11.orig/configure.in 2006-05-11 23:23:13.000000000 +0200 | |
3 | +++ mutt-1.5.11/configure.in 2006-05-12 00:58:13.000000000 +0200 | |
4 | @@ -816,6 +816,32 @@ | |
5 | fi]) | |
6 | dnl -- end cache -- | |
96c78afd | 7 | |
68eeb855 | 8 | +dnl -- home-etc -- |
96c78afd | 9 | +AC_ARG_WITH(home-etc, [ --with-home-etc[=PFX] Use HOME-ETC library to allow user keeping it's configuration files in a non-standard place ], |
10 | + [ | |
11 | + if test "$with_home_etc" != "no" | |
12 | + then | |
13 | + if test "$with_home_etc" != "yes" | |
14 | + then | |
15 | + LDFLAGS="$LDFLAGS -L$with_home_etc/lib" | |
16 | + fi | |
17 | + | |
18 | + saved_LIBS="$LIBS" | |
19 | + | |
20 | + AC_CHECK_LIB(home_etc, get_home_etc_static,, | |
21 | + AC_MSG_ERROR([could not find libhome_etc]),) | |
22 | + | |
23 | + AC_CHECK_HEADERS(home_etc.h) | |
24 | + | |
25 | + MUTTLIBS="$MUTTLIBS -lhome_etc" | |
26 | + LIBS="$saved_LIBS" | |
27 | + AC_DEFINE(USE_HOME_ETC,1, | |
28 | + [ Define if want to use the HOME-ETC library. ]) | |
29 | + need_home_etc=yes | |
30 | + fi | |
31 | + ]) | |
32 | +AM_CONDITIONAL(USE_HOME_ETC, test x$need_home_etc = xyes) | |
33 | + | |
34 | if test "$need_md5" = "yes" | |
35 | then | |
36 | MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5c.o" | |
68eeb855 | 37 | diff -Nur mutt-1.5.11.orig/doc/mutt.man mutt-1.5.11/doc/mutt.man |
38 | --- mutt-1.5.11.orig/doc/mutt.man 2005-08-18 21:38:54.000000000 +0200 | |
39 | +++ mutt-1.5.11/doc/mutt.man 2006-05-12 00:58:13.000000000 +0200 | |
40 | @@ -122,6 +122,8 @@ | |
41 | .IP "MAILDIR" | |
42 | Full path of the user's spool mailbox. Commonly used when the spool | |
43 | mailbox is a | |
44 | +.IP "HOME_ETC" | |
45 | +Path to alternative configuration directory. | |
46 | .B maildir (5) | |
47 | folder. | |
48 | .IP "MAILCAPS" | |
49 | @@ -138,17 +140,17 @@ | |
1bd25f33 | 50 | Specifies the editor to use when composing messages. |
51 | .SH FILES | |
52 | .PP | |
53 | -.IP "~/.muttrc or ~/.mutt/muttrc" | |
54 | +.IP "$HOME_ETC/.muttrc" or "$HOME_ETC/.mutt/muttrc" or "~/.muttrc" or "~/.mutt/muttrc" | |
55 | User configuration file. | |
68eeb855 | 56 | .IP "@sysconfdir@/Muttrc" |
1bd25f33 | 57 | System-wide configuration file. |
58 | .IP "/tmp/muttXXXXXX" | |
59 | Temporary files created by Mutt. | |
60 | -.IP "~/.mailcap" | |
68eeb855 | 61 | +.IP "~/.mailcap or $HOME_ETC/.mailcap" |
1bd25f33 | 62 | User definition for handling non-text MIME types. |
68eeb855 | 63 | .IP "@sysconfdir@/mailcap" |
1bd25f33 | 64 | System definition for handling non-text MIME types. |
68eeb855 | 65 | -.IP "~/.mime.types" |
66 | +.IP "~/.mime.types or $HOME_ETC/.mime.types" | |
67 | User's personal mapping between MIME types and file extensions. | |
68 | .IP "@sysconfdir@/mime.types" | |
69 | System mapping between MIME types and file extensions. | |
70 | diff -Nur mutt-1.5.11.orig/init.c mutt-1.5.11/init.c | |
71 | --- mutt-1.5.11.orig/init.c 2006-05-11 23:23:13.000000000 +0200 | |
72 | +++ mutt-1.5.11/init.c 2006-05-12 00:58:40.000000000 +0200 | |
73 | @@ -35,7 +35,12 @@ | |
74 | #include "mutt_ssl.h" | |
75 | #endif | |
1bd25f33 | 76 | |
68eeb855 | 77 | - |
96c78afd | 78 | +#ifdef HAVE_HOME_ETC_H |
79 | +# include <home_etc.h> | |
80 | +# define H_CFDIR _HEdir | |
81 | +#else | |
82 | +# define H_CFDIR Homedir | |
83 | +#endif | |
1bd25f33 | 84 | |
68eeb855 | 85 | #include "mx.h" |
86 | #include "init.h" | |
87 | @@ -2334,7 +2339,21 @@ | |
88 | else | |
89 | { | |
90 | /* Default search path from RFC1524 */ | |
91 | - MailcapPath = safe_strdup ("~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap"); | |
92 | + | |
93 | +#define MAILCAPPATHS "~/.mailcap:" PKGDATADIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap" | |
94 | +#ifdef HAVE_HOME_ETC_H | |
95 | + | |
96 | + MailcapPath = safe_malloc (mutt_strlen (MAILCAPPATHS) + mutt_strlen (_HEdir) + 2); | |
97 | + if (_HEdir != NULL && (mutt_strlen (_HEdir)) > 0) | |
98 | + sprintf (MailcapPath, "%s:%s", _HEdir, MAILCAPPATHS); /* __SPRINTF_CHECKED__ */ | |
99 | + else | |
100 | + strcpy (MailcapPath, MAILCAPPATHS); /* __SPRCPY_CHECKED__ */ | |
101 | + | |
102 | +#else | |
103 | + | |
104 | + MailcapPath = safe_strdup (MAILCAPPATHS); | |
105 | + | |
106 | +#endif | |
107 | } | |
108 | ||
109 | Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp"); | |
110 | @@ -2415,13 +2434,13 @@ | |
cdf1731c TO |
111 | |
112 | if (!Muttrc) | |
113 | { | |
114 | - snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION); | |
96c78afd | 115 | + snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION); |
cdf1731c | 116 | if (access(buffer, F_OK) == -1) |
1bd25f33 | 117 | - snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir)); |
96c78afd | 118 | + snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(H_CFDIR)); |
cdf1731c | 119 | if (access(buffer, F_OK) == -1) |
1bd25f33 | 120 | - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION); |
96c78afd | 121 | + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(H_CFDIR), MUTT_VERSION); |
1bd25f33 | 122 | if (access(buffer, F_OK) == -1) |
123 | - snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir)); | |
96c78afd | 124 | + snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(H_CFDIR)); |
1bd25f33 | 125 | |
126 | default_rc = 1; | |
127 | Muttrc = safe_strdup (buffer); | |
68eeb855 | 128 | @@ -2526,10 +2545,10 @@ |
129 | } | |
96c78afd | 130 | |
68eeb855 | 131 | uname (&u); |
132 | - pathlen = strlen (Homedir) + sizeof("/.slrnfaces/") | |
133 | + pathlen = strlen (H_CFDIR) + sizeof("/.slrnfaces/") | |
134 | + strlen (u.nodename) + 30; | |
135 | fifo = safe_malloc (pathlen); | |
136 | - sprintf (fifo, "%s/.slrnfaces", Homedir); | |
137 | + sprintf (fifo, "%s/.slrnfaces", H_CFDIR); | |
138 | if (mkdir (fifo, 0700)) | |
139 | { | |
140 | if (errno != EEXIST) | |
141 | @@ -2544,7 +2563,7 @@ | |
142 | FILE *fp; | |
143 | ||
144 | /* We'll abuse fifo filename memory here. It's long enough. */ | |
145 | - sprintf (fifo, "%s/.slrnfaces/README", Homedir); | |
146 | + sprintf (fifo, "%s/.slrnfaces/README", H_CFDIR); | |
147 | if ((fp = fopen (fifo, "w")) != NULL) | |
148 | { | |
149 | fputs (_( | |
150 | @@ -2560,7 +2579,7 @@ | |
151 | } | |
152 | } | |
153 | ||
154 | - status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", Homedir, | |
155 | + status = snprintf (fifo, pathlen, "%s/.slrnfaces/%s.%ld", H_CFDIR, | |
156 | u.nodename, (long)getpid()); | |
157 | if (status < 0) | |
158 | goto clean_face; | |
159 | diff -Nur mutt-1.5.11.orig/mutt_ssl.c mutt-1.5.11/mutt_ssl.c | |
160 | --- mutt-1.5.11.orig/mutt_ssl.c 2005-08-03 11:17:46.000000000 +0200 | |
161 | +++ mutt-1.5.11/mutt_ssl.c 2006-05-12 00:58:13.000000000 +0200 | |
162 | @@ -58,6 +58,13 @@ | |
163 | #define HAVE_ENTROPY() (!access(DEVRANDOM, R_OK) || entropy_byte_count >= 16) | |
164 | #endif | |
165 | ||
166 | +#ifdef HAVE_HOME_ETC_H | |
167 | +# include <home_etc.h> | |
168 | +# define H_CFDIR _HEdir | |
169 | +#else | |
170 | +# define H_CFDIR Homedir | |
171 | +#endif | |
172 | + | |
173 | typedef struct _sslsockdata | |
174 | { | |
175 | SSL_CTX *ctx; | |
176 | @@ -162,7 +169,7 @@ | |
177 | /* load entropy from egd sockets */ | |
178 | #ifdef HAVE_RAND_EGD | |
179 | add_entropy (getenv ("EGDSOCKET")); | |
180 | - snprintf (path, sizeof(path), "%s/.entropy", NONULL(Homedir)); | |
181 | + snprintf (path, sizeof(path), "%s/.entropy", NONULL(H_CFDIR)); | |
182 | add_entropy (path); | |
183 | add_entropy ("/tmp/entropy"); | |
184 | #endif | |
185 | diff -Nur mutt-1.5.11.orig/sendlib.c mutt-1.5.11/sendlib.c | |
186 | --- mutt-1.5.11.orig/sendlib.c 2006-05-11 23:23:13.000000000 +0200 | |
187 | +++ mutt-1.5.11/sendlib.c 2006-05-12 00:58:13.000000000 +0200 | |
188 | @@ -45,6 +45,13 @@ | |
1bd25f33 | 189 | #include <sys/wait.h> |
190 | #include <fcntl.h> | |
191 | ||
96c78afd | 192 | +#ifdef HAVE_HOME_ETC_H |
193 | +# include <home_etc.h> | |
194 | +# define H_CFDIR _HEdir | |
195 | +#else | |
196 | +# define H_CFDIR Homedir | |
197 | +#endif | |
1bd25f33 | 198 | + |
199 | #ifdef HAVE_SYSEXITS_H | |
200 | #include <sysexits.h> | |
201 | #else /* Make sure EX_OK is defined <philiph@pobox.com> */ | |
68eeb855 | 202 | @@ -908,9 +915,9 @@ |
1bd25f33 | 203 | |
204 | /* Given a file with path ``s'', see if there is a registered MIME type. | |
205 | * returns the major MIME type, and copies the subtype to ``d''. First look | |
206 | - * for ~/.mime.types, then look in a system mime.types if we can find one. | |
207 | - * The longest match is used so that we can match `ps.gz' when `gz' also | |
208 | - * exists. | |
209 | + * for either $HOME_ETC/.mime.types or ~/.mime.types, then look in a system | |
210 | + * mime.types if we can find one. The longest match is used so that we can | |
211 | + * match `ps.gz' when `gz' also exists. | |
212 | */ | |
213 | ||
68eeb855 | 214 | int mutt_lookup_mime_type (BODY *att, const char *path) |
215 | @@ -939,7 +946,7 @@ | |
1bd25f33 | 216 | switch (count) |
217 | { | |
218 | case 0: | |
219 | - snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(Homedir)); | |
96c78afd | 220 | + snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(H_CFDIR)); |
1bd25f33 | 221 | break; |
222 | case 1: | |
223 | strfcpy (buf, SYSCONFDIR"/mime.types", sizeof(buf)); |