%define luaver 5.1
%define lualibdir %{_libdir}/lua/%{luaver}
%define luapkgdir %{_datadir}/lua/%{luaver}
Name: lua-expat
Version: 1.1
Release: 4%{?dist}
Summary: SAX XML parser based on the Expat library
Group: Development/Libraries
License: MIT
URL: http://www.keplerproject.org/luaexpat/
Source0: http://luaforge.net/frs/download.php/2469/luaexpat-1.1.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: lua >= %{luaver}, lua-devel >= %{luaver}
BuildRequires: expat-devel
Requires: lua >= %{luaver}
%description
LuaExpat is a SAX XML parser based on the Expat library.
%prep
%setup -q -n luaexpat-%{version}
%build
make %{?_smp_mflags} PREFIX=%{_prefix} LUA_LIBDIR=%{lualibdir} LUA_DIR=%{luapkgdir} LUA_INC=%{_includedir} EXPAT_INC=%{_includedir} CFLAGS="%{optflags} -fPIC" LUA_VERSION_NUM=501
/usr/bin/iconv -f ISO8859-1 -t UTF8 README >README.UTF8
mv -f README.UTF8 README
%install
rm -rf %{buildroot}
make install PREFIX=%{_prefix} LUA_LIBDIR=%{buildroot}%{lualibdir} LUA_DIR=%{buildroot}%{luapkgdir} LUA_VERSION_NUM=501
%check
pushd src
ln -s lxp.so.* lxp.so
popd
lua -e 'package.cpath=package.cpath .. ";./src/?.so"; f = loadfile("tests/test.lua"); f()'
lua -e 'package.cpath=package.cpath .. ";./src/?.so"; package.path=package.path .. ";./src/?.lua"; f = loadfile("tests/test-lom.lua"); f()'
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc README doc/us/*
%{lualibdir}/*
%{luapkgdir}/*
%changelog
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Jun 05 2008 Tim Niemueller <tim@niemueller.de> - 1.1-2
- Minor spec fixes for guideline compliance
- Added %%check macro to execute tests
* Wed Jun 04 2008 Tim Niemueller <tim@niemueller.de> - 1.1-1
- Initial package