Update of /cvsroot/fink/dists/10.4/stable/main/finkinfo/languages
In directory vz-cvs-3.sog:/tmp/cvs-serv30159/stable/main/finkinfo/languages

Added Files:
Log Message:
luarocks to stable, with fix to avoid writing to %p during install phase

--- NEW FILE: luarocks.info ---
# luarocks.info
# Fink package file, maintained by Asko Kauppi <akau...@gmail.com>
# Packages:
#   luarocks      Add-on modules manager for Lua 5.1
# Todo:
#   - Author should give man page (luarocks.1)
# Bugs:
#   - none known
# Notes:
#   - Ability to install "fink-wrapped" rocks to '%p/lib/luarocks' by overriding
#     LUAROCKS_CONFIG does not work; the rocks end up in default 
#     '%p/var/lib/luarocks' instead. Will make such modules without LuaRocks,
#     i.e. 'lua51-socket', 'lua51-lfs' etc. (always 'lua51-' and the require
#     name)
# Notes:
#   - The "-ev" parameter to scripts is giving quite a lot of (unnecessary?) 
#     build output. Fink policy seems to be to have it; personally I would be
#     okay with just "-e".
#   - 'md5sum' is there always for fink, not necessary to list as dependency.
# Notes:
#   - LuaRocks will automatically create folders at '$(HOME)/.luarocks' if/when
#     user installs a module. LuaRocks automatically switches between the
#     default target (if having access = sudo) and that location.
# History:
#   dmacks 31-Jan-2012: 1.0-2: make sure install to %i not live %p
#   AKa 4-Sep-2008: 1.0-1 (1.0): Added 'BuildDepends: lua51-dev'
#   AKa 1-Sep-2008: 1.0-0 (1.0 rc3)
#   AKa 27-Aug-2008: 0.6.99-4: Removed the '.luarocks' and '.luarocks-admin'
#                               proxies as unnecessary.
#   AKa 20-Aug-2008: 0.6.99-3: changed how 'manifest' file is dealt with; caused
#                              bug when requiring from Lua
#   AKa 19-Aug-2008: 0.6.99-2 (1.0 rc2) uploaded to Fink
#   AKa 5-Jun-2008: 0.5.2-3 IMPORTANT FIX: 'lua' command did not get parameters
#                           (was: $* -> \$*)
#   AKa 14-Apr-2008: 0.5.2-2 small fixes for validation; uploading to fink
#   AKa 14-Apr-2008: 0.5.2-1 using 'Type: nosource' for luarocks-lfs
#   AKa 13-Apr-2008: 0.5.2-0

# --- luarocks ---
Package: luarocks
Version: 1.0
Revision: 2
Depends: lua51 (>= 5.1.3-5)
BuildDepends: lua51-dev (>= 5.1.3-5)
Recommends: lua51-dev (>= 5.1.3)

# vital for trying out alpha/beta packages (if .tar.gz is renamed after the 
#SourceRename: luarocks-%v.tar.gz

# 1.0
Source: http://luaforge.net/frs/download.php/3727/luarocks-%v.tar.gz
Source-MD5: c884fe3fae925bb30f770361e70e784e

# 1.0rc2
#Source: http://luarocks.luaforge.net/luarocks-1.0-rc2.tar.gz
#Source-MD5: 979294c211b91e06fdc2b48c9d61e819

# ---
Description: Add-on modules manager for Lua 5.1
License: OSI-Approved
Homepage: http://luaforge.net/projects/luarocks/
Maintainer: Asko Kauppi <akau...@gmail.com>

DescDetail: <<
LuaRocks is a system for distribution and building of Lua extension modules.

The fink LuaRocks uses the following paths for storing the installed modules:

- /sw/lib/luarocks/ for extensions wrapped as other fink packages
  (s.a. 'luarocks-socket', 'luarocks-lfs')

- /sw/var/lib/luarocks/ for extension packages installed as 'sudo'

- $(HOME)/.luarocks/ for extension packages installed as regular user

All of this is automatic, and all of the above module paths are configured to
be used (in reversed order; decided by %p/etc/luarocks/config.lua) by Lua.

DescUsage: <<
To use LuaRocks from behind a proxy, make sure your 'http_proxy' and/or
'FTP_PROXY' (yes, the other in lower case, the other in capital) are set
properly. -> man curl

Installing 'lua51-dev' is needed in order to install partly binary packages
manually, via 'luarocks install' (fink packages using LuaRocks will make a
BuildDepend on lua51-dev).

