Permalink
Browse files

COMP:Debian packaging

  • Loading branch information...
1 parent 8ade9b0 commit a55353de2c9aaf08d267b9979702f4afa9b9fa0e opencfd committed Jun 18, 2010
Showing with 151 additions and 37 deletions.
  1. +4 −1 Allwmake
  2. +60 −0 bin/foamBinDirs
  3. +1 −11 bin/foamPackBin
  4. +1 −25 bin/foamPackSource
  5. +78 −0 bin/foamSourceFiles
  6. +3 −0 debian/files
  7. +1 −0 debian/openfoam-doc.docs
  8. +1 −0 debian/openfoam-doc.install
  9. +2 −0 debian/openfoam.substvars
View
@@ -13,7 +13,10 @@ fi
( cd wmake/src && make )
# build ThirdParty sources
-( cd $WM_THIRD_PARTY_DIR && ./Allwmake )
+if [ -d "$WM_THIRD_PARTY_DIR" ]
+then
+ ( cd $WM_THIRD_PARTY_DIR && ./Allwmake )
+fi
# build OpenFOAM libraries and applications
src/Allwmake
View
@@ -0,0 +1,60 @@
+#!/bin/sh
+#---------------------------------*- sh -*-------------------------------------
+# ========= |
+# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+# \\ / O peration |
+# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
+# \\/ M anipulation |
+#------------------------------------------------------------------------------
+# License
+# This file is part of OpenFOAM.
+#
+# OpenFOAM is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
+#
+# Script
+# foamBinDirs <packDir> <arch>
+#
+# Description
+# Returns all directories containing binary files of OpenFOAM
+#
+#------------------------------------------------------------------------------
+
+if [ $# -ne 2 ]
+then
+ echo "Error: architecture type expected, exiting"
+ echo
+ echo "Usage : ${0##*/} <packDir> <arch>"
+ echo
+ exit 1
+fi
+packDir=$1
+arch=$2
+
+# base arch (w/o precision, optimization, etc)
+baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
+
+# get list of directories
+(
+ for dir in \
+ $packDir/lib/$arch \
+ $packDir/applications/bin/$arch \
+ $packDir/wmake/rules \
+ $packDir/wmake/bin/$baseArch \
+ ;
+ do
+ [ -d $dir ] && echo $dir
+ done
+)
+
+#------------------------------------------------------------------------------
View
@@ -70,17 +70,7 @@ do
done
# get list of directories
-dirList=$(
- for dir in \
- $packDir/lib/$arch \
- $packDir/applications/bin/$arch \
- $packDir/wmake/rules \
- $packDir/wmake/bin/$baseArch \
- ;
- do
- [ -d $dir ] && echo $dir
- done
-)
+dirList=`foamBinDirs $packDir $arch`
echo
echo "Packing $arch ($baseArch) port of $packDir into $packFile"
View
@@ -61,31 +61,7 @@ fi
# Clean up on termination and on Ctrl-C
trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
-find -H $packDir \
- ! -type d \
- \( -type f -o -type l \) \
- ! -name "*~" \
- -a ! -name ".*~" \
- -a ! -name "*.orig" \
- -a ! -name "*.dep" \
- -a ! -name "*.o" \
- -a ! -name "*.so" \
- -a ! -name "*.a" \
- -a ! -name "*.tgz" \
- -a ! -name "core" \
- -a ! -name "core.[1-9]*" \
- -a ! -name "libccmio*" \
-| sed \
- -e "\@$packDir/lib/@d" \
- -e '\@/\.git/@d' \
- -e '\@/\.tags/@d' \
- -e '\@applications/bin/@d' \
- -e '\@wmake/bin/@d' \
- -e '\@/t/@d' \
- -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
- -e '\@/platforms/@d' \
- -e '\@libccmio.*/@d' \
- > $tmpFile
+foamSourceFiles $packDir > $tmpFile
# provide some feedback
View
@@ -0,0 +1,78 @@
+#!/bin/sh
+#---------------------------------*- sh -*-------------------------------------
+# ========= |
+# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+# \\ / O peration |
+# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
+# \\/ M anipulation |
+#------------------------------------------------------------------------------
+# License
+# This file is part of OpenFOAM.
+#
+# OpenFOAM is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
+#
+# Script
+# foamSourceFiles <directory>
+#
+# Description
+# Returns all the .C and .H files and Make/options
+# and Make/files in a given directory.
+#
+#------------------------------------------------------------------------------
+
+if [ $# -ne 1 ]
+then
+ echo "Usage : ${0##*/} directory"
+ echo ""
+ echo "Returns all .C and .H files and Make/options and Make/files."
+ echo ""
+ exit 1
+fi
+
+# canonical form (no double and no trailing dashes)
+packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
+
+if [ ! -d $packDir ]
+then
+ echo "Error: directory $packDir does not exist"
+ exit 1
+fi
+
+find -H $packDir \
+ ! -type d \
+ \( -type f -o -type l \) \
+ ! -name "*~" \
+ -a ! -name ".*~" \
+ -a ! -name "*.orig" \
+ -a ! -name "*.dep" \
+ -a ! -name "*.o" \
+ -a ! -name "*.so" \
+ -a ! -name "*.a" \
+ -a ! -name "*.tgz" \
+ -a ! -name "core" \
+ -a ! -name "core.[1-9]*" \
+ -a ! -name "libccmio*" \
+| sed \
+ -e "\@$packDir/lib/@d" \
+ -e '\@/\.git/@d' \
+ -e '\@/\.tags/@d' \
+ -e '\@applications/bin/@d' \
+ -e '\@wmake/bin/@d' \
+ -e '\@/t/@d' \
+ -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
+ -e '\@/platforms/@d' \
+ -e '\@libccmio.*/@d' \
+ -e '\@/debian/@d'
+
+#------------------------------------------------------------------------------
View
@@ -0,0 +1,3 @@
+openfoam_1.7.0-1_i386.deb unknown optional
+openfoam_1.7.0-1_i386.deb unknown optional
+openfoam_1.7.0-1_i386.deb optional optional
View
@@ -0,0 +1 @@
+#DOCS#
@@ -0,0 +1 @@
+#DOCS#
@@ -0,0 +1,2 @@
+shlibs:Depends=libc6 (>= 2.3.6-6~), libc6 (>= 2.11), libgcc1 (>= 1:4.1.1), libopenmpi1.3, libscotch-5.1, libstdc++6 (>= 4.4.0), zlib1g (>= 1:1.1.4)
+misc:Depends=

0 comments on commit a55353d

Please sign in to comment.