Posted: Wed 23 Jan 2013, 16:43 Post subject:
Script to make a SeaMonkey sfs
Think the script explains itself. I tested it with precise
Code:
#!/bin/bash
###################################################################
# Script to download and make a puppylinux style seamonkey.sfs
#
# NOTICE: In puppylinux the squashfs hiaracy as seen from the
# systems perspective is Savefile, pup_xxx.sfs(the system
# pup), then loaded sfs files in their load order(?)
#
# Because of this we can not replace the original soft links
# in pup_xxx's /usr/[bin|lib] with our own in the sfs file.
#
# I can think of two solutions at the moment.
# 1) To place the links in a path with precidence to /usr/bin
# in $PATH
# 2) Make a fix script to do the changes the next time you
# boot the computer. The fix script may be placed in
# /root/startup
#
# This script use solution nr 1.
#
#
# CONFIGURE: Search for TODO: and select accordingly.
# NOTICE: This script does not create menu/desktop links.
#
####################################################################
# Save params
PARAMS=$*
WORK_FOLDER=$(pwd)
#
# TODO: Replace the version numbers so you get the one you want.
# Script tested with SEAMONKEY_VERSION="2.15"
SEMONKEY_VERSION="2.15.1"
#
# TODO: LANG_ID could be en-GB, en-US, uk, it, and so one find yours
# on the mozilla site. Tested with nb-NO and en-GB
LANG_ID="en-GB"
#
# TODO: Modify the url?
DOWNLOAD_URL=http://download.cdn.mozilla.net/pub/mozilla.org/seamonkey/releases/$SEMONKEY_VERSION/linux-i686/$LANG_ID/seamonkey-$SEMONKEY_VERSION.tar.bz2
if [ "$1" == '--help' -o "$1" == '' ]; then
echo ""
echo "seamonkey-sfs.sh [--clean|--pristine|--help]"
echo
echo "Without options nothing is removed and only simple checks are done before sfs file is made"
echo ""
echo "--clean removes seamonkey-$SEMONKEY_VERSION.sfs and"
echo "directory seamonkey-$SEMONKEY_VERSION"
echo ""
echo "--pristine: removes as clean and the file seamonkey-$SEMONKEY_VERSION.tar.bz2"
echo ""
echo "--help prints this information"
echo ""
exit 0
fi
if [ "$1" == '--clean' ]; then
#rm seamonkey-$SEMONKEY_VERSION.tar.bz2
rm seamonkey-$SEMONKEY_VERSION.sfs
rm -rf seamonkey-$SEMONKEY_VERSION
fi
if [ "$1" == '--pristine' ]; then
rm seamonkey-$SEMONKEY_VERSION.tar.bz2
rm seamonkey-$SEMONKEY_VERSION.sfs
rm -rf seamonkey-$SEMONKEY_VERSION
fi
#
# Download seamonkey from mozilla
wget -nc $DOWNLOAD_URL
# TODO_CODE: Check for errors.
if [ -e seamonkey-$SEMONKEY_VERSION.tar.bz2 ]; then
#File is present so unpack it to the opt folder
if [ ! -e ./seamonkey-$SEMONKEY_VERSION/opt ]; then
mkdir -p seamonkey-$SEMONKEY_VERSION/opt
fi
if [ ! -e seamonkey-$SEMONKEY_VERSION/opt/seamonkey ]; then
echo unpacking seamonkey-$SEMONKEY_VERSION.tar.bz2
#NOTICE: -axf must be followed by the file
tar --checkpoint=500 --directory=./seamonkey-$SEMONKEY_VERSION/opt/ -axf ./seamonkey-$SEMONKEY_VERSION.tar.bz2
fi
# TODO_CODE: Check for errors.
# Create folders and links to run seamonkey
mkdir -p ./seamonkey-$SEMONKEY_VERSION/bin/
mkdir -p ./seamonkey-$SEMONKEY_VERSION/usr/bin
mkdir -p ./seamonkey-$SEMONKEY_VERSION/usr/lib
cd seamonkey-$SEMONKEY_VERSION/
ln -f -s -t ./usr/lib/ /opt/seamonkey
# TODO: a link in ./usr/bin wil not replace the original link.
# The official pup_xxx.sfs has precedence and is only replaced
# by stuff in the personal save file
# RESOURCE: http://puppylinux.com/development/howpuppyworks.html
#ln -s -f -t ./usr/bin/ /opt/seamonkey/seamonkey
# SOULUTION: (Sort of) place the links in an earlyer $PATH path.
ln -s -f -t ./bin/ /opt/seamonkey/seamonkey
cd ./bin
ln -s -f seamonkey mozilla
# TODO_CODE: Check for errors
#
# TODO_CODE: Add plugins, libflash and so on.
#
# Create the sfs file
cd $WORK_FOLDER
mksquashfs $WORK_FOLDER/seamonkey-$SEMONKEY_VERSION/ seamonkey-$SEMONKEY_VERSION.sfs -noappend
#
fi
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum