File lua51-luafilesystem-fix-configuration.patch of Package lua51-luafilesystem

Index: luafilesystem-1.6.2/Makefile
===================================================================
--- luafilesystem-1.6.2.orig/Makefile
+++ luafilesystem-1.6.2/Makefile
@@ -1,6 +1,7 @@
 # $Id: Makefile,v 1.36 2009/09/21 17:02:44 mascarenhas Exp $
 
 T= lfs
+V= @@VERSION@@
 
 CONFIG= ./config
 
@@ -9,14 +10,15 @@ include $(CONFIG)
 SRCS= src/$T.c
 OBJS= src/$T.o
 
-lib: src/lfs.so
+lib: src/$(LIBNAME)
 
-src/lfs.so: $(OBJS)
-	MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/lfs.so $(OBJS)
+src/$(LIBNAME): $(OBJS)
+	MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS)
 
 install:
 	mkdir -p $(LUA_LIBDIR)
-	cp src/lfs.so $(LUA_LIBDIR)
+	cp src/$(LIBNAME) $(LUA_LIBDIR)
+	cd src; ln -sf $(LIBNAME) $T.so ; cp -r $T.so $(LUA_LIBDIR)
 
 clean:
-	rm -f src/lfs.so $(OBJS)
+	rm -f src/$(LIBNAME) $(OBJS)
Index: luafilesystem-1.6.2/config
===================================================================
--- luafilesystem-1.6.2.orig/config
+++ luafilesystem-1.6.2/config
@@ -4,7 +4,7 @@
 PREFIX=/usr/local
 
 # System's libraries directory (where binary libraries are installed)
-LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
+LUA_LIBDIR= $(PREFIX)$(LIBDIR)/lua/5.1
 
 # Lua includes directory
 LUA_INC= $(PREFIX)/include
@@ -16,7 +16,7 @@ LIB_OPTION= -shared #for Linux
 LIBNAME= $T.so.$V
 
 # Compilation directives
-WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
+WARN= -fPIC -W $(OPTFLAGS) -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
 INCS= -I$(LUA_INC)
 CFLAGS= $(WARN) $(INCS)
 CC= gcc