[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Installing and locating scripts
- From: Enrico Tassi <gares@...>
- Date: Mon, 4 Mar 2013 09:28:23 +0100
On Sun, Mar 03, 2013 at 05:36:17PM -0500, Rena wrote:
> I'm also not sure what is the best practice when it comes to
> installing a program that consists of several files (the main
> executable and several sub-scripts it includes) on a Linux system.
> With a compiled language you can split your source code into as many
> files as you like and still produce a single compiled binary, but with
> Lua all those individual files *are* your "binary".
>
> Should I just install the main script in the usual place
> (/usr/local/bin or /usr/bin), the additional scripts in some other
> standard place (/usr[/local]/share/appname/?), and have it try to find
> them in those standard places? Or is there a better way to handle
> this?
On Linux systems your installation scripts should target the /usr/local/
hierarchy. The standard Lua interpreter already looks in
/usr/local/share/lua/5.1/ for .lua file, and /usr/local/bin is likely to
be in your $PATH. If unsure just print package.path (and package.cpath
if you have extra .so) from Lua. The require function uses these
variables to find .lua files.
The /usr/ hierarchy (without local/) is for package managers, so the
only legitimate way to install things in there is by making a package
for your package manager (like a .deb or a .rpm).
cheers
--
Enrico Tassi