dd5888f
%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}}
dd5888f
%{!?lua_libdir: %global lua_libdir %{_libdir}/lua/%{lua_version}}
dd5888f
%{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}}
df9fd4d
dd5888f
%{!?lua_compat_version: %global lua_compat_version 5.1}
dd5888f
%{!?lua_compat_libdir: %global lua_compat_libdir %{_libdir}/lua/%{lua_compat_version}}
dd5888f
%{!?lua_compat_pkgdir: %global lua_compat_pkgdir %{_datadir}/lua/%{lua_compat_version}}
dd5888f
%{!?lua_compat_builddir: %global lua_compat_builddir %{_builddir}/compat-lua-%{name}-%{version}-%{release}}
df9fd4d
df9fd4d
Summary:        Lua binding for OpenSSL library
dd5888f
Name:           lua-sec
6902d82
Version:        0.9
f34987c
Release:        5%{?dist}
df9fd4d
License:        MIT
138fc20
URL:            https://github.com/brunoos/luasec
6902d82
Source0:        https://github.com/brunoos/luasec/archive/v%{version}/luasec-%{version}.tar.gz
dd5888f
Requires:       lua(abi) = %{lua_version}
dd5888f
Requires:       lua-socket
dd5888f
BuildRequires:  gcc
dd5888f
BuildRequires:  lua-devel
f34987c
%if 0%{?fedora} || 0%{?rhel} >= 8
41e2201
BuildRequires:  openssl-devel >= 1.0.2
f34987c
%else
f34987c
BuildRequires:  openssl11-devel
f34987c
%endif
df9fd4d
df9fd4d
%description
df9fd4d
Lua binding for OpenSSL library to provide TLS/SSL communication.
df9fd4d
It takes an already established TCP connection and creates a secure
df9fd4d
session between the peers.
df9fd4d
0135ceb
%if 0%{?fedora} >= 20
dd5888f
%package -n lua%{lua_compat_version}-sec
dd5888f
Summary:        Lua %{lua_compat_version} binding for OpenSSL library
dd5888f
Obsoletes:      lua-sec-compat < 0.7
dd5888f
Provides:       lua-sec-compat = %{version}-%{release}
dd5888f
Provides:       lua-sec-compat%{?_isa} = %{version}-%{release}
dd5888f
Requires:       lua(abi) = %{lua_compat_version}
dd5888f
BuildRequires:  compat-lua-devel >= %{lua_compat_version}
dd5888f
dd5888f
%description -n lua%{lua_compat_version}-sec
dd5888f
Lua %{lua_compat_version} binding for OpenSSL library to provide TLS/SSL communication.
0135ceb
It takes an already established TCP connection and creates a secure
0135ceb
session between the peers.
0135ceb
%endif
df9fd4d
df9fd4d
%prep
6902d82
%setup -q -n luasec-%{version}
df9fd4d
0135ceb
%if 0%{?fedora} >= 20
dd5888f
rm -rf %{lua_compat_builddir}
dd5888f
cp -a . %{lua_compat_builddir}
0135ceb
%endif
df9fd4d
df9fd4d
%build
f34987c
%if 0%{?rhel} == 7
f34987c
OPENSSL_CFLAGS="$(pkg-config --cflags-only-I openssl11)"
f34987c
OPENSSL_LDFLAGS="$(pkg-config --libs-only-L openssl11)"
f34987c
%endif
f34987c
dd5888f
%make_build linux \
f34987c
  CFLAGS="$RPM_OPT_FLAGS -fPIC -I. -I%{_includedir} -DWITH_LUASOCKET -DLUASOCKET_DEBUG -DLUA_COMPAT_APIINTCASTS $OPENSSL_CFLAGS" \
f34987c
  LD="gcc -shared" LDFLAGS="-fPIC -shared -L./luasocket $RPM_LD_FLAGS $OPENSSL_LDFLAGS"
df9fd4d
0135ceb
%if 0%{?fedora} >= 20
dd5888f
pushd %{lua_compat_builddir}
dd5888f
%make_build linux \
dd5888f
  CFLAGS="$RPM_OPT_FLAGS -fPIC -I. -I%{_includedir}/lua-%{lua_compat_version} -DWITH_LUASOCKET -DLUASOCKET_DEBUG -DLUA_COMPAT_APIINTCASTS" \
dd5888f
  LD="gcc -shared" LDFLAGS="-fPIC -shared -L./luasocket $RPM_LD_FLAGS"
0135ceb
popd
0135ceb
%endif
df9fd4d
df9fd4d
%install
dd5888f
%make_install \
f34987c
  CFLAGS="$RPM_OPT_FLAGS -fPIC -I. -I%{_includedir} -DWITH_LUASOCKET -DLUASOCKET_DEBUG -DLUA_COMPAT_APIINTCASTS $OPENSSL_CFLAGS" \
f34987c
  LD="gcc -shared" LDFLAGS="-fPIC -shared -L./luasocket $RPM_LD_FLAGS $OPENSSL_LDFLAGS" \
dd5888f
  LUAPATH=%{lua_pkgdir} LUACPATH=%{lua_libdir}
