From 6e210a8db2bd8e4e63cad3cb3307fd34a3c87a57 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 6 Jan 2021 18:18:17 +0100 Subject: [PATCH] *-luasec: update to 1.0 unify into a single template and add lua54 support --- srcpkgs/lua51-luasec | 1 + srcpkgs/lua51-luasec/patches/libressl.patch | 36 --------- srcpkgs/lua51-luasec/template | 29 ------- srcpkgs/lua52-luasec | 1 + srcpkgs/lua52-luasec/template | 28 ------- srcpkgs/lua53-luasec | 1 + srcpkgs/lua53-luasec/template | 34 -------- srcpkgs/lua54-luasec/template | 87 +++++++++++++++++++++ 8 files changed, 90 insertions(+), 127 deletions(-) create mode 120000 srcpkgs/lua51-luasec delete mode 100644 srcpkgs/lua51-luasec/patches/libressl.patch delete mode 100644 srcpkgs/lua51-luasec/template create mode 120000 srcpkgs/lua52-luasec delete mode 100644 srcpkgs/lua52-luasec/template create mode 120000 srcpkgs/lua53-luasec delete mode 100644 srcpkgs/lua53-luasec/template create mode 100644 srcpkgs/lua54-luasec/template diff --git a/srcpkgs/lua51-luasec b/srcpkgs/lua51-luasec new file mode 120000 index 0000000000..2326404994 --- /dev/null +++ b/srcpkgs/lua51-luasec @@ -0,0 +1 @@ +lua54-luasec \ No newline at end of file diff --git a/srcpkgs/lua51-luasec/patches/libressl.patch b/srcpkgs/lua51-luasec/patches/libressl.patch deleted file mode 100644 index 531278fa14..0000000000 --- a/srcpkgs/lua51-luasec/patches/libressl.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git src/ssl.c src/ssl.c -index 2fa6ede..bd8a744 100644 ---- src/ssl.c -+++ src/ssl.c -@@ -395,24 +395,30 @@ static int meth_want(lua_State *L) - } - return 1; - } -- -+ - /** - * Return the compression method used. - */ - static int meth_compression(lua_State *L) - { -+#if !defined(OPENSSL_NO_COMP) - const COMP_METHOD *comp; -+#endif - p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection"); - if (ssl->state != LSEC_STATE_CONNECTED) { - lua_pushnil(L); - lua_pushstring(L, "closed"); - return 2; - } -+#if !defined(OPENSSL_NO_COMP) - comp = SSL_get_current_compression(ssl->ssl); - if (comp) - lua_pushstring(L, SSL_COMP_get_name(comp)); - else - lua_pushnil(L); -+#else -+ lua_pushnil(L); -+#endif - return 1; - } - diff --git a/srcpkgs/lua51-luasec/template b/srcpkgs/lua51-luasec/template deleted file mode 100644 index c02e45e994..0000000000 --- a/srcpkgs/lua51-luasec/template +++ /dev/null @@ -1,29 +0,0 @@ -# Template file for 'lua51-luasec' -pkgname=lua51-luasec -reverts=0.6_1 -version=0.5.1 -revision=11 -wrksrc=${pkgname#*-}-${pkgname#*-}-${version} -build_style=gnu-makefile -hostmakedepends="lua51" -makedepends="lua51-devel libressl-devel" -depends="lua51" -short_desc="Lua binding for OpenSSL library to provide TLS/SSL communication" -maintainer="Duncaen " -license="MIT" -homepage="https://github.com/brunoos/luasec" -distfiles="https://github.com/brunoos/luasec/archive/${pkgname#*-}-${version}.tar.gz" -checksum=6d5c5f8e0521f3194668d9a839774e079e2fd5c45b15538dc7b8cacc56719406 - -replaces="luasec<=0.5.1_1" - -do_build() { - lua src/options.lua -g ${XBPS_CROSS_BASE}/usr/include/openssl/ssl.h > src/options.h - make linux CC=$CC LD=$CC \ - INC_PATH="-I${XBPS_CROSS_BASE}/usr/include -I${XBPS_CROSS_BASE}/usr/include/lua5.1" \ - LIB_PATH=-L${XBPS_CROSS_BASE}/usr/lib -} - -post_install() { - vlicense LICENSE -} diff --git a/srcpkgs/lua52-luasec b/srcpkgs/lua52-luasec new file mode 120000 index 0000000000..2326404994 --- /dev/null +++ b/srcpkgs/lua52-luasec @@ -0,0 +1 @@ +lua54-luasec \ No newline at end of file diff --git a/srcpkgs/lua52-luasec/template b/srcpkgs/lua52-luasec/template deleted file mode 100644 index 6267ba4997..0000000000 --- a/srcpkgs/lua52-luasec/template +++ /dev/null @@ -1,28 +0,0 @@ -# Template file for 'lua52-luasec' -pkgname=lua52-luasec -version=0.6 -revision=10 -wrksrc=${pkgname#*-}-${pkgname#*-}-${version} -build_style=gnu-makefile -hostmakedepends="lua52" -makedepends="lua52-devel libressl-devel" -depends="lua52" -short_desc="Lua binding for OpenSSL library to provide TLS/SSL communication" -maintainer="Duncaen " -license="MIT" -homepage="https://github.com/brunoos/luasec" -distfiles="https://github.com/brunoos/luasec/archive/${pkgname#*-}-${version}.tar.gz" -checksum=cef3a35c18beb8a54d9c8ce6260a4cabbd9a386de8711320d084daffad0aed5d - -do_build() { - lua src/options.lua -g ${XBPS_CROSS_BASE}/usr/include/openssl/ssl.h > src/options.h - make linux CC=$CC LD=$CC \ - INC_PATH="-I${XBPS_CROSS_BASE}/usr/include -I${XBPS_CROSS_BASE}/usr/include/lua5.2" \ - LIB_PATH=-L${XBPS_CROSS_BASE}/usr/lib -} - -pre_install() { - export LUAPATH=${DESTDIR}/usr/share/lua/5.2 - export LUACPATH=${DESTDIR}/usr/lib/lua/5.2 - vlicense LICENSE -} diff --git a/srcpkgs/lua53-luasec b/srcpkgs/lua53-luasec new file mode 120000 index 0000000000..2326404994 --- /dev/null +++ b/srcpkgs/lua53-luasec @@ -0,0 +1 @@ +lua54-luasec \ No newline at end of file diff --git a/srcpkgs/lua53-luasec/template b/srcpkgs/lua53-luasec/template deleted file mode 100644 index 16e685daf5..0000000000 --- a/srcpkgs/lua53-luasec/template +++ /dev/null @@ -1,34 +0,0 @@ -# Template file for 'lua53-luasec' -pkgname=lua53-luasec -version=0.8.1 -revision=4 -wrksrc="luasec-luasec-${version}" -build_style=gnu-makefile -make_build_args="LUAPATH=/usr/share/lua/5.3 LUACPATH=/usr/lib/lua/5.3" -make_install_args="${make_build_args}" -hostmakedepends="lua53" -makedepends="lua53-devel libressl-devel" -depends="lua53" -short_desc="Lua binding for OpenSSL library to provide TLS/SSL communication" -maintainer="Duncaen " -license="MIT" -homepage="https://github.com/brunoos/luasec" -distfiles="https://github.com/brunoos/luasec/archive/luasec-${version}.tar.gz" -checksum=cc9fc92df3be56add5c9687319951f457c31f5d12ac19cfc09d53056dc24f04e - -do_build() { - lua src/options.lua -g ${XBPS_CROSS_BASE}/usr/include/openssl/ssl.h > src/options.h - make linux CC=$CC LD=$CC \ - INC_PATH="-I${XBPS_CROSS_BASE}/usr/include -I${XBPS_CROSS_BASE}/usr/include/lua5.3" \ - LIB_PATH=-L${XBPS_CROSS_BASE}/usr/lib -} - -pre_install() { - vlicense LICENSE -} - -luasec_package() { - depends="lua53-luasec>=${version}_${revision}" - short_desc+=" (transitional dummy package)" - build_style=meta -} diff --git a/srcpkgs/lua54-luasec/template b/srcpkgs/lua54-luasec/template new file mode 100644 index 0000000000..b6740ad44e --- /dev/null +++ b/srcpkgs/lua54-luasec/template @@ -0,0 +1,87 @@ +# Template file for 'lua54-luasec' +pkgname=lua54-luasec +version=1.0 +revision=1 +wrksrc="luasec-${version}" +build_style=gnu-makefile +hostmakedepends="lua51 lua52 lua53 lua54" +makedepends="lua51-devel lua52-devel lua53-devel lua54-devel openssl-devel" +depends="lua54" +_desc="Lua binding for OpenSSL library to provide TLS/SSL communication" +short_desc="${_desc} (5.4.x)" +maintainer="Duncaen " +license="MIT" +homepage="https://github.com/brunoos/luasec" +distfiles="https://github.com/brunoos/luasec/archive/v${version}.tar.gz" +checksum=912bfd2050338895207cf24bc8dd26fa9ebddc34006cb8c33d488156d41ac932 + +post_extract() { + mkdir -p lua5.1 + mv * lua5.1 || true + cp -a lua5.1 lua5.2 + cp -a lua5.1 lua5.3 + cp -a lua5.1 lua5.4 +} + +do_configure() { + for luaver in 5.1 5.2 5.3 5.4; do + pushd lua${luaver} + lua${luaver} src/options.lua -g ${XBPS_CROSS_BASE}/usr/include/openssl/ssl.h > src/options.c + popd + done +} + +do_build() { + for luaver in 5.1 5.2 5.3 5.4; do + pushd lua${luaver} + make linux CC=$CC LD=$CC \ + INC_PATH="-I${XBPS_CROSS_BASE}/usr/include -I${XBPS_CROSS_BASE}/usr/include/lua${luaver}" \ + LIB_PATH=-L${XBPS_CROSS_BASE}/usr/lib + popd + done +} + +do_install() { + for luaver in 5.1 5.2 5.3 5.4; do + pushd lua${luaver} + make DESTDIR=${DESTDIR} LUAPATH=/usr/share/lua/${luaver} LUACPATH=/usr/lib/lua/${luaver} install + popd + done + vlicense lua5.4/LICENSE +} + +lua51-luasec_package() { + depends="lua51" + short_desc="${_desc} (5.1.x)" + pkg_install() { + vlicense "${wrksrc}/lua5.1/LICENSE" + vmove usr/lib/lua/5.1 + vmove usr/share/lua/5.1 + } +} + +lua52-luasec_package() { + depends="lua52" + short_desc="${_desc} (5.2.x)" + pkg_install() { + vlicense "${wrksrc}/lua5.2/LICENSE" + vmove usr/lib/lua/5.2 + vmove usr/share/lua/5.2 + } +} + +lua53-luasec_package() { + depends="lua53" + short_desc="${_desc} (5.3.x)" + pkg_install() { + vlicense "${wrksrc}/lua5.3/LICENSE" + vmove usr/lib/lua/5.3 + vmove usr/share/lua/5.3 + } +} + +luasec_package() { + depends="lua53-luasec>=${version}_${revision}" + short_desc+=" (transitional dummy package)" + build_style=meta +}