diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ea04dd --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/cqueues-20171014.tgz diff --git a/lua-cqueues.spec b/lua-cqueues.spec new file mode 100644 index 0000000..b5dad7e --- /dev/null +++ b/lua-cqueues.spec @@ -0,0 +1,123 @@ +%{!?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} + +Name: lua-cqueues +Version: 20171014 +Release: 0%{?dist} +Summary: Stackable Continuation Queues for the Lua Programming Language + +Group: Development/Libraries +License: MIT +URL: https://25thandclement.com/~william/projects/cqueues.html +Source0: https://25thandclement.com/~william/projects/releases/cqueues-%{version}.tgz + +BuildRequires: lua-devel >= %{luaver} +%if 0%{?fedora} +Requires: lua(abi) = %{luaver} +%else +Requires: lua >= %{luaver} +%endif + +%if 0%{?fedora} +BuildRequires: compat-lua >= %{luacompatver}, compat-lua-devel >= %{luacompatver} +%endif +BuildRequires: gcc, m4, make, openssl-devel + +%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} +%package compat +Summary: Stackable Continuation Queues for the Lua Programming Language %{luacompatver} +Group: Development/Libraries +# owner of /usr/lib64/lua/5.1, for some reason this depedency is not auto-generated +Requires: compat-lua-libs + +%description compat +Compatibility package for Lua %{luacompatver} +%endif + +%package doc +Summary: Documentation for the Stackable Continuation Queues library +Group: Development/Libraries +BuildArch: noarch +# Conflicts: {name} != {version} + compat-{name} != {version} would have been better +# but I'm trying to avoid Conflicts +Requires: %{name} == %{version} +# owner of /usr/share/doc +Requires: filesystem + +%description doc +Documentation for the Stackable Continuation Queues library +for the Lua Programming Language + +%prep +%setup -q -n cqueues-%{version} + +%build +make LUA_APIS="%{luaver}" %{?_smp_mflags} prefix=%{_prefix} libdir=%{_libdir} CFLAGS="%{optflags} -fPIC" + +%if 0%{?fedora} +make LUA_APIS="%{luacompatver}" %{?_smp_mflags} prefix=%{_prefix} libdir=%{_libdir} CFLAGS="-I%{_includedir}/lua-%{luacompatver} %{optflags} -fPIC" +%endif + +%install +make install LUA_APIS="%{luaver}" DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} + +%if 0%{?fedora} +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} +%files compat +%{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 +* Thu Sep 13 2018 Petr Špaček - 20171014-0 +- Initial package for Fedora 28+ and EPEL 7 diff --git a/sources b/sources new file mode 100644 index 0000000..9fbd7d6 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (cqueues-20171014.tgz) = f53c498ff6bc6833a52a21b300117ae6b97ce9cec0b986937ba87928be6e1ed0bdb41d8740883d1b4a9f71ca09cfe2d2de859dd9582bd1fcc068ceaf03d7215b