-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcreate_distribution.sh
88 lines (72 loc) · 1.97 KB
/
create_distribution.sh
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
#!/bin/bash
# $Id: create_distribution.sh 1029 2008-07-09 15:41:38Z lsc $
#
# Copyright (c) 2008 STFC Rutherford Appleton Laboratory
# Author: Lee-Shawn Chin
# Date : June 2008
# Check that ./autogen.sh is executable
if test ! -x ./autogen.sh;
then
echo "ERROR: ./autogen.sh is either unavailable or not executable" >&2
exit 1
fi
function clean_dir {
DIR_TO_CLEAN="$1"
echo -e "\n\nCleaning up $DIR_TO_CLEAN directory before packaging: "
echo "---------------------------------------------------------------- "
(
cd $DIR_TO_CLEAN
if test -f Makefile;
then
make clean || (
echo "ERROR: Automatic cleaning failed. " >&2
echo "Please clean up $DIR_TO_CLEAN manually and try again" >&2
exit 1
)
make distclean || (
echo "ERROR: Automatic cleaning failed. " >&2
echo "Please clean up $DIR_TO_CLEAN manually and try again" >&2
exit 1
)
fi
rm INSTALL 2> /dev/null
rm aclocal.m4 2> /dev/null
rm acinclude.m4 2> /dev/null
rm configure 2> /dev/null
rm configure.scan 2> /dev/null
rm config.* 2> /dev/null
rm *.log 2> /dev/null
rm *.xml 2> /dev/null
rm -rf autom4te.cache 2> /dev/null
)
echo -e "-OK-\n"
}
# clean up ./example/circles_mb directory
clean_dir ./example/circles_mb
# Run autotools
echo "Running ./autogen.sh: "
echo "--------------------- "
./autogen.sh
if test $? != 0; then exit 1; fi
# Run ./configure
echo -e "\n\nRunning ./configure: "
./configure
if test $? != 0; then exit 1; fi
# make dist
echo -e "\n\nCreating distribution files: "
echo "---------------------------- "
make dist
if test $? != 0; then exit 1; fi
# make distcheck
echo -e "\n\nChecking distribution files: "
echo "---------------------------- "
make distcheck
if test $? != 0; then exit 1; fi
# make distclean
echo -e "\n\nDeleting artifacts: "
echo "------------------- "
make distclean
if test $? != 0; then exit 1; fi
echo " ----------------------------------------------------- "
echo ""
echo "Your distribution file is now ready."