#!/bin/sh
#
# Install a series of packages in Ubuntu 7.04
# You will need to run this script as root with 755 permission
# This script has been tested with Feisty ONLY, I cannot guarantee it will work with other distros
#
# Authored by Bob Nelson  admin@stchman.com
#
# All of the apt-get installs will use the -y switch to assume yes to all prompts.
# All dependencies will be installed as well

script_name="feisty_script.sh"

# Script must run as root 
if [ $USER != "root" ]; then
	echo "You need to run this script as root."
	echo "Use 'sudo ./$script_name' then enter your password when prompted."
	exit 1
fi

# Update the package manager
sudo apt-get update

# Install essential utilities
# nautilus-open-terminal - open a  terminal in a specific folder in nautilus 
# build-essential - C/C++ headers
# alien - convert packages to another package, i.e. .rpm to .deb
# gtkorphan - clean up unused orphaned packages
sudo apt-get -y install nautilus-open-terminal build-essential alien gtkorphan

# Install hex editors
sudo apt-get -y install ghex khexedit

# Install Gnome hearts
sudo apt-get -y install gnome-hearts

# Install gstreamer plugins for audio/video playback, mp3, mpeg2, mpeg4, etc.
sudo apt-get -y install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse

# Install VLC media player and the mozilla plugin
sudo apt-get -y install vlc mozilla-plugin-vlc

# Configure medibuntu for codecs and DVD CSS decryption

# Update Medibuntu to the repository list
sudo wget http://www.medibuntu.org/sources.list.d/feisty.list -O /etc/apt/sources.list.d/medibuntu.list
# Add the key
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

# Install WINE
# get the key
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
# add WINE to the 3rd party software list
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/feisty.list -O /etc/apt/sources.list.d/winehq.list

# update package manager, this will update for both the new added repositories
sudo apt-get update

# install wine and cabextract packages (from budgetdedicated)
sudo apt-get -y install wine cabextract

# install the CSS decryption key (from medibuntu)
sudo apt-get -y install libdvdcss2

# Since Acrobat reader was removed from the repositories for Feisty we will get it from medibuntu
sudo apt-get -y install acroread acroread-plugins

# Install K3B CD/DVD burning program and the mp3 plugin from medibuntu
sudo apt-get -y install k3b libk3b2-mp3

# Install K9Copy for ripping encrypted DVDs
sudo apt-get -y install k9copy

# Install ntfs-config and ntfs-3g, this allows reading and writing to NTFS partitions
# ntfs-3g is installed with ntfs-config as it is a dependency
sudo apt-get -y install ntfs-config

# Install Gnome Partition Manager
sudo apt-get -y install gparted

# Install Graphical FTP programs gFTP and Filezilla
sudo apt-get -y install gftp filezilla

# Install the Microsoft core fonts (i.e. Arial, Times New Roman, etc.)
sudo apt-get -y install msttcorefonts

# Install SUN Java 5, JDK and browser plugin
sudo apt-get -y install sun-java5-bin sun-java5-fonts sun-java5-jdk sun-java5-jre sun-java5-plugin

# Install cups-pdf, this allows PDF creation through printer driver
sudo apt-get -y install cups-pdf

# Install the rar and unrar plugin to handle .rar files
sudo apt-get -y install rar unrar

# Install 7zip plugin to do .7z compression
sudo apt-get -y install p7zip p7zip-full

# Install MP3 and OGG ID3 tag editor
sudo apt-get -y install tagtool

# Install bittorrent client Ktorrent
sudo apt-get -y install ktorrent

# Install Adobe Flash 9, this will enable flash playback in your web browser
sudo apt-get -y install flashplugin-nonfree

# Install Gwenview Image viewer
sudo apt-get -y install gwenview

# Install glipper clipboard manager
sudo apt-get -y install glipper

# Install Bluefish Programmers/HTML editor
sudo apt-get -y install bluefish

# Install gDesklets to customize your desktop
sudo apt-get -y install gdesklets

# Install XMMS media player, the CD reader, and the flac plugin
sudo apt-get -y install xmms xmms-flac xmms-cdread

# Need to execute xmms to create the .xmms in the users home folder
xmms &

# create a small 2 second delay for xmms to create the folder
sleep 2

# kill xmms
killall -v xmms