0135ceb
0135ceb
%if 0%{?fedora} >= 20
dd5888f
pushd %{lua_compat_builddir}
dd5888f
%make_install \
dd5888f
  CFLAGS="$RPM_OPT_FLAGS -fPIC -I. -I%{_includedir}/lua-%{lua_compat_version} -DWITH_LUASOCKET -DLUASOCKET_DEBUG -DLUA_COMPAT_APIINTCASTS" \
dd5888f
  LD="gcc -shared" LDFLAGS="-fPIC -shared -L./luasocket $RPM_LD_FLAGS" \
dd5888f
  LUAPATH=%{lua_compat_pkgdir} LUACPATH=%{lua_compat_libdir}
0135ceb
popd
0135ceb
%endif
df9fd4d
df9fd4d
%files
458d858
%license LICENSE
458d858
%doc CHANGELOG
dd5888f
%{lua_libdir}/ssl.so
dd5888f
%{lua_pkgdir}/ssl.lua
dd5888f
%dir %{lua_pkgdir}/ssl
dd5888f
%{lua_pkgdir}/ssl/*.lua
df9fd4d
0135ceb
%if 0%{?fedora} >= 20
dd5888f
%files -n lua%{lua_compat_version}-sec
458d858
%license LICENSE
458d858
%doc CHANGELOG
dd5888f
%{lua_compat_libdir}/ssl.so
dd5888f
%{lua_compat_pkgdir}/ssl.lua
dd5888f
%dir %{lua_compat_pkgdir}/ssl
dd5888f
%{lua_compat_pkgdir}/ssl/*.lua
0135ceb
%endif
df9fd4d
df9fd4d
%changelog
f34987c
* Sat Nov 14 2020 Robert Scheck <robert@fedoraproject.org> 0.9-5
f34987c
- Build against OpenSSL 1.1 on RHEL 7 (for TLSv1.3 support)
f34987c
4544121
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-4
4544121
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
4544121
f3c6441
* Tue Jun 30 2020 Miro HronĨok <mhroncok@redhat.com> - 0.9-3
f3c6441
- Rebuilt for Lua 5.4
f3c6441
91220eb
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9-2
91220eb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
91220eb
6902d82
* Tue Nov 05 2019 Robert Scheck <robert@fedoraproject.org> 0.9-1
6902d82
- Upgrade to 0.9 (#1767708)
6902d82
c1e4825
* Wed Oct 23 2019 Robert Scheck <robert@fedoraproject.org> 0.8.2-1
c1e4825
- Upgrade to 0.8.2 (#1760499)
c1e4825
6b7a051
* Sat Aug 17 2019 Robert Scheck <robert@fedoraproject.org> 0.8.1-1
6b7a051
- Upgrade to 0.8.1 (#1742784)
6b7a051
41e2201
* Sat Jul 27 2019 Robert Scheck <robert@fedoraproject.org> 0.8-1
41e2201
- Upgrade to 0.8
41e2201
dd5888f
* Fri Jul 26 2019 Robert Scheck <robert@fedoraproject.org> 0.7-1
dd5888f
- Upgrade to 0.7
dd5888f
9db6d29
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-7
9db6d29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
9db6d29
41e3030
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-6
41e3030
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
41e3030
8599de6
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-5
8599de6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
8599de6
311e1b5
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-4
311e1b5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
311e1b5
98aa2fd
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-3
98aa2fd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
98aa2fd
4fa75ce
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.6-2
4fa75ce
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4fa75ce
458d858
* Sat Feb 18 2017 Robert Scheck <robert@fedoraproject.org> 0.6-1
458d858
- Upgrade to 0.6 (#1423914)
458d858
7756a00
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-7
7756a00
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7756a00
97b887c
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-6
97b887c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
97b887c
51e4a42
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-5
51e4a42
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
51e4a42
d994071
* Fri Jan 16 2015 Tom Callaway <spot@fedoraproject.org> - 0.5-4
d994071
- rebuild for lua 5.3
d994071
d331c22
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-3
d331c22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
d331c22
7b16f0b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5-2
7b16f0b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
7b16f0b
0135ceb
* Wed May 14 2014 Jan Kaluza <jkaluza@redhat.com> - 0.5-1
0135ceb
- update to luasec-0.5 (#1000622)
0135ceb
- build -compat subpackage against compat-lua
4bfa664
29be652
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-6
29be652
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
29be652
20b6a1d
* Sun May 12 2013 Tom Callaway <spot@fedoraproject.org> - 0.4.1-5
20b6a1d
- rebuild for lua 5.2
20b6a1d
73ff0cf
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-4
73ff0cf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
73ff0cf
47bedbb
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-3
47bedbb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
47bedbb
df9fd4d
* Tue Mar 06 2012 Johan Cwiklinski <johan AT x-tnd DOT be> 0.4.1-2
df9fd4d
- Remove __mkdir macros
df9fd4d
df9fd4d
* Tue Mar 06 2012 Johan Cwiklinski <johan AT x-tnd DOT be> 0.4.1-1
df9fd4d
- 0.4.1
df9fd4d
- Add lua as a Requires (bz #551763)
df9fd4d
df9fd4d
* Fri Jan 01 2010 Johan Cwiklinski <johan AT x-tnd DOT be> 0.4-1
df9fd4d
- Initial packaging