Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # get-picasa
- # Installer for Picasa-3.0.5744-02.i386 (for 32 and 64bit systems)
- ############################
- # Description:
- # This script downloads and installs Picasa 3 from Google.com.
- # It also installs dependencies and corrected .desktop files.
- ############################
- # Instructions:
- # Save this file in your home folder as get-picasa
- # then in a terminal :-
- # $ chmod 755 get-picasa
- #
- # then to install Picasa :-
- # $ su
- # # ./get-picasa
- #
- # To uninstall Picasa :-
- # $ su
- # # ./get-picasa uninstall
- ############################
- # Changelog:
- #
- # Sunday 10 Jul 2011 First pasted
- #
- ############################
- md5=5990be842062ca483239c9f1efca9614
- mkdesktop()
- {
- cat > /usr/share/applications/picasa.desktop << EOF1
- [Desktop Entry]
- Name=Picasa
- Comment=The Photo Organizer from Google
- Exec=/opt/google/picasa/3.0/bin/picasa
- Icon=/opt/google/picasa/3.0/desktop/picasa.xpm
- Type=Application
- Terminal=false
- Categories=Graphics;
- EOF1
- }
- mkfontdesktop()
- {
- cat > /usr/share/applications/picasa-fontcfg.desktop << EOF2
- [Desktop Entry]
- Name=Picasa Font Settings
- Comment=Configure fonts used by Picasa
- Exec=/opt/google/picasa/3.0/bin/picasafontcfg
- Terminal=false
- Icon=/opt/google/picasa/3.0/desktop/picasa-fontcfg.xpm
- Type=Application
- Categories=Graphics;
- EOF2
- }
- chksu()
- {
- (((UID)) || [[ $USER = "root" ]]) &&\
- { echo "Sorry, you must run this as root. (Use su NOT su -)"; exit 1; }
- }
- chkdeps()
- {
- echo "Checking dependencies for Picasa"
- deps=(lsb-core-lib libasound.so.2 libaudiofile.so.0 \
- libcups.so.2 libexif.so.12 libfreetype.so.6 libgphoto2.so.2 \
- libsane.so.1 libXau.so.6 libXmu.so.6 libXpm.so.4 \
- libxslt.so.1 libXxf86vm.so.1)
- for dp in ${deps[@]}; do
- urpmi --force $dp || exit 1
- done
- }
- down()
- {
- tmp_dir=$(mktemp -d)
- [[ -d $tmp_dir ]] || { echo "Failed to create temporary directory"; exit 1; }
- cd $tmp_dir || { echo "Error changing to temporary directory"; exit 1; }
- wget --timeout=20 --tries=3 "http://dl.google.com/linux/rpm/testing/i386/picasa-3.0-current.i386.rpm"
- [[ -f picasa-3.0-current.i386.rpm ]] || { echo "Download failed"; rm -rf $tmp_dir; exit 1; }
- md5chk=$(md5sum picasa-3.0-current.i386.rpm | cut -d' ' -f1)
- cd .. || { echo "Error changing directory"; exit 1; }
- [[ $md5 = $md5chk ]] || { echo "Checksum Failed"; rm -rf $tmp_dir; exit 1; }
- }
- inst()
- {
- [[ -f $tmp_dir/picasa-3.0-current.i386.rpm ]] || exit 1
- rpm -Uvh --nodeps $tmp_dir/picasa-3.0-current.i386.rpm 2> /dev/null
- [[ $? = 0 ]] || { echo "There was an error during install"; rm -rf $tmp_dir; exit 1; }
- }
- chkinst()
- {
- if rpm -qa | grep -q ^picasa; then
- echo "Picasa seems to be already installed - uninstall it before running this again"
- exit 1
- fi
- }
- chksu
- [[ $1 != *uninstall* ]] || { urpme picasa; exit 0; }
- chkinst
- chkdeps
- down
- inst
- rm -rf /usr/share/applications/picasa.desktop
- rm -rf /usr/share/applications/picasa-fontcfg.desktop
- mkdesktop
- mkfontdesktop
- rm -rf $tmp_dir
- echo "Picasa was successfully installed"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement