#!/bin/sh # # Copyright (c) 2016 Niki Kovacs # ----------------------------------------------------------------------------- # # This script builds all Slackware packages listed in the 'build_order' file. # # It puts them in the according package directory. # # If the package already exists in the package directory AND if it's already # installed, the script skips to the next package. # # Otherwise it builds and installs the package, until all packages listed in # the 'build_order' file are built. # CWD=$(pwd) SOURCEDIR=${CWD} case $(uname -m) in x86_64) TXZDIR=$CWD/../extras-14.2-64bit/slackware64 ;; * ) TXZDIR=$CWD/../extras-14.2-32bit/slackware ;; esac # Set the number of parallel make jobs NUMJOBS="-j$(expr $(grep -c '^processor' /proc/cpuinfo) + 1)" export NUMJOBS="$NUMJOBS" PACKAGES=$(egrep -v '(^\#)|(^\s+$)' $CWD/build_order) for PACKAGE in $PACKAGES; do if [ -r ${TXZDIR}/${PACKAGE}-[rV0-9]*.txz ] ; then if [ -r /var/log/packages/${PACKAGE}-[rV0-9]* ] ; then continue fi fi echo echo "+==============================================================================" echo "| Building package ${PACKAGE}..." echo "+==============================================================================" echo sleep 3 ( OUTPUT=${TXZDIR} export OUTPUT cd ${SOURCEDIR}/${PACKAGE} || exit 1 ./${PACKAGE}.SlackBuild || exit 1 ) upgradepkg --install-new ${TXZDIR}/${PACKAGE}-[rV0-9]*.txz || exit 1 done echo echo "+==============================================================================" echo "| Successfully built and installed all packages !" echo "+==============================================================================" echo