#!/bin/shTAR="$1"RETURNTARNAME="$2".$(dirname$0)/common.sherc unpack $TAR|| fatalmkdir-p optmv Phoenix-Firestorm-Releasex64-*$PRODUCTmv$PRODUCT opt/VERSION=$(echo"$TAR" | grep-oP'(?<=Releasex64-)\d+-\d+-\d+-\d+' | tr'-''.')[-n"$VERSION"]|| fatal "Can't get package version"install_file opt/firestorm/firestorm_icon.png /usr/share/pixmaps/$PRODUCT.png# create desktop filecat<<EOF | create_file /usr/share/applications/$PRODUCT.desktop[Desktop Entry]Version=1.0Type=ApplicationName=Firestorm Second Life viewerComment=Second Life is a 3-D virtual world entirely built and owned by its residentsExec=$PRODUCT %UIcon=$PRODUCTTerminal=falseCategories=GameEOFPKGNAME=$PRODUCT-$VERSIONerc pack $PKGNAME.tar opt usr || fatalreturn_tar $PKGNAME.tar