The problem is that even if you convert to a module, you have to test which version works; if it does, it will work!
> [HOWTO] Install software with slapt-mod
https://slackware.nl/slakfinder/index.p ... e=#results

Code: Select all
#!/bin/bash
## A simple wrapper for slapt-get to build Porteus module.
## by babam and ncmprhnsbl forum.porteus.org
## set module stripping options in /etc/slapt-get/slapt-modrc
getmod_help () {
green "\n $(basename $0): A simple wrapper for slapt-get to build Porteus module."
yellow " All operations must be run as root user."
printf "\n $(basename $0) [-c] [-u] [-d|-m|-M|-n|-N PACKAGE_NAME] [-l PATTERN] [-s PATTERN]\n\nOptions:\n -c: Purge cached packages\n -d: Download only\n -m: Download and build module (ZSTD compression)\n -M: Download and build module (XZ compression)\n -n: Download and build module without dependencies (ZSTD compression)\n -N: Download and build module without dependencies (XZ compression)\n -l: List installed packages\n -s: Search package\n -u: Update database\n -h: This usage\n\n"
echo " To change the temporary directory (default is /tmp), pass the TMP variable."
echo " $ TMP=/path/to/directory slapt-mod -m packagename"
echo
echo " Temporary directory is for storing downloaded packages, installing and converting them to modules."
echo
echo " See /etc/slapt-get/slapt-modrc to set preferences for stripping and language of created modules."
echo
}
# Must be root:
swtch_rt () {
if [ `whoami` != "root" ]; then
red "Please enter root's password"
su -c "sh $0 $*"
yellow "For ease of use, su to root user first."
exit
fi
}
getmod_ln () {
cd /var/lib/pkgtools/packages
if [ -e binutils-min-* ]; then
if [ ! -e binutils-[0-9]* &>/dev/null ]; then
NAME=$(ls binutils-min-* | cut -d- -f3-)
ln -s binutils-min-* binutils-$NAME
fi
fi
if [ -e boost-stripped-* ]; then
if [ ! -e boost-[0-9]* &>/dev/null ]; then
NAME=$(ls boost-stripped-* | cut -d- -f3-)
ln -s boost-stripped-* boost-$NAME
fi
fi
if [ -e gtk3-classic-* ]; then
if [ ! -e gtk+3-* ]; then
NAME=$(ls gtk3-classic-* | cut -d- -f3-)
ln -s gtk3-classic-* gtk+3-$NAME
fi
fi
if [ -e llvm-stripped-* ]; then
if [ ! -e llvm-[0-9]* &>/dev/null ]; then
NAME=$(ls llvm-stripped-* | cut -d- -f3-)
ln -s llvm-stripped-* llvm-$NAME
fi
fi
if [ -e mozjs78-lib-* ]; then
if [ ! -e mozjs78-[0-9]* &>/dev/null ]; then
NAME=$(ls mozjs78-lib-* | cut -d- -f3-)
ln -s mozjs78-lib-* mozjs78-$NAME
fi
fi
if [ -e pango-1.48.11-x86_64-1 ]; then
if [ ! -e pango-1.48.11-x86_64-1 ]; then
mv pango-1.48.11-x86_64-1 pango-1.48.11-x86_64-1
fi
fi
}
getmod_ls () {
if [ "$PKG" = "" ]; then
ls -1 /var/lib/pkgtools/packages
else
ls /var/lib/pkgtools/packages | grep --color -iE "$PKG"
fi
}
getmod_update () {
slapt-get --update
}
getmod_purge () {
echo
read -p "====> Remove all cached packages? Yes (Y/y), No (N/n): " ANSWER
case "$ANSWER" in
[Yy]|[Yy][Ee][Ss])
echo -e "\n====> Removing '$WORKDIR'"
rm -rf $WORKDIR
green "\nDone.\n" ;;
[Nn]|[Nn][Oo])
echo -e "\nAbort.\n" ;;
*)
echo -e "\n====> '$ANSWER' is not supported.\n" ;;
esac
}
getmod_search () {
slapt-get --available | grep -i $PKG | awk '{print $1,"",substr($0,index($0,$4))}'
}
getmod_mkmod () {
source /etc/slapt-get/slapt-modrc
PKGNAM=$(find $WORKINGDIR -name "$PKG*.t?z" -exec basename {} \; | grep -E "^$PKG-[^-]*-[^-]*-[^-]*$" | rev | cut -d. -f2- | rev)
[ "$PKGNAM" ] || exit
if [ "$NODEP" = "-n" -o "$NODEP" = "-N" ]; then
find $WORKINGDIR -name "*.t?z" | grep -f $WORKINGDIR/nodep | xargs -n1 installpkg --root $ROOTDIR
[ $? != 0 ] && { rm -rf $ROOTDIR ; exit ; }
else
find $WORKINGDIR -name "*.t?z" | xargs -n1 installpkg --root $ROOTDIR
[ $? != 0 ] && { rm -rf $ROOTDIR ; exit ; }
fi
sed -i "/^Name\[/d" $ROOTDIR/usr/share/applications/*.desktop 2>/dev/null
sed -i "/^Comment\[/d" $ROOTDIR/usr/share/applications/*.desktop 2>/dev/null
sed -i "/^GenericName/d" $ROOTDIR/usr/share/applications/*.desktop 2>/dev/null
sed -i "/^Keywords\[/d" $ROOTDIR/usr/share/applications/*.desktop 2>/dev/null
find $ROOTDIR -name "*.cache" -type f -delete
find $ROOTDIR -name "gschemas.compiled" -type f -delete
find $ROOTDIR -name "*.pyc" -type f -delete
find $ROOTDIR -name "*.pyo" -type f -delete
if [ $docs = 0 ]; then
[ -d $ROOTDIR/usr/doc ] && rm -rf $ROOTDIR/usr/doc
[ -d $ROOTDIR/usr/info ] && rm -rf $ROOTDIR/usr/info
[ -d $ROOTDIR/usr/share/gtk-doc ] && rm -rf $ROOTDIR/usr/share/gtk-doc
[ -d $ROOTDIR/usr/share/help ] && rm -rf $ROOTDIR/usr/share/help
fi
if [ $man = 0 ]; then
[ -d $ROOTDIR/usr/man ] && rm -rf $ROOTDIR/usr/man
fi
if [ $headers = 0 ]; then
[ -d $ROOTDIR/usr/include ] && rm -rf $ROOTDIR/usr/include
fi
if [ $locale = 0 ]; then
[ -d $ROOTDIR/usr/share/locale ] && ( cd $ROOTDIR/usr/share/locale && rm -rf `ls | grep -vw -e en -e en_US` )
else
[ -d $ROOTDIR/usr/share/locale ] && ( cd $ROOTDIR/usr/share/locale && rm -rf `ls | grep -vw -e $locale` )
fi
[ -d $ROOTDIR/usr/src ] && rm -rf $ROOTDIR/usr/src
rmdir --ignore-fail-on-non-empty $ROOTDIR/usr/share/locale 2>/dev/null
if [ "$COMP" = "-m" -o "$COMP" = "-n" ]; then
mksquashfs $ROOTDIR $TMP/$PKGNAM.xzm -b 256K -comp zstd -Xcompression-level 22 -noappend
else
mksquashfs $ROOTDIR $TMP/$PKGNAM.xzm -b 256K -comp xz -Xbcj x86 -noappend
fi
if [ $? = 0 ]; then
chown guest. $TMP/$PKGNAM.xzm
green "\n====> '$TMP/$PKGNAM.xzm' was created successfully.\n"
fi
rm -rf $ROOTDIR
}
getmod_download () {
mkdir -m 777 -p $TMP
mkdir -m 777 -p $WORKDIR
mkdir -m 777 -p $WORKINGDIR
sed -re "s,^(WORKINGDIR=).*,\1$WORKINGDIR,g" /etc/slapt-get/slapt-getrc > $WORKINGDIR/slapt-getrc
for i in `find /var/slapt-get -maxdepth 1 -type f` ; do
ln -s $i $WORKINGDIR 2>/dev/null
done
slapt-get --config $WORKINGDIR/slapt-getrc --download-only --prompt --install $PKG $@
}
getmod_nodep () {
mkdir -m 777 -p $TMP
mkdir -m 777 -p $WORKDIR
mkdir -m 777 -p $WORKINGDIR
rm -f $WORKINGDIR/nodep
for i in $PKG $@ ; do
echo "/$i-" >> $WORKINGDIR/nodep
done
awk '!x[$0]++' $WORKINGDIR/nodep > $WORKINGDIR/nodep.temp
mv $WORKINGDIR/nodep.temp $WORKINGDIR/nodep
sed -re "s,^(WORKINGDIR=).*,\1$WORKINGDIR,g" /etc/slapt-get/slapt-getrc > $WORKINGDIR/slapt-getrc
for i in `find /var/slapt-get -maxdepth 1 -type f` ; do
ln -s $i $WORKINGDIR 2>/dev/null
done
slapt-get --config $WORKINGDIR/slapt-getrc --no-dep --download-only --prompt --install $PKG $@
}
PKG=$2
COMP=$1
NODEP=$1
TMP=${TMP:-/tmp}
ROOTDIR=$TMP/$PKG.$$
WORKDIR=$TMP/GETMOD
WORKINGDIR=$WORKDIR/$PKG
case "$1" in
-u)
swtch_rt $1
getmod_ln
getmod_update ;;
-c)
swtch_rt $1
getmod_purge ;;
-d)
[ "$2" ] || { yellow "You're missing a package to download!!" && $0 && exit ; }
swtch_rt $1 $2
getmod_download ${@:3} ;;
-l)
swtch_rt $1
getmod_ls ;;
-m|-M)
[ "$2" ] || { yellow "You're missing a package for your module!!" && $0 && exit ; }
swtch_rt $1 $2
getmod_download ${@:3}
[ $? != 0 ] && exit
getmod_mkmod ;;
-n|-N)
[ "$2" ] || { yellow "You're missing a package to download!!" && $0 && exit ; }
swtch_rt $1 $2
getmod_nodep ${@:3}
[ $? != 0 ] && exit
getmod_mkmod ;;
-s)
[ "$2" ] || { yellow "You're missing a package name to search for!!" && $0 && exit ; }
swtch_rt $1 $2
getmod_search ;;
''|*|-h|--help)
getmod_help ;;
was incomplete?