%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}} %{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}} %global luapkgname vstruct Name: lua-%{luapkgname} Version: 2.1.1 Release: 1%{?dist} Summary: A Lua library for packing and unpacking binary data. License: MIT URL: https://github.com/ToxicFrog/%{luapkgname} Source0: https://github.com/ToxicFrog/%{luapkgname}/archive/refs/tags/v%{version}.tar.gz BuildArch: noarch BuildRequires: lua-devel BuildRequires: luarocks %description VStruct is a library for Lua 5.1, 5.2, 5.3, and LuaJIT 2. It provides functions for manipulating binary data, in particular for reading binary files or byte buffers into Lua values and for writing Lua values back into files or buffers. Supported data types include: * signed and unsigned integers of arbitrary size * fixed and floating point numbers * fixed-size, length-prefixed, and null-terminated strings * booleans and bitmasks * bit-packed integers, booleans and bitmasks In addition, the library supports seeking, alignment, and byte order controls, repetition, grouping of data into tables, and named fields. %prep %autosetup -n %{luapkgname}-%{version} %install rm -rf %{buildroot} luarocks --tree=%{buildroot}/usr \ make --deps-mode=none --no-manifest # Remove luarocks metadata rm -rf %{buildroot}/usr/lib %files %doc README.md %license COPYING %{lua_pkgdir}/* %changelog * Mon Oct 18 2021 Johannes Maibaum - 2.1.1-1 - Initial spec file for lua-vstruct