diff options
Diffstat (limited to 'docs/rocks_repositories.md')
-rw-r--r-- | docs/rocks_repositories.md | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/docs/rocks_repositories.md b/docs/rocks_repositories.md new file mode 100644 index 00000000..6e0f38cb --- /dev/null +++ b/docs/rocks_repositories.md | |||
@@ -0,0 +1,54 @@ | |||
1 | # Rocks repositories | ||
2 | |||
3 | For normal use, rocks repositories are manipulated by the `luarocks` | ||
4 | command-line tool. LuaRocks fetches rocks from one kind of repository -- rocks | ||
5 | servers -- and installs them into another kind of repository -- rocks trees. | ||
6 | |||
7 | Generally speaking, a rocks repository is a directory containing rocks and/or | ||
8 | rockspecs, and a manifest file which catalogs the rocks contained therein. | ||
9 | Rocks servers may contain [packed rocks](types_of_rocks.md) and rockspecs, and | ||
10 | may be located in remote (HTTP or FTP) URLs or paths in the local filesystem. | ||
11 | Rocks trees can contain only [unpacked](types_of_rocks.md) (installed) rocks, | ||
12 | and are always local. | ||
13 | |||
14 | LuaRocks can be configured to use multiple rocks trees and multiple rocks | ||
15 | servers. See the [Config file format](config_file_format.md) for details and | ||
16 | the reference for the [luarocks](luarocks.md) command-line tool for details. | ||
17 | |||
18 | Publishing a repository as a rocks server consists of making a directory | ||
19 | containing rocks and a manifest file available online. A manifest file can be | ||
20 | created using the make-manifest command of the `luarocks-admin` command-line | ||
21 | tool, included in LuaRocks. For the rocks tree, the manifest file is updated | ||
22 | automatically by LuaRocks. | ||
23 | |||
24 | # Rocktree structure | ||
25 | |||
26 | A rocks tree has this (default) layout; | ||
27 | |||
28 | ``` | ||
29 | {base} (base rocks tree directory) | ||
30 | ├── bin (deployment of command line scripts) | ||
31 | ├── lib | ||
32 | │ ├── luarocks | ||
33 | │ │ └── rocks (contains manifest and sub-dirs with rocks) | ||
34 | │ │ | ||
35 | │ └── lua | ||
36 | │ └── 5.1 (deployment of binary modules) | ||
37 | │ | ||
38 | └── share | ||
39 | └── lua | ||
40 | └── 5.1 (deployment of Lua modules) | ||
41 | ``` | ||
42 | |||
43 | Whenever LuaRocks installs a rock it will install them (the executable parts) | ||
44 | in the deployment directories. These directories should be included in your | ||
45 | system path, `LUA_PATH`, and `LUA_CPATH` to be able to | ||
46 | `require` the modules from your own scripts or use the command line | ||
47 | scripts from a prompt. Other included elements (see `copy_directories` | ||
48 | in rockspec), including the manifest and rockspecs, will be stored in the | ||
49 | `base/lib/luarocks/rocks`. | ||
50 | |||
51 | When multiple versions of the same rock are being installed, the older ones in | ||
52 | the deployment directories will be renamed to a name including the version. | ||
53 | The `luarocks.loader` module will be able to load the proper version of | ||
54 | the modules despite the changed names. | ||