Re: libexecdir - helper scripts
Bill Moseley <moseley@hank.org> writes:
> On Tue, May 20, 2003 at 06:54:45PM +0100, Roger Leigh wrote:
> > moseley@hank.org writes:
>
> > > libexecdir='${exec_prefix}/lib/${PACKAGE}'
> >
> > That's evil. The whole point of configure is to have install
> > locations standardised, and changing the defaults is never, ever,
> > a good idea.
>
> The problem was the standard was ${exec_prefix}/libexec. Since I
> run debian and I don't have /usr/libexec (or /usr/local/libexec) it
> just wasn't standard in my world ;). My reading for FHS 4.7.1
> seemed like /usr/lib is what I wanted.
True, but I presume you want it to be portable, and work on
distributions other than Debian, and OSes other than GNU/Linux.
> I also remember searching google about libexecdir and finding mostly
> heated discussion about libexecdir. In the end I was just more
> comfortable with the Debian location.
As the author, that's your decision, but configure/automake are
supposed to let users decide where things go. You should always use
the autoconf defaults unless there is a compelling reason. In this
case, you are making it default to Debian-specific settings. As
Debian is a special case in this respect, and you can easily alter it
in debian/rules, I'd not do this myself.
> I discussed this on the autoconf list and it was suggested we do in
> cofigure.in:
>
> AC_MSG_NOTICE([Setting libexecdir to \${exec_prefix}/lib/${PACKAGE}])
>
> but again, that only happens if --libexecdir is *not* passed to
> configure.
If you do do this, that's a good plan (though I don't recommend it).
> Is there plan in Debian to use the "standard" /usr/libexec in the
> future?
I'm not sure. The Hurd port already uses it; as for Linux ports, I
don't think it will in the near future, though I'd certainly like it
to be introduced in the medium term.
> > In debian/rules, just use ./configure --libexecdir=\$\{prefix\}/lib to
> > redefine it.
>
> Can it be a dir within that?
>
> --libexecdir=\$\{prefix\}/lib/swish-e
It can be whatever you like, but there's an easier approach (see
below)
> I'd rather not clutter /usr/lib.
There's an easier way. In your Makefile.am, just do this:
pkglibexecdir = $(libexecdir)/$(PACKAGE)
and then
pkglibexec_PROGRAMS = foo
foo_SOURCES = foo.c foo.h bar.c bar.h
or
pkglibexec_SCRIPTS = foo
Now when you use --libexecdir=\$\{exec_prefix\}/lib, your directory will
become $(exec_prefix)/lib/$(PACKAGE). You can use plain $prefix
instead of $exec_prefix, but $exec_prefix is technically correct, and
usually they are the same.
> Is there a reason why it can't be hard-coded in debian/rules?
>
> ./configure --prefix=/usr --libexecdir=/usr/lib/swish-e
Do as I suggest above, and then in debian/rules, do
./configure --prefix=/usr --libexecdir=\$${exec_prefix}/lib
(In this case, $exec_prefix == $prefix)
This keeps the configury stuff nice and generic, and you can still
customise it as you wish. Better still, it works exactly as people
will expect it to.
HTH,
Roger
--
Roger Leigh
Printing on GNU/Linux? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848 available on public keyservers
Reply to: