File: bootstrap

package info (click to toggle)
cacti-spine 1.2.30-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 804 kB
  • sloc: ansic: 7,554; sh: 204; makefile: 33
file content (108 lines) | stat: -rwxr-xr-x 4,239 bytes parent folder | download | duplicates (2)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/sh
# +-------------------------------------------------------------------------+
# | Copyright (C) 2004-2024 The Cacti Group                                 |
# |                                                                         |
# | This program 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 2          |
# | of the License, or (at your option) any later version.                  |
# |                                                                         |
# | This program 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.                            |
# +-------------------------------------------------------------------------+
# | Cacti: The Complete RRDtool-based Graphing Solution                     |
# +-------------------------------------------------------------------------+
# | This code is designed, written, and maintained by the Cacti Group. See  |
# | about.php and/or the AUTHORS file for specific developer information.   |
# +-------------------------------------------------------------------------+
# | http://www.cacti.net/                                                   |
# +-------------------------------------------------------------------------+

#
# ----------------------------------------------------------
# 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}" = "--help" -o "${1}" = "-h" ]; then
  display_help
  exit 0
fi

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 
which dos2unix > /dev/null 2>&1
if [ $? -eq 0 ]; then
  for e in $(echo "ac am c h in md mdlrc rb sh yml"); do
    echo "INFO: Ensuring UNIX format for *.$e"
    find . -type f -name \*.$e -exec dos2unix --d2u \{\} \; > /dev/null 2>&1
  done
fi

# Prepare a build state
echo "INFO: Running auto-tools to verify buildability"
aclocal --install
libtoolize
autoheader
automake --add-missing
autoreconf --force --install
[ $? -ne 0 ] && echo "ERROR: 'autoreconf' exited with errors" && exit -1


# Provide some meaningful notes
echo "INFO: Spine bootstrap process completed"
echo ""
echo "  These instructions assume the default install location for spine"
echo "  of /usr/local/spine.  If you choose to use another prefix, make"
echo "  sure you update the commands as required for that new path."
echo ""
echo "  To compile and install Spine using MySQL versions 5.5 or higher"
echo "  please do the following:"
echo ""
echo "  ./configure"
echo "  make"
echo "  make install"
echo "  chown root:root /usr/local/spine/bin/spine"
echo "  chmod +s /usr/local/spine/bin/spine"
echo ""
echo "  To compile and install Spine using MySQL versions previous to 5.5"
echo "  please do the following:"
echo ""
echo "  ./configure --with-reentrant"
echo "  make"
echo "  make install"
echo "  chown root:root /usr/local/spine/bin/spine"
echo "  chmod +s /usr/local/spine/bin/spine"
echo ""

exit 0