diff options
Diffstat (limited to 'luasec-prosody-git')
-rw-r--r-- | luasec-prosody-git/PKGBUILD | 67 | ||||
-rw-r--r-- | luasec-prosody-git/luasec-prosody.patch | 26 |
2 files changed, 93 insertions, 0 deletions
diff --git a/luasec-prosody-git/PKGBUILD b/luasec-prosody-git/PKGBUILD new file mode 100644 index 0000000..fd798ae --- /dev/null +++ b/luasec-prosody-git/PKGBUILD @@ -0,0 +1,67 @@ +# Maintainer: Philipp Gesang <phg42.2a@gmail.com> + +pkgname=luasec-prosody-git +_gitname=luasec +_gitbranch=master +pkgver=19.063e8a8 +pkgrel=2 +pkgdesc="A fork of LuaSec, an SSL and crypto library for Lua." +arch=("i686" "x86_64") +url="https://github.com/brunoos/luasec/wiki" +license=("MIT") +groups=() +depends=("lua" "openssl") +makedepends=("git") +provides=("luasec") +conflicts=("luasec-hg") +#install= +source=("${_gitname}::git+https://github.com/brunoos/${_gitname}#branch=${_gitbranch}" + "luasec-prosody.patch") # build for Lua 5.2 +noextract=() +sha512sums=("SKIP" + "459969712d74fd2137f0cf7c7acc227bfe1e097e99937c2b897c625e96d9de3d20265634a6e49418f4ef5cf037435d2e07b0a1747a850d110aa207ef6735c7b7") + +pkgver() { + cd "${_gitname}" + echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD) +} + +build() { + cd "${srcdir}" + msg "Connecting to GIT server ..." + + if [[ -d "${_gitname}" ]]; then + cd "${_gitname}" && git pull origin + msg "The local files are updated." + else + git clone "${_gitroot}" "${_gitname}" + fi + + msg "GIT checkout done or server timeout" + msg "Starting build ..." + + rm -rf "${srcdir}/${_gitname}-build" + git clone "${srcdir}/${_gitname}" "${srcdir}/${_gitname}-build" + cd "${srcdir}/${_gitname}-build" + + msg "Rewrite paths in Makefile to build for Lua 5.2" + git apply "${srcdir}/luasec-prosody.patch" + + ## build + msg "Compile for target \"linux\"" + if [[ "${LDFLAGS}" =~ "-Wl" ]] + then + msg "Fixing LDFLAGS (remove \"-Wl\")" + LDFLAGS=${LDFLAGS/-Wl,/} + echo "LDFLAGS=\"${LDFLAGS}\"" + fi + make linux +} + +package() { + cd "${srcdir}/${_gitname}-build" + make DESTDIR="${pkgdir}/" install + install -Dm0644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} + +# vim:set ts=2 sw=2 et: diff --git a/luasec-prosody-git/luasec-prosody.patch b/luasec-prosody-git/luasec-prosody.patch new file mode 100644 index 0000000..2d2672b --- /dev/null +++ b/luasec-prosody-git/luasec-prosody.patch @@ -0,0 +1,26 @@ +diff --git a/Makefile b/Makefile +index c8aa90f..31e27c8 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + # Inform the location to intall the modules +-LUAPATH ?= /usr/share/lua/5.1 +-LUACPATH ?= /usr/lib/lua/5.1 ++LUAPATH ?= /usr/share/lua/5.2 ++LUACPATH ?= /usr/lib/lua/5.2 + + # Compile with build-in LuaSocket's help files. + # Comment this lines if you will link with non-internal LuaSocket's help files +diff --git a/src/ssl.lua b/src/ssl.lua +index 1b062f6..1b63e70 100644 +--- a/src/ssl.lua ++++ b/src/ssl.lua +@@ -4,6 +4,8 @@ + -- + ------------------------------------------------------------------------------ + ++local unpack = unpack or table.unpack ++ + local core = require("ssl.core") + local context = require("ssl.context") + local x509 = require("ssl.x509") |