#!/bin/bash
###SHELLPACK preamble schedctl-install 0
WEB_LOCATION="https://groups.google.com/group/fa.linux.kernel/attach/9112ab460ea4182e/schedctl.c?part=0.1&authuser=0"
MIRROR_LOCATION="$WEBROOT/schedctl/schedctl.c"

###SHELLPACK parseargBegin
###SHELLPACK parseargEnd

cd $SHELLPACK_SOURCES || die Sources directory does not exist
rm -rf schedctl-${VERSION}-installed
mkdir -p schedctl-${VERSION}-installed

sources_fetch $WEB_LOCATION $MIRROR_LOCATION $SHELLPACK_SOURCES/schedctl-${VERSION}-installed/schedctl.c
cd $SHELLPACK_SOURCES/schedctl-${VERSION}-installed
gcc -O2 schedctl.c -o schedctl
if [ $? -ne 0 ]; then
	die "$P: Failed to build schedctl"
fi
cp schedctl $SHELLPACK_TOPLEVEL/bin

exit $SHELLPACK_SUCCESS
