aboutsummaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-21 18:05:31 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:37 +0700
commit60b9a232b4d573a57bfd0d0755d88320ca21aad4 (patch)
treea2932eca93ca3d1cc5cc5f4d9982b4bf8c256033 /development
parent7e2f9f95f418678917ffa1b30f73eb3249a76feb (diff)
development/urn: Support for lua 5.4, lua51, luajit.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/urn/README4
-rw-r--r--development/urn/urn.SlackBuild63
2 files changed, 28 insertions, 39 deletions
diff --git a/development/urn/README b/development/urn/README
index bb2045f88053..64bf262b2c51 100644
--- a/development/urn/README
+++ b/development/urn/README
@@ -13,11 +13,11 @@ What?
[1]: Minimalism is an implementation detail.
-Default urn works with lua 5.1.
+Default urn works with lua 5.4.
You can set "URN_LUAVER" environment variable to change the lua version.
Example:
-URN_LUAVER=5.3 for lua 5.3
+URN_LUAVER=5.1 for lua51
URN_LUAVER=jit for luajit
Optional Dependency:
diff --git a/development/urn/urn.SlackBuild b/development/urn/urn.SlackBuild
index 307402f3008d..49ce58cb245d 100644
--- a/development/urn/urn.SlackBuild
+++ b/development/urn/urn.SlackBuild
@@ -21,25 +21,20 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20241021 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - update README for lua 5.4.
+# - noarch.
+# - properly support URN_LUAVER.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=urn
VERSION=${VERSION:-0.7.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
+ARCH=noarch
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- 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
@@ -49,22 +44,23 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
set -e
+LUACMD=/usr/bin/lua$URN_LUAVER
+
+if [ ! -x "$LUACMD" ]; then
+ echo "**************************************"
+ echo "Can't find lua$URN_LUAVER command."
+ case "$URN_LUAVER" in
+ ""|jit|5.1)
+ echo "Install lua$( echo $URN_LUAVER | sed 's,\.,,g' ) and try again." ;;
+ *) echo "Unsupported lua version '$URN_LUAVER', see README." ;;
+ esac
+ echo "**************************************"
+ echo
+ exit 1
+fi
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -72,14 +68,10 @@ rm -rf $PRGNAM-v$VERSION
tar xvf $CWD/$PRGNAM-v$VERSION.tar.gz
cd $PRGNAM-v$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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
-make all
-make all
+make all LUA=$LUACMD
install -m 755 -d $PKG/usr/bin
install -m 755 -d $PKG/usr/share/$PRGNAM
@@ -90,13 +82,10 @@ find bin -type f -exec install -m 755 {} $PKG/usr/share/$PRGNAM/{} \;
cat << EOF > $PKG/usr/bin/urn
#!/usr/bin/env sh
-exec lua\$URN_LUAVER /usr/share/urn/bin/urn.lua \$@
+exec $LUACMD /usr/share/urn/bin/urn.lua \$@
EOF
chmod 755 $PKG/usr/bin/urn
-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
-
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENCE README.md $PKG/usr/doc/$PRGNAM-$VERSION