Discussion:
BUG REPORT tin 1.9.6 release 20101126 ("Burnside") [UNIX]
Urs Janßen
2011-08-08 15:39:06 UTC
Permalink
Concerning the configure options, I wonder why the default for
--with-defaults-dir is /etc/tin and not the directory where
tin.defaults was installed ($sysconfdir/etc/tin). This is quite
inconsistent and suppose this is a bug.
--with-defaults-dir is documented as defaulting to /etc/tin and not to
$sysconfdir/tin or whatever so I can't see a bug here.
Yes, the behavior follows the documentation, but what I mean
is why --with-defaults-dir defaults to /etc/tin and not to
$sysconfdir/etc/tin? I don't see any reason to install the
that would default to /usr/local/etc/etc/tin
defaults somewhere and read them in another place! Of course
installation is done to

$(DESTDIR)$(INS_SYSDEF_DIR)

choosen by --with-install-prefix (=DESTDIR) (defaults to /)
and --with-defaults-dir= (INS_SYSDEF_DIR) (defaults to /etc/tin/)
so the full default is /etc/tin/

but you are right there is a bug in configure.in as it sets
TIN_DEFAULTS_DIR (the place which is used for reading the defaults file)
just to INS_SYSDEF_DIR, not to DESTDIR/INS_SYSDEF_DIR, but uses
$(DESTDIR)$(INS_SYSDEF_DIR) for initiall installation. that's a bug, but I'm
currently unsure how to fix this.

inm short src:Makefile.in uses:

DESTDIR = @DESTDIR@
INS_SYSDEF_DIR = @TIN_DEFAULTS_DIR@
$(INSTALL) -m 644 $(DOCDIR)/tin.defaults $(DESTDIR)$(INS_SYSDEF_DIR)/tin.defaults

but include/autoconf.hin has

# undef TIN_DEFAULTS_DIR

and the configure macro used is

CF_WITH_PATH(defaults-dir,
[ --with-defaults-dir=PATH
directory containing tin.defaults file
],
TIN_DEFAULTS_DIR,/etc/tin)
AC_DEFINE_UNQUOTED(TIN_DEFAULTS_DIR,"$TIN_DEFAULTS_DIR")

tin.h has:

#ifdef TIN_DEFAULTS_DIR
# define TIN_DEFAULTS TIN_DEFAULTS_DIR,TIN_DEFAULTS_BUILTIN
#endif

and init.c:read_site_config() tries to open each path given in
TIN_DEFAULTS"/tin.defaults" and stops after the first match.

- removing $(DESTDIR) from Mailefile.in would break --with-install-prefix.
- prepending $(DESTDIR) to the value of TIN_DEFAULTS_DIR in the configure
macro would require remvoibng the $(DESTDIR) prefix from the makefile rule
which makes things less understandable

looks like we have to do something like:
define DESTDIR in autoconf.h[in] and prepend it tin.h like
#define TIN_DEFAULTS DESTDIR##TIN_DEFAULTS_DIR,TIN_DEFAULTS_BUILTIN

BTW IIRC --with-install-prefix was introduced before
AC_PREFIX_DEFAULT(/usr/local) was added to configure.in
and nobody cleaned that up (i.e. use --prefix instead).
the current solution is to use --with-defaults-dir too, but
I find this behavior very unintuitive and it is easy to miss
this second configure option. So, I'm just suggesting that
the behavior and the documentation be changed to the default
$sysconfdir/etc/tin.
as stated above that would lead to /usr/local/etc/etc/tin, so if we are
going to do such a change that should be ${sysconfdir}"/tin"
FYI, one uses a different prefix for MacPorts software to avoid
conflicts with software from the vendor (Apple). As both kinds
of software (having different versions) are installed in parallel,
one needs a different place for configuration files.
something like this

--prefix=/foo/ \
--with-defaults-dir=/foo/etc/tin/

without giving --with-install-prefix might solve your problem, but indeed
isn't very intuitive.

urs
--
"Only whimps use tape backup: _real_ men just upload their important stuff
on ftp, and let the rest of the world mirror it ;)" - Linus
Urs Janßen
2011-08-09 10:04:57 UTC
Permalink
Post by Urs Janßen
Yes, the behavior follows the documentation, but what I mean
is why --with-defaults-dir defaults to /etc/tin and not to
$sysconfdir/etc/tin? I don't see any reason to install the
that would default to /usr/local/etc/etc/tin
and even if --with-defaults-dir would expand to $sysconfdir"/tin"
that would be a big change as that expands to
/usr/local/etc/tin when no --prefix or --sysconfdir is given and that is a
totally different location as it were in the past, so the change is not
backward compatible.

we might change that someday, but as tin 2.0 will be released within the
next few weeks and this is a "big" chnage this won't happen in the near
future.
Post by Urs Janßen
installation is done to
$(DESTDIR)$(INS_SYSDEF_DIR)
choosen by --with-install-prefix (=DESTDIR) (defaults to /)
and --with-defaults-dir= (INS_SYSDEF_DIR) (defaults to /etc/tin/)
so the full default is /etc/tin/
but you are right there is a bug in configure.in as it sets
TIN_DEFAULTS_DIR (the place which is used for reading the defaults file)
just to INS_SYSDEF_DIR, not to DESTDIR/INS_SYSDEF_DIR, but uses
$(DESTDIR)$(INS_SYSDEF_DIR) for initiall installation. that's a bug
after discussing this with Thomas Dickey who introduced that special
switch (--with-install-prefix), he said that the current bahavior is as
expected ($DESTDIR) just prefixes the installation is not ment to be
evaluated by the resulting binary. this is used to installations into path
where it should not be executed but used as binaries source for building
packages (which lateron do not go into $DESTDIR prefixed locations).

urs
--
"Only whimps use tape backup: _real_ men just upload their important stuff
on ftp, and let the rest of the world mirror it ;)" - Linus
Loading...