#!/bin/bash

################################################
# Slackware ARM virtualization software stack
################################################
# Author:...Brenton Earl <el0226@slackware.com>
# Date:.....2023-11-06
# Summary:..Built with support for aarch64 only.
################################################
# TODO:  nothing for now
################################################

BASEDIR=$(pwd)
REPOSITORY=${REPOSITORY:-$BASEDIR}
#REPOSITORY=${REPOSITORY:-/data/sa64-virtualization/slackbuilds}
#NUMJOBS=${NUMJOBS:--j$(nproc)}

export BASEDIR REPOSITORY
#export BASEDIR REPOSITORY NUMJOBS


removepkg --terse /root/tgzstash/testing/*el0226.txz
rm -v /root/tgzstash/testing/*el0226.txz
rm -v /root/tgzstash/testing/*el0226.txt

for SLACKBUILD in \
    spice-protocol \
    spice \
    spice-gtk \
    gtk-vnc \
    lloyd-yajl \
    libvirt \
    libvirt-python \
    libvirt-glib \
    osinfo-db-tools \
    osinfo-db \
    libosinfo \
    virt-manager \
    libmd \
    libbsd \
    netcat-openbsd \
    qemu ;
do
    cd $REPOSITORY/$SLACKBUILD || exit 1

    #chmod +x source.download || exit 1
    #./source.download || exit 1
    #./arm/build
    dbuild || ./arm/build || exit 1

    upgradepkg --terse --install-new /root/tgzstash/testing/$SLACKBUILD-*el0226.txz
    
    unset $SLACKBUILD
done 

