After many hours of fiddling with a 'project' computer (which is really just a better way of saying spare parts that were laying around the house and turned into a working machine), I installed way too many slackbuild packages which became very time consuming. Mythtv can be named the main culprit behind this, because it has a lot of packages that it depends on (and those packages depend on a lot of packages and so on). So I began to ask myself this question of 'Can I make slackbuilds easier?' and in the spirit of B0b the Builder I answered 'Yes we can!'.
So I give to you, my fellow slackers, a small script that takes a file (for some reason too many cmd line arguments won't register) of package names and slackbuild names and then does the rest of the work for you. This will work for most all packages that follow the usual layout: pkgName-0.1.2.extension or even pkg-Name-0.1.2.extension or even pkg-Name-0.1.2rc3.extension. Note it will break if the package is a snapshot that includes the date in the version number or other weird formats. Also note that it will not pass arguments to the slackbuilds for you (though I'd imagine you can just set them before you run the script and all will turn out ok). Anyway feel free to do anything you like with these scripts (use it, modify it, post it on the web, print it out and set it on fire) so long as you don't claim credit for the work you didn't do.
root@multimedia:/make# cat /usr/sbin/installsbo
# Takes <file>
# Creates and installs the slackbuild and then cleans up
if [[ $# < 1 ]]; then
echo "Usage: $0 </path/to/listOfPackages>"
for x in $list; do
if [[ $isSB == 0 ]]; then
if [[ -n `echo $package | grep ".tar.bz2" ` ]]; then
elif [[ -n `echo $package | grep ".tar.gz" ` ]]; then
elif [[ -n `echo $package | grep ".tgz" ` ]]; then
echo "unanticipated package extension: $package"
if [[ -n `echo $SB | grep ".tar.bz2" ` ]]; then
elif [[ -n `echo $SB | grep ".tar.gz" ` ]]; then
elif [[ -n `echo $SB | grep ".tgz" ` ]]; then
echo "unanticipated slackbuild extension: $SB"
buildDir=`echo $SB | sed s/$sbreplace// `
packageName=`echo $package | sed -r 's/(.*)[-_]([0-9a-zA-Z].*)/\1/' `
packageVers=`echo $package | sed -r $regex `
echo "unpackaging slackbuild ..."
tar $sbflags $SB
echo "moving package ..."
mv $package $buildDir/
echo "moving to $buildDir ..."
sed -rs $regex $buildDir.SlackBuild > a
mv a $buildDir.SlackBuild
chmod +x $buildDir.SlackBuild
if [[ -n `cat $buildDir.SlackBuild | grep "PKGNAME"` ]]; then
elif [[ -n `cat $buildDir.SlackBuild | grep "PRGNAM"` ]]; then
echo "adding to script ..."
echo -e $addtoscript >> ./$buildDir.SlackBuild
echo "running slackbuild ..."
if [[ $? != 1 ]]; then
echo "Failed to install: $package";
rm -R $buildDir $SB
root@multimedia:/make# cat /usr/sbin/checkpkg
# Checks if a slackbuild was made into a package
# We can assume if this returns 1 then it was also installed
echo "Checking: $1 ..."
if [[ `ls $1` == $1 ]]; then
So an example file would look like either of the following:
example-1.2.3.tar.bz2 example.tar.gz helloWorld.4.5.6.tar.bz2 helloWorld.tar.gz
Note: yeah I know this could use some cleaning up, but it's been a long day and I coded this this morning give me a break haha.