diff options
Diffstat (limited to 'docs/installation_instructions_for_unix.md')
-rw-r--r-- | docs/installation_instructions_for_unix.md | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/docs/installation_instructions_for_unix.md b/docs/installation_instructions_for_unix.md new file mode 100644 index 00000000..79afc64e --- /dev/null +++ b/docs/installation_instructions_for_unix.md | |||
@@ -0,0 +1,140 @@ | |||
1 | # Installation instructions for Unix | ||
2 | |||
3 | First of all, get the [latest ".tar.gz" package | ||
4 | here](http://luarocks.github.io/luarocks/releases). | ||
5 | |||
6 | The LuaRocks build system for Unix is based on a simple "configure" script and | ||
7 | a Makefile. The "configure" script offers some flags that are useful for | ||
8 | different models of use of LuaRocks. Run `./configure --help` for details. | ||
9 | |||
10 | ## Quick start | ||
11 | |||
12 | To get a default installation of Lua and LuaRocks under `/usr/local`: | ||
13 | |||
14 | First, ensure that you have development tools installed on your system, | ||
15 | otherwise run the command below to install them. | ||
16 | |||
17 | For Ubuntu/Debian systems, this should do it: | ||
18 | |||
19 | ``` | ||
20 | -$ sudo apt install build-essential libreadline-dev unzip | ||
21 | ``` | ||
22 | |||
23 | For Yum-based distributions, try this: | ||
24 | |||
25 | ``` | ||
26 | -$ sudo yum install libtermcap-devel ncurses-devel libevent-devel readline-devel | ||
27 | ``` | ||
28 | |||
29 | Then, to build and install Lua, either install it using your package | ||
30 | manager of choice, or run the following commands to download the | ||
31 | package tarball, extract, build and install it. (Replace 5.3.5 with the | ||
32 | latest Lua version.) | ||
33 | |||
34 | ``` | ||
35 | -$ curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz | ||
36 | -$ tar -zxf lua-5.3.5.tar.gz | ||
37 | -$ cd lua-5.3.5 | ||
38 | -$ make linux test | ||
39 | -$ sudo make install | ||
40 | ``` | ||
41 | |||
42 | Once Lua and its dependencies are installed, it is time to install LuaRocks: | ||
43 | |||
44 | * Download and unpack [latest ".tar.gz" file](http://luarocks.github.io/luarocks/releases). | ||
45 | |||
46 | * Run `./configure --with-lua-include=/usr/local/include`. (This will attempt | ||
47 | to detect your installation of Lua. If you get any error messages, see the | ||
48 | section [Customizing your settings](#customizing-your-settings), below.) | ||
49 | |||
50 | * Run `make`. | ||
51 | |||
52 | * As superuser, run `make install`. | ||
53 | |||
54 | Installation should be done! Run `luarocks` with no arguments to | ||
55 | see a summary of your settings. | ||
56 | |||
57 | This should be sufficient. For more information and installation options, read on. | ||
58 | |||
59 | ## The default settings | ||
60 | |||
61 | The default settings are suitable for installing LuaRocks globally in your | ||
62 | system while allowing both system-wide and per-user sets of rocks. User | ||
63 | accounts will be able to install their own rocks in their $HOME directory, and | ||
64 | the superuser can install rocks that will be available for everyone. | ||
65 | |||
66 | By default LuaRocks will install itself in `/usr/local`, like Lua, and will | ||
67 | use `/usr/local/etc/luarocks/config.lua` as a default path for the | ||
68 | configuration file. The default system-wide rocks trees is configured as | ||
69 | `/usr/local/lib/luarocks`, and per-user rocks install at | ||
70 | `$HOME/.luarocks/rocks/`. Command-line scripts provided by rocks will be | ||
71 | installed in `/usr/local/lib/luarocks/bin/` or `$HOME/.luarocks/bin/`, | ||
72 | respectively. The user may then add these directories to their `$PATH` | ||
73 | variable. | ||
74 | |||
75 | ## Customizing your settings | ||
76 | |||
77 | All paths described above can be overridden with flags in the `configure` | ||
78 | script, or entries in the configuration file. These are the supported flags, | ||
79 | as presented by the `--help` option: | ||
80 | |||
81 | ``` | ||
82 | Installation directories: | ||
83 | --prefix=PREFIX Directory where LuaRocks should be installed, | ||
84 | Default is '/usr/local' | ||
85 | |||
86 | By default, `make install' will install all the files in `/usr/local', | ||
87 | `/usr/local/lib' etc. You can specify an installation prefix other than | ||
88 | `/usr/local/' using `--prefix', for instance `--prefix=$HOME'. | ||
89 | |||
90 | For better control, use the options below. | ||
91 | |||
92 | Fine tuning of the installation directories: | ||
93 | --sysconfdir=SYSCONFDIR Directory for single-machine config. | ||
94 | Default is PREFIX/etc | ||
95 | |||
96 | Where to install files provided by rocks: | ||
97 | --rocks-tree=DIR Root of the local tree of installed rocks. | ||
98 | To make files installed in this location | ||
99 | accessible to Lua and your $PATH, see | ||
100 | "luarocks path --help" after installation. | ||
101 | Avoid using paths controlled by your | ||
102 | system's package manager, such as /usr. | ||
103 | - Default is PREFIX | ||
104 | |||
105 | Where is your Lua interpreter: | ||
106 | --lua-version=VERSION Use specific Lua version: 5.1, 5.2, 5.3, or 5.4 | ||
107 | - Default is auto-detected. | ||
108 | --with-lua-bin=LUA_BINDIR Location of your Lua binar(y/ies). | ||
109 | - Default is the directory of the | ||
110 | auto-detected Lua interpreter, | ||
111 | (or DIR/bin if --with-lua is used) | ||
112 | --with-lua=LUA_DIR Use Lua from given directory. Default is LUA_BINDIR/.. | ||
113 | --with-lua-include=DIR Lua's includes dir. Default is LUA_DIR/include | ||
114 | --with-lua-lib=DIR Lua's libraries dir. Default is LUA_DIR/lib | ||
115 | --with-lua-interpreter=NAME Lua interpreter name. | ||
116 | - Default is to auto-detected | ||
117 | |||
118 | For specialized uses of LuaRocks: | ||
119 | --force-config Force using a single config location. | ||
120 | Do not honor the $LUAROCKS_CONFIG_5_x | ||
121 | or $LUAROCKS_CONFIG environment | ||
122 | variable or the user's local config. | ||
123 | Useful to avoid conflicts when LuaRocks | ||
124 | is embedded within an application. | ||
125 | --disable-incdir-check If you do not wish to use "luarocks build", | ||
126 | (e.g. when only deploying binary packages) | ||
127 | you do not need lua.h installed. This flag | ||
128 | skips the check for lua.h in "configure". | ||
129 | |||
130 | ``` | ||
131 | |||
132 | After installation, a default config file called config.lua will be installed | ||
133 | at the directory defined by `--sysconfdir`. For further configuration of | ||
134 | LuaRocks paths, see the [Config file format](config_file_format.md). | ||
135 | |||
136 | ## Next steps | ||
137 | |||
138 | Once LuaRocks is installed, learn more about [using LuaRocks](using_luarocks.md). | ||
139 | |||
140 | |||