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
|
#!/bin/sh
# This script prepares and creates a .tar.gz package of
# the source tree. This should really be done with 'make dist'
# but until we get that working, this script does the job.
# Get the version number
VERSION=`cat ./configure.in | grep 'VERSION=' | cut -d'=' -f2`
echo 'Version number is '$VERSION
# Create the directory
DISTDIR=dolfin-$VERSION
echo 'Creating directory '$DISTDIR
rm -rf $DISTDIR
mkdir $DISTDIR
# Make clean
echo 'Making clean'
make clean > /dev/null
# Copy files
FILES=`ls | grep -v $DISTDIR`
echo 'Copying files'
cp -R $FILES $DISTDIR
# Remove unecessary files
REMOVE1=`find $DISTDIR | grep CVS`
REMOVE2=`find $DISTDIR -name '*~'`
REMOVE3=`find $DISTDIR -name '*.a'`
REMOVE4=$DISTDIR'/config.cache '$DISTDIR'/config.status '$DISTDIR'/config.log'
REMOVE5=`find $DISTDIR | grep '\.deps'`
REMOVE=$REMOVE1' '$REMOVE2' '$REMOVE3' '$REMOVE4' '$REMOVE5
echo 'Removing unecessary files'
rm -rf $REMOVE
# Create the archive
TARBALL='dolfin-'$VERSION'.tar.gz'
echo 'Creating arhive: '$TARBALL
tar zcf $TARBALL $DISTDIR
# Remove the directory
echo 'Removing temporary directory'
rm -rf $DISTDIR
# Unpack the tarball
echo 'Unpacking tarball to check if it compiles'
tar zxf $TARBALL
# Compile
echo 'Compiling in directory '$DISTDIR' (see make-'$VERSION'.log)'
MAKELOG='../make-'$VERSION'.log'
cd $DISTDIR
rm -f $MAKELOG
./configure >> $MAKELOG
make >& $MAKELOG
|