aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-23 16:47:01 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:40 +0700
commit41a4da0dc71ad6201e892533870029cce6325478 (patch)
tree43f61260be7d8898cf9e6a9e6c56a32836885a10
parent43e92ab3fb95158bb680f992980d7db9779f29f8 (diff)
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>
-rw-r--r--libraries/luasec/README3
-rw-r--r--libraries/luasec/luasec.SlackBuild69
2 files changed, 33 insertions, 39 deletions
diff --git a/libraries/luasec/README b/libraries/luasec/README
index ef4629b1b0492..172d470c6e8f2 100644
--- a/libraries/luasec/README
+++ b/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.
diff --git a/libraries/luasec/luasec.SlackBuild b/libraries/luasec/luasec.SlackBuild
index fbb6f1d02d66e..19c2b66e065cd 100644
--- a/libraries/luasec/luasec.SlackBuild
+++ b/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