From 0b35e738e21c7a6a0cd0bc8a8c55afda7187bda9 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Jan 03 2021 02:52:28 +0000 Subject: Basic %check for Lua module --- diff --git a/lua-dbi.spec b/lua-dbi.spec index 2e01cf3..528d4f6 100644 --- a/lua-dbi.spec +++ b/lua-dbi.spec @@ -17,7 +17,8 @@ Source0: https://github.com/mwild1/luadbi/archive/v%{version}/luadbi-%{ve Requires: lua(abi) = %{lua_version} BuildRequires: gcc BuildRequires: make -BuildRequires: lua-devel +BuildRequires: lua >= %{lua_version} +BuildRequires: lua-devel >= %{lua_version} BuildRequires: sqlite-devel %if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: mariadb-connector-c-devel @@ -43,6 +44,7 @@ Obsoletes: lua-dbi-compat < 0.7.2 Provides: lua-dbi-compat = %{version}-%{release} Provides: lua-dbi-compat%{?_isa} = %{version}-%{release} Requires: lua(abi) = %{lua_compat_version} +BuildRequires: compat-lua >= %{lua_compat_version} BuildRequires: compat-lua-devel >= %{lua_compat_version} %description -n lua%{lua_compat_version}-dbi @@ -95,6 +97,19 @@ make install_free INSTALL='install -p' \ popd %endif +%check +lua -e \ + 'package.cpath="%{buildroot}%{lua_libdir}/?.so;"..package.cpath; + package.path="%{buildroot}%{lua_pkgdir}/?.lua;"..package.path; + local DBI = require("DBI"); print("Hello from "..DBI._VERSION.."!");' + +%if 0%{?fedora} +lua-%{lua_compat_version} -e \ + 'package.cpath="%{buildroot}%{lua_compat_libdir}/?.so;"..package.cpath; + package.path="%{buildroot}%{lua_compat_pkgdir}/?.lua;"..package.path; + local DBI = require("DBI"); print("Hello from "..DBI._VERSION.."!");' +%endif + %files %license COPYING %doc README.md