File lua51-luasocket.spec of Package lua51-luasocket

#
# spec file for package lua51-luasocket
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define lua_archdir %{_libdir}/lua/5.1
%define lua_noarchdir %{_datadir}/lua/5.1


Name:           lua51-luasocket
Version:        3.0~rc1+git20140716
Release:        1.1
Summary:        Network support for the Lua language
License:        MIT
Group:          Development/Libraries
Url:            https://github.com/diegonehab/luasocket
Source:         luasocket-3.0~rc1-git20140716.tar.gz
Patch0:         luasocket-makefile.patch
#%if 0%{?suse_version} >= 1220
BuildRequires:  lua51-devel
#%else
#BuildRequires:  lua-devel
#%endif
Requires:       Lua(API) = 5.1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
LuaSocket is a Lua extension library that is composed by two parts: a C core
that provides support for the TCP and UDP transport layers, and a set of Lua
modules that add support for functionality commonly needed by applications
that deal with the Internet.

Among the support modules, the most commonly used implement the SMTP, HTTP
and FTP. In addition there are modules for MIME, URL handling and LTN12.

%prep
%setup -q -n luasocket-3.0~rc1+git20140716
%patch0 -p1

%build
%{_bindir}/iconv -f ISO8859-1 -t UTF8 LICENSE >LICENSE.UTF8
mv -f LICENSE.UTF8 LICENSE
make %{?_smp_mflags} OPTFLAGS="%{optflags} -fPIC" linux

%install
make install-unix OPTFLAGS="%{optflags}" INSTALL_TOP=%{buildroot} INSTALL_TOP_CDIR=%{buildroot}%{lua_archdir} INSTALL_TOP_LDIR=%{buildroot}%{lua_noarchdir}

%files
%defattr(-,root,root,-)
%doc doc/*
%doc README LICENSE
%dir %{_libdir}/lua
%dir %{_libdir}/lua/5.1
%dir %{_datadir}/lua
%dir %{_datadir}/lua/5.1
%{lua_archdir}/mime
%{lua_archdir}/socket
%{lua_noarchdir}/ltn12.lua
%{lua_noarchdir}/mime.lua
%{lua_noarchdir}/socket.lua
%{lua_noarchdir}/socket/

%changelog
* Thu Sep 15 2016 mvetter@suse.com
- Using Requires: Lua(API) = 5.1 instead of Requires: lua51 as
  suggested by DimStar in SR#423700
* Mon Oct 20 2014 i@marguerite.su
- update version 3.0~rc1+git20140716
* Sat Feb 22 2014 i@marguerite.su
- initial version 3.0~rc1
- copied from luasocket