#!/usr/bin/env bash
# Thomas Dreibholz's Install Script for Hirsute Hippo
# Copyright (C) 2007-2021 by Thomas Dreibholz
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# Contact: thomas.dreibholz@gmail.com


# ------ Keys for additional repositories -----------------------------------
if [ "$1" = "initial" ] ; then
   sudo apt-get update
   sudo apt-get install software-properties-common

   # Thomas Dreibholz's PPA
   sudo add-apt-repository -s -y ppa:dreibh/ppa         # Launchpad PPA of Thomas Dreibholz

   # Debug symbols key for ddebs.ubuntu.com: C8CAB6595FDFF622
   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C8CAB6595FDFF622

   # VirtualBox:
   wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add
   wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add

   # Kubuntu Updates: KDE point releases (see https://wiki.kubuntu.org/Kubuntu/KubuntuPPAs)
   # sudo add-apt-repository -s -y ppa:kubuntu-ppa/ppa         # Launchpad PPA for Kubuntu Updates
   # Kubuntu Backports: KDE major releases (see https://wiki.kubuntu.org/Kubuntu/KubuntuPPAs)
   # !!! sudo add-apt-repository -s -y ppa:kubuntu-ppa/backports   # Launchpad PPA for Kubuntu Backports

   # KDE Neon key: E6D4736255751E5D
   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E6D4736255751E5D

   # LibreOffice
   # !!! sudo add-apt-repository -s -y ppa:libreoffice/ppa         # Launchpad PPA for LibreOffice
fi

DESKTOP="kubuntu-desktop"
# kubuntu-desktop
# ubuntu-desktop

# ------ Tools --------------------------------------------------------------
PACKAGES="$PACKAGES acpi agrep apt-file apt-show-versions autofs chrpath cifs-utils cron-apt dict ding ethtool gpm ibritish ispell joe kcalc kgpg manpages-dev marble mathomatic minicom netperfmeter powertop reiserfsprogs sdparm smartmontools snmp snmp-mibs-downloader subnetcalc trans-de-en unrar"

# ------ Networking ---------------------------------------------------------
PACKAGES="$PACKAGES firefox firefox-locale-de httrack lksctp-tools miredo ncftp nmap nttcp openssh-server portmap rsplib-fgp-cfgfiles rsplib-services rsplib-tools sendxmpp spamassassin traceroute w3m whois wireshark konsole"
# akonadiconsole

# ------ Development, LaTeX, Firefox and many other tools -------------------
# Compiler and Tool-Chains
PACKAGES="$PACKAGES alien apt-file autoconf automake binutils-dev bison cdbs cmake colordiff config-package-dev doxygen flex gcc gcc-doc gdb git-core intltool kdevelop libtool mercurial python3-pip quilt rpm subversion unifdef valgrind xmlto"
# Libraries
PACKAGES="$PACKAGES bison blt-dev build-essential default-jre doxygen flex g++ gcc graphviz libadns1-dev libc-ares-dev libcpprspserver-dev libcurl4-gnutls-dev libgeoip-dev libglib2.0-dev libglib2.0-doc libgtk2.0-dev liblua5.2-dev libmagick-dev libosgearth-dev libpango1.0-dev libpcap-dev libreadline-dev librsplib-dev libsctp-dev libsdl1.2-dev libsmi2-dev libsqlite0-dev libwebkitgtk-1.0 libxml2-dev openscenegraph-plugin-osgearth perl python python3 tcl-dev tk-dev xsltproc zlib1g-dev"
# Debian
PACKAGES="$PACKAGES debhelper devscripts dput dpatch dupload fakeroot lintian pbuilder ubuntu-dev-tools"
# Linux Kernel
PACKAGES="$PACKAGES linux-crashdump linux-doc linux-headers-generic linux-source"
# Qt/KDE Development
PACKAGES="$PACKAGES qtbase5-dev libqt5opengl5-dev qt5-default"
# KDE Debugging
# PACKAGES="$PACKAGES kdepim-dbg kdepim-runtime-dbg kdepimlibs-dbg kdevplatform-dbg kdebase-runtime-dbg kde-runtime-dbg kdelibs5-dbg kdeplasma-addons-dbg pulseaudio-dbg"

# ------ Graphics Processing ------------------------------------------------
PACKAGES="$PACKAGES dia digikam ffmpeg2theora fractgen giftrans gimp gimp-data-extras gimp-help-de gimp-help-en gnuplot graphviz imagemagick inkscape r-base r-base-core r-base-dev r-base-html r-doc-html r-doc-info r-doc-pdf r-mathlib transfig xfig kdegraphics-thumbnailers"
# slideshow

# ------ LaTeX and Document Processing --------------------------------------
PACKAGES="$PACKAGES a2ps bibtexconv gv kile kile-doc kile-l10n libreoffice-l10n-en-gb libreoffice-lightproof-en hunspell-en-gb lyx msttcorefonts pstoedit texlive-full ttf-bitstream-vera ttf-dejavu"
# pdftk

# ------ Multimedia ---------------------------------------------------------
PACKAGES="$PACKAGES kaffeine kdenlive kubuntu-restricted-extras lame libdvdread4 mp3blaster recordmydesktop vlc x264 x265 ffmpeg"

# ------ Localization -----------------------------------------------------------
# Deutsch:
PACKAGES="$PACKAGES language-pack-de language-pack-kde-de language-pack-gnome-de aspell-de manpages-de manpages-de-dev ingerman libreoffice-l10n-de libreoffice-help-de hunspell-de-de hunspell-de-at"
# Bokmål:
PACKAGES="$PACKAGES language-pack-nb language-pack-kde-nb language-pack-gnome-nb aspell-no hunspell-no libreoffice-l10n-nb"


# ------ Unwanted Stuff -----------------------------------------------------
# This software opens listening TCP/UDP sockets -> should only be installed if really needed ...
sudo apt-get remove minidlna webfs kdeconnect kdeconnect-plasma


# ---------------------------------------------------------------------------
sudo apt-get -q update && \
sudo apt-get -q dist-upgrade && \
sudo apt-get -q install $DESKTOP && \
sudo apt-get -q install $PACKAGES && \
sudo apt-get -q dist-upgrade && \
sudo apt-get -q autoremove && \
sudo apt-file update
