%{!?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-luaossl Version: 20181207 Release: 1%{?dist} Summary: Most comprehensive OpenSSL module in the Lua universe License: MIT URL: https://github.com/wahern/luaossl Source0: https://github.com/wahern/luaossl/archive/rel-%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: make BuildRequires: openssl-devel BuildRequires: lua BuildRequires: lua-devel %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: compat-lua BuildRequires: compat-lua-devel %endif Requires: lua(abi) = %{luaver} %description luaossl is a comprehensive binding to OpenSSL for Lua 5.1, 5.2, and later. %if 0%{?fedora} || 0%{?rhel} > 7 %package -n compat-%{name} Summary: Most comprehensive OpenSSL module in the Lua universe Requires: lua(abi) = %{luacompatver} %description -n compat-%{name} luaossl is a comprehensive binding to OpenSSL for Lua 5.1, 5.2, and later. %endif %package doc Summary: Documentation for OpenSSL Lua module BuildArch: noarch Requires: %{name} = %{version} %if 0%{?fedora} || 0%{?rhel} > 7 Requires: compat-%{name} = %{version} %endif %description doc Documentation for the Stackable Continuation Queues library for the Lua Programming Language %prep %setup -q -n luaossl-rel-%{version} %build %set_build_flags export CFLAGS="$CFLAGS -fPIC" 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 DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} install%{luaver} install -d -m 0755 %{buildroot}%{_pkgdocdir} install -p -m 0644 doc/luaossl.pdf %{buildroot}%{_pkgdocdir}/luaossl.pdf %if 0%{?fedora} || 0%{?rhel} > 7 make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} install%{luacompatver} %endif %files %{luapkgdir}/openssl %{luapkgdir}/openssl.lua %{lualibdir}/_openssl.so %license LICENSE %if 0%{?fedora} || 0%{?rhel} > 7 %files -n compat-%{name} %{luacompatpkgdir}/openssl %{luacompatpkgdir}/openssl.lua %{luacompatlibdir}/_openssl.so %license LICENSE %endif %files doc %{_pkgdocdir} %doc %{_pkgdocdir}/luaossl.pdf %changelog * Mon Apr 08 2019 Tomas Krizek - 20181207-1 - Initial package for F28+ and EPEL 7+