Page MenuHomeHEPForge

install_webversion_for_laptop.bat
No OneTemporary

install_webversion_for_laptop.bat

#!/bin/bash
# run this from /home/Karina/Work/HiggsBounds/HBsvn/higgsbounds/trunk/webversion
# 1)copies latest HiggsBounds to $destfolder, compiles it, (suitable for web)
# 2)creates index_debug.html from index.html
# 3)copies webpages and cgi scripts to $destfolder (changing paths where necessary)
#
# ./install_webversion_for_laptop.bat short
# skips step (1), so use while developing and testing webpages and cgi scripts
echo 'Note: need to put bib files etc in properly'
startfolder="/home/Karina/Work/HiggsBounds/HBsvn/higgsbounds/trunk/webversion"
destfolder="/home/Karina/Work/HiggsBounds/HiggsBounds_for_laptop_webversion"
#first check I'm running this from the correct folder:
currentfolder=$PWD
if [[ $startfolder != $currentfolder ]]
then
echo 'pwd is not' $startfolder
exit
fi
# unless $1 is 'short', will pack up HiggsBounds, copy it over and install it
# with appropriate settings for website
if [[ $1 == "short" ]]
then
echo 'option "short" specified: Not recompiling HiggsBounds'
else
cd /home/Karina/Work/HiggsBounds/HBsvn/higgsbounds/trunk/HiggsBounds_KW/
./create_package.bat
mv ../HiggsBounds_KW.tar.gz "$destfolder"
cd "$destfolder"
gunzip -c HiggsBounds_KW.tar.gz | tar xvf -
cp -r HiggsBounds_KWF90/* .
rm -r HiggsBounds_KWF90
cp configure configure_myorig
sed -e "s/F90FLAGS = -fbounds-check/F90FLAGS = -fbounds-check -DWEBVERSION/g" configure_myorig > configure
./configure
make HBweb
cd $startfolder
fi
# creates the file index_debug.html by uncommenting a section in index.html and then
# specifying debugmode=T in each form on the page
sed -e "s/<!-- BEGIN DEBUGGING BIT//g" \
-e "s/END DEBUGGING BIT -->//g" \
-e "s/<!-- BEGIN COMMENT OUT IN DEBUGGING BIT -->/<!--/g" \
-e "s/<!-- END COMMENT OUT IN DEBUGGING BIT -->/-->/g" \
-e 's/<INPUT TYPE=hidden NAME="debugmode" VALUE="F">/<INPUT TYPE=hidden NAME="debugmode" VALUE="T">/g' index.html > index_debug.html
# creates the file downloads_detailed.html by uncommenting a section in downloads.html and then
sed -e "s/<!-- BEGIN DETAILED BIT//g" \
-e "s/END DETAILED BIT -->//g" \
-e 's/downloads_detailed.html">show history/downloads.html">hide history/g' downloads.html > downloads_detailed.html
# list of cgi files that need to be copied across
cgifiles="callHiggsBounds.cgi \
HB_BRSM.cgi \
HB_inputfromFH.cgi \
GetinputfromFH.pm \
HiggsBounds_input.cgi \
DrawTables.pm \
Examples.pm \
Gettestdata.pm"
# add list of cgi files to the other files that need to be copied across
listfiles="$cgifiles""
downloads.html \
downloads_detailed.html \
HBstyle.css \
privacypolicy.html \
index_debug.html \
HiggsBounds-logo-small.jpg \
DarkSUSY2-100.jpg \
sample_fhucc_mhmax.txt \
minipaper.tex \
minipaper.bib \
minipaper.bbl \
minipaper.pdf \
index.html"
# '*' is a sed wildcard and will match any number (or none) or the character immediately preceeding it
# change paths and website addresses to appropriate settings for laptop. Also want to use the hepforge .css file, so get to see what effect it'll have on the page.
# note that the links to the tar.gz files will not work as they're not stored on my laptop!
for f in $listfiles ; do
sed \
-e "s/<link rel\=\"stylesheet\" type=\"text\/css\" *href=\"http:\/\/projects\.hepforge\.org\/higgsbounds\/HBstyle\.css\">/<link rel\=\"stylesheet\" type\=\"text\/css\" href\=\"http:\/\/projects\.hepforge\.org\/common\/css\/cedar\-hepforge\-common\.css\" \/><link rel\=\"stylesheet\" type=\"text\/css\"href=\"http:\/\/projects\.hepforge\.org\/higgsbounds\/HBstyle\.css\">/g" \
-e "s/http\:\/\/projects\.hepforge\.org\/higgsbounds\/cgi-bin\//\/cgi-bin\//g" \
-e "s/http\:\/\/projects\.hepforge\.org\/higgsbounds\//http\:\/\/localhost\/HiggsBounds\//g" \
-e "s/\/hepforge\/home\/higgsbounds\/public\_html\/cgi-bin/\/var\/www\/cgi-bin/g" \
-e "s/\/hepforge\/home\/higgsbounds\/HBWebsiteExe/\/home\/Karina\/Work\/HiggsBounds\/HiggsBounds\_for\_laptop\_webversion/g" \
$f > "$destfolder""/extras/""$f"
#echo "$destfolder""/extras/""$f"
done
# can't just copy the cgi scripts directly into /var/www/cgi-bin/ because of the permissions,
# so using 'cat' gets round that
for f in $cgifiles ; do
cat "$destfolder""/extras/""$f" > /var/www/cgi-bin/"$f"
done
# for the html files, I get round the problem by using links e.g.
#ln -s /home/Karina/Work/HiggsBounds/HiggsBounds_for_laptop_webversion/extras/downloads_detailed.html /var/www/html/HiggsBounds/HiggsBounds/downloads_detailed.html
rm index_debug.html
rm downloads_detailed.html
echo 'All done!'

File Metadata

Mime Type
text/x-shellscript
Expires
Sat, Dec 21, 1:24 PM (19 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4022947
Default Alt Text
install_webversion_for_laptop.bat (4 KB)

Event Timeline