From ce01081879e8a670241df15b110a863de668a048 Mon Sep 17 00:00:00 2001 From: John Regan Date: Sun, 10 Jan 2016 10:48:47 -0600 Subject: [PATCH] New package: lua-lualdap-1.2.0 --- .../files/001-makefile-generic.patch | 13 ++++ .../files/002-lua52-lua53-fix.patch | 22 ++++++ srcpkgs/lua-lualdap/files/COPYING | 20 ++++++ srcpkgs/lua-lualdap/template | 69 +++++++++++++++++++ srcpkgs/lua51-lualdap | 1 + srcpkgs/lua52-lualdap | 1 + 6 files changed, 126 insertions(+) create mode 100644 srcpkgs/lua-lualdap/files/001-makefile-generic.patch create mode 100644 srcpkgs/lua-lualdap/files/002-lua52-lua53-fix.patch create mode 100644 srcpkgs/lua-lualdap/files/COPYING create mode 100644 srcpkgs/lua-lualdap/template create mode 120000 srcpkgs/lua51-lualdap create mode 120000 srcpkgs/lua52-lualdap diff --git a/srcpkgs/lua-lualdap/files/001-makefile-generic.patch b/srcpkgs/lua-lualdap/files/001-makefile-generic.patch new file mode 100644 index 00000000000..10d203008bd --- /dev/null +++ b/srcpkgs/lua-lualdap/files/001-makefile-generic.patch @@ -0,0 +1,13 @@ +diff --git Makefile Makefile +index 3ff7bc1..f05d15b 100644 +--- Makefile ++++ Makefile +@@ -1,8 +1,3 @@ +-CFLAGS += $(shell pkg-config --cflags lua) +-LDLIBS += $(shell pkg-config --libs lua) -lldap +- +-LUA_MODULES := $(shell pkg-config --variable=INSTALL_CMOD lua) +- + all: lualdap.so + + lualdap.so: lualdap.c diff --git a/srcpkgs/lua-lualdap/files/002-lua52-lua53-fix.patch b/srcpkgs/lua-lualdap/files/002-lua52-lua53-fix.patch new file mode 100644 index 00000000000..ca0b0be5738 --- /dev/null +++ b/srcpkgs/lua-lualdap/files/002-lua52-lua53-fix.patch @@ -0,0 +1,22 @@ +diff --git lualdap.c lualdap.c +index a3f42a9..026e369 100644 +--- lualdap.c ++++ lualdap.c +@@ -876,7 +876,7 @@ static int lualdap_search_tostring(lua_State *L) + */ + static int lualdap_createmeta(lua_State *L) + { +- const luaL_reg methods[] = { ++ const luaL_Reg methods[] = { + {"close", lualdap_close}, + {"add", lualdap_add}, + {"compare", lualdap_compare}, +@@ -1043,7 +1043,7 @@ static void set_info(lua_State *L) + */ + int luaopen_lualdap(lua_State *L) + { +- struct luaL_reg lualdap[] = { ++ struct luaL_Reg lualdap[] = { + {"open_simple", lualdap_open_simple}, + {NULL, NULL}, + }; diff --git a/srcpkgs/lua-lualdap/files/COPYING b/srcpkgs/lua-lualdap/files/COPYING new file mode 100644 index 00000000000..af8815c5f2a --- /dev/null +++ b/srcpkgs/lua-lualdap/files/COPYING @@ -0,0 +1,20 @@ +Copyright (c) 2003-2007 The Kepler Project. +Copyright (c) 2015 Jason A. Donenfeld . + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/srcpkgs/lua-lualdap/template b/srcpkgs/lua-lualdap/template new file mode 100644 index 00000000000..f38f4cf7d70 --- /dev/null +++ b/srcpkgs/lua-lualdap/template @@ -0,0 +1,69 @@ +# Template file for 'lua-lualdap' +pkgname=lua-lualdap +version=1.2.0 +revision=1 +build_style=gnu-makefile +hostmakedepends="pkg-config" +makedepends="lua51-devel lua52-devel lua-devel libldap-devel" +short_desc="LDAP bindings for Lua" +maintainer="John Regan " +license="MIT" +homepage="http://git.zx2cf.com/lualdap" +distfiles="http://git.zx2c4.com/lualdap/snapshot/lualdap-${version}.tar.xz" +checksum=126c50f013ebf329c1771ab4d489f5e6eb7b11d2a64412414f1c6bc6e8a69ed8 +wrksrc="lualdap-${version}" + +post_extract() { + cd ${wrksrc} + for p in ${FILESDIR}/*.patch; do + patch -p0 -i "${p}" + done + mkdir -p lua51 + mv * lua51 || true + cp -a lua51 lua52 + cp -a lua51 lua53 +} + +do_build() { + for luaver in 5.1 5.2 5.3; do + cd ${wrksrc}/lua${luaver//.} + make \ + CC=$CC \ + LD=$CC \ + CFLAGS="$(pkg-config --cflags lua${luaver})" \ + LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \ + LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \ + ${makejobs} + done +} + +do_install() { + for luaver in 5.1 5.2 5.3; do + cd ${wrksrc}/lua${luaver//.} + make \ + CC=$CC \ + LD=$CC \ + CFLAGS="$(pkg-config --cflags lua${luaver})" \ + LDLIBS="$(pkg-config --libs lua${luaver}) -lldap" \ + LUA_MODULES="$(pkg-config --variable=INSTALL_CMOD lua${luaver})" \ + DESTDIR="${PKGDESTDIR}" \ + install + done + vlicense "${FILESDIR}/COPYING" +} + +lua51-lualdap_package() { + short_desc+=" - Lua 5.1" + pkg_install() { + vmove usr/lib/lua/5.1 + vlicense "${FILESDIR}/COPYING" + } +} + +lua52-lualdap_package() { + short_desc+=" - Lua 5.2" + pkg_install() { + vmove usr/lib/lua/5.2 + vlicense "${FILESDIR}/COPYING" + } +} diff --git a/srcpkgs/lua51-lualdap b/srcpkgs/lua51-lualdap new file mode 120000 index 00000000000..27333fc92f7 --- /dev/null +++ b/srcpkgs/lua51-lualdap @@ -0,0 +1 @@ +lua-lualdap \ No newline at end of file diff --git a/srcpkgs/lua52-lualdap b/srcpkgs/lua52-lualdap new file mode 120000 index 00000000000..27333fc92f7 --- /dev/null +++ b/srcpkgs/lua52-lualdap @@ -0,0 +1 @@ +lua-lualdap \ No newline at end of file