752f2b1
%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}}
752f2b1
%{!?lua_libdir: %global lua_libdir %{_libdir}/lua/%{lua_version}}
752f2b1
%{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}}
Johan Cwiklinski 43294b9
752f2b1
%{!?lua_compat_version: %global lua_compat_version 5.1}
752f2b1
%{!?lua_compat_libdir: %global lua_compat_libdir %{_libdir}/lua/%{lua_compat_version}}
752f2b1
%{!?lua_compat_pkgdir: %global lua_compat_pkgdir %{_datadir}/lua/%{lua_compat_version}}
752f2b1
%{!?lua_compat_builddir: %global lua_compat_builddir %{_builddir}/compat-lua-%{name}-%{version}-%{release}}
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
Summary:        Database interface library for Lua
752f2b1
Name:           lua-dbi
752f2b1
Version:        0.7.2
752f2b1
Release:        1%{?dist}
Johan Cwiklinski 43294b9
License:        MIT
752f2b1
URL:            https://github.com/mwild1/luadbi
752f2b1
Source0:        https://github.com/mwild1/luadbi/archive/v%{version}/luadbi-%{version}.tar.gz
752f2b1
Patch0:         lua-dbi-0.7.2-sqlite36.patch
752f2b1
%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7
752f2b1
Requires:       lua(abi) = %{lua_version}
752f2b1
%else
752f2b1
Requires:       lua >= %{lua_version}
752f2b1
%endif
752f2b1
BuildRequires:  gcc, lua-devel, sqlite-devel
4018b41
%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8
4018b41
BuildRequires:  mariadb-connector-c-devel
4018b41
%else
4018b41
BuildRequires:  mysql-devel
4018b41
%endif
752f2b1
%if 0%{?fedora} >= 30 || 0%{?rhel} >= 8
752f2b1
BuildRequires:  libpq-devel
Johan Cwiklinski 43294b9
%else
752f2b1
BuildRequires:  postgresql-devel
Johan Cwiklinski 43294b9
%endif
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
%description
Johan Cwiklinski 43294b9
LuaDBI is a database interface library for Lua. It is designed to provide a
Johan Cwiklinski 43294b9
RDBMS agnostic API for handling database operations. LuaDBI also provides
752f2b1
support for prepared statement handles, placeholders and bind parameters for
752f2b1
all database operations.
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
Currently LuaDBI supports DB2, Oracle, MySQL, PostgreSQL and SQLite databases
Johan Cwiklinski 43294b9
with native database drivers.
Johan Cwiklinski 43294b9
e18b83a
%if 0%{?fedora} >= 20
752f2b1
%package -n lua%{lua_compat_version}-dbi
752f2b1
Summary:        Database interface library for Lua %{lua_compat_version}
752f2b1
Obsoletes:      lua-dbi-compat < 0.7.2
752f2b1
Provides:       lua-dbi-compat = %{version}-%{release}
752f2b1
Provides:       lua-dbi-compat%{?_isa} = %{version}-%{release}
752f2b1
Requires:       lua(abi) = %{lua_compat_version}
752f2b1
BuildRequires:  compat-lua-devel >= %{lua_compat_version}
752f2b1
752f2b1
%description -n lua%{lua_compat_version}-dbi
752f2b1
LuaDBI is a database interface library for Lua %{lua_compat_version}. It is designed to provide
752f2b1
a RDBMS agnostic API for handling database operations. LuaDBI also provides
752f2b1
support for prepared statement handles, placeholders and bind parameters for
752f2b1
all database operations.
e18b83a
e18b83a
Currently LuaDBI supports DB2, Oracle, MySQL, PostgreSQL and SQLite databases
e18b83a
with native database drivers.
e18b83a
%endif
e18b83a
Johan Cwiklinski 43294b9
%prep
752f2b1
%setup -q -n luadbi-%{version}
752f2b1
%patch0 -p1 -b .sqlite36
Johan Cwiklinski 43294b9
e18b83a
%if 0%{?fedora} >= 20
752f2b1
rm -rf %{lua_compat_builddir}
752f2b1
cp -a . %{lua_compat_builddir}
e18b83a
%endif
e18b83a
Johan Cwiklinski 43294b9
%build
752f2b1
%make_build free \
752f2b1
  CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
752f2b1
  LUA_V=%{lua_version} LUA_INC="-I%{_includedir}" \
752f2b1
  MYSQL_LDFLAGS="-L%{_libdir}/mysql -lmysqlclient"
Johan Cwiklinski 43294b9
e18b83a
%if 0%{?fedora} >= 20
752f2b1
pushd %{lua_compat_builddir}
752f2b1
%make_build free \
752f2b1
  CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
752f2b1
  LUA_V=%{lua_compat_version} LUA_INC="-I%{_includedir}/lua-%{lua_compat_version}" \
