recipes: Adjust 'docsdir' variable to be consistent with the current recipe format
[dragora.git] / recipes / lua / luarocks / recipe
blob596f31e1a64b5e34831a1cd7ae97bf140b9dc50e
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
19 set -e
21 program=luarocks
22 version=3.8.0
23 arch=noarch
24 release=1
26 # Define major version for Lua release
27 lua_version=5.4
29 # Define a category for the output of the package name
30 pkgcategory=lua
32 tarname=${program}-${version}.tar.gz
34 # Remote source(s)
35 fetch=https://luarocks.org/releases/${tarname}
37 description="
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/
45 license="MIT License"
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
52 jobs=1
54 build()
56     unpack "${tardir}/$tarname"
58     cd "$srcdir"
60     # Set sane permissions
61     chmod -R u+w,go-w,a+rX-s .
63     ./configure \
64      --prefix=/usr \
65      --with-lua=/usr \
66      --with-lua-lib=/usr/lib${libSuffix} \
67      --sysconfdir=/etc \
68      --lua-version=${lua_version}
70     make -j${jobs}
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"
77     # Copy documentation
78     mkdir -p "${destdir}/$docsdir"
79     cp -p $docs "${destdir}/$docsdir"