%if 0%{?fedora} >= 20 || 0%{?rhel} > 7 %define luaver 5.2 %else %define luaver 5.1 %endif %global lualibdir %{_libdir}/lua/%{luaver} %global luapkgdir %{_datadir}/lua/%{luaver} %global real_name luasec %global github_commit 063e8a8a5c57858cdc845f8d51b994426edd37ab %global shortcommit %(c=%{github_commit}; echo ${c:0:7}) Name: lua-sec Version: 0.4.1 Release: 6.0.3.20130824R%{shortcommit}%{?dist} Summary: Lua binding for OpenSSL library Group: Development/Libraries License: MIT URL: https://github.com/brunoos/luasec Source0: https://github.com/brunoos/luasec/archive/%{shortcommit}.tar.gz Patch0: lua-sec-0.4.1-no_ecdh.patch Patch1: lua-sec-0.4.1-fix-Makefile.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: lua-devel BuildRequires: lua-socket-devel BuildRequires: openssl-devel Requires: lua-socket %if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 Requires: lua(abi) = %{luaver} %else Requires: lua >= %{luaver} %endif %description Lua binding for OpenSSL library to provide TLS/SSL communication. It takes an already established TCP connection and creates a secure session between the peers. %prep %setup -q -n %{real_name}-%{github_commit} %patch0 -p1 -b .ecdh %patch1 -p1 -b .fixMakefile for file in CHANGELOG LICENSE; do iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \ touch -r $file $file.new && \ mv $file.new $file done %build make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{_includedir}" \ LDFLAGS="-L%{_libdir}" EXTRA="" DEFS="" \ linux %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{luapkgdir} mkdir -p $RPM_BUILD_ROOT%{lualibdir} make install DESTDIR=$RPM_BUILD_ROOT \ CFLAGS="$RPM_OPT_FLAGS -fPIC -I%{_includedir}" \ EXTRA="" DEFS="" LDFLAGS="-L%{_libdir}" \ LUAPATH=$RPM_BUILD_ROOT%{luapkgdir} \ LUACPATH=$RPM_BUILD_ROOT%{lualibdir} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc CHANGELOG LICENSE %{lualibdir}/ssl.so %{luapkgdir}/ssl.lua %dir %{luapkgdir}/ssl %{luapkgdir}/ssl/* %changelog * Mon Sep 09 2013 Matěj Cepl - 0.4.1-6.0.3.20130824R063e8a8 - Rebuilt for new lua-socket (#985573, #1000622) * Sat Aug 03 2013 Fedora Release Engineering - 0.4.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Sun May 12 2013 Tom Callaway - 0.4.1-5 - rebuild for lua 5.2 * Thu Feb 14 2013 Fedora Release Engineering - 0.4.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Thu Jul 19 2012 Fedora Release Engineering - 0.4.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Tue Mar 06 2012 Johan Cwiklinski 0.4.1-2 - Remove __mkdir macros * Tue Mar 06 2012 Johan Cwiklinski 0.4.1-1 - 0.4.1 - Add lua as a Requires (bz #551763) * Fri Jan 01 2010 Johan Cwiklinski 0.4-1 - Initial packaging