aboutsummaryrefslogtreecommitdiff
path: root/docs/installation_instructions_for_unix.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/installation_instructions_for_unix.md')
-rw-r--r--docs/installation_instructions_for_unix.md140
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
3First of all, get the [latest ".tar.gz" package
4here](http://luarocks.github.io/luarocks/releases).
5
6The LuaRocks build system for Unix is based on a simple "configure" script and
7a Makefile. The "configure" script offers some flags that are useful for
8different models of use of LuaRocks. Run `./configure --help` for details.
9
10## Quick start
11
12To get a default installation of Lua and LuaRocks under `/usr/local`:
13
14First, ensure that you have development tools installed on your system,
15otherwise run the command below to install them.
16
17For Ubuntu/Debian systems, this should do it:
18
19```
20-$ sudo apt install build-essential libreadline-dev unzip
21```
22
23For Yum-based distributions, try this:
24
25```
26-$ sudo yum install libtermcap-devel ncurses-devel libevent-devel readline-devel
27```
28
29Then, to build and install Lua, either install it using your package
30manager of choice, or run the following commands to download the
31package tarball, extract, build and install it. (Replace 5.3.5 with the
32latest 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
42Once 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
54Installation should be done! Run `luarocks` with no arguments to
55see a summary of your settings.
56
57This should be sufficient. For more information and installation options, read on.
58
59## The default settings
60
61The default settings are suitable for installing LuaRocks globally in your
62system while allowing both system-wide and per-user sets of rocks. User
63accounts will be able to install their own rocks in their $HOME directory, and
64the superuser can install rocks that will be available for everyone.
65
66By default LuaRocks will install itself in `/usr/local`, like Lua, and will
67use `/usr/local/etc/luarocks/config.lua` as a default path for the
68configuration 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
71installed in `/usr/local/lib/luarocks/bin/` or `$HOME/.luarocks/bin/`,
72respectively. The user may then add these directories to their `$PATH`
73variable.
74
75## Customizing your settings
76
77All paths described above can be overridden with flags in the `configure`
78script, or entries in the configuration file. These are the supported flags,
79as presented by the `--help` option:
80
81```
82Installation directories:
83 --prefix=PREFIX Directory where LuaRocks should be installed,
84 Default is '/usr/local'
85
86By 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
90For better control, use the options below.
91
92Fine tuning of the installation directories:
93 --sysconfdir=SYSCONFDIR Directory for single-machine config.
94 Default is PREFIX/etc
95
96Where 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
105Where 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
118For 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
132After installation, a default config file called config.lua will be installed
133at the directory defined by `--sysconfdir`. For further configuration of
134LuaRocks paths, see the [Config file format](config_file_format.md).
135
136## Next steps
137
138Once LuaRocks is installed, learn more about [using LuaRocks](using_luarocks.md).
139
140