#! /bin/sh # d0newpkg # script to create a template for a new package with all the recommended files. # created 28-Jan-1998 A.M.Jonckheere if [ "$#" -ne 3 ]; then echo " " echo "Create a template for a new package with examples of all the "\ "recommended files." echo " " echo "Usage: createNewPkg package_name \"Czar's Name\" Czar's_Email_address" echo " " echo "Creates a subdirectory \"package_name\" in your current working directory." echo "Fetches examplePkg from cvs and does the necessary substitutions" echo "to change examplePkg -> package_name etc." echo " " exit 2 fi cvs co -d $1 examplePkg echo "y" | cvs release $1 echo " " cd $1 find . -name CVS -exec rm -r {} \; 2> /dev/null mv examplePkg $1 mv $1/examplePkgPrivate $1/$1Private mv $1/examplePkg.hpp $1/$1.hpp mv src/examplePkg.cpp src/$1.cpp mv test/examplePkg_t.cpp test/$1_t.cpp pwd echo "==== examplePkg -> $1" find . ! -type d ! -type l -print > doit.tmp for i in `cat doit.tmp`;do echo "== Update pkgname in $i" sed -e "s/examplePkg/$1/g" \ $i > $i.new mv $i.new $i done rm doit.tmp echo "==== Czar\'s name, addresss and times" find . -name "*.html" -print > doit.tmp for i in `cat doit.tmp`;do echo "== Update $i" sed -e 's/$Name: $/$Name: $/' \ -e "s/Czar\'s Name/$2/" \ -e "s/czar-address@fnal.gov/$3/" \ -e "s///" \ -e "s/Last modified: .*$/Last modified: `date`/" \ $i > $i.new mv $i.new $i done rm doit.tmp cd .. if [ -d include ]; then cd include ln -s ../$1/$1 $1 cd .. fi