Index: CMakeLists.txt
--- CMakeLists.txt.orig	2008-05-01 04:02:57.000000000 +0200
+++ CMakeLists.txt	2015-01-12 21:37:34.636616892 +0100
@@ -1,32 +1,27 @@
 # src/CMakeLists.txt
 
+cmake_minimum_required(VERSION 3.1)
+
+if(COMMAND cmake_policy)
+    cmake_policy(SET CMP0003 NEW)
+endif(COMMAND cmake_policy)
+
 FIND_LIBRARY(LIB_LUA lua PATHS
-	/usr/local/lib
-	/usr/lib
+	@l_prefix@/lib
 )
 
-IF(NOT LIB_LUA)
-	FIND_LIBRARY(LIB_LUA lua5.1 PATHS
-		/usr/local/lib
-		/usr/lib
-	)
-ENDIF(NOT LIB_LUA)
-
 FIND_PATH( CURL_INCLUDE_DIR curl/curl.h
-  /usr/include
-  /usr/local/include
+  @l_prefix@/include
 )
 
 FIND_LIBRARY( LIB_CURL curl
-  /usr/lib
-  /usr/local/lib
+  @l_prefix@/lib
 )
 
 INCLUDE_DIRECTORIES(
 	${${PROJECT_NAME}_SOURCE_DIR}/src
 	${CURL_INCLUDE_DIR}
-	/usr/local/include/lua5.1
-	/usr/include/lua5.1
+    @l_prefix@/include/lua
 )
 
 SET(${PROJECT_NAME}_LIBRARIES
@@ -39,5 +34,5 @@
 )
 
 LINK_LIBRARIES(${${PROJECT_NAME}_LIBRARIES} m)
-ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES})
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
 INSTALL_TARGETS(/lib ${PROJECT_NAME})
Index: luacurl.c
--- luacurl.c.orig	2008-05-05 15:14:55.000000000 +0200
+++ luacurl.c	2015-01-12 21:37:16.246671033 +0100
@@ -810,7 +810,7 @@
 }
 
 
-static const struct luaL_reg luacurl_meths[] =
+static const struct luaL_Reg luacurl_meths[] =
 {
 	{"close", lcurl_easy_close},
 	{"setopt", lcurl_easy_setopt},
@@ -820,7 +820,7 @@
 	{0, 0}
 };
 
-static const struct luaL_reg luacurl_funcs[] =
+static const struct luaL_Reg luacurl_funcs[] =
 {
 	{"new", lcurl_easy_init},
 	{"escape", lcurl_escape},
