Browse Source

upgrading package: lua-curl 0.3.0 -> 1.2.1

master
parent
commit
ea2bdcb8a4
  1. 159
      lua-curl/lua-curl.patch
  2. 48
      lua-curl/lua-curl.spec

159
lua-curl/lua-curl.patch

@ -1,85 +1,74 @@
Index: Makefile
--- Makefile.orig 2008-10-25 17:26:26 +0200
+++ Makefile 2010-02-08 12:01:53 +0100
@@ -1,37 +1,35 @@
# TODO: support for abi&libtool, installation of lua-curl.h
-LIBNAME=liblua5.1-curl
+LIBNAME=libcurl
LIBTOOL=libtool --silent --tag=CC
-HEADER=/usr/include/curl/curl.h
+HEADER=$(PREFIX)/include/curl/curl.h
PREFIX=/usr/local/
#LUA=lua50
-LUA=lua5.1
-LUADOC= luadoc
+LUA=$(PREFIX)/bin/lua
+LUADOC= $(PREFIX)/bin/luadoc
VERSION_INFO=0:0:0
CONSTANTS:= curlopt.h curl_netrcopt.h \
curl_form.h curl_authopt.h curl_ftpauthopt.h curl_ftpmethods.h
-CURL_CFLAGS:= $(shell curl-config --cflags 2>/dev/null) $(shell getconf LFS_CFLAGS)
+CURL_CFLAGS:= $(shell curl-config --cflags 2>/dev/null)
CURL_LDFLAGS:= $(shell curl-config --libs 2>/dev/null)
REALSO:=$(LIBNAME).so.$(subst :,.,$(VERSION_INFO))
# ------------------------------ lua5.1 stuff ---------------------------------
-ifeq "$(LUA)" "lua5.1"
-LUA_CFLAGS := $(shell pkg-config lua5.1 --cflags) $(shell getconf LFS_CFLAGS)
+LUA_CFLAGS := $(shell pkg-config lua --cflags)
# This retrieves the name of the libtool convenience library for Lua
# (e.g. "/usr/lib/liblua5.1.la") used by --mode=link.
-LUA_LIBTOOL_S := $(shell pkg-config lua5.1 --variable=libtool_lib)
+LUA_LIBTOOL_S := $(shell pkg-config lua --variable=libtool_lib)
LUA_LIBTOOL_D := $(LUA_LIBTOOL_S)
# this is the path where you'll eventually install the module
-LUA_RPATH:=$(shell pkg-config lua5.1 --define-variable=prefix=$(PREFIX) \
+LUA_RPATH:=$(shell pkg-config lua --define-variable=prefix=$(PREFIX) \
--variable=INSTALL_CMOD)
# this is the path where you'll eventually install the C header file
-LUA_HPATH:=$(shell pkg-config lua5.1 --define-variable=prefix=$(PREFIX) \
+LUA_HPATH:=$(shell pkg-config lua --define-variable=prefix=$(PREFIX) \
--variable=includedir)/lua5.1
LUA_DPATH:=$(PREFIX)/share/doc/luacurl/
LUA_LPATH:=$(PREFIX)/lib/
-OBJS:= lua-curl.lo luabind.lo
-endif
+OBJS:= lua-curl.o luabind.o
# ------------------------------ lua50 stuff ---------------------------------
ifeq "$(LUA)" "lua50"
@@ -47,7 +45,7 @@
endif
# ------------------------- Here the Makefile --------------------------------
-all: $(LIBNAME).la
+all: curl.so
constants:$(CONSTANTS)
doc: doc/curl.html
doc/curl.html: lua-curl.luadoc
@@ -55,20 +53,16 @@
$(LUADOC) -d `pwd`/doc/ `pwd`/doc/*.lua
rm -f doc/*.lua doc/index.html
-%.lo: %.c
- $(LIBTOOL) --mode=compile $(CC) -c -Wall -O2 $(LUA_CFLAGS) $<
+%.o: %.c
+ $(CC) -c -Wall -O2 -fPIC $(CURL_CFLAGS) $(LUA_CFLAGS) $<
# link objects to make static and dynamic libraries. The .so will be
# left in "./.libs/". Note that the Lua library and its dependencies are
# not called out on the link line since they are assumed to be part of
# whatever our library is linked to. We want to avoid duplicate library
# copies, which is a waste of space and can cause run-time problems.
-$(LIBNAME).la curl.so: constants $(OBJS)
- $(LIBTOOL) --mode=link $(CC) \
- -rpath $(LUA_RPATH) -o $(LIBNAME).la \
- -version-info $(VERSION_INFO) \
- $(CURL_LDFLAGS) $(OBJS)
- ln -sf ./.libs/$(REALSO) curl.so
+curl.so: constants $(OBJS)
+ $(CC) -shared -o curl.so $(OBJS) $(CURL_LDFLAGS) -llua
# If all went well, we can dynamically load the module into Lua. The
# following will load the library into the interpreter and call a function.
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},

48
lua-curl/lua-curl.spec

@ -22,9 +22,8 @@
##
# package version
%define V_lua 5.1
%define V_curl 0.3.0
%define V_subdir 3788
%define V_lua 5.3
%define V_curl 1.2.1
# package information
Name: lua-curl
@ -37,15 +36,15 @@ Class: EVAL
Group: Language
License: MIT
Version: %{V_curl}
Release: 20100208
Release: 20150112
# list of sources
Source0: http://luaforge.net/frs/download.php/%{V_subdir}/lua-curl_%{V_curl}.orig.tar.gz
Source0: http://files.luaforge.net/releases/luacurl/luacurl/luacurl-%{V_curl}/luacurl-%{V_curl}.zip
Patch0: lua-curl.patch
# build information
BuildPreReq: OpenPKG, openpkg >= 20100101, gcc
PreReq: OpenPKG, openpkg >= 20100101
BuildPreReq: OpenPKG, openpkg >= 20140101, gcc
PreReq: OpenPKG, openpkg >= 20140101
BuildPreReq: lua, curl
PreReq: lua, curl
@ -55,35 +54,34 @@ PreReq: lua, curl
%track
prog lua-curl = {
version = %{V_curl}
url = http://luaforge.net/frs/?group_id=117
url = http://files.luaforge.net/releases/luacurl/luacurl
regex = luacurl-(__VER__)\.tar\.gz
}
prog lua-curl:subdir = {
version = %{V_subdir}
url = http://luaforge.net/frs/?group_id=117
regex = download\.php/(\d+)/luacurl-(__VER__)\.tar\.gz
}
%prep
%setup -q -n lua-curl-%{V_curl}
%setup -q -n luacurl-%{V_curl}
%patch -p0
%build
%{l_make} %{l_mflags} \
CC="%{l_cc}" \
PREFIX="%{l_prefix}"
%{l_shtool} subst %{l_value -s -a} CMakeLists.txt
DESTDIR=$RPM_BUILD_ROOT%{l_prefix} \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX="%{l_prefix}" \
-DCMAKE_C_COMPILER="%{l_cc}" \
-DCMAKE_CXX_COMPILER="%{l_cxx}" \
-DCMAKE_C_FLAGS="%{l_cflags} %{l_cppflags lua .}" \
-DCMAKE_CXX_FLAGS="%{l_cxxflags} %{l_cppflags lua .}" \
-DCMAKE_EXE_LINKER_FLAGS="%{l_ldflags}" \
.
%{l_make} %{l_mflags}
%install
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/lib/lua/%{V_lua} \
$RPM_BUILD_ROOT%{l_prefix}/share/lua/doc/curl
%{l_shtool} install -c -m 644 \
curl.so $RPM_BUILD_ROOT%{l_prefix}/lib/lua/%{V_lua}/
$RPM_BUILD_ROOT%{l_prefix}/lib/lua/%{V_lua}
%{l_shtool} install -c -m 644 \
doc/* $RPM_BUILD_ROOT%{l_prefix}/share/lua/doc/curl/
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} \
'%doc %{l_prefix}/share/lua/doc/curl/*'
libProject.so $RPM_BUILD_ROOT%{l_prefix}/lib/lua/%{V_lua}/curl.so
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files

Loading…
Cancel
Save