#!/bin/sh ## ## SCRIPT: 01_targzip_feAppMenusDirectories.sh ## ## PURPOSE: Makes a tar.gz file from a set of application files --- ## in this case, from a set of DEVELOPMENT directories of ## 'AppMenus' FE subsystem files that are destined to be put ## in a user's ## $HOME/apps/feAppMenus_yyyymmmdd ## directory. ## ## HOW TO USE: Best for the 'package'-making-person to run this script ## in a terminal. The person can run from his home directory ## because this script should 'cd' to the proper directory ## to do the tar and gzip commands. ## ## Or run in the TARDIR, defined below. ## ## ** NOTE **: Tailor the 2 DIR vars (FROMDIR and TARDIR) and the 'tar' ## command below to suit the file structure of this application. ## ********* ## ** AND ** : Set the date (yyyymmdd) to be used in the output tarfile name. ## ********* ## We put the output file, [whatever].tar.gz, into the TARDIR ## directory --- the directory where the tar script(s) reside. ## ## Started: 2010sep09 Based on the script for the 'xpg' FE subsystem. ## Changed: ######################################################### ## Set the FROMDIR and TARDIR vars --- and setup the 'tar' ## command below properly. ######################################################### FROMDIR="$HOME/apps/feAppMenus" TARDIR="$FROMDIR/.TAR_feAppMenus" ## FOR TESTING: (show statements as they execute) set -x ############################################## ## 'cd' to the directory containing the ## application files --- in this case, ## the FE 'AppMenus' DEVELOPMENT Directory. ############################################## cd "$FROMDIR" ############################################## ## Make the tar file from the app files. ## *** CHANGE THIS DATE FOR A NEW RELEASE. *** ############################################## TARFILE="$TARDIR/feAppMenus_2011oct05.tar" tar -cvf "$TARFILE" \ --exclude=".bkup*" \ --exclude=".PREP*" \ --exclude=".TAR*" \ --exclude=".TEST*" \ chestdef_scripts/ \ chestdefs/ \ helps/ \ images/ \ includes_sh/ \ includes_tk/ \ scripts/ \ tkGUIs/ \ set_fedir_vars.shi \ set_fedir_vars.tki \ feAppMenus_PKG.txt ############################################## ## Make the gzip (.gz) file from the tar file. ############################################## gzip "$TARFILE" ############################################## ## Indicate where the tar file is and its name. ############################################## echo " ############################ The tar file was created in $TARFILE It should have a '.gz' suffix. ############################# " ############################################# ## CHECK THE CONTENTS OF THE TAR-GZIPPED FILE ## --- using 'tar ztvf'. ## (Make sure there are no '~' files --- ## backup files from text editors.) ############################################# OUTLIST="/tmp/temp_tarTOC.lis" tar ztvf "${TARFILE}.gz" > "$OUTLIST" gedit "$OUTLIST"