- Code: Select all
%define luaver 5.3
%define lualibdir %{_libdir}/lua/%{luaver}
%define luapkgdir %{_datadir}/lua/%{luaver}
%define oname luaexpat
Name: lua-expat
Version: 1.3.0
Release: %mkrel 1
Summary: SAX XML parser based on expat, for lua
Group: Development/Other
License: MIT
URL: https://matthewwild.co.uk/projects/luaexpat/
Source0: https://matthewwild.co.uk/projects/luaexpat/%{oname}-%{version}.tar.gz
BuildRequires: lua5.3
BuildRequires: lua5.3-devel
BuildRequires: expat-devel
Requires: lua5.3
%description
SAX XML parser based on expat, for lua.
%prep
%setup -q -n %{oname}-%{version}
%build
perl -pi -e 's/(CFLAGS =)/$1 -fPIC/' config
echo 'LUA_VERSION_NUM=503"' >> config
%make_build
%install
rm -rf %{buildroot}
make install LUA_LIBDIR=$RPM_BUILD_ROOT%{lualibdir} LUA_DIR=$RPM_BUILD_ROOT%{luapkgdir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README doc/us/*
%{lualibdir}/*
%{luapkgdir}/*
%changelog
* Fri Oct 09 2020 john_gibbe <john_gibbe> 1.3.0-1.mga8
+ Revision: 1.3.0-1
- adaptation to bulid on Mageia 8
* Fri Oct 18 2013 umeabot <umeabot> 1.2.0-4.mga4
+ Revision: 507588
- Mageia 4 Mass Rebuild
* Sat Jan 12 2013 umeabot <umeabot> 1.2.0-3.mga3
+ Revision: 359045
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild
* Sun Dec 23 2012 pterjan <pterjan> 1.2.0-2.mga3
+ Revision: 334420
- Force Lua 5.1
* Thu Sep 08 2011 tv <tv> 1.2.0-1.mga2
+ Revision: 141150
- new release (fixes CVE-2011-2188)
* Fri Apr 15 2011 shikamaru <shikamaru> 1.1-2.mga1
+ Revision: 85959
- Clean spec (buildroot, trailing space, one BR per line)
- imported package lua-expat
* Fri May 01 2009 Michael Scherer <misc@mandriva.org> 1.1-1mdv2010.0
+ Revision: 369965
- add missing BuildRequires
- import lua-expat
when I rebuild it with "rpmbuild -ba lua-expat.spec" gives:
- Code: Select all
# LANGUAGE=en rpmbuild -ba lua-expat.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Cc3mBV
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ cd /root/rpmbuild/BUILD
+ rm -rf luaexpat-1.3.0
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/luaexpat-1.3.0.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd luaexpat-1.3.0
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ RPM_EC=0
++ jobs -p
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.GLO3hW
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd luaexpat-1.3.0
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
+ perl -pi -e 's/(CFLAGS =)/$1 -fPIC/' config
Can't open config: No such file or directory.
+ echo 'LUA_VERSION_NUM=503"'
+ /usr/bin/make -O -j12 V=1 VERBOSE=1
export MACOSX_DEPLOYMENT_TARGET="10.3";
cc -I/usr/include/lua5.1 -I/usr/include -g -pedantic -Wall -O2 -fPIC -DPIC -ansi -o src/lxp.so src/lxplib.c -shared -lexpat
In file included from /usr/include/lua.h:16,
from src/lxplib.c:14:
/usr/include/luaconf.h:584:2: error: #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
584 | #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
| ^~~~~
In file included from src/lxplib.c:14:
/usr/include/lua.h:93:9: error: unknown type name 'LUA_INTEGER'
93 | typedef LUA_INTEGER lua_Integer;
| ^~~~~~~~~~~
/usr/include/lua.h:96:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_Unsigned'
96 | typedef LUA_UNSIGNED lua_Unsigned;
| ^~~~~~~~~~~~
make: *** [Makefile:27: src/lxp.so] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.GLO3hW (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.GLO3hW (%build
I tried it by hand and checked that effectively it lacks -DLUA_C89_NUMBER in cc flags. What is the spec command line to automatically add this flag?