summaryrefslogtreecommitdiffstats
path: root/academic/megax/megax.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'academic/megax/megax.SlackBuild')
-rw-r--r--academic/megax/megax.SlackBuild41
1 files changed, 22 insertions, 19 deletions
diff --git a/academic/megax/megax.SlackBuild b/academic/megax/megax.SlackBuild
index 165c9f4de6..4f20e38180 100644
--- a/academic/megax/megax.SlackBuild
+++ b/academic/megax/megax.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Slackware build script for megax (formerly 'megacc')
+# Slackware build script for megax (formerly 'megacc', called now simply 'mega')
# This takes the place of "megacc" in 2018, as it includes also the GUI
# of the program (megax) in addition to megacc.
@@ -27,21 +27,32 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=megax
-VERSION=${VERSION:-10.2.5_1}
+VERSION=${VERSION:-11.0.11_1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
+SRCNAM=mega
DEBVER=$(echo $VERSION | tr _ -)
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i386 ;;
- arm*) ARCH=arm ;;
+ i?86) ARCH=i586 ;;
*) ARCH=$( uname -m ) ;;
esac
fi
+if [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+ DEBARCH="amd64"
+elif [[ $ARCH =~ i?86 ]]; then
+ LIBDIRSUFFIX=""
+ DEBARCH="i386"
+else
+ printf "\n\n$ARCH is not supported... \n" >/dev/stderr
+ exit 1
+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.
@@ -54,17 +65,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i386" ] || [ "$ARCH" = "i486" ] || [ "$ARCH" = "i586" ] || [ "$ARCH" = "i686" ]; then
- LIBDIRSUFFIX=""
- DEBARCH="i386"
-elif [ "$ARCH" = "x86_64" ]; then
- LIBDIRSUFFIX="64"
- DEBARCH="amd64"
-else
- printf "\n\n$ARCH is not supported... \n"
- exit 1
-fi
-
set -e
rm -rf $PKG
@@ -73,7 +73,7 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
mkdir $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
-ar p $CWD/${PRGNAM}_${DEBVER}_${DEBARCH}.deb data.tar.xz | tar xJv
+ar p $CWD/${SRCNAM}_${DEBVER}_${DEBARCH}.deb data.tar.xz | tar xJv
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -82,20 +82,23 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Fix path in runmega.sh for x86_64
-sed -i "s|/usr/lib/megax|/usr/lib${LIBDIRSUFFIX}/megax|g" usr/lib/$PRGNAM/runmega.sh
+sed -i "s|/usr/lib/megax|/usr/lib${LIBDIRSUFFIX}/$PRGNAM|g" usr/lib/mega/runmega.sh
# Place things in /usr/lib and just create symlinks later.
# This is what Debian's and RedHat's packages do.
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
-cp -a usr/lib/$PRGNAM $PKG/usr/lib${LIBDIRSUFFIX}
+cp -a usr/lib/mega $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM
# Copy man pages to their proper place.
cp -a usr/local/share/man $PKG/usr
+sed -i "s:lib:lib${LIBDIRSUFFIX}:" $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/runmega.sh
+sed -i "s:mega:$PRGNAM:" $PKG/usr/lib${LIBDIRSUFFIX}/$PRGNAM/runmega.sh
+
mkdir -p $PKG/usr/bin
cd $PKG/usr/bin
ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/megacc
- ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/runmega.sh megax
+ ln -s ../lib${LIBDIRSUFFIX}/$PRGNAM/runmega.sh runmega
cd -
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \