diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..b9bdec1
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,5 @@
+
+lua51
+lua52
+lua53
+
diff --git a/_service b/_service
new file mode 100644
index 0000000..6417984
--- /dev/null
+++ b/_service
@@ -0,0 +1,14 @@
+
+
+ https://github.com/diegonehab/luasocket.git
+ git
+ enable
+ luasocket
+ 3.0~rc1+git%cd.%h
+
+
+ *.tar
+ xz
+
+
+
diff --git a/lua51-luasocket.changes b/lua-luasocket.changes
similarity index 63%
rename from lua51-luasocket.changes
rename to lua-luasocket.changes
index 3bdd8a7..c5272a4 100644
--- a/lua51-luasocket.changes
+++ b/lua-luasocket.changes
@@ -1,3 +1,15 @@
+-------------------------------------------------------------------
+Fri Jul 14 08:42:16 UTC 2017 - tchvatal@suse.com
+
+- Update to version 3.0~rc1+git20170515.5a17f79:
+ * make protect_segment in url.lua rfc compliant
+ * fix for Lua 5.3 built without number / string conversion
+ * correct typo
+ * Fix issue #196
+ * Preserve path when parsing urls.
+ * Fix typo
+- Switch to multibuild package
+
-------------------------------------------------------------------
Tue Jul 11 08:41:58 UTC 2017 - tchvatal@suse.com
diff --git a/lua51-luasocket.spec b/lua-luasocket.spec
similarity index 81%
rename from lua51-luasocket.spec
rename to lua-luasocket.spec
index 5b6ed8d..b0350af 100644
--- a/lua51-luasocket.spec
+++ b/lua-luasocket.spec
@@ -1,5 +1,5 @@
#
-# spec file for package lua51-luasocket
+# spec file for package lua-luasocket
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
@@ -16,18 +16,23 @@
#
-Name: lua51-luasocket
+%define flavor @BUILD_FLAVOR@
+%define mod_name luasocket
+Name: %{flavor}-%{mod_name}
Version: 3.0~rc1+git20140716
Release: 0
Summary: Network support for the Lua language
License: MIT
+# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group: Development/Libraries
Url: https://github.com/diegonehab/luasocket
-Source: luasocket-%{version}.tar.gz
+Source: %{mod_name}-%{version}.tar.gz
Patch0: luasocket-makefile.patch
-BuildRequires: lua51-devel
-Requires: Lua(API) = 5.1
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildRequires: %{flavor}-devel
+Requires: %{flavor}
+%if "%{flavor}" == ""
+ExclusiveArch: do_not_build
+%endif
%description
LuaSocket is a Lua extension library that is composed by two parts: a C core
@@ -39,7 +44,7 @@ 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-%{version}
+%setup -q -n %{mod_name}-%{version}
%patch0 -p1
%build
@@ -51,7 +56,6 @@ make %{?_smp_mflags} OPTFLAGS="%{optflags} -fPIC -I%{lua_incdir}" linux
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
%{lua_archdir}/mime
diff --git a/luasocket-3.0~rc1+git20140716.tar.gz b/luasocket-3.0~rc1+git20140716.tar.gz
deleted file mode 100644
index 70a8004..0000000
--- a/luasocket-3.0~rc1+git20140716.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d917d3967da743a7ea2b0b1aa188f259a08efcaa1ecbaa6801e1765ed39d9e26
-size 2419744
diff --git a/luasocket-3.0~rc1+git20170515.5a17f79.tar.xz b/luasocket-3.0~rc1+git20170515.5a17f79.tar.xz
new file mode 100644
index 0000000..f4b4a98
--- /dev/null
+++ b/luasocket-3.0~rc1+git20170515.5a17f79.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9cc8eba1531179c7ed67e3ec30aec74863ccb9d73e32a3cf8032fc8390255bac
+size 228132