COMP: finiteVolume : explicitly add dependency to libOpenFOAM.so
[OpenFOAM-1.6.x.git] / bin / foamPackDoxygen
blob4503470846a85e21700461cf75d887eadd81ebe7
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 # \\/ M anipulation |
8 #-------------------------------------------------------------------------------
9 # License
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM; if not, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 # Script
27 # foamPackDoxygen [-prefix DIR] [-o outputDir]
29 # Description
30 # Packs and compresses the OpenFOAM doxygen html for release
32 #------------------------------------------------------------------------------
33 packDir=$WM_PROJECT-$WM_PROJECT_VERSION
34 packTag=_Doxygen.gtgz
36 usage() {
37 while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
38 cat <<USAGE 1>&2
39 Usage: ${0##*/} [-prefix DIR] [-o outputDir]
41 Packs and compresses the OpenFOAM doxygen html for release
43 USAGE
44 exit 1
47 unset prefix outputDir
49 while [ "$#" -gt 0 ]
51 case $1 in
52 -prefix | --prefix )
53 prefix=${2%%/}
54 shift 2
56 -o | -output )
57 outputDir=${2%%/}
58 shift 2
60 -h | -help )
61 usage
63 -*)
64 usage "unknown option: '$*'"
66 esac
67 done
69 # if packing from within the directory, use -prefix form
70 if [ "${PWD##*/}" = "$packDir" ]
71 then
72 : ${prefix:=$packDir}
75 # pack the directories directly and add prefix afterwards
76 if [ -n "$prefix" ]
77 then
78 packDir="$prefix"
79 elif [ ! -d $packDir ]
80 then
81 echo "Error: directory $packDir does not exist" 1>&2
82 exit 1
86 # add optional output directory
88 if [ -d "$outputDir" ]
89 then
90 packFile="$outputDir/$packDir$packTag"
91 else
92 packFile="$packDir$packTag"
96 if [ -f $packFile ]
97 then
98 echo "Error: $packFile already exists"
99 exit 1
102 # Pack and compress the packFile using GNU tar
103 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 echo
105 echo "Packing doxygen html into $packFile"
106 echo
108 if [ -n "$prefix" ]
109 then
110 tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html
111 else
112 tar czpf $packFile $packDir/doc/Doxygen/html
115 if [ $? -eq 0 ]
116 then
117 echo "Finished packing doxygen html into file $packFile"
118 else
119 echo "Error: failure packing doxygen html file $packFile"
122 #------------------------------------------------------------------------------