Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Apr 2011 17:58:18 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Michael =?ISO-8859-1?Q?Gr=FCnewald?= <michaelgrunewald@yahoo.fr>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: Place to install library of shell functions
Message-ID:  <20110405175818.4681d6f5.freebsd@edvax.de>
In-Reply-To: <4D9B3403.2070704@yahoo.fr>
References:  <4D9B3403.2070704@yahoo.fr>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Tue, 05 Apr 2011 17:23:47 +0200, Michael Gr=FCnewald <michaelgrunewald@y=
ahoo.fr> wrote:
> Dear FreeBSD users,
>=20
>=20
> today I come to you with what seems to be somehow pedantic question: =20
> where is the best place to install libraries of shell functions.

Depends. Are you interested in shell functions you install
from a port / package, or your own shell functions?



> I read hier(4) carefully and it seems the correct place for this would=20
> be somewhere under `/usr/local/share':
>=20
>                  share/    architecture-independent files

This structure usually serves the purpose of /usr/share,
but for software installed by ports or packages, as the
/usr/local/ subtree "duplicates" the system's structures
in many cases.



> On the base systems, many macros (make templates and groff macros) are=20
> actually installed under /usr/share.  However, the only library of shell=
=20
> functions I am aware of is `/etc/rc.subr', that landed on this funny=20
> location, probably to be pretty sure that this library is on the same=20
> filesystem as the scripts under /etc/rc.d.

I guess that's the intention behind this decision. You'll
see that many things on FreeBSD are determined by a well-
intended thought, rather than an arbitrary "Oh, why don't
we just put it ... *throw a dice* ... here?"



> Several of the ports install shell scripts under `/usr/local/lib' that=20
> hier(4) devotes to  ``shared and archive ar(1)-type libraries''.  These=20
> shell scripts are:
>=20
>  > find /usr/local/lib -name '*.sh'
> /usr/local/lib/tk8.5/tkConfig.sh
> /usr/local/lib/seamonkey/run-mozilla.sh
> /usr/local/lib/libxul/run-mozilla.sh
> /usr/local/lib/rpm/convertrpmrc.sh
> /usr/local/lib/rpm/find-lang.sh
> /usr/local/lib/rpm/getpo.sh
> /usr/local/lib/rpm/u_pkg.sh
> /usr/local/lib/rpm/vpkg-provides.sh
> /usr/local/lib/rpm/vpkg-provides2.sh
> /usr/local/lib/firefox/run-mozilla.sh
> /usr/local/lib/tcl8.5/tclConfig.sh
> /usr/local/lib/thunderbird/run-mozilla.sh
> /usr/local/lib/llvm-gcc-2.8/gcc/x86_64-portbld-freebsd8.2/4.2.1/install-t=
ools/fixinc.sh
>=20
> Two files (the `/usr/local/lib/tcl8.5/tclConfig.sh' one and the=20
> `s/tcl/tk/g' one) are actually shell script libraries (defining a bunch=20
> of variables), and all the others are ancillary scripts, that would=20
> maybe better fit in `/usr/local/libexec'.

It depends on where the respective port maintainer want to
have them.



> So, practical experience does not really second my a priori that these=20
> files sould go under the `share' hierarchy and I would like to have your=
=20
> opinion on this question.

Many software is ported from Linux, so their structures,
or sometimes the lack of, is applied.

For example, I put _my_ stuff that is NOT managed by ports and
definitely does NOT belong to the system into an /opt subtree,
a Solaris-ism I'm "abusing": /opt/bin is in $PATH, so anything
system-wide executable is located there, and /opt/share
does contain non-executable shell scripts (e. g. those with
helper functionalities) or files with settings (that are
sourced by something else) - things that usually are not
called directly.




--=20
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20110405175818.4681d6f5.freebsd>