#!/bin/bash # autopackage 1.0.4 # RootName @micq.org/micq:0.5.0.4 # ShortName mICQ # SoftwareVersion 0.5.0.4 # InterfaceVersion # PackageVersion # CPUArchitecture x86 # gecko mimetype hack: # DisplayName de mICQ Text-basiertes ICQ-Programm # DisplayName en mICQ Text based ICQ client # Summary de Zeilenbasiertes ICQ-Programm für fortgeschrittene Benutzer # Summary en Text/line based ICQ client for advances users # Do not attempt to parse any information below this line # programmatically. The only supported interfaces this file exports # are the comments above (which may be in any order) and the command # line switches. # This is an autopackage (http://autopackage.org/) # Copyright 2002-2005 Mike Hearn, Hongli Lai, and Curtis L Knight skipLines="196" export metaSize="9135" export dataSize="617007" export MD5="666fac99bdcca7568947d853a04b375f" export AUTOPACKAGETARGET="1.0" ## END OF HEADER function normal() { echo -en "033[0m"; } function bold() { echo -en "033[1m"; } function green() { echo -en "033[1;32m"; } function cyan() { echo -en "033[1;36m"; } function red() { echo -en "033[1;31m"; } if [[ "$executed_from_directory" == "" ]]; then export executed_from_directory=`pwd` fi if [ `echo $BASH_VERSION | sed 's/([0-9]).*/1/'` = "1" ]; then echo "You need at least version 2 of bash to use autopackage" exit 1 fi packageDir=`dirname "$0"` packageDir=`cd "$packageDir" 2>/dev/null; pwd` packageBase=`basename "$0"` export package_filename="$packageDir/$packageBase" if [[ "$MD5" == "00000000000000000000000000000000" ]]; then echo -n "WARN: No MD5 checksum exists, skipping integrity verification... " else if which md5sum >/dev/null; then md5sum=`tail --bytes=$dataSize "$0" | md5sum | cut -b-32`; if [[ "$md5sum" != "$MD5" ]]; then red; echo "Verifing archive integrity failed"; normal; echo "Error in MD5 sums: $md5sum is different from $MD5" exit 2 fi else echo echo "----------" echo "An embedded MD5 sum of the archive exists but no md5sum program was found in $PATH" echo echo "If you have md5sum on your system, you should try adding it to your path" echo "----------" echo "No md5sum program exists... " fi fi [ ! -d "${TMP}" ] && export TMP="/tmp" export working_dir="" # if we're being invoked from another installer, don't create our own working directory if [[ "$1" == "-w" ]]; then shift export working_dir="$1" shift fi # make a temporary directory if [[ "$1" == "-x" ]] ; then # If it's extract mode, pick a "proper" dirname working_dir=`dirname "$0"` working_dir=`cd "$working_dir" 2>&-; pwd 2>&-` working_dir_suffix=`basename "$0" | sed s/\.package$//ig` working_dir=`echo "$working_dir/$working_dir_suffix"` if [ ! -d "$working_dir" ]; then if ! mkdir "$working_dir" ; then echo "Error: cannot create directory $working_dir" fi fi elif [[ "$working_dir" == "" ]]; then # this was invoked by the user, so we need to setup the initial working space function searchTmp() { working_dir="$executed_from_directory/tmp$RANDOM$$" if ! mkdir "$working_dir" 2> /dev/null; then working_dir="${TMP}/autopackage.$RANDOM$$" if ! mkdir "$working_dir"; then echo "Error: cannot create temporary directory $working_dir" exit fi fi } # First, try to use a ramdisk if cat /proc/mounts | awk '{print $2 " " $4}' | grep '/dev/shm rw' >/dev/null 2>&1; then # Check if the user has more than 128 MB RAM mem=`free -b | awk '/^Mem:.*/ {print $2}'` if [[ $mem -gt 134217728 ]]; then export working_dir="/dev/shm/autopackage.$RANDOM$$" mkdir "$working_dir" 2> /dev/null || searchTmp else # don't use ramdisk if the user has little memory searchTmp fi else # extract to the filesystem if /dev/shm is not available searchTmp fi fi export payload_dir="$working_dir/payload/@micq.org/micq:0.5.0.4" export meta_dir="$working_dir/meta/@micq.org/micq:0.5.0.4" mkdir -p "$payload_dir" mkdir -p "$meta_dir" chmod -R 777 "$working_dir" # extract the metadata # if group and user are the same and are not # system uids then allow group writeable files if [[ "`id -gn`" == "`id -un`" ]] && [ `id -u` -gt 99 ]; then umask 002 else umask 022 fi if ! tail -n +$skipLines "$0" | head --bytes=$metaSize | tar xvz -C "$meta_dir" >/dev/null; then red; echo -n "ERROR: "; normal; echo "unable to extract the metadata payload! Check disk space or redownload."; echo rm -rf "$working_dir" exit 1 fi # copy the payload into the working directory so we can extract it later if ! tail --bytes=$dataSize "$0" > "$payload_dir/payload.tar.bz2"; then red; echo "ERROR: Unable to extract the data payload! Check disk space or redownload."; normal; echo rm -rf "$working_dir" exit 1 fi case "$1" in "-x" | "--extract") # extract mode echo -n "Please wait: extracting files... " pushd "$payload_dir" >/dev/null # work around oddness in tar bzip2 -dc "payload.tar.bz2" | tar -xv -C "$working_dir" | ( while read a; do echo -n "."; done; echo; ) popd >/dev/null echo echo "Files have been extracted to $working_dir" echo exit 0 ;; "-d" | "--debug") # debug mode echo -n "Please wait: extracting files... " bzip2 -dc "$payload_dir/payload.tar.bz2" | tar -xv -C "$payload_dir" | ( while read a; do echo -n "."; done; echo; ) echo cd "$working_dir" echo "Type 'exit' to finish without installing." echo "Run apkg-installer manually to continue... " echo bash cd .. rm -rf "$working_dir" # clean up exit 0 ;; "--delay") # this is an internal option, do not use it outside of the autopackage runtime # delay mode, we are being run from a require* function. just extract stuff to the working dir, and stop. # the require function will boot us up later exit 0;; *) # default mode [ALL] - pass control to installer "$meta_dir/apkg-installer" "$@" exit $? ;; esac ## END OF STUB y5B \{wƎ@hNM{b;O;fD#aIu|?!9Į{zn ?`0kOF+b'5W|w{m~_7Fŋno7%YKĎ Rz#kj0# 0J/v ؾÙNġ/``'FNwS;ga3vNвgbHdc!3'L$F17rI";"U|᎐Dı=Ŏ <wGPFMR0A'tfg=>ȁ&cL#C2Wx%`"Z&S_$5{t^(`ζB*N!Q 4 Q31&0#F]x(܆4p<D@\# @5;cdPÒ"&~]PBs$ l qHvpPGNFf7q>qoVg/vgݯ}$mw==Gxfs[ϟﶾ>:06rL>I"`KcD7qIu-ۧ^w k u\ƈ)k#"Ĕo ӷ]`k(!_mm'8 GHM^'y[BoSD4|%%$Y+QWL#D/`'G';0H%8N1Ǩ pM}@$¥]gOj'/iwb`5^D2H\؞p8 t &xs`_{5gm'``V/_cFo;d2 KFt2Y A: q n4 &RT1P(pI-88|?O4`{[I˸Rv6U*p[~-hVXG^8Lx*W\~K@z/zʺIV$5ʎA}oP3r.\`0 &Dgr{h%0Q؏GONU\ד9M60:@uG8ޱ;N$lL8"}' #LD:=HF0@ԩD70=`jTC@ l2e&ab!!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