%{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))" || echo 0)} %global lualibdir %{_libdir}/lua/%{luaver} %global luapkgdir %{_datadir}/lua/%{luaver} %global luacompatver 5.1 %global luacompatlibdir %{_libdir}/lua/%{luacompatver} %global luacompatpkgdir %{_datadir}/lua/%{luacompatver} %global luapkgname cqueues Name: lua-%{luapkgname} Version: 20190813 Release: 2%{?dist} Summary: Stackable Continuation Queues for the Lua Programming Language License: MIT URL: https://github.com/wahern/%{luapkgname} Source0: https://github.com/wahern/%{luapkgname}/archive/rel-%{version}/%{name}-%{version}.tar.gz Patch1: 0001-extern-cqueue__poll.patch BuildRequires: gcc BuildRequires: m4 BuildRequires: make BuildRequires: openssl-devel BuildRequires: lua BuildRequires: lua-devel >= %{luaver} %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: compat-lua BuildRequires: compat-lua-devel %endif Requires: lua(abi) = %{luaver} %description cqueues is a type of event loop for Lua. It doesn't use callbacks but instead you communicate with an event controller by the yielding and resumption of Lua coroutines using objects. cqueues are stackable. Each instantiated cqueue is a poll-able object which can be polled from another cqueue, or another event loop system entirely. The design is meant to be non-intrusive, composable, and embeddable within existing applications. cqueues includes a sockets library with DNS, buffering, end-of-line translation, SSL/TLS, and descriptor passing support builtin. Domain querying, connection establishment, and SSL negotiation are handled transparently as part of a state machine entered with every I/O operation, so users can read and write immediately upon instantiating the object, as if opening a regular file. cqueues also includes modules for handling signals, threads, and file change notifications using native kernel facilities and accessible through easy to use interfaces which abstract the different kernel facilities. %if 0%{?fedora} || 0%{?rhel} > 7 %package -n lua%{luacompatver}-%{luapkgname} Summary: Stackable Continuation Queues for the Lua Programming Language %{luacompatver} Requires: compat-lua-libs # NOTE: remove Provides after F31 end of life %if 0%{?fedora} < 32 && "x%{?rhel}" == "x" Provides: lua-%{luapkgname}-compat Provides: compat-lua-%{luapkgname} %endif %description -n lua%{luacompatver}-%{luapkgname} Compatibility package for Lua %{luacompatver} %endif %package doc Summary: Documentation for the Stackable Continuation Queues library BuildArch: noarch # Conflicts: {name} != {version} + compat-{name} != {version} would have been better # but I'm trying to avoid Conflicts Requires: %{name} == %{version} %description doc Documentation for the Stackable Continuation Queues library for the Lua Programming Language %prep %setup -q -n %{luapkgname}-rel-%{version} %patch1 -p1 %build export CFLAGS="%{?optflags} -fPIC" export LDFLAGS="%{?build_ldflags}" make LUA_APIS="%{luaver}" %{?_smp_mflags} prefix=%{_prefix} libdir=%{_libdir} %if 0%{?fedora} || 0%{?rhel} > 7 make LUA_APIS="%{luacompatver}" %{?_smp_mflags} prefix=%{_prefix} libdir=%{_libdir} CFLAGS="$CFLAGS -I%{_includedir}/lua-%{luacompatver}" %endif %install make install LUA_APIS="%{luaver}" DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} %if 0%{?fedora} || 0%{?rhel} > 7 make install LUA_APIS="%{luacompatver}" DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} %endif # documentation mkdir -p %{buildroot}%{_pkgdocdir} cp -r -t %{buildroot}%{_pkgdocdir} doc/cqueues.pdf examples sed -i '1 s|^#!/.*$|#!/usr/bin/lua|' %{buildroot}%{_pkgdocdir}/examples/* #% check ## Lua openssl package is missing #make check -j1 %files %{luapkgdir}/* %{lualibdir}/* %license LICENSE %if 0%{?fedora} || 0%{?rhel} > 7 %files -n lua%{luacompatver}-%{luapkgname} %{luacompatpkgdir}/* %{luacompatlibdir}/* %license LICENSE %endif %files doc # force examples to be non-executable to avoid potential mess in autogenerated deps %defattr(644,root,root,755) %doc %{_pkgdocdir}/* %license LICENSE %changelog * Wed Feb 05 2020 Tomas Krizek - 20190813-2 - Add patch to mark cqueues__poll as extern * Mon Oct 21 2019 Tomas Krizek - 20190813-1 - Make spec EPEL8 compatible - Update to latest upstream version, BZ#1735765 * Thu Jul 25 2019 Fedora Release Engineering - 20171014-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Tue Apr 16 2019 Tomas Krizek - 20171014-6 - Use lua5.1-cqueues for Lua 5.1 package name https://pagure.io/packaging-committee/issue/878 * Wed Apr 10 2019 Tomas Krizek - 20171014-5 - Re-add compat-lua-devel needed for 5.1 build * Thu Apr 04 2019 Tomas Krizek - 20171014-4 - Compatibility patch for GCC 9, fixes BZ#1675333 - Clean up BuildRequires/Requires * Thu Apr 04 2019 Tomas Krizek - 20171014-3 - Change compat package name to compat-lua-cqueues * Fri Feb 01 2019 Fedora Release Engineering - 20171014-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jan 11 2019 Petr Špaček - 20171014-1 - Rebuild for released Fedora/CentOS versions (fedpkg update was missing) * Thu Sep 13 2018 Petr Špaček - 20171014-0 - Initial package for Fedora 28+ and EPEL 7