~ubuntu-branches/debian/stretch/3depict/stretch

« back to all changes in this revision

Viewing changes to packaging/checkBuild.sh

  • Committer: Package Import Robot
  • Author(s): D Haley
  • Date: 2011-12-18 19:33:32 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20111218193332-1motgr3vg9xeh41b
Tags: 0.0.9-1
* Update to upstream 0.0.9 
* Close powerpc bug fixed by 0.0.8-1 (Closes: #655682) 
* Close mgl font parsing bug fixed by mathgl upstream (Closes: #623431)
* Fix unclean source package (Closes: #643039)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
 
 
3
 
 
4
#Location of HG repository to open
 
5
REPOSITORY_PATH=
 
6
CHECKOUT_PATH=
 
7
BINARY=./src/3Depict
 
8
PROJECTNAME=3Depict
 
9
 
 
10
#Abort note file
 
11
ABORT_MSG_FILE=NOTE_ABORT
 
12
 
 
13
#Number of simultaneous processes when building
 
14
NUM_PROC=2 
 
15
 
 
16
notifyAbort()
 
17
{
 
18
        echo `cat $ABORT_MSG_FILE`
 
19
        #TODO: Do we have a reliable SMTP system that we know how to use??
 
20
        
 
21
                
 
22
        rm $ABORT_MSG_FILE
 
23
 
 
24
        echo "$CHECKOUT_PATH may need to be removed before re-running this script"
 
25
        exit 1
 
26
}
 
27
 
 
28
#-- Check variables are set --
 
29
# TODO: This is not neat, but I don't have internet and don't think
 
30
# we can loop over empty items.
 
31
NOTCONFIGURED=0
 
32
if [ x$REPOSITORY_PATH == x""  ] ; then
 
33
        NOTCONFIGURED=1
 
34
fi
 
35
if [ x$CHECKOUT_PATH == x""  ] ; then
 
36
        NOTCONFIGURED=1
 
37
fi
 
38
if [ x$BINARY == x"" ] ; then
 
39
        NOTCONFIGURED=1
 
40
fi
 
41
if [ x$PROJECTNAME == x""  ] ; then
 
42
        NOTCONFIGURED=1
 
43
fi
 
44
if [ $NOTCONFIGURED -ne 0 ] ; then
 
45
        echo "PATHS NOT CONFIGURED -- CONFIGUREPATHS FIRST, THEN DELETE THIS ERROR MESSAGE"
 
46
        exit 1
 
47
fi
 
48
#------
 
49
 
 
50
if [ x`which hg` == x"" ] ; then
 
51
        echo "hg binary not available in $PATH. Aborting" > $ABORT_MSG_FILE
 
52
        notifyAbort
 
53
fi
 
54
 
 
55
if [ -d $CHECKOUT_PATH ] ; then
 
56
        echo "target destination for checkout ($CHECKOUT_PATH) not empty!" > $ABORT_MSG_FILE
 
57
        notifyAbort
 
58
fi
 
59
 
 
60
mkdir -p $CHECKOUT_PATH
 
61
 
 
62
pushd $CHECKOUT_PATH
 
63
 
 
64
hg clone $REPOSITORY_PATH
 
65
 
 
66
if [ $? -ne 0 ] ; then
 
67
        echo "repository checkout failed!" > $ABORT_MSG_FILE
 
68
        notifyAbort
 
69
fi
 
70
 
 
71
if [ ! -d $PROJECTNAME ] ; then
 
72
        echo "Odd, 3depict checked out, but no code dir found" > $ABORT_MSG_FILE
 
73
        notifyAbort
 
74
fi
 
75
 
 
76
cd $PROJECTNAME
 
77
 
 
78
#Initiate the configuration
 
79
./configure --enable-debug-checks --enable-openmp-parallel
 
80
 
 
81
if [ $? -ne 0 ] ; then
 
82
        echo "Configure failed!" > $ABORT_MSG_FILE
 
83
        notifyAbort
 
84
fi
 
85
 
 
86
make -j $NUM_PROC
 
87
 
 
88
if [ $? -ne 0 ] ; then 
 
89
        echo "Build failed" > $ABORT_MSG_FILE
 
90
        notifyAbort
 
91
fi
 
92
 
 
93
if [ ! -f $BINARY ] ; then  
 
94
        echo "Weird, binary is missing!" > $ABORT_MSG_FILE
 
95
        notifyAbort
 
96
fi
 
97
 
 
98
#Run the unit tests
 
99
$BINARY -t
 
100
 
 
101
if [ $? -ne 0 ] ; then
 
102
        echo "Unit test failure! Fix it Fix it Fix it! Fix it! " > $ABORT_MSG_FILE
 
103
        exit 1
 
104
fi
 
105
popd
 
106
 
 
107
rm -rf $CHECKOUT_PATH
 
108