%{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))" || echo 0)} %global luapkgdir %{_datadir}/lua/%{luaver} %global luacompatver 5.1 %global luacompatpkgdir %{_datadir}/lua/%{luacompatver} Name: lua-http Version: 0.3 Release: 1%{?dist} Summary: HTTP library for Lua License: MIT URL: https://github.com/daurnimator/lua-http Source0: https://github.com/daurnimator/lua-http/archive/v%{version}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: lua BuildRequires: pandoc Requires: lua-basexx >= 0.2.0 Requires: lua-binaryheap >= 0.3 Requires: lua-bitop Requires: lua-compat53 >= 0.3 Requires: lua-fifo Requires: lua-luaossl >= 20161208 Requires: lua-lpeg Requires: lua-lpeg-patterns >= 0.5 Requires: lua-cqueues >= 20161214 %description lua-http is an performant, capable HTTP and WebSocket library for Lua. %if 0%{?fedora} || 0%{?rhel} > 7 %package -n compat-%{name} Summary: HTTP library for Lua Requires: compat-lua-basexx >= 0.2.0 Requires: compat-lua-binaryheap >= 0.3 Requires: compat-lua-bitop Requires: compat-lua-compat53 >= 0.3 Requires: compat-lua-fifo Requires: compat-lua-luaossl >= 20161208 Requires: compat-lua-lpeg Requires: compat-lua-lpeg-patterns >= 0.5 Requires: lua-cqueues-compat >= 20161214 %description -n compat-%{name} lua-http is an performant, capable HTTP and WebSocket library for Lua. %endif %package doc Summary: Documentation for HTTP library for Lua Requires: %{name} = %{version} %if 0%{?fedora} || 0%{?rhel} > 7 Requires: compat-%{name} = %{version} %endif %description doc Documentation for the HTTP library for Lua. %prep %setup -q -n %{name}-%{version} %build pushd doc %make_build lua-http.html lua-http.3 popd %install install -d -m 0755 "%{buildroot}%{_pkgdocdir}" install -p -m 0644 doc/lua-http.html "%{buildroot}%{_pkgdocdir}/index.html" install -D -p -m 0644 doc/lua-http.3 -t "%{buildroot}%{_mandir}/man3/" install -d -m 0755 %{buildroot}%{luapkgdir}/http install -p -m 0644 http/*.lua -t "%{buildroot}%{luapkgdir}/http/" install -d -m 0755 %{buildroot}%{luapkgdir}/http/compat install -p -m 0644 http/compat/*.lua -t "%{buildroot}%{luapkgdir}/http/compat/" %if 0%{?fedora} || 0%{?rhel} > 7 install -d -m 0755 %{buildroot}%{luacompatpkgdir}/http install -p -m 0644 http/*.lua -t "%{buildroot}%{luacompatpkgdir}/http/" install -d -m 0755 %{buildroot}%{luacompatpkgdir}/http/compat install -p -m 0644 http/compat/*.lua -t "%{buildroot}%{luacompatpkgdir}/http/compat/" %endif %files %{_mandir}/man3/lua-http.3* %license LICENSE.md %{luapkgdir}/http %if 0%{?fedora} || 0%{?rhel} > 7 %files -n compat-%{name} %{_mandir}/man3/lua-http.3* %license LICENSE.md %{luacompatpkgdir}/http %endif %files doc %{_pkgdocdir} %doc %{_pkgdocdir}/index.html %changelog * Mon Apr 08 2019 Tomas Krizek - 0.5-1 - Initial package for Fedora 28+ and EPEL 7+