#!/bin/bash

poddy="poddy-1.1"

wget http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
rpm -U --nodeps rpmfusion-free-release-stable.noarch.rpm
rm -f rpmfusion-free-release-stable.noarch.rpm

wget http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
rpm -U --nodeps rpmfusion-nonfree-release-stable.noarch.rpm
rm -f rpmfusion-nonfree-release-stable.noarch.rpm

yum install cd-discid cdparanoia flac eject lsdvd fuse fuseiso xine xine-lib-extras-free xine-lib-extras-nonfree ffmpeg lirc unzip lcdproc java-1.6.0-openjdk xawtv sudo python-eyed3 lame

wget http://www.virtualworlds.de/poddy/$poddy.zip

echo ""
echo ""
echo "Please enter the name of the unix user Poddy has to be installed for:"

read user

unzip $poddy.zip -d /home/$user
rm $poddy.zip

chown -R $user /home/$user/poddy
chgrp -R $user /home/$user/poddy

echo ""
echo "Poddy is now installed in /home/$user/poddy. Next the configuration application"
echo "is started where you can set up the parameters for Poddy. If nothing happens,"
echo "please check your Java-configuration"
echo ""
echo "For executing the setup manually please go to /home/$user/poddy and start it"
echo "by calling ./setup.sh"
echo ""
echo "For more information please visit http://www.virtualworlds.de/poddy"
echo ""

cd /home/$user/poddy/
su $user -c ./setup.sh

echo ""
echo "Installation finished!"
echo ""