# Install XMMS skins
# change to the XMMS skins folder
cd ~/.xmms/Skins

# get the skins from www.stchman.com
wget http://www.stchman.com/tools/XMMS_skins/chaos_XMMS.zip
wget http://www.stchman.com/tools/XMMS_skins/Cobalt-Obscura.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/m2n.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/maXMMS.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/sword.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/cherry_best.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/Coolblue.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/MarbleX.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/NoerdAmp-SE.tar.gz
wget http://www.stchman.com/tools/XMMS_skins/Winamp_X_XMMS_1.01.tar.gz

# correct the problem of sometimes the ~/.kde folder being owned by root
# we want to change the ownership to the person currently logged in
sudo chown -R $USER:$USER ~/.kde

# change the permissions to 755 of the ~/.kde
chmod -R 755 ~/.kde

###################################################
# Install the Tahoma fonts to the msttcorefonts folder
# Since Tahoma does not come with msttcorefont, we will install them manually
# Change to the users home folder
cd ~

# get the tahoma.zip file from www.stchman.com
wget http://www.stchman.com/tools/tahoma.zip

# extract the .zip achive to the msttcorefonts folder
sudo unzip -d /usr/share/fonts/truetype/msttcorefonts ~/tahoma.zip

# update the font cache
sudo fc-cache -f -v

# remove the .zip file as it is no longer needed
rm -r -f ~/tahoma.zip
###################################################

###################################################
# get the scripts from the website to make Ubuntu look like M$ fonts
# change to users home folder
#cd ~

# get the font scripts from www.stchman.com
#wget http://www.stchman.com/tools/MS_fonts/fontconfig.tbz

# unpack archive in the /etc/fonts folder
#sudo tar -xvjpf ~/fontconfig.tbz -C /etc/fonts/

# remove the archive that was downloaded
#rm -r -f ~/fontconfig.tbz
###################################################

###################################################
# Install Kompozer HTML editor
# Kompozer is the unofficial bug fix for Nvu
# change to users home folder
cd ~

# get the Ubuntu Kompozer package from www.stchman.com
wget http://www.stchman.com/tools/kompozer/kompozer-0.7.10-i386.deb

# install the Nvu package
sudo dpkg -i ~/kompozer-0.7.10-i386.deb

# remove the Nvu .deb package as the installer is no longer needed
rm -r -f ~/kompozer-0.7.10-i386.deb
###################################################

###################################################
# Install sysinfo
# sysinfo is part of the repositories for Feisty, but the 0.7-0 is not as functional
# 0.7-1 has more features
# change to users home folder
cd ~

# get the Ubuntu Debian package
wget http://www.stchman.com/tools/sysinfo_0.7-1_i386.deb

# install the Sysinfo package
sudo dpkg -i ~/sysinfo_0.7-1_i386.deb

# remove the SysInfo .deb package as the installer is no longer needed
rm -r -f ~/sysinfo_0.7-1_i386.deb
###################################################

###################################################
# Install Thunderbird 2
# Thunderbird 2 is not in the repositories
# Change to the users home folder
cd ~

#Get the .tar.gz file from www.stchman.com
wget http://www.stchman.com/tools/thunderbird-2.0.0.6.tar.gz

# Unpack the .tar.gz archive to the /opt folder, this will create a /opt/thunderbird folder
sudo tar -C /opt -zxvf ~/thunderbird-*

# Create a symbolic link in the /usr/bin folder
sudo ln -s /opt/thunderbird/thunderbird /usr/bin/thunderbird

# Create a menu item
# There will be a menu entry in Applications--->Internet
sudo echo "[Desktop Entry]" > /usr/share/applications/thunderbird.desktop
sudo echo "Encoding=UTF-8" >> /usr/share/applications/thunderbird.desktop
sudo echo "Name=Thunderbird"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Comment=Thunderbird Mail Client"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Exec=thunderbird"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Icon=/opt/thunderbird/icons/mozicon16.xpm"  >> /usr/share/applications/thunderbird.desktop
sudo echo "StartupNotify=true"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Terminal=false"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Type=Application"  >> /usr/share/applications/thunderbird.desktop
sudo echo "Categories=Applications;Network;"  >> /usr/share/applications/thunderbird.desktop

# Remove .tar.gz as it is no longer needed
rm -f ~/thunderbird-*
####################################################

