%global debug_package %{nil} %define _build_id_links none %if 0%{?rhel} && 0%{?rhel} < 10 %global gcc_toolset_enable source /opt/rh/gcc-toolset-15/enable %else %global gcc_toolset_enable source /usr/lib/gcc-toolset/15-env.source %endif %global luajit_version_major 2 %global luajit_version_minor 1 %global luajit_version_patch 1774896198 %global luajit_version %{luajit_version_major}.%{luajit_version_minor}.%{luajit_version_patch} %global luajit_commit 18b087c %global apiver 2.1 Name: luajit Version: %{luajit_version} Release: %autorelease Summary: Just-In-Time Compiler for Lua License: MIT URL: http://luajit.org Source0: %{name}-%{luajit_version_major}.%{luajit_version_minor}.tar.gz BuildRequires: gcc-toolset-15-gcc BuildRequires: gcc-toolset-15-gcc-plugin-annobin BuildRequires: gcc-toolset-15-gcc-c++ BuildRequires: make BuildRequires: pkgconfig %description LuaJIT implements the full set of language features defined by Lua 5.1. The virtual machine (VM) is API- and ABI-compatible to the standard Lua interpreter and can be deployed as a drop-in replacement. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains development files for %{name}. %prep %autosetup -n %{name}-%{luajit_version_major}.%{luajit_version_minor} echo "%{luajit_version_patch}" > .relver # Enable Lua 5.2 features sed -i -e '/-DLUAJIT_ENABLE_LUA52COMPAT/s/^#//' src/Makefile # preserve timestamps (cicku) sed -i -e '/install -m/s/-m/-p -m/' Makefile %build %{gcc_toolset_enable} # Q= - enable verbose output # E= @: - disable @echo messages # NOTE: we use amalgamated build as per documentation suggestion doc/install.html make amalg Q= E=@: PREFIX=%{_prefix} TARGET_STRIP=: \ CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}" \ MULTILIB=%{_lib} \ %{?_smp_mflags} %install # PREREL= - disable -betaX suffix # INSTALL_TNAME - executable name %make_install PREFIX=%{_prefix} \ MULTILIB=%{_lib} # Remove static .a find %{buildroot} -type f -name *.a -delete -print %ldconfig_scriptlets %check %files %license COPYRIGHT %doc README %{_bindir}/%{name} %{_bindir}/%{name}-%{luajit_version} %{_libdir}/lib%{name}-*.so.* %{_mandir}/man1/%{name}.1* %{_datadir}/%{name}-%{luajit_version_major}.%{luajit_version_minor}/ %files devel %{_includedir}/%{name}-%{apiver}/ %{_libdir}/lib%{name}-*.so %{_libdir}/pkgconfig/%{name}.pc %changelog %autochangelog