recipe 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Build recipe for luarocks.
  2. #
  3. # Copyright (C) 2020 Kevin "The Nuclear" Bloom, <kevin.bloom@posteo.net>.
  4. # Copyright (c) 2020-2022 Matias Fonzo, <selk@dragora.org>.
  5. #
  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
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  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.
  17. # Exit immediately on any error
  18. set -e
  19. program=luarocks
  20. version=3.8.0
  21. arch=noarch
  22. release=1
  23. # Define major version for Lua release
  24. lua_version=5.4
  25. # Define a category for the output of the package name
  26. pkgcategory=lua
  27. tarname=${program}-${version}.tar.gz
  28. # Remote source(s)
  29. fetch=https://luarocks.org/releases/${tarname}
  30. description="
  31. The package manager for Lua modules.
  32. Luarocks allows you to create and install Lua modules
  33. as self-contained packages called \"rocks\".
  34. "
  35. homepage=https://luarocks.org/
  36. license="MIT License"
  37. # Source documentation
  38. docs="CHANGELOG.md COPYING CODE_OF_CONDUCT.md README.md"
  39. docsdir="${docdir}/${program}-${version}"
  40. # Limit parallel jobs for this build
  41. jobs=1
  42. build()
  43. {
  44. unpack "${tardir}/$tarname"
  45. cd "$srcdir"
  46. # Set sane permissions
  47. chmod -R u+w,go-w,a+rX-s .
  48. ./configure \
  49. --prefix=/usr \
  50. --with-lua=/usr \
  51. --with-lua-lib=/usr/lib${libSuffix} \
  52. --sysconfdir=/etc \
  53. --lua-version=${lua_version}
  54. make -j${jobs}
  55. make -j${jobs} DESTDIR="$destdir" install
  56. mkdir -p "${destdir}/usr/lib${libSuffix}/luarocks/rocks-${lua_version}"
  57. # To manage (dot) new files
  58. touch "${destdir}/etc/luarocks/.graft-config"
  59. # Copy documentation
  60. mkdir -p "${destdir}/$docsdir"
  61. cp -p $docs "${destdir}/$docsdir"
  62. }