From owner-freebsd-questions@FreeBSD.ORG Tue Apr 5 15:58:21 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 210E51065676 for ; Tue, 5 Apr 2011 15:58:21 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id C12188FC13 for ; Tue, 5 Apr 2011 15:58:20 +0000 (UTC) Received: from r55.edvax.de (port-92-195-71-79.dynamic.qsc.de [92.195.71.79]) by mx02.qsc.de (Postfix) with ESMTP id 4DBD51DA7D; Tue, 5 Apr 2011 17:58:19 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p35FwIGe001595; Tue, 5 Apr 2011 17:58:18 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 5 Apr 2011 17:58:18 +0200 From: Polytropon To: Michael =?ISO-8859-1?Q?Gr=FCnewald?= Message-Id: <20110405175818.4681d6f5.freebsd@edvax.de> In-Reply-To: <4D9B3403.2070704@yahoo.fr> References: <4D9B3403.2070704@yahoo.fr> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD questions Subject: Re: Place to install library of shell functions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 15:58:21 -0000 On Tue, 05 Apr 2011 17:23:47 +0200, Michael Gr=FCnewald 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, ...