commit e71dae212be7bdce61fa6fd187f7a2fe108ffd64 Author: Dmitrii Tochanskii Date: Wed Oct 1 16:28:20 2025 +0000 lua 5.4.7 diff --git a/0001-add-shared-library.patch b/0001-add-shared-library.patch new file mode 100644 index 0000000..53bfeb2 --- /dev/null +++ b/0001-add-shared-library.patch @@ -0,0 +1,53 @@ +diff --git a/Makefile b/Makefile +index 72ca8ff..b58b800 100644 +--- a/Makefile ++++ b/Makefile +@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw p + # What to install. + TO_BIN= lua luac + TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +-TO_LIB= liblua.a ++TO_LIB= liblua.a liblua-5.4.so + TO_MAN= lua.1 luac.1 + + # Lua version and release. +diff --git a/src/Makefile b/src/Makefile +index b771196..673f5fb 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -7,7 +7,7 @@ + PLAT= guess + + CC= gcc -std=gnu99 +-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS) ++CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -fPIC $(SYSCFLAGS) $(MYCFLAGS) + LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) + LIBS= -lm $(SYSLIBS) $(MYLIBS) + +@@ -33,6 +33,7 @@ CMCFLAGS= + PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris + + LUA_A= liblua.a ++LUA_SO= liblua-5.4.so + CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o + LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o + BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) +@@ -44,7 +45,7 @@ LUAC_T= luac + LUAC_O= luac.o + + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) +-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A= $(LUA_A) + + # Targets start here. +@@ -66,6 +67,9 @@ $(LUA_T): $(LUA_O) $(LUA_A) + $(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -o $@ -shared $? ++ + test: + ./$(LUA_T) -v + diff --git a/0002-update-path.patch b/0002-update-path.patch new file mode 100644 index 0000000..946e233 --- /dev/null +++ b/0002-update-path.patch @@ -0,0 +1,19 @@ +diff --git a/Makefile b/Makefile +index b58b800..bbbd3b9 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,11 +10,11 @@ PLAT= guess + # so take care if INSTALL_TOP is not an absolute path. See the local target. + # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with + # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. +-INSTALL_TOP= /usr/local ++INSTALL_TOP= /usr/ + INSTALL_BIN= $(INSTALL_TOP)/bin + INSTALL_INC= $(INSTALL_TOP)/include +-INSTALL_LIB= $(INSTALL_TOP)/lib +-INSTALL_MAN= $(INSTALL_TOP)/man/man1 ++INSTALL_LIB= $(INSTALL_TOP)/lib64 ++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1 + INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V + INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V + diff --git a/lua.spec b/lua.spec new file mode 100644 index 0000000..caeeb77 --- /dev/null +++ b/lua.spec @@ -0,0 +1,43 @@ +Name: lua +Version: 5.4.7 +Release: 1%{?dist} +Summary: A powerful light-weight programming language designed for extending applications + +License: MIT +URL: https://www.lua.org/ +Source0: https://www.lua.org/ftp/lua-%{version}.tar.gz + +Patch0: 0001-add-shared-library.patch +Patch1: 0002-update-path.patch + +BuildRequires: gcc +Requires: bash + +%description + + +%prep +%setup -q +%patch -P0 -p1 +%patch -P1 -p1 + + +%build +%make_build + + +%install +%make_install INSTALL_TOP=%{buildroot}/usr + + +%files +%{_bindir} +%{_libdir} +%{_mandir} +%{_includedir} + + + +%changelog +* Wed Oct 01 2025 Dmitrii Tochanskii +-