Apache Portable Runtime
binding for Lua

The Lua/APR binding aims to bring most of the functionality in the Apache Portable Runtime library to the small and flexible programming language Lua. Thus far the following modules have been implemented (the following links take you straight to the relevant documentation):

How to download, build & install the module

There are Windows binaries available that have been tested with Lua for Windows v5.1.4-40. You can also build the Lua/APR binding yourself. Here are your options:

Build on UNIX using LuaRocks

The easiest way to download, build & install the Lua/APR binding is to use LuaRocks:

$ luarocks install http://peterodding.com/code/lua/apr/downloads/lua-apr-0.14.2-1.rockspec

If you have git installed you can also download and install the latest sources using the following command:

$ luarocks install http://peterodding.com/code/lua/apr/downloads/lua-apr-scm-1.rockspec

After installing the library you can run the test suite using the following command:

$ lua -lapr.test

Build on UNIX using makefile

If you don't have LuaRocks installed the following shell commands should help you get started on UNIX:

$ if which git; then # Get the latest sources using `git'?
$   git clone git://github.com/xolox/lua-apr.git
$ else # Or get the most recently released archive using `wget'.
$   wget http://peterodding.com/code/lua/apr/downloads/lua-apr-0.14.2-1.zip
$   unzip lua-apr-0.14.2-1.zip
$   mv lua-apr-0.14.2-1 lua-apr
$ fi
$ cd lua-apr
$ sudo make install_deps # installs build & runtime dependencies for Debian/Ubuntu
$ sudo make install # installs apr.lua and apr/core.so in /usr/local
$ lua -lapr.test # runs the test suite

The makefile creates a debug build by default. Use sudo make install RELEASE=1 to create a release build instead. Just be sure to run make clean when switching between debug/release mode to avoid linking incompatible object files.

Build on Windows using makefile

A makefile for Microsoft Windows is included in the repository. It has been tested on Windows XP with NMAKE from the free Microsoft Visual C++ Express 2010 tool chain. If you don't have git installed you can download the latest sources directly from GitHub as a ZIP file. Please note that the Windows makefile only builds the Lua/APR binding, you need to build APR yourself (see the instructions).

The makefile creates a debug build by default. Use NMAKE /f Makefile.win RELEASE=1 to create a release build instead. Just be sure to run NMAKE /f Makefile.win clean when switching between debug/release mode to avoid linking incompatible object files.

Status

The following functionality has not been implemented yet but is on the to-do list:

Contact

If you have questions, bug reports, suggestions, etc. the author can be contacted at peter@peterodding.com. The latest version is available at http://peterodding.com/code/lua/apr/ and http://github.com/xolox/lua-apr.

License

This software is licensed under the MIT license.
© 2011 Peter Odding <peter@peterodding.com> and zhiguo zhao <zhaozg@gmail.com>.