1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
|
#!/bin/bash
# Usage:
#
# createElastixWebsite <action>
#
# with
# <action> one of:
# exportwin
# exportlinux64
# exportlinux32 (only on rashindra's computer)
# doxygen
# ziplinux64
# ziplinux32 (only on rashindra's computer)
# zipwin
# collect
#
# Typical use:
# 1. Prepare a release tag
# 2. Set the version and tag variables in this script
# 3. call this script with argument exportwin
# 4. call this script with argument exportlinux64
# 5. Run cmake on windows and linux.
# 6. run make install on linux, make package, and make package_source
# 7. compile and install on windows using vc2008.
# 8. create the manual on windows, using latex.
# 9. call this script with argument doxygen
# 10. call this script with argument zipwin
# 11. call this script with argument ziplinux64
# 12. call this script with argument collect
# 13. log in on rashindra's computer, using ssh
# 14. call this script with argument exportlinux32
# 15. run cmake, and make install
# 16. call this script with argument ziplinux32
# 17. copy the resulting zip manually using winscp to $tempdir/downloads
# 18. copy $tempdir to the website, using winscp.
#
# This script is rather nongeneric. It only works on stefan's computer :)
#
#
arg="$1"
# You have to set the following
version="4.7"
fullversion="4.7.0"
tag="elastix_04_7"
username="sklein"
# Some base directories
exportbasedirwin="d:/tk/elastix/exports/tagspublic"
exportbasedirlinux64="m:/tk2/elastix/exports/tagspublic"
# when using rashindra's machine:
exportbasedirlinux32="/home/stefan/tk/elastix/exports/tagspublic"
# when using the biggrid
exportbasedirlinux32grid="m:/tk2/elastix/exports/tagspublic"
exportdirwin="$exportbasedirwin/$tag"
exportdirlinux64="$exportbasedirlinux64/$tag"
# when using the biggrid
exportdirlinux32grid="$exportbasedirlinux32grid/$tag""linux32"
svnurl="https://svn.bigr.nl/elastix"
tempdir="d:/dox/elastixwebsite/$tag"
websitebase="http://elastix.isi.uu.nl"
copyright="$exportdirwin/src/CopyrightElastix.txt"
# checkout linux64 export:
if [ "$arg" = "exportlinux64" ]
then
svn export --native-eol LF $svnurl/tagspublic/$tag $exportdirlinux64
mkdir -p $exportdirlinux64/install
mkdir -p $exportdirlinux64/release
mkdir -p $exportdirlinux64/help
exit
fi
# checkout linux32 export; Run this one directly on a linux32 system!
if [ "$arg" = "exportlinux32" ]
then
svn export --native-eol LF $svnurl/tagspublic/$tag $exportdirlinux32
mkdir -p $exportdirlinux32/install
mkdir -p $exportdirlinux32/release
mkdir -p $exportdirlinux32/help
exit
fi
# checkout windows export:
if [ "$arg" = "exportwin" ]
then
svn export --native-eol CRLF $svnurl/tagspublic/$tag $exportdirwin
mkdir -p $exportdirwin/install
mkdir -p $exportdirwin/bin
mkdir -p $exportdirwin/help
exit
fi
if [ "$arg" = "doxygen" ]
then
# Create html help
currentdir=`pwd`
cd $exportdirwin/help
doxygen doxyfile.out &> doxygen.log
cd $currentdir
exit
fi
# zip linux64
if [ "$arg" = "ziplinux64" ]
then
currentdir=`pwd`
cd $exportdirlinux64
# tar does not recognise m:/... filenames; convert to cygwin style.
cwdir=`pwd`
# rename the tar.bz2 to the website convention
mv release/elastix-$fullversion-Linux.tar.bz2 release/elastix_linux64_v$version.tar.bz2
mv release/elastix-$fullversion-Source.tar.bz2 release/elastix_sources_v$version.tar.bz2
# zip the example. todo: use cpack for this as well.
cd help
tar -cjvf $cwdir/release/elastix_example_v$version.tar.bz2 exampleinput example
cd $currentdir
exit
fi
# zip linux32grid
if [ "$arg" = "ziplinux32grid" ]
then
currentdir=`pwd`
cd $exportdirlinux32grid
# tar does not recognise m:/... filenames; convert to cygwin style.
cwdir=`pwd`
# rename the tar.bz2 to the website convention
mv release/elastix-$fullversion-Linux.tar.bz2 release/elastix_linux64_v$version.tar.bz2
# do nothing
cd $currentdir
exit
fi
# zip win
if [ "$arg" = "zipwin" ]
then
currentdir=`pwd`
cd $exportdirwin
cd bin
# call cpack
cpack -C Release --config CPackConfig.cmake
cpack -C Release --config CPackSourceConfig.cmake
# rename zips to website convention
mv elastix-$fullversion-win32.zip elastix_windows32_v$version.zip
mv elastix-$fullversion-win32.exe elastix_windows32_v$version.exe
mv elastix-$fullversion-Source.zip elastix_sources_v$version.zip
# create help zip
cd ../help
helpzip="elastix_example_v$version.zip"
rm $exportdirwin/bin/$helpzip
wzzip -ex -a -r -P $exportdirwin/bin/$helpzip exampleinput example.bat
cd $currentdir
exit
fi
# collect all stuff that needs to be copied to the website
if [ "$arg" = "collect" ]
then
rm -r $tempdir
mkdir -p $tempdir
mkdir -p $tempdir/download
cp $exportdirwin/bin/*.zip $tempdir/download
cp $exportdirwin/bin/*.exe $tempdir/download
cp $exportdirlinux64/release/*.tar.bz2 $tempdir/download
# cp $exportdirlinux32grid/release/*.tar.bz2 $tempdir/download
cp $exportdirwin/dox/manual/manual.pdf $tempdir/download/elastix_manual_v$version.pdf
cp -r $exportdirwin/help/html $tempdir/doxygen
# Create a version.txt file with the version number in it.
echo "v"$version > $tempdir/download/version.txt
# write the date/time
date '+%d-%m-%Y' > $tempdir/download/latestreleasedate.txt
# copy the copyright message
cp $exportdirwin/src/CopyrightElastix.txt $tempdir
# copy the linux32 binaries manually using winscp
exit
fi
# copy using winscp
exit 0
|