Sophie

Sophie

distrib > Mandriva > 10.1 > i586 > by-pkgid > 91a3f9cd2341d86bfec2b2cb116e3e22 > files > 3

luasocket-2.0-1mdk.src.rpm

%define name         luasocket
%define soname       socket
%define version      2.0
%define major        2
%define release      1mdk
%define libname      %mklibname %{name} %{major}
%define libname_orig %mklibname %{name}
%define lua_version  5.0

Summary:        Network access library for the Lua programming language
Name:           %name
Version:        %version
Release:        %release
License:        MIT
Group:          Development/Other
URL:            http://www.tecgraf.puc-rio.br/~diego/luasocket/new/
Source0:        %{name}-%{version}-alpha.tar.bz2
Patch0:         %{name}.patch.bz2
BuildRoot:      %_tmppath/%{name}-buildroot
Obsoletes:      %{libname} = %{version}
Obsoletes:      %{libname_orig}
Provides:       %{libname} = %{version}
Provides:       %{libname_orig}

%description
LuaSocket is a Lua extension library that is composed by two parts: a C layer
that provides support for the TCP and UDP transport layers, and a set of Lua
modules that add support for the SMTP (sending e-mails), HTTP (WWW access) and
FTP (uploading and downloading files) protocols.


%package -n     %{libname}
Summary:        Network access library for the Lua programming language
Group:          Development/Other
Obsoletes:      %{libname} = %{version}
Obsoletes:      %{libname_orig}
Provides:       %{libname} = %{version}
Provides:       %{libname_orig}
Requires:       liblua5
BuildRequires:  liblua-devel

%description -n %{libname}
LuaSocket is a Lua extension library that is composed by two parts: a C layer
that provides support for the TCP and UDP transport layers, and a set of Lua
modules that add support for the SMTP (sending e-mails), HTTP (WWW access) and
FTP (uploading and downloading files) protocols.

%package -n     %{libname}-devel
Summary:        Static library and header files for the luasocket library
Group:          Development/Other
License:        MIT
Obsoletes:      %{libname}-devel = %{version}
Obsoletes:      %{libname_orig}-devel
Provides:       %{libname}-devel = %{version}
Provides:       %{libname_orig}-devel
Requires:       %{libname} = %{version}-%{release}

%description -n %{libname}-devel
LuaSocket is a Lua extension library that is composed by two parts: a C layer
that provides support for the TCP and UDP transport layers, and a set of Lua
modules that add support for the SMTP (sending e-mails), HTTP (WWW access) and
FTP (uploading and downloading files) protocols.

This package contains the static libluasocket library and its header files
needed to compile applications that use luasocket.

%prep
%setup -q -n %{name}-%{version}-alpha
%patch -p1

%build
export CFLAGS="%{optflags} -fPIC"
%make

%install
strip %{soname}.so
%__rm -rf %{buildroot}
install -d %{buildroot}/%{_libdir}/lua/%{lua_version}
install -d %{buildroot}/%{_datadir}/lua/%{lua_version}
install -d %{buildroot}/%{_includedir}/lua/%{lua_version}
install -d %{buildroot}/%{_defaultdocdir}/lua/%{lua_version}/%{name}
install -m0755 %{soname}.so %{buildroot}%{_libdir}/lua/%{lua_version}
install -m0644 %{soname}.a %{buildroot}/%{_libdir}/lua/%{lua_version}
install -m0644 luasocket.h %{buildroot}%{_includedir}/lua/%{lua_version}
install -m0644 NEW %{buildroot}%{_defaultdocdir}/lua/%{lua_version}/%{name}
install -m0644 README %{buildroot}%{_defaultdocdir}/lua/%{lua_version}/%{name}
install -m0644 lua.README %{buildroot}%{_defaultdocdir}/lua/%{lua_version}/%{name}

%post -n %{libname}
cd %{_datadir}/lua/%{lua_version} && rm -f %{soname}.lua && ln default.lua %{soname}.lua

%postun -n %{libname}
if [ "$1" = "0" ]; then
  rm -f %{_datadir}/lua/%{lua_version}/%{soname}.lua
fi

%clean
%__rm -rf %{buildroot}

%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/lua/%{lua_version}/*.so
%{_defaultdocdir}/lua/%{lua_version}/*

%files -n %{libname}-devel
%defattr(-,root,root)
%{_includedir}/lua/%{lua_version}/*
%{_libdir}/lua/%{lua_version}/*.so
%{_libdir}/lua/%{lua_version}/*.a

%changelog
* Wed May 05 2004 Lenny Cartier <lenny@mandrakesoft.com> 2.0-1mdk
- from Andre Nathan <andre@digirati.com.br> :
	- Package creation.