File lua-luasocket.spec of Package lua-luasocket

#
# spec file for package lua-luasocket (Version 2.0.2)
#
# Copyright 2009 Mario García H.
#
# 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.

%define lua_version 5.1
%define lforge_name luasocket
%define lua_libdir	%(eval [ -d %{_libdir}/lua ] && echo 0 || echo 1)
%define lua_datadir	%(eval [ -d %{_datadir}/lua ] && echo 0 || echo 1)

Summary: Comprehensive networking support library for Lua
Name: lua-luasocket
Version: 2.0.2
Release: 1
Source0: %{lforge_name}-%{version}.tar.gz
Source1: http://luaforge.net/frs/download.php/2664/%{lforge_name}-%{version}.tar.gz
Patch0: %{lforge_name}-%{version}-paths.patch
Patch1: %{lforge_name}-%{version}-path64.patch
Vendor: %{vendor}
URL: http://luaforge.net/projects/%{name}/
License: MIT
Requires: lua >= %{lua_version}
BuildRequires: lua-devel >= %{lua_version}
Group: Development/Languages/Lua
BuildRoot: %{_builddir}/%{name}-%{version}-build


%description
LuaSocket is the most comprehensive networking
support library for the Lua language.

It provides easy access to TCP, UDP, DNS, SMTP,
FTP, HTTP, MIME and much more.


%prep
%setup -q -n %{lforge_name}-%{version}
%ifarch = x86_64
%patch1 -p1
%else
%patch0 -p1
%endif


%build
%{__make}


%install
%{__make} DESTDIR=$RPM_BUILD_ROOT install
find %{buildroot} -name "*.so" -exec strip {} \;

#doc/ etc/ samples/ src/ test/

install -d -m 0755 %{buildroot}/%{_docdir}/%{lforge_name}-%{version}
install -m 0644 NEW %{buildroot}/%{_docdir}/%{lforge_name}-%{version}
install -m 0644 README %{buildroot}/%{_docdir}/%{lforge_name}-%{version}
install -m 0644 LICENSE %{buildroot}/%{_docdir}/%{lforge_name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%dir %{_libdir}/lua/%{lua_version}/mime
%dir %{_libdir}/lua/%{lua_version}/socket
%dir %{_datadir}/lua/%{lua_version}/socket
%dir %{_docdir}/%{lforge_name}-%{version}
%if %{?lua_libdir:1}0
%dir %{_libdir}/lua
%dir %{_libdir}/lua/5.1
%endif
%if %{?lua_datadir:1}0
%dir %{_datadir}/lua
%dir %{_datadir}/lua/5.1
%endif
%{_libdir}/lua/%{lua_version}/mime/core.so
%{_libdir}/lua/%{lua_version}/socket/core.so
%{_datadir}/lua/%{lua_version}/ltn12.lua
%{_datadir}/lua/%{lua_version}/mime.lua
%{_datadir}/lua/%{lua_version}/socket.lua
%{_datadir}/lua/%{lua_version}/socket/ftp.lua
%{_datadir}/lua/%{lua_version}/socket/http.lua
%{_datadir}/lua/%{lua_version}/socket/smtp.lua
%{_datadir}/lua/%{lua_version}/socket/tp.lua
%{_datadir}/lua/%{lua_version}/socket/url.lua

%doc %{_docdir}/%{lforge_name}-%{version}/README
%doc %{_docdir}/%{lforge_name}-%{version}/LICENSE
%doc %{_docdir}/%{lforge_name}-%{version}/NEW


%changelog
* Fri Jul 31 2009 Mario García H. <code933k@gmail.com> - 2.0.2
- Initial package.
openSUSE Build Service is sponsored by