#!/bin/sh # +-------------------------------------------------------------------------+ # | Copyright (C) 2004-2026 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/ | # +-------------------------------------------------------------------------+ # # ---------------------------------------------------------- set -eu # 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" ] || [ "${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 if command -v dos2unix > /dev/null 2>&1; then for e in 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" mkdir -p config m4 if command -v libtoolize > /dev/null 2>&1; then LIBTOOLIZE=libtoolize elif command -v glibtoolize > /dev/null 2>&1; then LIBTOOLIZE=glibtoolize else echo "ERROR: GNU libtoolize (or glibtoolize on macOS) is required" >&2 exit 1 fi export LIBTOOLIZE autoreconf --force --install # 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 or MariaDB" 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 "" exit 0