%global luaver 5.1 %global luajitver 2.1 %global lualibdir %{_libdir}/lua/%{luaver} %global luapkgdir %{_datadir}/lua/%{luaver} %global luajitincludedir %{_includedir}/luajit-%{luajitver} Name: luajit-lgi Version: 0.9.2 Release: 1%{?dist} Summary: Luajit bindings to GObject libraries License: MIT URL: https://github.com/pavouk/lgi Source0: https://github.com/pavouk/lgi/archive/%{version}/lgi-%{version}.tar.gz # see gh#212 (commit a127f82) Patch0: lgi-0.9.2-fix-s390x.patch # see gh#215 Patch1: lgi-0.9.2-fix-gobject-warnings.patch BuildRequires: pkgconfig(gobject-introspection-1.0) >= 0.10.8 BuildRequires: pkgconfig(gmodule-2.0) BuildRequires: pkgconfig(libffi) BuildRequires: luajit >= %{luajitver} BuildRequires: luajit-devel >= %{luajitver} BuildRequires: lua-markdown # for the testsuite: BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(cairo-gobject) BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: gcc BuildRequires: make BuildRequires: which BuildRequires: Xvfb xauth BuildRequires: dbus-x11 at-spi2-core Requires: luajit >= %{luajitver} %global __requires_exclude_from %{_docdir} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %description LGI is gobject-introspection based dynamic Lua binding to GObject based libraries. It allows using GObject-based libraries directly from Lua. %package samples Summary: Examples of luajit-lgi usage # gtk-demo is LGPLv2+ License: LGPLv2+ and MIT Requires: %{name}%{?_isa} = %{version}-%{release} %description samples %{summary} %prep %autosetup -n lgi-%{version} -p1 %build export CFLAGS="%{optflags} -DLUA_COMPAT_APIINTCASTS" %configure || : make LUA_INCDIR=%{luajitincludedir} LUA_CFLAGS="$(pkgconf --cflags luajit)" \ %{?_smp_mflags} # generate html documentation markdown.lua README.md docs/*.md %install mkdir -p \ %{buildroot}%{lualibdir} \ %{buildroot}%{luapkgdir} make install \ "PREFIX=%{_prefix}" \ "LUA_LIBDIR=%{lualibdir}" \ "LUA_SHAREDIR=%{luapkgdir}" \ "DESTDIR=%{buildroot}" # install docs mkdir -p %{buildroot}%{_pkgdocdir} cp -av README.html docs/*.html \ %{buildroot}%{_pkgdocdir} cp -av samples %{buildroot}%{_pkgdocdir} find %{buildroot}%{_pkgdocdir} -type f \ -exec chmod -x {} \; %check export CFLAGS="%{optflags} -DLUA_COMPAT_APIINTCASTS" %configure || : # report failing tests, don't fail the build xvfb-run -a -w 1 make check \ LUA=%{_bindir}/luajit \ LUA_CFLAGS=-I%{luajitincludedir} || : %files %dir %{_pkgdocdir} %license LICENSE %{_pkgdocdir}/*.html %{luapkgdir}/lgi.lua %{luapkgdir}/lgi %{lualibdir}/lgi %files samples %{_pkgdocdir}/samples %changelog * Sun Jul 26 2020 James Reed - 0.9.2-1 - Initial package (based on lua-lgi.spec)