Commit d6b1a4d9 authored by Thomas Roessler's avatar Thomas Roessler

Mutt now correctly uses the sysconfdir as determined by configure.

parent 4d54eac8
......@@ -16,6 +16,8 @@ mutt_SOURCES = addrbook.c alias.c attach.c browser.c buffy.c color.c \
mutt_LDADD = @[email protected] $(INTLLIBS)
mutt_DEPENDENCIES = @[email protected] $(INTLDEPS)
DEFS=-DSHAREDIR=\"$(sharedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
EXTRA_mutt_SOURCES = pgp.c pgpinvoke.c pgpkey.c pgppubring.c sha1dgst.c \
gnupgparse.c resize.c snprintf.c dotlock.c pop.c imap.c socket.c
......@@ -56,12 +58,17 @@ install-exec-local:
fi
install-data-local:
-if [ ! -f $(sharedir)/Muttrc ]; then \
$(srcdir)/mkinstalldirs $(sharedir); \
$(INSTALL) -m 644 $(srcdir)/Muttrc $(sharedir); \
$(srcdir)/mkinstalldirs $(sharedir)
$(srcdir)/mkinstalldirs $(sysconfdir)
-if [ -f $(sharedir)/Muttrc ] ; then \
mv $(sharedir)/Muttrc $(sysconfdir) ; \
elif [ -f $(sharedir)/../Muttrc ] ; then \
mv $(sharedir)/../Muttrc $(sysconfdir) ; \
else \
$(INSTALL) -m 644 $(srcdir)/Muttrc $(sysconfdir) ; \
fi
-if [ ! -f $(sharedir)/mime.types ]; then \
$(INSTALL) -m 644 $(srcdir)/mime.types $(sharedir); \
-if [ ! -f $(sysconfdir)/mime.types ]; then \
$(INSTALL) -m 644 $(srcdir)/mime.types $(sysconfdir); \
fi
......
......@@ -116,6 +116,8 @@ mutt_SOURCES = addrbook.c alias.c attach.c browser.c buffy.c color.c \
mutt_LDADD = @[email protected] $(INTLLIBS)
mutt_DEPENDENCIES = @[email protected] $(INTLDEPS)
DEFS=-DSHAREDIR=\"$(sharedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
EXTRA_mutt_SOURCES = pgp.c pgpinvoke.c pgpkey.c pgppubring.c sha1dgst.c \
gnupgparse.c resize.c snprintf.c dotlock.c pop.c imap.c socket.c
......@@ -141,8 +143,6 @@ CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = Muttrc
PROGRAMS = $(bin_PROGRAMS)
DEFS = @[email protected] -I. -I$(srcdir) -I.
CPPFLAGS = @[email protected]
LDFLAGS = @[email protected]
LIBS = @[email protected]
......@@ -542,12 +542,17 @@ install-exec-local:
fi
install-data-local:
-if [ ! -f $(sharedir)/Muttrc ]; then \
$(srcdir)/mkinstalldirs $(sharedir); \
$(INSTALL) -m 644 $(srcdir)/Muttrc $(sharedir); \
$(srcdir)/mkinstalldirs $(sharedir)
$(srcdir)/mkinstalldirs $(sysconfdir)
-if [ -f $(sharedir)/Muttrc ] ; then \
mv $(sharedir)/Muttrc $(sysconfdir) ; \
elif [ -f $(sharedir)/../Muttrc ] ; then \
mv $(sharedir)/../Muttrc $(sysconfdir) ; \
else \
$(INSTALL) -m 644 $(srcdir)/Muttrc $(sysconfdir) ; \
fi
-if [ ! -f $(sharedir)/mime.types ]; then \
$(INSTALL) -m 644 $(srcdir)/mime.types $(sharedir); \
-if [ ! -f $(sysconfdir)/mime.types ]; then \
$(INSTALL) -m 644 $(srcdir)/mime.types $(sysconfdir); \
fi
# Don't make this one ChangeLog - it's intended to be
......
......@@ -10,9 +10,6 @@
/* Where to put l10n data */
#undef MUTTLOCALEDIR
/* Where to put other shared data */
#undef SHAREDIR
/* Enable debugging info */
#define DEBUG
......
......@@ -11,9 +11,6 @@
/* Where to put l10n data */
#undef MUTTLOCALEDIR
/* Where to put other shared data */
#undef SHAREDIR
/* Enable debugging info */
#define DEBUG
......
This diff is collapsed.
......@@ -343,7 +343,6 @@ AC_ARG_WITH(sharedir, [ --with-sharedir=PATH specify where to put arch in
sharedir=$mutt_cv_sharedir
AC_SUBST(sharedir)
AC_DEFINE_UNQUOTED(SHAREDIR, "$mutt_cv_sharedir")
AC_ARG_WITH(docdir, [ --with-docdir=PATH specify where to put the documentation],
[mutt_cv_docdir=$withval],
......@@ -360,7 +359,6 @@ AC_ARG_WITH(docdir, [ --with-docdir=PATH specify where to put the documen
docdir=$mutt_cv_docdir
AC_SUBST(docdir)
if test x$mutt_cv_setgid = xyes; then
DOTLOCK_GROUP='mail'
DOTLOCK_PERMISSION=2755
......@@ -447,4 +445,4 @@ MUTTLOCALEDIR=$mutt_cv_prefix/$DATADIRNAME/locale
AC_SUBST(MUTTLOCALEDIR)
AC_DEFINE_UNQUOTED(MUTTLOCALEDIR, "$MUTTLOCALEDIR")
AC_OUTPUT(Makefile intl/Makefile po/Makefile.in rx/Makefile Muttrc doc/Makefile doc/dotlock.man doc/mutt.man charsets/Makefile contrib/Makefile)
AC_OUTPUT(Makefile intl/Makefile po/Makefile.in rx/Makefile Muttrc doc/Makefile doc/manual.sgml doc/dotlock.man doc/mutt.man charsets/Makefile contrib/Makefile)
......@@ -25,7 +25,7 @@ subdir = doc
DISTFILES = Makefile.in dotlock.man.in \
manual.sgml mutt.man.in \
manual.sgml.in mutt.man.in \
PGP-Notes.txt \
applying-patches.txt \
devel-notes.txt \
......@@ -85,7 +85,7 @@ manual.html: manual.sgml
sgml2html manual
clean:
rm -f *~ *.html *.orig *.rej *.man
rm -f *~ *.html *.orig *.rej *.man manual.sgml
clean-real:
rm -f manual.txt
......@@ -107,6 +107,10 @@ dotlock.man: dotlock.man.in ../config.status
cd .. \
&& CONFIG_FILES=$(subdir)/[email protected] CONFIG_HEADERS= $(SHELL) ./config.status
manual.sgml: manual.sgml.in ../config.status
cd .. \
&& CONFIG_FILES=$(subdir)/[email protected] CONFIG_HEADERS= $(SHELL) ./config.status
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: Makefile $(DISTFILES)
for file in $(DISTFILES) ; do \
......
......@@ -540,12 +540,14 @@ suit your own tastes. When Mutt is first invoked, it will attempt to
read the ``system'' configuration file (defaults set by your local
system administrator), unless the ``-n'' <ref id="commandline"
name="command line"> option is specified. This file is typically
<tt>/usr/local/share/Muttrc</tt> or <tt>/usr/local/lib/Muttrc</tt>.
If your home directory has a subdirectory named <tt/.mutt/, mutt
will next look for a file named <tt>.mutt/muttrc</tt>. Otherwise, it
looks for a file in your home directory named <tt/.muttrc/. In this
file is where you place <ref id="commands" name="commands"> to
configure Mutt.
<tt>@[email protected]/Muttrc</tt> or <tt>@[email protected]/Muttrc</tt>. Mutt
will next look for a file named <tt>.muttrc</tt> in your home
directory. If this file does not exist and your home directory has
a subdirectory named <tt/.mutt/, mutt try to load a file named
<tt>.mutt/muttrc</tt>.
<tt>.muttrc</tt> is the file where you will usually place your <ref
id="commands" name="commands"> to configure Mutt.
In addition, mutt supports version specific configuration files that are
parsed instead of the default files as explained above. For instance, if
......@@ -1871,9 +1873,8 @@ can be changed with the <tt/edit-description/ command (default: d).
<p>
When you add an attachment to your mail message, Mutt searches your
personal mime.types file at <tt>&dollar;{HOME}/.mime.types</tt>, and then
the system mime.types file at <tt>SHAREDIR/mime.types</tt>.
<tt/SHAREDIR/ is defined at compilation time, and can be determined
by typing <tt/mutt -v/ from the command line.
the system mime.types file at <tt>@[email protected]/mime.types</tt> or
<tt>@[email protected]/mime.types</tt>
The mime.types file consist of lines containing a MIME type and a space
separated list of extensions. For example:
......@@ -1910,10 +1911,9 @@ internally, Mutt parses a series of external configuration files to
find an external handler. The default search string for these files
is a colon delimited list set to
<tscreen><verb>
${HOME}/.mailcap:SHAREDIR/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
${HOME}/.mailcap:@[email protected]/mailcap:@[email protected]/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
</verb></tscreen>
where <tt/&dollar;HOME/ is your home directory and <tt/SHAREDIR/ is the
shared directory defined at compile time (visible from <tt/mutt -v/).
where <tt/&dollar;HOME/ is your home directory.
In particular, the metamail distribution will install a mailcap file,
usually as <tt>/usr/local/etc/mailcap</tt>, which contains some baseline
......
......@@ -1569,7 +1569,7 @@ void mutt_init (int skip_sys_rc, LIST *commands)
else
{
/* Default search path from RFC1524 */
MailcapPath = safe_strdup ("~/.mailcap:" SHAREDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
MailcapPath = safe_strdup ("~/.mailcap:" SHAREDIR "/mailcap:" SYSCONFDIR "/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap");
}
Tempdir = safe_strdup ((p = getenv ("TMPDIR")) ? p : "/tmp");
......@@ -1661,17 +1661,14 @@ void mutt_init (int skip_sys_rc, LIST *commands)
if (!Muttrc)
{
snprintf (buffer, sizeof(buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION);
if (access(buffer, F_OK) == -1)
snprintf (buffer, sizeof(buffer), "%s/.muttrc", NONULL(Homedir));
if (access(buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc-%s", NONULL(Homedir), MUTT_VERSION);
if (access(buffer, F_OK) == -1)
{
snprintf (buffer, sizeof (buffer), "%s/.muttrc-%s", NONULL(Homedir), MUTT_VERSION);
if (access (buffer, F_OK) == -1)
{
snprintf (buffer, sizeof (buffer), "%s/.mutt/muttrc", NONULL(Homedir));
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/.muttrc", NONULL(Homedir));
}
}
default_rc = 1;
Muttrc = safe_strdup (buffer);
}
......@@ -1689,6 +1686,10 @@ void mutt_init (int skip_sys_rc, LIST *commands)
requested not to via "-n". */
if (!skip_sys_rc)
{
snprintf (buffer, sizeof(buffer), "%s/Muttrc-%s", SYSCONFDIR, MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof(buffer), "%s/Muttrc", SYSCONFDIR);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/Muttrc-%s", SHAREDIR, MUTT_VERSION);
if (access (buffer, F_OK) == -1)
snprintf (buffer, sizeof (buffer), "%s/Muttrc", SHAREDIR);
......
......@@ -252,6 +252,7 @@ static void show_version (void)
printf ("SENDMAIL=\"%s\"\n", SENDMAIL);
printf ("MAILPATH=\"%s\"\n", MAILPATH);
printf ("SHAREDIR=\"%s\"\n", SHAREDIR);
printf ("SYSCONFDIR=\"%s\"\n", SYSCONFDIR);
#ifdef ISPELL
printf ("ISPELL=\"%s\"\n", ISPELL);
......
......@@ -589,7 +589,7 @@ static int lookup_mime_type (char *d, const char *s)
cur_sze = 0;
szf = strlen (s);
for (count = 0 ; count < 2 ; count++)
for (count = 0 ; count < 3 ; count++)
{
/*
* can't use strtok() because we use it in an inner loop below, so use
......@@ -601,6 +601,9 @@ static int lookup_mime_type (char *d, const char *s)
snprintf (buf, sizeof (buf), "%s/.mime.types", NONULL(Homedir));
break;
case 1:
strfcpy (buf, SYSCONFDIR"/mime.types", sizeof(buf));
break;
case 2:
strfcpy (buf, SHAREDIR"/mime.types", sizeof (buf));
break;
default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment