#!/bin/csh
#
# Aperture AkroCal: a free and efficient digital schedule utility
# https://www.aperture.akron.oh.us/~akrocal/
#
# Copyright (C) 2025 Anton McClure <asm@aperture.akron.oh.us>
# All rights reserved.
pkg install -y wget xinit xorg xorg-fonts drm-kmod xf86-video-intel xorg-fonts xorg-fonts-100dpi xorg-fonts-75dpi xorg-fonts-cyrillic xorg-fonts-miscbitmaps xorg-fonts-truetype xorg-fonts-type1 curl xorg-fonts xorg-fonts-100dpi xorg-fonts-75dpi xorg-fonts-cyrillic xorg-fonts-miscbitmaps xorg-fonts-truetype xorg-fonts-type1 xfontsel font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi font-adobe-utopia-75dpi font-adobe-utopia-type1 font-alias font-amsfonts font-arabic-misc font-bh-100dpi font-bh-75dpi font-bh-lucidatypewriter-100dpi font-bh-lucidatypewriter-75dpi font-bh-ttf font-bh-type1 font-bitstream-100dpi font-bitstream-75dpi font-bitstream-type1 font-cronyx-cyrillic font-cursor-misc font-daewoo-misc font-dec-misc font-gost font-ibm-type1 font-isas-misc font-jis-misc font-micro-misc font-misc-cyrillic font-misc-ethiopic font-misc-meltho font-misc-misc font-mutt-misc font-schumacher-misc font-screen-cyrillic font-sony-misc font-sun-misc font-tex-gyre-bonum-math font-tex-gyre-pagella-math font-tex-gyre-schola-math font-tex-gyre-termes-math font-util font-winitzki-cyrillic font-xfree86-type1
mkdir -p /usr/local/share/akrocal /usr/local/bin
rm -rvf /tmp/akrocal*
set ver = `wget -O- ftp://ftp.aperture.akron.oh.us/akrocal/ver`
echo $ver
wget -O /tmp/akrocal-${ver}.tar.gz ftp://ftp.aperture.akron.oh.us/akrocal/akrocal-${ver}.tar.gz
cd /tmp/
tar -xzvf akrocal-${ver}.tar.gz
cd akrocal-${ver}/
service akrocal stop
echo 'SHELL=/bin/csh' > /etc/cron.d/cobcal
echo '0 6 * * * root rm /usr/local/bin/akrocal-setup.csh; wget ftp://ftp.aperture.akron.oh.us/akrocal/setup.csh -O /usr/local/bin/akrocal-setup.csh && csh /usr/local/bin/akrocal-setup.csh;' >> /etc/cron.d/cobcal
echo '@reboot root rm /usr/local/bin/akrocal-setup.csh; sleep 10; wget ftp://ftp.aperture.akron.oh.us/akrocal/setup.csh -O /usr/local/bin/akrocal-setup.csh && csh /usr/local/bin/akrocal-setup.csh' >> /etc/cron.d/cobcal
csh install.csh
