aboutsummaryrefslogtreecommitdiff
path: root/docs/rocks_repositories.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/rocks_repositories.md')
-rw-r--r--docs/rocks_repositories.md54
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
3For normal use, rocks repositories are manipulated by the `luarocks`
4command-line tool. LuaRocks fetches rocks from one kind of repository -- rocks
5servers -- and installs them into another kind of repository -- rocks trees.
6
7Generally speaking, a rocks repository is a directory containing rocks and/or
8rockspecs, and a manifest file which catalogs the rocks contained therein.
9Rocks servers may contain [packed rocks](types_of_rocks.md) and rockspecs, and
10may be located in remote (HTTP or FTP) URLs or paths in the local filesystem.
11Rocks trees can contain only [unpacked](types_of_rocks.md) (installed) rocks,
12and are always local.
13
14LuaRocks can be configured to use multiple rocks trees and multiple rocks
15servers. See the [Config file format](config_file_format.md) for details and
16the reference for the [luarocks](luarocks.md) command-line tool for details.
17
18Publishing a repository as a rocks server consists of making a directory
19containing rocks and a manifest file available online. A manifest file can be
20created using the make-manifest command of the `luarocks-admin` command-line
21tool, included in LuaRocks. For the rocks tree, the manifest file is updated
22automatically by LuaRocks.
23
24# Rocktree structure
25
26A 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
43Whenever LuaRocks installs a rock it will install them (the executable parts)
44in the deployment directories. These directories should be included in your
45system path, `LUA_PATH`, and `LUA_CPATH` to be able to
46`require` the modules from your own scripts or use the command line
47scripts from a prompt. Other included elements (see `copy_directories`
48in rockspec), including the manifest and rockspecs, will be stored in the
49`base/lib/luarocks/rocks`.
50
51When multiple versions of the same rock are being installed, the older ones in
52the deployment directories will be renamed to a name including the version.
53The `luarocks.loader` module will be able to load the proper version of
54the modules despite the changed names.