%define luaver 5.1 %define lualibdir %{_libdir}/lua/%{luaver} %define luapkgdir %{_datadir}/lua/%{luaver} %define real_name luadbi Name: lua-dbi Version: 0.5 Release: 2%{?dist} Summary: Database interface library for Lua Group: Development/Libraries License: MIT URL: http://code.google.com/p/%{real_name} Source0: http://%{real_name}.googlecode.com/files/%{real_name}.%{version}.tar.gz Patch0: %{name}-RH-build.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: lua-devel, mysql-devel, sqlite-devel, postgresql-devel %if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 Requires: lua(abi) = %{luaver} %else Requires: lua >= %{luaver} %endif %description LuaDBI is a database interface library for Lua. It is designed to provide a RDBMS agnostic API for handling database operations. LuaDBI also provides support for prepared statement handles, placeholders and bind parameters for all database operations. Currently LuaDBI supports DB2, Oracle, MySQL, PostgreSQL and SQLite databases with native database drivers. %prep %setup -q -c %patch0 -p1 -b .RH-build find . -name \*.[ch] -print -exec chmod -x '{}' \; %build export CFLAGS="$RPM_OPT_FLAGS -fPIC" make %{?_smp_mflags} LIBDIR="%{_libdir}" %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{luapkgdir} mkdir -p $RPM_BUILD_ROOT%{lualibdir} cp -p *.so $RPM_BUILD_ROOT%{lualibdir} cp -p *.lua $RPM_BUILD_ROOT%{luapkgdir} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README COPYING %{lualibdir}/*.so %{luapkgdir}/*.lua %changelog * Sat Jun 23 2012 Matej Cepl <mcepl@redhat.com> - 0.5-2 - Couple of fixes to satisfy packaging review. * Mon May 23 2011 MatÄj Cepl <mcepl@redhat.com> - 0.5-1 - Initial packaging