#!/bin/sh ## ## SCRIPT: 01_targzip_tkGooiesDirectories.sh ## ## PURPOSE: This script makes a '.tar.gz' file from a set of application files. ## In this case, the application files are in a hierarchy of ## directories of 'tkGooies' files. ## ## The 'tkGooies' files are ultimately destined to be put ## 1) in a user's directory ## (a location like $HOME/apps/tkGooies is recommended) ## OR ## 2) in a site's directory ## (a location like /apps/tkGooies is recommended). ## ## The resulting '.tar.gz' file is to be concatenated 'under' the script ## 02_extractFromSelf_code_forCat2tarfile_ofTkGooiesDirs.sh ## to make a 'self-extracting install file' to be posted at ## a 'web site development' directory: ## $HOME/WebSites/WebSite1/freedomenv/TkGooies ## ## After a 'download.htm' file in that 'web site development directory' ## is appropriately updated, the 'download.htm' file and the ## 'self-extracting install file' are to be posted at ## www.freedomenv.com/TkGooies ## ## We put the output file, [whatever].tar.gz, into the $TARDIR directory ## --- the directory where this script and the 'Cat2tarfile' script reside. ## (See below where the full directory name is set in var TARDIR.) ## ## HOW TO USE THIS SCRIPT: ## ## It is best for the 'package'-making-person to run this script ## in a terminal --- to see the commands being executed and ## error messages, if any. ## ## The package-maker could 'cd' to the directory containing ## this script (and the 'Cat2tarfile' script). ## Then execute this script. Example terminal commands: ## ## cd $TARDIR (see $TARDIR defined below) ## ./01_targzip_tkGooiesDirectories.sh ## ## Alternatively, the package-maker person could run this script ## from his/her home directory (or almost any directory), ## because this script should 'cd' to the proper directory ## to do the tar and gzip commands. ## ## BEFORE RUNNING THIS SCRIPT: ## ## Check that the 2 DIR vars (APPDIR and TARDIR) are set properly. ## ## Also check that the 'tar' command below --- especially ## the '-exclude' parameter values --- suits the file ## structure (directory naming) of this application. ## ## ********** REMEMBER TO SET THE RELEASE-DATE in the TARFILE var!!!! ## --- in each build run for a new release. ## ## ********** REMEMBER TO UPDATE DIRECTORY/FILE NAMES IN THE 'tar' COMMAND, ## if any directories are added or filenames in the 'tar' ## command were changed. ## ######################################################################## ## MAINTENANCE HISTORY: ## Started: 2015feb07 A first release --- in 2015. ## Changed: 2015mar09 Prepped for 2015mar09 release. FIRST ONE. ######################################################################## ######################################################### ## Set the APPDIR and TARDIR vars. ## This is setting up to run the 'tar' command below. ######################################################### APPDIR="$HOME/apps/tkGooies_linux" TARDIR="$APPDIR/.TAR_tkGooies" ## FOR DISPLAY of msgs in a terminal window when creating the tar file: set -x ############################################## ## 'cd' to the directory containing the ## application files --- in this case, ## the tkGooies Directory where all the ## development files are stored. ############################################## cd "$APPDIR" ####################################################### ## Make the tar file from the app files. ## !!! CHANGE THIS DATE !!! before running this script! ####################################################### TARFILE="$TARDIR/pkg_tkGooies_linux_2015mar09.tar" tar -cvf "$TARFILE" \ --exclude=".TAR*" \ --exclude=".bkup*" \ --exclude="bkup*" \ --exclude=".PREP*" \ --exclude="PREP*" \ --exclude="00_PREP*" \ --exclude=".TEST*" \ --exclude=".OLD*" \ chestdef_scripts/ \ chestdefs/ \ helps/ \ images/ \ includes_sh/ \ includes_tk/ \ scripts/ \ tkGUIs/ \ set_fedir_vars.shi \ set_fedir_vars.tki \ tkGooies_linux_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. ############################# " ################################################## ## Put the TOC (Table Of Contents) of the tar file ## in a file --- for checking for a 'clean' install. ## ## That is, check that (only) the desired files ## are in the 'tar.gz' file. ## For example, no backup files or directories. ################################################## OUTLIST="/tmp/temp_tarTOC.lis" tar ztvf "${TARFILE}.gz" > "$OUTLIST" gedit "$OUTLIST"