[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper location to install shell function libraries?

From: Nick Bowler
Subject: Re: Proper location to install shell function libraries?
Date: Wed, 1 Mar 2017 11:13:18 -0500


On 3/1/17, Andreas Kusalananda Kähäri <address@hidden> wrote:
> The scripts make use of a common set of shell functions, defined in
> their own file.  This is currently sourced like this:
>     prefix="@prefix@"
>     exec_prefix="@exec_prefix@"
>     . "@libexecdir@/toolbox.shlib"
> Then, in the file, I have a line like
>     AC_CONFIG_FILES([src/script], [chmod +x src/script])
> for each script, so that it's generated from the corresponding
> file upon running configure.
> My query is this: Would libexecdir be the best place to put a file that
> is architecture dependent, but *not* meant to be executed separatedly
> (it's a library).  Or should it actually be stored under libdir (which
> I've never seen done with a shell library of functions)?

Seems fine.  If you are installing more than one file (or think you
might do so in the future) I suggest putting them in a subdirectory
thereof -- if you use Automake then this will define the pkglibexecdir
variable by default to install files into a subdirectory with the
same name as your package.

The definition of these install variables comes from the GNU Coding
Standards[1].  You mention the installed scripts are machine-dependent
so they should be installed in either libdir or libexecdir.  GCS says:

  "libexecdir: The directory for installing executable programs to be
               run by other programs rather than by users  ..."

  "libdir:     The directory for object files and libraries of object
               code ..."

Which doesn't really help us decide where to install non-executable
machine-dependent shell fragments.  Based on this information alone,
libexecdir seems like a reasonable choice.  However, looking at what
packages installed on my computer do, libdir seems to be much more
commonly used.  So I'd say do whatever you prefer.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]