diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4d96289 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/luajson-1.3.2-7a86bc2.tar.gz diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/lua-json.spec b/lua-json.spec new file mode 100644 index 0000000..549e7f1 --- /dev/null +++ b/lua-json.spec @@ -0,0 +1,88 @@ +%define luaver 5.3 +%define luapkgdir %{_datadir}/lua/%{luaver} +%global commit 7a86bc22066858afeb23845a191a6ab680b46233 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Name: lua-json +Version: 1.3.2 +Release: 9%{?dist} +Summary: JSON Parser/Constructor for Lua +Group: Development/Libraries +License: MIT +URL: http://luaforge.net/projects/luajson/ +Source0: https://github.com/harningt/luajson/archive/%{commit}/luajson-%{version}-%{shortcommit}.tar.gz +Patch0: luajson-lua-5.2.patch +BuildRequires: lua >= %{luaver}, lua-lpeg >= 0.8.1 +# for checks +BuildRequires: lua-filesystem >= 1.4.1, lua-lunit >= 0.4 +Requires: lua >= %{luaver}, lua-lpeg >= 0.8.1 +BuildArch: noarch + +%description +LuaJSON is a customizable JSON decoder/encoder, using LPEG for parsing. + +%prep +%setup -q -n luajson-%{commit} +%patch0 -p1 -b .lua-52 + +%build + +%install +mkdir -p $RPM_BUILD_ROOT%{luapkgdir} +cp -pr lua/* $RPM_BUILD_ROOT%{luapkgdir} + +%check +make check-regression +# three tests that used to fail here now pass because of how numbers work in lua 5.2 +# make check-unit | tee testlog.txt +# grep -q "0 failed, 0 errors" testlog.txt + +%files +%doc LICENSE docs/LuaJSON.txt docs/ReleaseNotes-1.0.txt +%{luapkgdir}/* + +%changelog +* Thu Feb 08 2018 Fedora Release Engineering - 1.3.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.3.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.3.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.3.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sun Sep 20 2015 Bastien Nocera 1.3.2-5 +- Rebuild for lua 5.3 + +* Wed Jun 17 2015 Fedora Release Engineering - 1.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.3.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 1.3.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri May 10 2013 Tom Callaway - 1.3.2-1 +- update to 1.3.2, rebuild for lua 5.2 + +* Thu Feb 14 2013 Fedora Release Engineering - 1.2.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Mar 22 2012 Tom Callaway - 1.2.2-1 +- update to 1.2.2 + +* Fri Jan 13 2012 Fedora Release Engineering - 1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Sep 10 2009 Michel Salim - 1.0-1 +- Initial package diff --git a/luajson-lua-5.2.patch b/luajson-lua-5.2.patch new file mode 100644 index 0000000..75966c1 --- /dev/null +++ b/luajson-lua-5.2.patch @@ -0,0 +1,24 @@ +diff -up luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua.lua-52 luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua +--- luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua.lua-52 2013-05-10 16:32:47.277329679 -0400 ++++ luajson-7a86bc22066858afeb23845a191a6ab680b46233/lua/json/decode/state.lua 2013-05-10 16:33:19.301328534 -0400 +@@ -8,7 +8,7 @@ local jsonutil = require("json.util") + local assert = assert + local type = type + local next = next +-local unpack = unpack ++local unpack = table.unpack + + local _ENV = nil + +diff -up luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua.lua-52 luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua +--- luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua.lua-52 2013-05-10 16:31:50.764331699 -0400 ++++ luajson-7a86bc22066858afeb23845a191a6ab680b46233/tests/lunit-encoderfunc.lua 2013-05-10 16:32:00.788331341 -0400 +@@ -8,7 +8,7 @@ local setmetatable = setmetatable + module("lunit-encoderfunc", lunit.testcase, package.seeall) + + local function build_call(name, parameters) +- return json.util.buildCall(name, unpack(parameters, parameters.n)) ++ return json.util.buildCall(name, table.unpack(parameters, parameters.n)) + end + + function test_param_counts() diff --git a/sources b/sources new file mode 100644 index 0000000..c9e4f8f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (luajson-1.3.2-7a86bc2.tar.gz) = e1747249f3dc2084390bd11daad25a023ea3064d934f21eefd8c7f4bc6cfc1e855166b2c1e1eac8b8d256753dc07f274416dce3089e9e0e0bbba2c2da04c06f9