File: bootstrap

package info (click to toggle)
cacti-spine 0.8.7e-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,900 kB
  • ctags: 534
  • sloc: ansic: 4,564; sh: 882; makefile: 70
file content (80 lines) | stat: -rwxr-xr-x 2,375 bytes parent folder | download
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
#!/bin/sh
#
# ----------------------------------------------------------
# Name: bootstrap
#
# Function: build spine from scratch
#
# Description: This script will take a vanilla Spine source
#              package and attempt to compile it.  It will 
#              attempt to handle nasty things like dos2unix
#              issues in all files and searching for the
#              presence of required modules.
#
#              It is not a replacement for the auto tools,
#              but simply a supplement.
#
# ----------------------------------------------------------

# Help function
display_help () {
  echo "--------------------------------------------------------------"
  echo "Spine bootstrap script"
  echo "  Attempts to configure spine based on a 'normal' system. If you"
  echo "  install things in non-common locations you may have to use"
  echo "  the install instructions to build."
  echo "--------------------------------------------------------------"
  echo 
}

# Check for parameters
if [ "${1}x" == "--helpx" -o "${1}x" == "-hx" ]; then
  display_help
  exit 0
fi

# Check for dos2unix
which dos2unix > /dev/null 2>&1
[ $? -gt 0 ] && echo "FATAL: Unable to locate dos2unix utility" && exit -1

echo "INFO: Starting Spine build process"

# Remove software build specific directories
echo "INFO: Removing cache directories"
rm -rf autom4te.cache .deps

# Make sure all files are unix formatted files 
find . -type f -exec dos2unix \{\} \; > /dev/null 2>&1

# Make sure things are executable if they exist
echo "INFO: Setting permissions"
[ -f ./configure ] && chmod +x configure > /dev/null 2>&1

# Prepare a build state
echo "INFO: Running auto-tools to verify buildability"
aclocal
[ $? -ne 0 ] && echo "ERROR: 'aclocal' exited with errors" && exit -1

libtoolize --force
[ $? -ne 0 ] && echo "ERROR: 'libtool' exited with errors" && exit -1

autoheader
[ $? -ne 0 ] && echo "ERROR: 'autoheader' exited with errors" && exit -1

automake --foreign --add-missing --copy
[ $? -ne 0 ] && echo "ERROR: 'automake' exited with errors" && exit -1

autoconf
[ $? -ne 0 ] && echo "ERROR: 'autoconf' exited with errors" && exit -1

# Provide some meaningful notes
echo "INFO: Spine bootstrap process completed"
echo ""
echo "  To compile and install Spine do the following:"
echo ""
echo "  ./configure"
echo "  make"
echo "  make install"
echo ""

exit 0