#!/bin/bash # # ## ## ##### exoodles (update date/verion globals) ##### ########## Date: 2011-05-29 ######### ############## Version: 3.9.35 ################## ########## Installs multimedia packages for ######### ##### Debian Sid, Testing, and Stable ##### ## Author: David M. Thompson ## # License: GPL 3 or later # # # ## ##### ### variables ##### ## # Warn="" Err="" Stand="" Quest="" Mess="" Comm="" Norm="" PlainLine='------------------------------------------------------------------' Line=${Stand}$PlainLine${Norm} MessageLine=${Mess}$Line${Norm} # apt stuff, system base PackageManager='apt-get' NonTrusted='--allow-unauthenticated' WithoutRecommends='--no-install-recommends' Version='3.9.35' VersionDate='2011-05-29' Etch=0 Stable=0 Testing=0 Unstable=0 Level='' Bits=$(uname -m|grep -o 64) if [ -z "$Bits" ];then Bits=32 fi W3264Codecs='w32codecs' if [ "$Bits" == 64 ];then W3264Codecs='w64codecs' fi # defaults and flags ConfigFile=/etc/exoodles.conf # change this to true for debian deb packaging to turn off undesired script options DebPackage=false PackageManagerSet=false LevelSet=false # apt-cache search gstreamer | awk '{print $1}' |grep -E 'gstreamer.*-plugins-(good|bad|ugly)$' GstreamerPlugins='gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly' downloadUrl='ex.505.ru' # ## ##### ######### #### functions ######### ##### ## # error_handler(){ local error_code='' message='' case $1 in noroot) message="${Warn}You must be root to run this script. Exiting now.${Norm}" error_code=1 ;; badupdate) message="${Comm}$PackageManager update${Err} reports errors. Please correct the problem.${Norm}" error_code=200 ;; wgetfailed) message="${Warn}Exoodles self-update download exited with errors.\nMaybe the server is offline or changed? Exiting now.${Norm}" error_code=3 ;; baddownload) message="${Warn}Exoodles self-update file download appears to be corrupted.\nTry updating again. Exiting now.${Norm}" error_code=4 ;; esac echo -e "$message ${Stand}(${Comm}$error_code${Stand})${Norm}" if [ "$error_code" -lt 200 ];then exit $error_code else hit_enter_to_continue fi } trap_handler(){ echo ${Norm} exit 0 } get_options(){ local opt='' non_deb_options='U' setup_hints='' if [ "$DebPackage" == 'true' ];then non_deb_options='' fi if [ "$1" == '--help' ];then print_options else while getopts :RS:${non_deb_options}vh opt;do case $opt in h) print_options ;; R) reset_script_configs ;; S) if [ -n "$( grep -Eis '^([1-3])$' <<< "$OPTARG" )" ];then case $OPTARG in 1)setup_hints='abcde';; 2)setup_hints='google-chrome';; 3)setup_hints='lxdvdrip';; esac print_setup_data "$setup_hints" else echo "${Warn}Unsupported option: ${Comm}-S $OPTARG${Warn} Please pick from the following options:${Norm}" print_options fi ;; U) script_self_updater ;; v) print_version exit 0 ;; *) echo "${Warn}You entered an unsupported option: ${Comm}-$OPTARG${Norm}" print_options ;; esac done fi } print_options(){ echo "Exoodles supports the following options:" echo '-R Reset exoodles config file, deletes any user selections so you can change them.' echo ' (like apt-get/aptitude, system base).' echo '-S Setup help data. Requires further numeric option, like: -S 1' echo ' 1 - config tips for abcde' echo ' 2 - setting up plugins for google-chrome' echo ' 3 - config tips for lxdvdrip' if [ "$DebPackage" != 'true' ];then echo '-U Run exoodles self updater. Must be root, and exoodles must be in system $PATH.' fi echo '-h Show this help menu' echo '-v Show exoodles version information' echo exit 0 } print_version(){ echo $Line echo "${Stand}Currently installed exoodles version:" echo "Version Number: $Version" echo "Version Date: $VersionDate${Norm}" } script_self_updater(){ local script_location=$( which exoodles ) temp_data='' good_data='' if [ -n "$script_location" ];then start_tests #check for root print_version echo $Line echo "${Stand}Starting exoodles self updater.${Norm}" temp_data="$( wget -q -O - $downloadUrl )" || error_handler 'wgetfailed' good_data=$( grep '#file-download-good#' <<< "$temp_data" ) # try it again just in case it fails if [ -z "$good_data" ];then echo "${Stand}First download attempt failed, trying it again...${Norm}" # no -q because want to see error output on second failure temp_data="$( wget -O - $downloadUrl )" || error_handler 'wgetfailed' good_data=$( grep '#file-download-good#' <<< "$temp_data" ) fi # then process it and restart if [ -n "$good_data" ];then echo "$temp_data" > $script_location chmod 705 $script_location echo "${Stand}Success! Restarting exoodles now to new version.${Norm}" exoodles exit 0 else error_handler 'baddownload' fi else echo "${Err}exoodles is not in your system PATH. Unable to update.${Norm}" exit 0 fi } reset_script_configs(){ echo "${Stand}Deleting $ConfigFile now to reset all user selections then restarting exoodles.${Norm}" if [ -f $ConfigFile ];then rm -f $ConfigFile fi exoodles exit 0 } # ## ##### ## initial tests and setup ##### ## # start_tests(){ if [ "$(whoami)" != "root" ];then error_handler noroot fi } check_config_file(){ if [ -f $ConfigFile ];then if [ -n "$( grep -Eis 'package-manager=(apt-get|aptitude)' $ConfigFile | cut -d '=' -f 2 )" ];then PackageManager=$( grep -Eis 'package-manager=(apt-get|aptitude)' $ConfigFile | cut -d '=' -f 2 ) PackageManagerSet='true' fi if [ -n "$( grep -Eis 'system-base=(stable|testing|unstable)' $ConfigFile | cut -d '=' -f 2 )" ];then Level=$( grep -Eis 'system-base=(stable|testing|unstable)' $ConfigFile | cut -d '=' -f 2 ) LevelSet='true' fi fi } set_debian_base(){ local NotDebian='(deb-ats|deb-mep|deb-mm|deb-op|deb-sdx|deb-skp|deb-swift|deb-vb|alphagemini|aptosid|byteme|cathbard|debian-multimedia|dotdeb|edevelop|eeepc|freevo|giss.tv|google|java|kanotix|kde|kiberpipa|kplayer|lamaresh|liquorix|lxde|mepis|moblock|opera|noreply|prodeia.de|rarewares|rox4debian|sidux|skype|swiftfox|tovid|videolan|virtualbox|wine-hq|xadras)' local StableDefault=$( grep -Esi 'APT::Default-Release[[:space:]]*"(stable|etch|lenny|squeeze)"' /etc/apt/apt.conf ) local TestingDefault=$( grep -Esi 'APT::Default-Release[[:space:]]*"(testing|wheezy)"' /etc/apt/apt.conf ) local UnstableDefault=$( grep -Esi 'APT::Default-Release[[:space:]]*"(sid|unstable)"' /etc/apt/apt.conf ) local repo_name='' if [ -n "$StableDefault" ];then Level='stable' elif [ -n "$TestingDefault" ];then Level='testing' elif [ -n "$UnstableDefault" ];then Level='unstable' fi Etch=$( grep -cis '^4.' /etc/debian_version ) Stable=$( grep -Esiw '^[[:space:]]*deb' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Eiv "$NotDebian" | grep -Eicw '(stable|squeeze|lenny|etch)' ) Testing=$( grep -Esiw '^[[:space:]]*deb' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Eiv "$NotDebian" | grep -Eicw '(wheezy|testing)' ) Unstable=$( grep -Esiw '^[[:space:]]*deb' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Eiv "$NotDebian" | grep -Eicw '(sid|unstable)' ) if [ -z "$Level" ];then if [ "$Stable" -gt 0 -a "$Testing" -eq 0 -a "$Unstable" -eq 0 ];then Level='stable' elif [ "$Stable" -gt 0 -a "$Testing" -gt 0 ] || [ "$Testing" -gt 0 -a "$Unstable" -eq 0 ];then Level='testing' elif [ "$Testing" -gt 0 -a "$Unstable" -gt 0 ] || [ "$Testing" -eq 0 -a "$Unstable" -gt 0 ];then Level='unstable' else get_system_base_manually fi fi # assign specific level based on the Debian release name if [ "$Level" == 'stable' -o "$Level" == 'testing' ];then repo_name=$( grep -Esiw '^[[:space:]]*deb' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -Eiv "$NotDebian" | grep -Eiow -m1 '(wheezy|squeeze|lenny)' ) if [ -n "$repo_name" ];then Level=$repo_name fi fi } get_system_base_manually(){ local options='stable testing unstable wheezy squeeze lenny quit' echo $Line echo "${Stand}Exoodles was unable to determine your Debian system base." echo "Please select the base you want Exoodles to use for Debian-Multimedia" echo "package installs. Exoodles will remember this answer. You can change it" echo "in $ConfigFile if you want later." echo echo "If you use explicit repo instead of generic testing or stable, please pick" echo "that instead. For example, if you use: squeeze, select squeeze, not stable." echo $Line select option in $options do case $option in stable|testing|unstable|wheezy|squeeze|lenny) Level=$option touch $ConfigFile echo "system-base=$option" >> $ConfigFile ;; quit) echo "${Stand}Ok, try again some other time once you know the answer.${Norm}" exit 0 ;; *) echo "${Err}You have to pick one before you can continue!${Norm}" get_system_base_manually ;; esac break done } ask_apt_aptitude(){ local option='' package_managers='apt-get aptitude quit' if [ "$PackageManagerSet" != 'true' -a -f /var/log/aptitude ];then echo $Line echo "${Stand}It appears you are using aptitude. It is not good to mix apt-get and aptitude." echo "Please pick your preferred package manager before you continue. You can change" echo "it in $ConfigFile if you want later." echo $Line select option in $package_managers do case $option in apt-get|aptitude) PackageManager=$option touch $ConfigFile echo "package-manager=$option" >> $ConfigFile ;; quit) echo "${Stand}Ok, try again some other time once you know the answer.${Norm}" exit 0 ;; *) echo "${Err}You have to pick one before you can continue!${Norm}" ask_apt_aptitude ;; esac break done fi } set_apt_aptitude_data(){ if [ "$PackageManager" == 'aptitude' ];then if [ "$Etch" -gt 0 ];then NonTrusted='' else NonTrusted='--allow-untrusted' fi WithoutRecommends='--without-recommends' fi } update_to_nonfree(){ for i in /etc/apt/sources.list /etc/apt/sources.list.d/*.list; do if [ -f $i ];then if [ -n "$( grep -Es 'deb.*debian\.org' $i )" -a -z "$( grep -Es 'deb.*debian\.org.*non-free' $i )" ];then echo "${Stand}Adding ${Comm}non-free${Stand} to debian.org in ${Comm}$i${Stand}.......${Norm}" sed -i -r 's%(deb.*debian\.org.*main.*)%\1 contrib non-free%' $i fi # add the new non-free to existing exoodles if [ -n "$( grep -Es 'deb.*debian-multimedia' $i )" -a -z "$( grep -Es 'deb.*debian-multimedia.*non-free' $i )" ];then echo "${Stand}Adding ${Comm}non-free${Stand} to ${Comm}debian-multimedia${Stand} in ${Comm}$i${Stand}.......${Norm}" sed -i -r 's%(deb.*debian-multimedia.*main.*)%\1 non-free%' $i fi fi done } # needs one option: which repo add_new_repo(){ # check for no multimedia stuff local repo_search='' repo_full='' source_subfile_name='' repo_level='' local use_sub_source='' sources_special_test='' update_system='' case $1 in debian-multimedia|google-chrome) repo_level=$Level ;; opera|opera-beta) case $Level in stable) repo_level='squeeze' ;; testing|unstable) repo_level='sid' ;; esac ;; esac case $1 in debian-multimedia) repo_search='debian-multimedia' repo_full="deb http://www.debian-multimedia.org/ $repo_level main non-free" source_subfile_name='multimedia.list' update_system='true' ;; google-chrome) repo_search='google' ## old one: http://dl.google.com/linux/deb/ ## new one: http://dl.google.com/linux/chrome/deb/ repo_full="deb http://dl.google.com/linux/chrome/deb/ stable main" source_subfile_name='google-chrome.list' # this makes the automated subfile add not happen, don't use sources.list here # use_sub_source='true' # to stop auto repo add to sources.list.d/ touch /etc/default/google-chrome ;; opera) repo_search='opera' repo_full="deb http://deb.opera.com/opera/ $repo_level non-free" source_subfile_name='opera.list' # have to handle case with opera-beta repo present, which triggers true # opera test, but it's a separate repo. if [ -z "$( grep -Eis "^[ /t]*deb[ /t].*opera" /etc/apt/sources.list.d/*.list /etc/apt/sources.list | grep -vi 'opera-beta' )" ];then sources_special_test='true' fi ;; opera-beta) repo_search='opera-beta' repo_full="deb http://deb.opera.com/opera-beta/ $repo_level non-free" source_subfile_name='opera.list' ;; skype) repo_search='skype' repo_full="deb http://download.skype.com/linux/repos/debian/ stable non-free" source_subfile_name='skype.list' ;; esac echo "${Stand}Checking to see if sources for ${Comm}$1${Stand} are present...${Norm}" if [ -z "$( grep -Eils "^[ /t]*deb[ /t].*$repo_search" /etc/apt/sources.list.d/*.list /etc/apt/sources.list )" -o "$sources_special_test" == 'true' ];then if [ -z "$( ls /etc/apt/sources.list.d/*.list 2>/dev/null )" -a "$use_sub_source" != 'true' ]; then echo "${Stand}Adding Debian Level:$Level $repo_search sources...${Norm}" echo "# $repo_search sources added by exoodles" >> /etc/apt/sources.list echo "$repo_full" >> /etc/apt/sources.list else if [ ! -f /etc/apt/sources.list.d/$source_subfile_name ];then echo "${Stand}Adding Debian Level:$Level $repo_search sources...${Norm}" echo "${Stand}Adding $repo_search sources...${Norm}" echo "# $repo_search sources added by exoodles" > /etc/apt/sources.list.d/$source_subfile_name echo "$repo_full" >> /etc/apt/sources.list.d/$source_subfile_name fi fi # add keyrings case $1 in debian-multimedia) echo "${Stand}Updating multimedia keyrings...${Norm}" update_apt # update after adding sources but before installing keyring package install_packages 'debian-multimedia-keyring' "$NonTrusted" ;; opera|opera-beta) update_keyrings_manually 'Opera' ;; google-chrome) update_keyrings_manually 'Chrome' ;; esac update_apt else echo "${Mess}Sources for ${Comm}$1${Mess} are already present, continuing...${Norm}" if [ "$update_system" == 'true' ];then update_apt fi fi } update_keyrings_manually(){ local keyring_url='' case $1 in Chrome) keyring_url='https://dl-ssl.google.com/linux/linux_signing_key.pub' ;; Opera) keyring_url='http://deb.opera.com/archive.key' ;; esac echo "${Stand}Updating $1 keyrings...${Norm}" wget -O - $keyring_url | apt-key add - if [ "$?" -eq 0 ];then echo "${Stand}$1 keyring updated successfully.${Norm}" else echo "${Err}There was an error updating $1 keyring.${Norm}" fi } # ## ##### ## utilities ##### ## # continue_message(){ echo $Line echo "${Stand}Please select another install item, or back to main menu, or quit.${Norm}" } hit_enter_to_continue(){ local value='' echo "${Stand}Please hit ${Comm}enter${Stand} to continue.${Norm}" read value } # check to make sure the package is available for user system, # optional argument: c / i for candidate/installed check_available(){ local package_available='' status='Candidate:' case $1 in c) status='Candidate:';; i) status='Installed:';; esac LC_ALL= LC_CTYPE= LC_MESSAGES= LANG= package_available=$( apt-cache policy $1 2>/dev/null | grep -i $status | cut -d ':' -f 2-4 | cut -d ' ' -f2 | grep -iv '\(none\)' ) echo $package_available } # $2 is optional, extra arguments install_packages(){ local package='' packages='' echo $Line for package in $1;do if [ -n "$( check_available $package 'c' )" ];then echo "${Stand}Adding ${Comm}$package${Stand} to install group.${Norm}" packages="$packages$package " else echo "${Mess}Sorry, ${Comm}$package${Stand} is not available for Debian $Level.${Norm}" fi done echo $Line if [ -n "$packages" ];then echo "${Stand}Installing ${Comm}$packages${Stand}...${Norm}" $PackageManager install $WithoutRecommends $2 $packages else echo "${Stand}No packages available from ${Comm}$1${Stand} so none installed${Norm}" hit_enter_to_continue fi } update_apt(){ echo "${Stand}Running $PackageManager update...${Norm}" $PackageManager update || error_handler badupdate } # ## ##### ## main selector ##### ## # package_group_selector(){ local rerun='' echo -e "$MessageLine ${Warn} Exoodles - Multimedia Installer - Version: ${Comm}$Version${Warn} Date: ${Comm}$VersionDate $MessageLine ${Stand}The following are the available options for package installs. Please note that each main application will also get all required codecs and libs added automatically, so there's no need to manually install the specific codecs unless you want to. Exoodles believes that your Debian distribution level is: ${Comm}$Level${Stand} and will install packages using the package manager: ${Comm}$PackageManager${Stand} You can return to this main menu to pick from another group to install more packages, then to exit, just hit the quit number and the script will exit. There are 3 main types of programs, which will require libraries and packages from the following desktops, or none, in the case of CLI tools. The amount of libraries required varies application to application, but you will see what will be added for each package and can decide whether to install it all or not. ${Comm}QT/KDE${Stand}; ${Comm}GTK/Gnome${Stand}; ${Comm}CLI${Stand} (command line tools). The script will note which applies. Check each subsection for complete package list. See ${Comm}exoodles -h${Stand} for advanced setup help options for some applications. $Line ${Comm}1${Stand} - ${Comm}browsers-internet${Stand} google chrome, opera, opera beta, java, flash, skype, acroread mozilla plugin, mplayer mozilla plugin, vlc mozilla plugin. ${Comm}2${Stand} - ${Comm}codecs-plugins${Stand} libdvdcss, ffmpeg, flac, gstreamer-plugins, lame, vorbis-tools, w32codecs ${Comm}3${Stand} - ${Comm}editing-authoring${Stand} brasero, k3b, k9copy, lxdvdrip, mencoder, qdvdauthor, xdvdshrink ${Comm}4${Stand} - ${Comm}media-players-audio${Stand} aqualung, amarok, audacious, banshee, gmusicbrowser, quod-libet, streamtuner ${Comm}5${Stand} - ${Comm}media-players-video${Stand} mplayer, kaffeine, vlc, xine ${Comm}6${Stand} - ${Comm}miscellaneous-media${Stand} abcde, acroread, audacity, evince-gtk, Java, streamripper ${Comm}7${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="browsers-internet codecs-plugins editing-authoring media-players-audio media-players-video miscellaneous-media quit" select option in $options do case $option in browsers-internet) browsers_internet_installer rerun='true' ;; codecs-plugins) codecs_plugins_installer rerun='true' ;; editing-authoring) editing_authoring_installer rerun='true' ;; media-players-audio) media_players_audio_installer rerun='true' ;; media-players-video) media_players_video_installer rerun='true' ;; miscellaneous-media) miscellaneous_media_installer rerun='true' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then package_group_selector fi } # ### ###### #### Specific group installers ###### ### # browsers_internet_installer() { local rerun='' echo -e "$MessageLine ${Mess} Browsers and Internet Tools $MessageLine ${Stand}Here are some popular internet/browser packages for you to install. $Line ${Stand}BROWSERS: ${Comm}1${Stand} - ${Comm}google-chrome${Stand} Adds google chrome sources if needed, installs google-chrome (GTK) ${Comm}2${Stand} - ${Comm}update-chrome-keyring${Stand} If you get an apt repo update error from Chrome, try updating the keyring. These update every year usually. ${Comm}3${Stand} - ${Comm}opera${Stand} Adds opera sources if needed, installs opera (QT based). ${Comm}4${Stand} - ${Comm}opera-beta${Stand} Adds opera-beta sources if needed, installs opera (QT based). ${Comm}5${Stand} - ${Comm}update-opera-keyring${Stand} If you get an apt repo update error from Opera, try updating the keyring. These update every year usually. $Line ${Stand}PLUGINS/UTILITIES: ${Comm}6${Stand} - ${Comm}flash${Stand} Installs Adobe flash support for web browsers ${Comm}7${Stand} - ${Comm}java${Stand} Installs Sun java, also adds java support for web browsers ${Comm}8${Stand} - ${Comm}mozilla-acroread${Stand} Adobe acroread pdf reader plugin for firefox/mozilla. ${Comm}9${Stand} - ${Comm}mozilla-mplayer${Stand} mplayer plugin for firefox/mozilla + $W3264Codecs (Removes kaffeine-mozilla firefox plugin if required.) ${Comm}10${Stand} - ${Comm}mozilla-vlc${Stand} vlc plugin for mozilla/firefox/iceweasel ${Comm}11${Stand} - ${Comm}skype${Stand} Adds skype sources if needed, installs skype (64 bit, also adds 64 bit ia32 libs). ${Comm}12${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}13${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="google-chrome update-chrome-keyring opera opera-beta update-opera-keyring flash java mozilla-acroread mozilla-mplayer mozilla-vlc skype main-menu quit" select option in $options do case $option in flash) install_flash continue_message rerun='true' ;; google-chrome) add_new_repo 'google-chrome' install_google_chrome rerun='true' ;; update-chrome-keyring) update_keyrings_manually 'Chrome' rerun='true' ;; java) install_java continue_message rerun='true' ;; mozilla-acroread) install_packages "acroread mozilla-acroread" continue_message rerun='true' ;; mozilla-mplayer) install_mozilla_mplayer continue_message rerun='true' ;; mozilla-vlc) install_packages "mozilla-plugin-vlc $W3264Codecs" continue_message rerun='true' ;; opera) add_new_repo 'opera' install_packages "opera" rerun='true' ;; opera-beta) add_new_repo 'opera-beta' install_packages "opera" rerun='true' ;; update-opera-keyring) update_keyrings_manually 'Opera' rerun='true' ;; skype) add_new_repo 'skype' install_skype rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then browsers_internet_installer fi } codecs_plugins_installer(){ local rerun='' echo -e "$MessageLine ${Mess} Codecs + Encoders + Audio/Video Plugins Installer $MessageLine ${Stand}Here are some popular audio/video codecs/plugins for you to install. $Line ${Comm}1${Stand} - ${Comm}ffmpeg${Stand} ffplay multimedia player, ffserver streaming server and the ffmpeg audio and video encoder. Supports most existing file formats (AVI, MPEG, OGG, Matroska, ASF...) and encoding formats (MPEG, DivX, MPEG4, AC3, DV...) ${Comm}2${Stand} - ${Comm}flac${Stand} Installs program to allow encoding of flac files. ${Comm}3${Stand} - ${Comm}gstreamer-plugins${Stand} Installs the following gstreamer plugins: $GstreamerPlugins ${Comm}4${Stand} - ${Comm}libdvdcss${Stand} Installs dvd playback libs. ${Comm}5${Stand} - ${Comm}lame${Stand} Installs program to allow encoding of mp3 files. ${Comm}6${Stand} - ${Comm}twolame${Stand} TwoLAME is an optimized MPEG Audio Layer 2 encoder. ${Comm}7${Stand} - ${Comm}vorbis-tools${Stand} ogg vorbis, theora, flac sound/video encoder tools. ${Comm}8${Stand} - ${Comm}$W3264Codecs${Stand} Installs $W3264Codecs. ${Comm}9${Stand} - ${Comm}x264${Stand} x264 is an advanced encoder for creating H.264 (MPEG-4 AVC) video streams (CLI). ${Comm}10${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}11${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="ffmpeg flac gstreamer-plugins libdvdcss lame twolame vorbis-tools $W3264Codecs x264 main-menu quit" select option in $options do case $option in flac) install_packages "flac" continue_message rerun='true' ;; lame) install_packages "lame" continue_message rerun='true' ;; ffmpeg) install_packages "ffmpeg" continue_message rerun='true' ;; gstreamer-plugins) install_packages "$GstreamerPlugins" continue_message rerun='true' ;; libdvdcss) install_packages "libdvdcss2" continue_message rerun='true' ;; twolame) install_packages "twolame" continue_message rerun='true' ;; vorbis-tools) install_packages "flac vorbis-tools" continue_message rerun='true' ;; $W3264Codecs) install_packages "$W3264Codecs" continue_message rerun='true' ;; x264) install_packages "x264" continue_message rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then codecs_plugins_installer fi } editing_authoring_installer(){ local rerun='' echo -e "$MessageLine ${Mess}CD/DVD Burning + Copying + Editing + Authoring Tools Installer $MessageLine ${Stand}Here are some popular multimedia packages for you to install. You can install them one at a time. When you are done, just hit the quit number and the script will exit. $Line ${Stand}CD/DVD BURNING/COPYING: ${Comm}1${Stand} - ${Comm}brasero${Stand} Installs ${Comm}brasero${Stand} cd/dvd burning tool (GTK/Gnome). ${Comm}2${Stand} - ${Comm}k3b${Stand} Installs ${Comm}k3b${Stand} cd/dvd copy/burn (QT/KDE). ${Comm}3${Stand} - ${Comm}mybashburn${Stand} Installs ${Comm}mybashburn${Stand} command line, burning app (CLI, with dialogues). $Line ${Stand}DVD AUTHORING/EDITING/RIPPING: ${Comm}4${Stand} - ${Comm}k9copy${Stand} dvd backup/authoring program (requires burning program like K3B) (KDE/QT). ${Comm}5${Stand} - ${Comm}lxdvdrip${Stand} dvd backup/authoring program, backs up and burns, all in one! (CLI) ${Comm}6${Stand} - ${Comm}mencoder${Stand} A simple movie encoder, designed to encode MPlayer-playable movies. ${Comm}7${Stand} - ${Comm}qdvdauthor${Stand} GUI frontend for dvdauthor and other related tools (KDE/QT). ${Comm}8${Stand} - ${Comm}xdvdshrink${Stand} Simple GUI frontend for dvdauthor and other related tools (GTK). ${Comm}9${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}10${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="brasero k3b mybashburn k9copy lxdvdrip mencoder qdvdauthor xdvdshrink main-menu quit" select option in $options do case $option in brasero) install_packages "brasero flac lame" continue_message rerun='true' ;; k3b) install_k3b continue_message rerun='true' ;; k9copy) install_packages "k9copy libdvdcss2" continue_message rerun='true' ;; lxdvdrip) install_packages "lxdvdrip libdvdcss2" continue_message rerun='true' ;; mencoder) install_packages "mencoder libdvdcss2" continue_message rerun='true' ;; mybashburn) install_packages "mybashburn lame" continue_message rerun='true' ;; qdvdauthor) install_packages "qdvdauthor libdvdcss2" continue_message rerun='true' ;; xdvdshrink) install_packages "xdvdshrink libdvdcss2" continue_message rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then editing_authoring_installer fi } media_players_audio_installer(){ local rerun='' echo -e "$MessageLine ${Mess} Audio Players + Tools $MessageLine ${Stand}Here are some popular multimedia packages for you to install. These are all audio only players, or very audio focused. For video (mplayer, vlc, kaffeine etc), go the video players dedicated section. Some of these will also install the gstreamer-plugins: ${Comm}$GstreamerPlugins $Line ${Comm}1${Stand} - ${Comm}amarok${Stand} Audio player, streams, music library + related multimedia packages (QT/KDE). ${Comm}2${Stand} - ${Comm}aqualung${Stand} True GAPLESS Audio player, streams, music library + related multimedia packages (GTK+gstreamer plugs). ${Comm}3${Stand} - ${Comm}audacious${Stand} Simple xmms style audio player, streams, music library + related multimedia packages (GTK+gstreamer plugs). ${Comm}4${Stand} - ${Comm}banshee${Stand} media management and playback application, streams, music library + related multimedia packages (GTK/Gnome+gstreamer plugs). ${Comm}5${Stand} - ${Comm}gmusicbrowser${Stand} graphic jukebox for large collections of mp3/ogg/flac/mpc files (GTK/Gnome+gstreamer plugs). ${Comm}6${Stand} - ${Comm}moc${Stand} ncurses based console audio player (CLI). ${Comm}7${Stand} - ${Comm}quod-libet${Stand} Audio player, streams, music library + related multimedia packages (Python/GTK+gstreamer plugs). ${Comm}8${Stand} - ${Comm}rhythmbox${Stand} media management and playback application, streams, music library + related multimedia packages (GTK/Gnome+gstreamer plugs). ${Comm}9${Stand} - ${Comm}shell-fm${Stand} console based player for last.fm radio streams (CLI). ${Comm}10${Stand} - ${Comm}streamtuner${Stand} search/libray streams (like shoutcast), music library + streamripper (to rip streams) + related multimedia packages (GTK+gstreamer plugs). ${Comm}11${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}12${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="amarok aqualung audacious banshee gmusicbrowser moc quod-libet rhythmbox shell-fm streamtuner main-menu quit" select option in $options do case $option in amarok) install_packages "amarok lame" continue_message rerun='true' ;; aqualung) install_packages "aqualung $GstreamerPlugins" continue_message rerun='true' ;; audacious) install_packages "audacious $GstreamerPlugins" continue_message rerun='true' ;; banshee) install_packages "banshee $GstreamerPlugins" continue_message rerun='true' ;; gmusicbrowser) install_packages "gmusicbrowser $GstreamerPlugins" continue_message rerun='true' ;; moc) install_packages "moc moc-ffmpeg-plugin" continue_message rerun='true' ;; quod-libet) install_packages "quodlibet $GstreamerPlugins" continue_message rerun='true' ;; rhythmbox) install_packages "rhythmbox $GstreamerPlugins" continue_message rerun='true' ;; shell-fm) install_packages "shell-fm" continue_message rerun='true' ;; streamtuner) install_packages "streamtuner streamripper $GstreamerPlugins" continue_message rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then media_players_audio_installer fi } media_players_video_installer(){ local rerun='' #${Comm}5${Stand} - ${Comm}realplayer${Stand} Installs ${Comm}realplayer${Stand} proprietary Real Audio media player.$text64 echo -e "$MessageLine ${Mess} Video Players $MessageLine ${Stand}Here are some popular multimedia packages for you to install. Most of these video players also can do audio playback. $Line ${Comm}1${Stand} - ${Comm}kaffeine${Stand} Video/dvd player + related multimedia packages (QT/KDE). ${Comm}2${Stand} - ${Comm}mplayer${Stand} Audio/Video player + ${Comm}$W3264Codecs${Stand} + related multimedia packages (GTK). ${Comm}3${Stand} - ${Comm}mplayer-nogui${Stand} mplayer without the GTK gui (CLI) ${Comm}4${Stand} - ${Comm}mozilla-mplayer${Stand} Browser plugin: ${Comm}firefox mozilla mplayer plugin + $W3264Codecs${Stand} (Removes kaffeine-mozilla firefox plugin if required.) ${Comm}5${Stand} - ${Comm}smplayer${Stand} mplayer gui + ${Comm}$W3264Codecs${Stand} + related multimedia packages. (QT/KDE based ) ${Comm}6${Stand} - ${Comm}vlc${Stand} VLC is the VideoLAN project's media player. It plays MPEG, MPEG2, MPEG4, DivX, MOV, WMV, QuickTime, mp3, Ogg/Vorbis files, DVDs, VCDs, and multimedia streams from various network sources.(GTK+QT libraries). ${Comm}7${Stand} - ${Comm}xine-ui${Stand} Video player + ${Comm}$W3264Codecs${Stand} + multimedia packages (GTK). ${Comm}8${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}9${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="kaffeine mplayer mplayer-nogui mozilla-mplayer smplayer vlc xine-ui main-menu quit" select option in $options do case $option in kaffeine) install_packages "libdvdcss2 kaffeine" continue_message rerun='true' ;; mplayer) install_mplayer 'mplayer' continue_message rerun='true' ;; mplayer-nogui) install_mplayer 'mplayer-nogui' continue_message rerun='true' ;; smplayer) install_mplayer 'smplayer' continue_message rerun='true' ;; mozilla-mplayer) install_mozilla_mplayer continue_message rerun='true' ;; realplayer) install_realplayer continue_message rerun='true' ;; vlc) install_packages "libdvdcss2 $W3264Codecs vlc lame" continue_message rerun='true' ;; xine-ui) install_packages "libdvdcss2 $W3264Codecs xine-ui libxine1-plugins" continue_message rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then media_players_video_installer fi } miscellaneous_media_installer(){ local rerun='' echo -e "$MessageLine ${Mess} Misc Media and Utility Installer $MessageLine ${Stand}Here are some popular multimedia packages for you to install. You can install them one at a time. When you are done, just hit the quit number and the script will exit. $Line ${Comm}1${Stand} - ${Comm}abcde${Stand} CD audio to flac, ogg, mp3 ripping tool. Includes lame, codecs (CLI) ${Comm}2${Stand} - ${Comm}acroread${Stand} Installs ${Comm}Adobe Acrobat${Stand} pdf reader. ${Comm}3${Stand} - ${Comm}audacity${Stand} Audio processing tool. Includes lame, plugins, codecs (GTK). ${Comm}4${Stand} - ${Comm}evince-gtk${Stand} Evince is a simple multi-page pdf/postscript document viewer (GTK). ${Comm}5${Stand} - ${Comm}kstreamripper${Stand} download online streams into audio files (QT/KDE gui). ${Comm}6${Stand} - ${Comm}java${Stand} Installs Sun Java, also adds Java support for web browsers ${Comm}7${Stand} - ${Comm}ms-core-fonts${Stand} Installs the Microsoft core fonts. ${Comm}8${Stand} - ${Comm}streamripper${Stand} download online streams into audio files (CLI, library). ${Comm}9${Stand} - ${Comm}main-menu${Stand} Return to main menu group selector. ${Comm}10${Stand} - ${Comm}quit${Stand} Exit script. $Line ${Quest}Please type the appropriate number and hit ${Comm}enter${Quest}.${Norm} $Line" options="abcde acroread audacity evince-gtk kstreamripper java ms-core-fonts streamripper main-menu quit" select option in $options do case $option in abcde) install_packages "abcde flac lame vorbis-tools" continue_message rerun='true' ;; acroread) install_packages "acroread" continue_message rerun='true' ;; audacity) install_packages "audacity lame libmp3lame0 ladspa-plugin libavcodec52 libavformat52" continue_message rerun='true' ;; evince-gtk) install_packages "evince-gtk" continue_message rerun='true' ;; java) install_java continue_message rerun='true' ;; ms-core-fonts) install_ms_corefonts continue_message rerun='true' ;; kstreamripper) install_packages "kstreamripper flac lame" continue_message rerun='true' ;; streamripper) install_packages "streamripper flac lame" continue_message rerun='true' ;; main-menu) echo $Line echo "${Stand}Ok, going back to main selector menu now.${Norm}" rerun='' ;; quit) echo $Line echo "${Stand}Thanks for using this script, have a nice day.${Norm}" exit 0 ;; *) echo "${Err}Please pick one of the numbers, try again.${Norm}" ;; esac break done if [ "$rerun" == 'true' ];then miscellaneous_media_installer fi } # #### ## complex / repeated package installers and utilities: #### # check_mscorefonts_version(){ local msCoreFonts='' if [ -n "$( check_available ttf-mscorefonts-installer )" ];then msCoreFonts='ttf-mscorefonts-installer' elif [ -n "$( check_available msttcorefonts )" ];then msCoreFonts='msttcorefonts' fi echo $msCoreFonts } install_flash(){ # flashplugin-nonfree is only available if you have Sid sources in Debian if [ -n "$( check_available flashplugin-nonfree )" ];then install_packages "flashplugin-nonfree" else # install debian-multimedia version instead for Testing/Stable if [ -n "$( check_available flashplayer-mozilla )" ];then install_packages "flashplayer-mozilla" else echo $Line echo "${Err}There is no non-free flash plugin available for your current system.${Norm}" hit_enter_to_continue fi fi } install_google_chrome(){ echo $Line echo "${Stand}Installing google chrome now...${Norm}" if [ "$Bits" == 64 ];then echo "${Stand}Making sure you have the ia32 stuff you need...${Norm}" install_packages "ia32-libs ia32-libs-gtk" fi install_packages 'google-chrome-unstable' } install_java(){ echo $Line if [ "$Bits" == 32 ];then install_packages "sun-java6-plugin" else install_packages "java-gcj-compat-plugin" fi update-alternatives --config java } install_k3b() { # this will create a list of available packages, and sorts them latest to oldest local k3bExtraCodecs=$( apt-cache search libk3b | grep extracodecs | awk '{print $1}' | sort -r ) local package='' echo $Line for package in $k3bExtraCodecs;do if [ -n "$( check_available $package )" ];then k3bExtraCodecs=$package break fi done install_packages "$k3bExtraCodecs k3b flac lame" } # $1 - which mplayer to install install_mplayer(){ local msCoreFonts=$( check_mscorefonts_version ) install_packages "libdvdcss2 $W3264Codecs $msCoreFonts $1" } install_mozilla_mplayer(){ local msCoreFonts=$( check_mscorefonts_version ) if [ -n "$( dpkg -l | grep kaffeine-mozilla )" ]; then echo $Line echo "${Stand}Removing kaffeine-mozilla...${Norm}" dpkg --purge kaffeine-mozilla fi if [ -n "$( check_available gecko-mediaplayer )" ];then install_packages "libdvdcss2 $W3264Codecs $msCoreFonts gecko-mediaplayer mplayer" else # install debian-multimedia version instead for Testing/Stable if [ -n "$( check_available mplayerplug-in )" ];then install_packages "libdvdcss2 $W3264Codecs $msCoreFonts mplayerplug-in mplayer" else echo $Line echo "${Err}There is no non-free mozilla mplayer plugin available for your current system.${Norm}" hit_enter_to_continue fi fi } install_ms_corefonts(){ local msCoreFonts=$( check_mscorefonts_version ) if [ -n "$msCoreFonts" ];then install_packages "$msCoreFonts" else echo $Line echo "${Err}There is no ms core fonts package available for your current system.${Norm}" hit_enter_to_continue fi } install_realplayer(){ if [ "$Bits" == 32 ];then install_packages "realplayer" else echo $Line echo "${Err}realplayer is not available in 64 bit.${Norm}" hit_enter_to_continue fi } # no keys for skype? install_skype(){ echo $Line echo "${Stand}Installing skype now...${Norm}" if [ "$Bits" == 64 ];then echo "${Stand}Making sure you have the ia32 stuff you need...${Norm}" install_packages "ia32-libs ia32-libs-gtk libasound2-plugins" fi install_packages "skype" "$NonTrusted" } # #### ## setup data tips and tricks #### # print_setup_data(){ echo $Line echo "Setup tips for ${Comm}$1${Norm}:" echo $Line case $1 in abcde) echo " Depending on your preferences, abcde can benefit from changing a few of the defaults in the main config file, ${Comm}/etc/abcde.conf${Norm} Note that you can also override these with user preference file here: ${Comm}/home//.abcde.conf${Norm} Sometimes when changing the main /etc file doesn't work, setting the user config file does, in case you have problems. Overall, the config file comments are quite clear and explain what each global setting does, so it pays to read it at least once so you can see what you can really do with abcde automatically. Most of the config defaults are fine for most users, but to activate any one of them, simply uncomment it, and restart abcde. To change to real cd reader location, set like this. Note that you can get the real location of shortcuts like /dev/cdrom by doing: ${Comm}readlink /dev/cdrom${Norm} and you can get the list of system shortcuts by doing: ${Comm}ls /dev | grep cdrom${Norm} ${Comm}CDROM=/dev/scd1${Norm} To make abcde always output as flac files, you'd uncomment this ${Comm}OUTPUTTYPE=flac${Norm} For auto-eject of cd tray after ripping is completed ${Comm}EJECTCD=y${Norm} Note that you can set defaults for ogg, mp3 ripping qualities, and so on as well, and that you can also use arguments to achieve the same results. And you can place any desired options in your ${Comm}/home//.abcde.conf${Norm} file as well (note ${Comm}.${Norm}). These will override the master /etc versions. ${Comm}abcde -h${Norm} shows a fairly complete set of the supported abcde options. " ;; google-chrome) echo " After you install ${Comm}google-chrome${Norm}, you will need to, for now, setup the links to your system plugins directory manually. This is pretty easy to do, and only requires a few simple steps: Do both steps as root ${Comm}cd /opt/google/chrome${Norm} ${Comm}ln -s /usr/lib/mozilla/plugins${Norm} Then you need to tell google chrome about the new plugins directory, add: ${Comm}--enable-plugins %U${Norm} to your google chrome start command, either in a startup icon or in your program menu: ${Comm}/usr/bin/google-chrome --enable-plugins %U${Norm} Note that you can also use the direct path to do this: ${Comm}/opt/google/chrome/google-chrome --enable-plugins %U${Norm} Then restart google chrome, and your flash and other plugins from mozilla should be working fine, as expected. Please note that these steps are probably only required in the early versions of chrome, and the plugins stuff should be automatic in future releases. So always check to see if the plugins work before you do this fix. " ;; lxdvdrip) echo " ${Comm}lxdvdrip${Norm} requires a few tweaks to its configuration file, ${Comm}/etc/lxdvdrip.conf${Norm}, which is in German. You can also find a gzipped English copy here, which you can use instead: ${Comm}/usr/share/doc/lxdvdrip/examples/lxdvdrip.conf.EN.gz${Norm} Before you do anything else, try running lxdvdrip, as regular user. If you get errors saying that play_cell_lxdvdrip and/or vamps_lxdvdrip cannot be found, you'll need to rename those in the config file, like this: Change: ${Comm}play_cell_name=play_cell_lxdvdrip${Norm} To: ${Comm}play_cell_name=play_cell${Norm} And change: ${Comm}vamps_name=vamps_lxdvdrip${Norm} To: ${Comm}vamps_name=vamps${Norm} Now let's set the basic default configurations you will probably want. The following change the application / dvd defaults to English, which is what most people will probably want: ${Comm}audio=2${Norm} ${Comm}untertitel=en${Norm} ${Comm}language=en${Norm} 'untertitel' means subtitles. Then make sure your dvd location is correct. Hint: use: readlink /dev/dvd or whatever ls /dev | grep dvd gives as the associated shortcuts to your real dvd location. If you have only one dvd/cd unit, the default is probably right, but double check. ${Comm}dvdleser=/dev/sr0${Norm} ${Comm}dvdbrenner=/dev/sr0${Norm} dvdleser means dvd reader and dvdbrenner means dvd burner If you don't want to keep your dvd backup files and data in /tmp, you will want to change the defaults to let's say your /home directory somewhere: ${Comm}filmverzeichnis=/home/fred/dvds${Norm} ${Comm}tmp=/home/fred/dvds${Norm} If you always want to do multiple burns, leave: ${Comm}multicopy=1${Norm} otherwise set it =0, which will do only one burn before completion. multicopy=1 will just ask you over and over if you want to burn another dvd until you exit the process. If you want lxdvdrip to clean up after itself after every dvd backkup, then change this to 1. ${Comm}delete=1${Norm} And last but not least, make sure to set burning speed=0 in order to get full speed burns. The default is 4, which is very slow on today's close to 20x burners. 0 means whatever the max supported is will be used. ${Comm}speed=0${Norm} " ;; esac exit 0 } # ## ###### ############# ######### main launcher ############# ###### ## # trap 'trap_handler' INT TERM get_options "$@" start_tests check_config_file set_debian_base ask_apt_aptitude set_apt_aptitude_data update_to_nonfree add_new_repo 'debian-multimedia' package_group_selector # ## ##### ### all done! ##### ## # exit 0 #file-download-good#