1 # Build recipe for luarocks.
3 # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
4 # Copyright (c) 2020-2022 Matias Fonzo, <selk@dragora.org>.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # Exit immediately on any error
26 # Define major version for Lua release
29 # Define a category for the output of the package name
32 tarname=${program}-${version}.tar.gz
35 fetch=https://luarocks.org/releases/${tarname}
38 The package manager for Lua modules.
40 Luarocks allows you to create and install Lua modules
41 as self-contained packages called \"rocks\".
44 homepage=https://luarocks.org/
47 # Source documentation
48 docs="CHANGELOG.md COPYING CODE_OF_CONDUCT.md README.md"
49 docsdir="${docdir}/${program}-${version}"
51 # Limit parallel jobs for this build
56 unpack "${tardir}/$tarname"
60 # Set sane permissions
61 chmod -R u+w,go-w,a+rX-s .
66 --with-lua-lib=/usr/lib${libSuffix} \
68 --lua-version=${lua_version}
71 make -j${jobs} DESTDIR="$destdir" install
72 mkdir -p "${destdir}/usr/lib${libSuffix}/luarocks/rocks-${lua_version}"
74 # To manage (dot) new files
75 touch "${destdir}/etc/luarocks/.graft-config"
78 mkdir -p "${destdir}/$docsdir"
79 cp -p $docs "${destdir}/$docsdir"