752f2b1
  MYSQL_LDFLAGS="-L%{_libdir}/mysql -lmysqlclient"
e18b83a
popd
e18b83a
%endif
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
%install
752f2b1
make install_free INSTALL='install -p' \
752f2b1
  CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
752f2b1
  LUA_V=%{lua_version} LUA_INC="-I%{_includedir}" \
752f2b1
  LUA_CDIR=$RPM_BUILD_ROOT%{lua_libdir} LUA_LDIR=$RPM_BUILD_ROOT%{lua_pkgdir} \
752f2b1
  MYSQL_LDFLAGS="-L%{_libdir}/mysql -lmysqlclient"
39fc752
e18b83a
%if 0%{?fedora} >= 20
752f2b1
pushd %{lua_compat_builddir}
752f2b1
make install_free INSTALL='install -p' \
752f2b1
  CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" \
752f2b1
  LUA_V=%{lua_compat_version} LUA_INC="-I%{_includedir}/lua-%{lua_compat_version}" \
752f2b1
  LUA_CDIR=$RPM_BUILD_ROOT%{lua_compat_libdir} LUA_LDIR=$RPM_BUILD_ROOT%{lua_compat_pkgdir} \
752f2b1
  MYSQL_LDFLAGS="-L%{_libdir}/mysql -lmysqlclient"
e18b83a
popd
e18b83a
%endif
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
%files
4018b41
%license COPYING
752f2b1
%doc README.md
752f2b1
%{lua_libdir}/dbd/
752f2b1
%{lua_pkgdir}/DBI.lua
Johan Cwiklinski 43294b9
e18b83a
%if 0%{?fedora} >= 20
752f2b1
%files -n lua%{lua_compat_version}-dbi
4018b41
%license COPYING
752f2b1
%doc README.md
752f2b1
%{lua_compat_libdir}/dbd/
752f2b1
%{lua_compat_pkgdir}/DBI.lua
e18b83a
%endif
e18b83a
Johan Cwiklinski 43294b9
%changelog
752f2b1
* Thu Jul 25 2019 Robert Scheck <robert@fedoraproject.org> 0.7.2-1
752f2b1
- Upgrade to 0.7.2
752f2b1
bf78a00
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-22
bf78a00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
bf78a00
b3b0891
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-21
b3b0891
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
b3b0891
5c09bda
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-20
5c09bda
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
5c09bda
0d376dd
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-19
0d376dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0d376dd
4018b41
* Thu Sep 21 2017 Robert Scheck <robert@fedoraproject.org> 0.5-18
4018b41
- Build against mariadb-connector-c-devel rather mysql-devel for
4018b41
  Fedora >= 28 (#1493634, thanks to Michal Schorm)
4018b41
356b43d
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-17
356b43d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
356b43d
6eed5bc
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-16
6eed5bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
6eed5bc
7ab4ef5
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-15
7ab4ef5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7ab4ef5
44568bc
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-14
44568bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
44568bc
39fc752
* Sun Jun 21 2015 Robert Scheck <robert@fedoraproject.org> 0.5-13
39fc752
- Really build -compat subpackage against compat-lua (#1232688)
39fc752
9c282bd
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-12
9c282bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
9c282bd
bbaa557
* Thu Jan 15 2015 Tom Callaway <spot@fedoraproject.org> - 0.5-11
bbaa557
- add all new upstream fixes
bbaa557
- rebuild for lua 5.3
bbaa557
- fix compile against modern pgsql
bbaa557
9bc10f8
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-10
9bc10f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
9bc10f8
2f0932c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-9
2f0932c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
2f0932c
e18b83a
* Thu May 22 2014 Jan Kaluza <jkaluza@redhat.com> - 0.5-8
e18b83a
- build -compat subpackage against compat-lua
e18b83a
8ea17d7
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-7
8ea17d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8ea17d7
5b6b728
* Fri May 10 2013 Tom Callaway <spot@fedoraproject.org> - 0.5-6
5b6b728
- rebuild for lua 5.2
5b6b728
3728e5d
* Fri Apr 26 2013 Robert Scheck <robert@fedoraproject.org> - 0.5-5
3728e5d
- Added upstream patch to avoid PostgreSQL transaction warnings
3728e5d
eacf9e7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-4
eacf9e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
eacf9e7
0c328c6
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
0c328c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
0c328c6
Johan Cwiklinski 43294b9
* Sat Jun 23 2012 Matej Cepl <mcepl@redhat.com> - 0.5-2
Johan Cwiklinski 43294b9
- Couple of fixes to satisfy packaging review.
Johan Cwiklinski 43294b9
Johan Cwiklinski 43294b9
* Mon May 23 2011 Matěj Cepl <mcepl@redhat.com> - 0.5-1
Johan Cwiklinski 43294b9
- Initial packaging