With Fink LuaRocks, you don't need to explicitly say '-lluarocks.require' if
using the 'lua' executable. This is done for you, and Rocks will seamlessly
be available via 'require'.

# NOTE: "!/bin/sh -e" is needed for making 'if-then-else-fi' work.
# Comments are here to avoid unnecessary output when executing the script (-ev).
# Running './configure' creates 'config.unix'.
# 'curl' is preferred over 'wget' since OS X has it by default ('wget' would
# be a dependency)
CompileScript: <<
#!/bin/sh -ev
 ./configure --prefix=%p \
             --sysconfdir=%p/etc/luarocks \
             --rocks-tree=%p/var/lib/luarocks \
             --lua-suffix=51 \
             --with-lua=%p \
             --with-lua-include=%p/include \
             --with-lua-lib=%p/lib \
             --with-downloader=curl \

#InfoTest: <<
#    TestScript: make test || exit 2

# %p/etc/luarocks/config.lua after 'make install':
#rocks_servers = {
#   [[http://luarocks.luaforge.net/rocks]]
#rocks_trees = {
#   home..[[/.luarocks]],
#   [[/sw/var/lib/luarocks]]
InstallScript: <<
#!/bin/sh -ev
 mkdir -p %i/bin \
          %i/etc/luarocks \
          %i/lib/luarocks/rocks \
          %i/var/lib/luarocks/rocks \
 make install DESTDIR=%d
 cat <<EOF >> %i/lib/luarocks/.luarocks-lua51
%p/bin/lua51 -lluarocks.require \$*
 chmod a+x %i/lib/luarocks/.luarocks-lua51

DocFiles: <<

# 'update-alternatives' levels for Lua:
#   510 lua51 package
#   514 LuaRocks (automatically adding '-lluarocks.require')
PostInstScript: <<
 update-alternatives --install %p/bin/lua lua %p/lib/luarocks/.luarocks-lua51 
514 \
            --slave %p/share/man/man1/lua.1 lua.1 %p/share/man/man1/lua51.1
 cat <<EOF

*** Information on using LuaRocks ***

LuaRocks allows a wealth of addon modules be installed for Lua. There are two
ways you can install such modules.

1. Local installation

Typing 'luarocks install xxx' installs package 'xxx' to $(HOME)/.luarocks.

2. System wide manual installation, as 'sudo'

Typing 'sudo luarocks install xxx' installs package 'xxx' to %p/var.

Removing LuaRocks will NOT remove the packages you have installed, but they
won't be usable from Lua unless LuaRocks is reinstalled.

In addition to modules installed via LuaRocks, certain Lua packages can be 
available as separate versioned fink packages, s.a. 'lua51-socket', 'lua51-lfs' 
and 'lua51-lanes'. Building and installing such packages happens without 
LuaRocks, and the modules are placed in the default Lua paths (%p/lib/lua/5.1 
and %p/share/lua/5.1). 

*** Using proxies ***

If you are behind a network proxy, the 'curl' utility needs to be informed.
See 'fink describe luarocks' for details.
( Fink itself needs the proxy set up separately, at %p/etc/fink.conf:
    ProxyHTTP: http://x.x.x.x:port )


In order to build and install binary modules, you will need Lua C headers, 
available in the lua51-dev fink package. This needs to be MANUALLY INSTALLED 
    sudo fink install lua51-dev       <<-- DO THIS STEP NOW

To try LuaRocks out:

    luarocks install luafilesystem
    > require "lfs"
    > = lfs.currentdir()
    luarocks list
        1.4.1-1 (installed) - $(HOME)/.luarocks/rocks/
    luarocks search --all
    luarocks remove luafilesystem

# '/sw/var/lib/luarocks[/rocks]/manifest' is created by LuaRocks at runtime, and
# needs to be explicitly cleaned up. We only do this, if there are no installed
# rocks remaining. Otherwise, we'll leave the rocks and the manifest as well.
# This allows reinstalling LR to see the rocks that were (manually) installed
# during the last installation.
# Note: 'PreRmScript' is always stored as script, "#!/bin/sh -ev" not required.
PreRmScript: <<
 if [ $1 != "upgrade" ]; then
   update-alternatives --remove lua %p/lib/luarocks/.luarocks-lua51
 N=`ls -1 %p/var/lib/luarocks/rocks/ | grep -v manifest | wc -l`
 if test -f %p/var/lib/luarocks/rocks/manifest -a $N -eq 0; then
   rm %p/var/lib/luarocks/rocks/manifest

# See: --> DescDetail, DescUsage
#DescPackaging: <<

Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
Fink-commits mailing list

Reply via email to