summaryrefslogtreecommitdiffstats
path: root/academic/labplot2/labplot2.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'academic/labplot2/labplot2.SlackBuild')
-rw-r--r--academic/labplot2/labplot2.SlackBuild71
1 files changed, 48 insertions, 23 deletions
diff --git a/academic/labplot2/labplot2.SlackBuild b/academic/labplot2/labplot2.SlackBuild
index c1da77ddf7..a4b4946d00 100644
--- a/academic/labplot2/labplot2.SlackBuild
+++ b/academic/labplot2/labplot2.SlackBuild
@@ -1,8 +1,10 @@
#!/bin/bash
#
# Slackware build script for LabPlot
-# Based on the Slackware 14.1 SlackBuild and AUR PKGBUILD for labplot
-# Written by Fellype do Nascimento <fellype(at)gmail.com>
+# Based on the Slackware 15.0 SlackBuild and AUR PKGBUILD for labplot
+#
+# Copyright 2014-2023, Fellype do Nascimento, Guaratingueta - Brazil
+# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
@@ -21,12 +23,12 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-NAME=labplot
cd $(dirname $0) ; CWD=$(pwd)
+NAME=labplot
PRGNAM=labplot2
-VERSION=${VERSION:-2.4.0}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-2.10.1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -51,11 +53,17 @@ PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64"
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
set -e
@@ -66,6 +74,7 @@ cd $TMP
rm -rf $NAME-$VERSION
tar -xJf $CWD/$NAME-$VERSION.tar.xz
cd $NAME-$VERSION
+
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -73,31 +82,47 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-./compile
-
+mkdir build
( cd build/
-cmake ./ -DCMAKE_INSTALL_PREFIX=/usr
-cmake ./ -DCMAKE_BUILD_TYPE=Release
-make install DESTDIR=$PKG
+cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DENABLE_READSTAT=OFF \
+ -DENABLE_TESTS=OFF \
+ -DLOCAL_DBC_PARSER=OFF \
+ -DLOCAL_VECTOR_BLF=OFF \
+ ..
+make
+make install/strip DESTDIR=$PKG
)
-( cd $PKG
-find -L . | xargs -O file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find -L . | xargs -O file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-find -L . | xargs -O file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null || true
-)
+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
+
+# no usr/share/doc dir
+mkdir -p $PKG/usr/doc
+mv $PKG/usr/share/doc/* $PKG/usr/doc
+rmdir $PKG/usr/share/doc
+
+# Leave only one main category in key "Categories" for the .desktop file
+sed -i "s:Qt;KDE;Education;Science;Physics;Math;:Science;:" $PKG/usr/share/applications/org.kde.labplot2.desktop
+
+# Fix permissions in .desktop file
+chmod 0644 $PKG/usr/share/applications/org.kde.labplot2.desktop
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS ChangeLog COPYING INSTALL README \
+cp -a AUTHORS ChangeLog README.md LICENSES/* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-
-if [ -e /usr/bin/requiredbuilder ]; then
- requiredbuilder -v -y -s $CWD $PKG
-fi
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE