Browse Source

libraries/luasec: Support for lua 5.4, lua51.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
pull/255/head
B. Watson 1 year ago
committed by Willy Sudiarto Raharjo
parent
commit
41a4da0dc7
No known key found for this signature in database GPG Key ID: 3F617144D7238786
  1. 3
      libraries/luasec/README
  2. 69
      libraries/luasec/luasec.SlackBuild

3
libraries/luasec/README

@ -2,3 +2,6 @@ A binding for OpenSSL library to provide TLS/SSL communication over
LuaSocket. This version delegates to LuaSocket the TCP connection
establishment between the client and server. Then LuaSec uses this
connection to start a secure TLS/SSL session.
Optional dependency: lua51. If lua51 is installed at build time, this
package will contain a module for Lua 5.1.

69
libraries/luasec/luasec.SlackBuild

@ -24,11 +24,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20241023 bkw: Modified by SlackBuilds.org, BUILD=2:
# - build for lua 5.4 and lua51.
# - include samples/ in the doc dir.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=luasec
VERSION=${VERSION:-1.3.1}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -40,9 +44,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@ -52,18 +53,11 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
SLKCFLAGS="-O2 -fPIC" # on all platforms we need PIC
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
SLKCFLAGS+=" -O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
SLKCFLAGS+=" -O2 -march=i686 -mtune=i686"
fi
set -e
@ -75,34 +69,31 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
-o -perm 511 \) -exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
cd src
patch < $CWD/makefile.patch
cd -
make linux \
LUACPATH="/usr/lib${LIBDIRSUFFIX}/lua/5.1" \
LIB_PATH=" -L/usr/lib${LIBDIRSUFFIX}" \
SLKCFLAGS="${SLKCFLAGS}"
mkdir -p $PKG/usr/share/lua/5.1
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1
# Installing:
make install \
LUAPATH=$PKG/usr/share/lua/5.1 \
LUACPATH=$PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
runmake() {
local cmod=$( pkg-config $1 --variable INSTALL_CMOD )
local lmod=$( pkg-config $1 --variable INSTALL_LMOD )
local incs=$( pkg-config $1 --variable INSTALL_INC )
make clean
make -j1 \
WARN="$SLKCFLAGS" \
INC_PATH=-I$incs \
LUAPATH=$lmod \
LUACPATH=$cmod \
DESTDIR=$PKG \
linux install
strip $PKG/$cmod/ssl.so
}
runmake lua
[ -x /usr/bin/lua51 ] && runmake lua51
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
CHANGELOG INSTALL LICENSE README.md \
CHANGELOG LICENSE README.md samples \
$PKG/usr/doc/$PRGNAM-$VERSION
tar zcvf $PKG/usr/doc/$PRGNAM-$VERSION/samples.tar.gz samples
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

Loading…
Cancel
Save