0

I am using CentOS 5.

I am trying using Mod_Security which requires liblua. I was not able to find lua on the default repos. I prefer not to use any third party repos. This in mind, I downloaded the lua source from the offical site. After compiling the only file even close is liblua.a. I need a liblua-5.1(.4).so file for Apache.

How do I make a .so file for liblua?

Joshua Enfield
  • 3,454
  • 8
  • 42
  • 59

3 Answers3

1

Grab a similar-enough SRPM and rebuild it, preferably with mock.

EDIT:

Oh great, now you've done it. See what happens when I get bored?

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • Can you clarify? I haven't used mock, I take it you recommended it for testing the install first? I attempted a rpm -i [rpm name] but it complained the MD5 sum did not match for file lua-5.1.4-autotoolize.patch. – Joshua Enfield May 12 '10 at 21:22
0

Desiring to compile from source rather than enable a 3rd party repository is an anti-pattern.

Nathan Powell
  • 579
  • 2
  • 6
0

For future reads of this, to do this from source you do the following:

Download Lua source from site.
yum install curses-devel readline-devel
make linux (you may need to get a few other devel libraries if the above fails)
cd /usr/local/lib
gcc -shared -o liblua.5.1.3.so /usr/local/lib/liblua.a
mv liblua.5.1.3.so liblua.5.1.3.so /usr/lib/

Note to load this, and libxml2 into mod_security you need to use LoadFile not LoadModule.
LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua.5.1.3.so
Joshua Enfield
  • 3,454
  • 8
  • 42
  • 59
  • 2
    You should really get out of the habit of copying these to /usr/lib/, leave that for the RPM supplied .so files. Keep them in /usr/local/lib/ where they belong and be a good sysadmin. :) –  Jun 07 '10 at 04:58