# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define _libdir64 %{_prefix}/lib64 Name: lua Version: 5.4.4 Release: 1 Summary: Powerful light-weight programming language Group: Development/Languages License: MIT URL: http://www.lua.org/ Source0: https://www.lua.org/ftp//lua-%{version}.tar.gz Source1: liblua-5.1.so-aix32 Source2: liblua-5.1.so-aix64 Source3: liblua-5.3.so-aix32 Source4: liblua-5.3.so-aix64 Patch0: %{name}-5.4.1-makefile.patch BuildRequires: coreutils Requires: libgcc >= 10.3.0 %description Lua is a powerful light-weight programming language designed for extending applications. Lua is also frequently used as a general-purpose, stand-alone language. Lua is free software. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, interpreted from bytecodes, and has automatic memory management with garbage collection, making it ideal for configuration, scripting, and rapid prototyping. %package devel Summary: Development files for %{name} Group: System Environment/Libraries Requires: %{name} = %{version}-%{release} #Requires: readline-devel >= 5.2 #Requires: pkg-config %description devel This package contains development files for %{name}. %prep %setup -q mkdir ../32bit mv * ../32bit mv ../32bit . mkdir 64bit cd 32bit tar cf - . | (cd ../64bit ; tar xpf -) cd .. %patch0 -p0 %build #export CC="/usr/vac/bin/xlc_r" export RM="/usr/bin/rm -f" export AR="/usr/bin/ar -X32_64" # first build the 64-bit version cd 64bit export OBJECT_MODE=64 export CC="/opt/freeware/bin/gcc" export CFLAGS=" -O2 -maix64" make aix cd src `echo /usr/bin/nm -X32_64 | /usr/bin/sed -e 's/B\([^B]*\)$/P\1/'` -PCpgl liblua.a | \ /usr/bin/awk '{ if ((($ 2 == "T") || ($ 2 == "D") || ($ 2 == "B") || ($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) \ && (substr($ 1,1,1) != ".")) { if (($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) { print $ 1 " weak" } \ else { print $ 1 } } }' | /usr/bin/sort -u > liblua.exp ${CC} -maix64 -shared lib%{name}.a -o lib%{name}-5.4.so -Wl,-bE:lib%{name}.exp -lm rm -f lib%{name}.a /usr/bin/ar -X64 -rc lib%{name}.a lib%{name}-5.4.so rm -f %{name}.exp lua luac make all CC="/opt/freeware/bin/gcc -maix64 -O2" CFLAGS="-O -DLUA_USE_LINUX" MYLIBS="" MYLDFLAGS="-L. -L/opt/freeware/lib64 -L/opt/freeware/lib -lreadline -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" cd .. if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi # now build the 32-bit version cd ../32bit export OBJECT_MODE=32 export CC="/opt/freeware/bin/gcc -D_LARGE_FILES -O2" make aix cd src `echo /usr/bin/nm -X32_64 | /usr/bin/sed -e 's/B\([^B]*\)$/P\1/'` -PCpgl liblua.a | \ /usr/bin/awk '{ if ((($ 2 == "T") || ($ 2 == "D") || ($ 2 == "B") || ($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) \ && (substr($ 1,1,1) != ".")) { if (($ 2 == "W") || ($ 2 == "V") || ($ 2 == "Z")) { print $ 1 " weak" } \ else { print $ 1 } } }' | /usr/bin/sort -u > liblua.exp ${CC} -maix32 -shared lib%{name}.a -o lib%{name}-5.4.so -Wl,-bE:lib%{name}.exp -Wl,-bmaxdata:0x80000000 -lm rm -f lib%{name}.a /usr/bin/ar -X32 -rc lib%{name}.a lib%{name}-5.4.so rm -f %{name}.exp lua luac make all CC="/opt/freeware/bin/gcc -maix32 -D_LARGE_FILES -O2" CFLAGS="-O -DLUA_USE_LINUX" MYLIBS="" MYLDFLAGS="-L. -L/opt/freeware/lib -lreadline -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000" if [ "%{dotests}" == 1 ] then (gmake -k check || true) fi cp %{SOURCE1} liblua-5.1.so /usr/bin/strip -X32 -e liblua-5.1.so /usr/bin/ar -X32 -q liblua.a liblua-5.1.so cp %{SOURCE2} liblua-5.1.so /usr/bin/strip -X64 -e liblua-5.1.so /usr/bin/ar -X64 -q liblua.a liblua-5.1.so /usr/bin/ar -X64 -q ../../64bit/src/liblua.a liblua-5.1.so cp %{SOURCE3} liblua-5.3.so /usr/bin/strip -X32 -e liblua-5.3.so /usr/bin/ar -X32 -q liblua.a liblua-5.3.so cp %{SOURCE4} liblua-5.3.so /usr/bin/strip -X64 -e liblua-5.3.so /usr/bin/ar -X64 -q liblua.a liblua-5.3.so /usr/bin/ar -X64 -q ../../64bit/src/liblua.a liblua-5.3.so # add the 64-bit shared objects to the shared libraries containing already the # 32-bit shared objects /usr/bin/ar -X64 -q lib%{name}.a ../../64bit/src/lib%{name}-5.4.so %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} export PATH=/opt/freeware/bin:$PATH cd 64bit export OBJECT_MODE=64 make install INSTALL_TOP=${RPM_BUILD_ROOT}%{_prefix} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in * ; do mv -f ${f} ${f}_64 done ) mv ${RPM_BUILD_ROOT}%{_libdir} ${RPM_BUILD_ROOT}%{_libdir64} cd ../32bit export OBJECT_MODE=32 make install INSTALL_TOP=${RPM_BUILD_ROOT}%{_prefix} ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in lua luac ; do mv -f ${f} ${f}_32 done ) # Make 64bit executable as default ( cd ${RPM_BUILD_ROOT}%{_bindir} for f in lua luac do ln -sf ${f}_64 ${f} done ) /usr/bin/strip -X32_64 ${RPM_BUILD_ROOT}%{_bindir}/* || : mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/%{name}/5.4 mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}/5.4 /usr/bin/ar -X32 -x ${RPM_BUILD_ROOT}%{_libdir}/liblua.a ${RPM_BUILD_ROOT}%{_libdir}/liblua-5.1.so /usr/bin/ar -X64 -x ${RPM_BUILD_ROOT}%{_libdir}/liblua.a ${RPM_BUILD_ROOT}%{_libdir64}/liblua-5.1.so mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig mkdir -p ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig cat etc/%{name}.pc | \ grep -v '^#' | \ grep -v INSTALL_ | \ sed 's|/usr/local|/opt/freeware|' \ > ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/%{name}.pc cp ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/%{name}.pc ${RPM_BUILD_ROOT}%{_libdir64}/pkgconfig/ %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc 32bit/README 32bit/doc/*.html %doc 32bit/doc/*.css 32bit/doc/*.gif 32bit/doc/*.png %{_bindir}/* %{_libdir}/*.a %{_libdir}/*.so* %{_libdir64}/*.a %{_libdir64}/*.so* %{_mandir}/man1/* %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/5.4 %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/5.4 %files devel %defattr(-,root,system,-) %{_includedir}/* #%{_libdir}/pkgconfig/*.pc #%{_libdir64}/pkgconfig/*.pc %changelog * Tue Apr 04 2023 Raghu N Arava - 5.4.4-1 - Update to 5.4.4-1 * Wed Nov 04 2020 Reshma V Kumar - 5.4.1-1 - Update to fix CVE-2020-15888,CVE-2020-15889,CVE-2020-15945,CVE-2020-24342 * Thu Feb 28 2019 Reshma V Kumar 5.3.4-2 - Rebuild after removing lua.pc * Mon Dec 19 2016 Reshma V Kumar 5.3.3-1 - Update to latest version * Thu Jan 29 2015 sangames Mallayya 5.1.5-1 - Rebuild for distributing it in AIX Toolbox. * Mon Mar 26 2012 Gerard Visiedo - 5.1.5-1 - update to version - 5.1.5 * Wed Feb 11 2009 Jean Noel Cordenner 5.1.4 - Initial port for AIX