#!/bin/sh # $Id: fedora-helper-fc6,v 1.10 2007/04/20 20:46:49 hutch Exp $ FC_VER=6 ADOBE_READER_VER=7.0.8 ADOBE_READER_URI=ftp://ftp.adobe.com/pub/adobe/reader/unix/7x/7.0.8/enu/AdobeReader_enu-$ADOBE_READER_VER-1.i386.rpm ADOBE_READER_RPM=${ADOBE_READER_URI##*/} ADOBE_READER_RPM_NAME=${ADOBE_READER_RPM%\.i386*} JRE_VER="Java Runtime Environment Version 5.0 Update 9" JRE_URI=http://jdl.sun.com/webapps/download/AutoDL?BundleId=10743 JRE_DIR=1.5.0_09 OPERA_URI='http://www.opera.com/download/get.pl?id=28477&location=93¬hanks=yes&sub=marine' LIMEWIRE_URI=http://www.limewire.com/LimeWireSoftLinux VMPLAYER_VER=1.0.3 VMPLAYER_URI=http://download3.vmware.com/software/vmplayer/VMware-player-1.0.3-34682.i386.rpm VMPLAYER_RPM=${VMPLAYER_URI##*/} FLASH_VER=9.0.31.0 FLASH_URI=http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-9.0.31.0-release.i386.rpm FLASH_RPM=${FLASH_URI##*/} # Check for $FC_VER if ! rpm -q fedora-release-$FC_VER > /dev/null 2>&1 ; then echo "You must be running Fedora Core $FC_VER to run Fedora Helper." exit 1 fi # Check for root user WHOAMI=`/usr/bin/whoami` if [ "$WHOAMI" != "root" ] ; then echo "You must be the root user to run Fedora Helper." exit 1 fi # Check for zenity if [ ! -f /usr/bin/zenity ] ; then echo -e "Fedora Helper requires \"zenity\" to provide its graphical user interface.\n" echo 'To install zenity, the "zenity" package and its dependencies' echo -e "will be installed.\n" echo -n "Continue with zenity installation? (Y/n) " read YN # Default response is "Y" : ${YN:=Y} case $YN in [yY]|[yY][eE][sS]) yum -y install zenity || exit 1 ;; *) exit 0 ;; esac fi STDOUT=`mktemp` zenity --title "Fedora Helper for FC$FC_VER" \ --width=600 \ --height=418 \ --list \ --checklist \ --multiple \ --column " " \ --column "Item" \ --column "Description" \ FALSE "MP3 Support" "MP3 support for all installed MP3 applications" \ FALSE "DVD Support" "DVD support for all installed DVD applications" \ FALSE Win32codecs "Needed to play proprietary media formats" \ FALSE ATI "ATI graphics drivers" \ FALSE nVidia "nVidia graphics drivers" \ FALSE Acrobat "Adobe Acrobat Reader $ADOBE_READER_VER" \ FALSE Flash "Flash Plugin $FLASH_VER" \ FALSE Java "$JRE_VER" \ FALSE Opera "Opera 9.10 Web browser" \ FALSE LimeWire "LimeWire P2P file-sharing software" \ FALSE RealPlayer "RealPlayer 10" \ FALSE VMwarePlayer "VMware Player $VMPLAYER_VER" \ > $STDOUT rpmCheck() { rpm -q $1 > /dev/null 2>&1 } yumCheck() { # Is another program using yum? if [ -f /var/run/yum.pid ] ; then zenity --error \ --text "Another program is currently running the Yum package installer. You must exit from this program before continuing with Fedora Helper." exit 1 fi } requiresLivna() { rpmforgeCheck if ! rpmCheck livna-release-$FC_VER ; then zenity --question \ --text='In order to complete this operation, support for the Livna software repository must be installed. Click "OK" to install Livna support, or "Cancel" to quit the program.' if [ $? -eq 0 ] ; then cd /tmp wget -N http://rpm.livna.org/livna-release-$FC_VER.rpm rpm -ivh livna-release-$FC_VER.rpm rm livna-release-$FC_VER.rpm else exit 1 fi fi } rpmforgeCheck() { if grep -i enabled=1 /etc/yum.repos.d/dag.repo > /dev/null 2>&1 \ || grep -i enabled=1 /etc/yum.repos.d/dries.repo > /dev/null 2>&1 \ || grep -i enabled=1 /etc/yum.repos.d/freshrpms.repo > /dev/null 2>&1 \ ; then zenity --error \ --text "Support for one or more RPMforge software repositories (FreshRPMS, Dries, Dag) was detected. This program uses the Livna software repository for MP3 and DVD support, which is not compatible with RPMforge repositories." exit 1 fi } # MP3 Support # amaroK requires amarok-extras-nonfree # Audacious requires audacious-plugins-nonfree-mp3 # K3b requires k3b-extras-nonfree # Noatun requires kdemultimedia-extras-nonfree # Rhythmbox requires gstreamer-plugins-ugly # Xmms requires xmms-mp3 if grep "MP3 Support" $STDOUT > /dev/null ; then requiresLivna # amaroK if rpmCheck amarok ; then if rpmCheck amarok-extras-nonfree ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\namaroK" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\namaroK" PKGLIST="$PKGLIST amarok-extras-nonfree" fi fi # Audacious if rpmCheck audacious ; then if rpmCheck audacious-plugins-nonfree-mp3 ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nAudacious" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nAudacious" PKGLIST="$PKGLIST audacious-plugins-nonfree-mp3" fi fi # K3b if rpmCheck k3b ; then if rpmCheck k3b-extras-nonfree ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nK3b" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nK3b" PKGLIST="$PKGLIST k3b-extras-nonfree" fi fi # Noatun if rpmCheck kdemultimedia ; then if rpmCheck kdemultimedia-extras-nonfree ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nNoatun" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nNoatun" PKGLIST="$PKGLIST kdemultimedia-extras-nonfree" fi fi # Rhythmbox if rpmCheck rhythmbox ; then if rpmCheck gstreamer-plugins-ugly ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nRhythmbox" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nRhythmbox" PKGLIST="$PKGLIST gstreamer-plugins-ugly" fi fi # Xmms if rpmCheck xmms ; then if rpmCheck xmms-mp3 ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nXmms" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nXmms" PKGLIST="$PKGLIST xmms-mp3" fi fi if [ -z "$NEEDS_MP3_SUPPORT" ] ; then zenity --info \ --text "MP3 support is already installed for all detected applications:\n$HAS_MP3_SUPPORT" elif [ -z "$NEEDS_MP3_SUPPORT" -a -z "$HAS_MP3_SUPPORT" ] ; then zenity --info \ --text "No applications needing MP3 support were detected." else zenity --info \ --text "MP3 support will be installed for the following applications:\n$NEEDS_MP3_SUPPORT" fi [ -n "$PKGLIST" ] && yumCheck && yum -y install $PKGLIST unset PKGLIST fi # DVD Support # All DVD applications need libdvdcss for encrypted DVD support # If totem is installed, remove and install totem-xine if grep "DVD Support" $STDOUT > /dev/null ; then requiresLivna # Kaboodle if rpmCheck kdemultimedia ; then if rpmCheck kdemultimedia-extras-nonfree ; then HAS_MP3_SUPPORT="$HAS_MP3_SUPPORT\nKaboodle" else NEEDS_MP3_SUPPORT="$NEEDS_MP3_SUPPORT\nKaboodle" PKGLIST="$PKGLIST kdemultimedia-extras-nonfree" fi fi # MPlayer if rpmCheck mplayer ; then if rpmCheck libdvdcss ; then HAS_DVD_SUPPORT="$HAS_DVD_SUPPORT\nMPlayer" else NEEDS_DVD_SUPPORT="$NEEDS_DVD_SUPPORT\nMPlayer" PKGLIST="$PKGLIST libdvdcss" fi fi # Totem if rpmCheck totem ; then NEEDS_DVD_SUPPORT="$NEEDS_DVD_SUPPORT Totem" # totem conflicts with totem-xine; totem-xine will be installed later rpm -e totem --nodeps PKGLIST="$PKGLIST totem-xine libdvdcss" fi # Totem compiled against xine-lib if rpmCheck totem-xine ; then if rpmCheck libdvdcss ; then HAS_DVD_SUPPORT="$HAS_DVD_SUPPORT\nTotem" else NEEDS_DVD_SUPPORT="$NEEDS_DVD_SUPPORT\nTotem" PKGLIST="$PKGLIST libdvdcss" fi fi # VLC if rpmCheck vlc ; then if rpmCheck libdvdcss ; then HAS_DVD_SUPPORT="$HAS_DVD_SUPPORT\nVLC" else NEEDS_DVD_SUPPORT="$NEEDS_DVD_SUPPORT\nVLC" PKGLIST="$PKGLIST libdvdcss" fi fi # xine if rpmCheck xine ; then if rpmCheck libdvdcss ; then HAS_DVD_SUPPORT="$HAS_DVD_SUPPORT\nxine" else NEEDS_DVD_SUPPORT="$NEEDS_DVD_SUPPORT\nxine" PKGLIST="$PKGLIST libdvdcss" fi fi if [ -z "$NEEDS_DVD_SUPPORT" ] ; then zenity --info \ --text "DVD support is already installed for all detected applications:\n$HAS_DVD_SUPPORT" elif [ -z "$NEEDS_DVD_SUPPORT" -a -z "$HAS_DVD_SUPPORT" ] ; then zenity --info \ --text "No applications needing DVD support were detected." else zenity --info \ --text "DVD support will be installed for the following applications:\n$NEEDS_DVD_SUPPORT" fi [ -n "$PKGLIST" ] && yumCheck && yum -y install $PKGLIST unset PKGLIST fi # Win32codecs if grep Win32codecs $STDOUT > /dev/null ; then cd /tmp CODECS_LOCATION="http://www.mplayerhq.hu/MPlayer/releases/codecs" OUTPUT_FILE=`mktemp` if ! wget -O $OUTPUT_FILE $CODECS_LOCATION > /dev/null 2>&1 ; then echo "Could not determine latest version of audio and video codecs." exit 1 fi export CODECS=`perl -ne 'print "$1\n" if / /dev/null ; then if rpmCheck $ADOBE_READER_RPM_NAME ; then zenity --info \ --text "Adobe Acrobat Reader $ADOBE_READER_VER is already installed." else zenity --info \ --text "Adobe Acrobat Reader $ADOBE_READER_VER will now be installed." cd /tmp wget -N $ADOBE_READER_URI # compat-libstdc++-33 is a prerequisite for Acrobat Reader # Do not use yum "localinstall" because the Acrobat Reader RPM # is not signed, and yum defaults to "gpgcheck=1" if ! rpmCheck compat-libstdc++-33 ; then yum -y install compat-libstdc++-33 fi rpm -Uvh $ADOBE_READER_RPM # Fix "acroread" script; shipped version causes "expr: syntax error" ( cd /usr/local/Adobe/Acrobat7.0/bin; wget http://remi.collet.free.fr/files/acroread.patch && patch < acroread.patch && rm acroread.patch ) [ -h /usr/lib/mozilla/plugins/nppdf.so ] && rm /usr/lib/mozilla/plugins/nppdf.so ln -s /usr/local/Adobe/Acrobat7.0/Browser/intellinux/nppdf.so /usr/lib/mozilla/plugins rm $ADOBE_READER_RPM fi fi # Flash if grep Flash $STDOUT > /dev/null ; then if [ "$(rpm -q flash-plugin --queryformat \"%{VERSION}\")" == "\"$FLASH_VER\"" ] ; then zenity --info \ --text="Flash Plugin $FLASH_VER is already installed." else zenity --info \ --text="Flash Plugin $FLASH_VER will now be installed." cd /tmp wget $FLASH_URI rpm -Uvh $FLASH_RPM rm $FLASH_RPM fi fi # Java if grep Java $STDOUT > /dev/null ; then if [ "$(rpm -q jre --queryformat \"%{VERSION}\")" == "\"$JRE_DIR\"" ] ; then zenity --info \ --text="$JRE_VER is already installed." else zenity --info \ --text="$JRE_VER will now be installed." cd /tmp wget -O jre.bin $JRE_URI zenity --info \ --text="You must read and accept the license agreement to complete installation of $JRE_VER." sh ./jre.bin if [ $? -eq 0 ] ; then ln -f -s /usr/java/jre$JRE_DIR/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/ /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jre$JRE_DIR/bin/java 2 SELECTION=`/usr/sbin/alternatives --config java < /dev/null 2>/dev/null | grep "/usr/java/jre$JRE_DIR/bin/java" | cut -c4-6` echo $SELECTION | /usr/sbin/alternatives --config java > /dev/null fi rm jre.bin jre-*.rpm fi fi # ATI drivers if grep ATI $STDOUT > /dev/null ; then requiresLivna if rpm -q kmod-fglrx xorg-x11-drv-ati > /dev/null 2>&1 ; then INSTALLED_KMOD_VER=`rpm -q kmod-fglrx --queryformat "%{DESCRIPTION}" | perl -ne 'print "$1\n" if /kernel ([0-9].*?) for/'` zenity --info \ --text="ATI drivers are already installed for kernel $INSTALLED_KMOD_VER." else zenity --info \ --text="ATI drivers will now be installed." yumCheck && yum -y install kmod-fglrx /usr/bin/aticonfig --initial INSTALLED_KMOD_VER=`rpm -q kmod-fglrx --queryformat "%{DESCRIPTION}" | perl -ne 'print "$1\n" if /kernel ([0-9].*?) for/'` KERNEL_VER=`uname -r` if [ "$INSTALLED_KMOD_VER" != "$KERNEL_VER" ] ; then zenity --info \ --text="ATI drivers were installed for kernel $INSTALLED_KMOD_VER. You are currently running kernel $KERNEL_VER, and will not be able to use ATI drivers until you boot into kernel $INSTALLED_KMOD_VER." else zenity --info \ --text="You must restart the X Window System to begin using nVidia drivers." fi fi fi # nVidia drivers if grep nVidia $STDOUT > /dev/null ; then requiresLivna if rpm -q kmod-nvidia xorg-x11-drv-nvidia > /dev/null 2>&1 ; then INSTALLED_KMOD_VER=`rpm -q kmod-nvidia --queryformat "%{DESCRIPTION}" | perl -ne 'print "$1\n" if /kernel ([0-9].*?) for/'` zenity --info \ --text="nVidia drivers are already installed for kernel $INSTALLED_KMOD_VER." else zenity --info \ --text="nVidia drivers will now be installed." yumCheck && yum -y install kmod-nvidia /usr/sbin/nvidia-xconfig INSTALLED_KMOD_VER=`rpm -q kmod-nvidia --queryformat "%{DESCRIPTION}" | perl -ne 'print "$1\n" if /kernel ([0-9].*?) for/'` KERNEL_VER=`uname -r` if [ "$INSTALLED_KMOD_VER" != "$KERNEL_VER" ] ; then zenity --info \ --text="nVidia drivers were installed for kernel $INSTALLED_KMOD_VER. You are currently running kernel $KERNEL_VER, and will not be able to use nVidia drivers until you boot into kernel $INSTALLED_KMOD_VER." else zenity --info \ --text="You must restart the X Window System to begin using nVidia drivers." fi fi fi # Opera if grep Opera $STDOUT > /dev/null ; then if rpmCheck opera ; then zenity --info \ --text="Opera 9 is already installed." else zenity --info \ --text="Opera 9 will now be installed." cd /tmp wget -O opera.rpm $OPERA_URI # compat-libstdc++-33 is a prerequisite for Opera # Do not use yum "localinstall" because the Opera RPM # is not signed, and yum defaults to "gpgcheck=1" if ! rpmCheck compat-libstdc++-33 ; then yum -y install compat-libstdc++-33 fi rpm -Uvh opera.rpm rm opera.rpm fi fi # LimeWire if grep LimeWire $STDOUT > /dev/null ; then if rpmCheck LimeWire-free ; then zenity --info \ --text="LimeWire is already installed." else zenity --info \ --text="LimeWire will now be installed." cd /tmp wget $LIMEWIRE_URI rpm -Uvh LimeWireLinux.rpm fi fi # RealPlayer if grep RealPlayer $STDOUT > /dev/null ; then if rpmCheck RealPlayer ; then REALPLAYER_VERSION=`rpm -q RealPlayer --queryformat "%{VERSION}" | awk -F\. '{ print $1 }'` fi if [ "$REALPLAYER_VERSION" -eq 10 ] ; then zenity --info \ --text="RealPlayer 10 is already installed." else zenity --info \ --text="RealPlayer 10 will now be installed." cd /tmp wget -O RealPlayer10GOLD.rpm 'http://www.real.com/realcom/R?href=http%3A%2F%2Fforms.real.com%2Freal%2Fplayer%2Fdownload.html%3Ff%3Dunix%2FRealPlayer10GOLD.rpm%26product%3Dplayerplus%26system%3Dlinux&pageid=linuxPage&pageregion=advanced_install&src=linux&pcode=rn&opage=linux' rpm -Uvh RealPlayer10GOLD.rpm ln -f -s /usr/local/RealPlayer/mozilla/nphelix.so /usr/lib/mozilla/plugins ln -f -s /usr/local/RealPlayer/mozilla/nphelix.xpt /usr/lib/mozilla/plugins rm RealPlayer10GOLD.rpm fi fi # VMware Player if grep VMwarePlayer $STDOUT > /dev/null ; then if [ "$(rpm -q VMwarePlayer --queryformat \"%{VERSION}\")" == "\"$VMPLAYER_VER\"" ] ; then zenity --info \ --text="VMware Player $VMPLAYER_VER is already installed." else zenity --info \ --text="VMware Player $VMPLAYER_VER will now be installed." cd /tmp wget $VMPLAYER_URI rpm -Uvh $VMPLAYER_RPM # gcc-c++ and kernel-devel are VMware Player prerequisites if ! rpmCheck gcc-c++ ; then yum -y install gcc-c++ fi if ! rpmCheck kernel-devel ; then yum -y install gcc-c++ fi /usr/bin/vmware-config.pl rm $VMPLAYER_RPM fi fi