uronode/configure

350 lines
9.9 KiB
Plaintext
Raw Normal View History

2015-09-03 20:01:45 +01:00
#!/bin/sh
_sleep()
{
[ "$NON_INTERACTIVE" = 1 ] || sleep "$@"
}
_whiptail()
{
[ "$NON_INTERACTIVE" = 1 ] || whiptail "$@"
}
echo "Cleaning the directory for a fresh configuration..."
_sleep 2
make distclean > make.debug
2015-11-22 14:56:30 +00:00
[ "$ETC_DIR" ] || ETC_DIR=/usr/local/etc/ax25
[ "$SBIN_DIR" ] || SBIN_DIR=/usr/local/sbin
[ "$BIN_DIR" ] || BIN_DIR=/usr/local/bin
[ "$LIB_DIR" ] || LIB_DIR=/usr/local/lib
[ "$DATA_DIR" ] || DATA_DIR=/usr/local/share
[ "$MAN_DIR" ] || MAN_DIR=/usr/local/share/man
[ "$VAR_DIR" ] || VAR_DIR=/usr/local/var/ax25
2015-09-03 20:01:45 +01:00
echo "Welcome to the configuration utility for URONode. This configure script"
echo "will very simply and easily guide you into installling URONode with as"
echo "very little trouble as possible. All you need to really do is simply"
echo "answer the following questions below properly. If you make a mistake"
echo "just break out of it (ctrl+c) and rerun ./configure. Let's get started!"
_sleep 1
echo " "
_sleep 1
echo -n "you need gcc to build URONode: "
GCC=`which gcc`
_sleep 2
if [ -e "$GCC" ]
then
echo -n "saw $GCC... "
_sleep 1
echo "GCC found! Congratulations!!"
else
echo "gcc not found!"
echo " "
echo "You need this compiler to build URONode."
echo "Please install gcc, and rerun this ./configure script."
echo "If you have a copy of gcc installed, please insure you have a"
echo "symlink by typing as root: ln -s /usr/bin/gcc-#.## /usr/bin/gcc"
echo "and rerun ./configure to continue."
exit 1
fi
2016-04-01 16:06:32 +01:00
_sleep 1
echo -n "you need make to make URONode: "
MAKE=`which make`
_sleep 2
if [ -e "$MAKE" ]
then
echo -n "saw $MAKE... "
_sleep 1
echo "MAKE found! Congratulations!!"
else
echo "make not found!"
echo " "
echo "You need this utility to make URONode."
echo "Please install make, and rerun this ./configure script."
echo "If you have a copy of make installed, please insure you have"
echo "it in your path and rerun ./configure to continue."
exit 1
fi
2015-09-03 20:01:45 +01:00
echo -n "Your machine architecture is: "
_sleep 1
ARCH=`uname -m`
echo $ARCH
_sleep 1
echo -n "Checking for the existence of the Zlib headers... "
ZLIB=""
HAVEZLIB="#undef HAVE_ZLIB"
for zlibdir in /usr/include /usr/local/include
do
if [ -f $zlibdir/zlib.h ]
then
echo $zlibdir/zlib.h
ZLIB="-lz"
HAVEZLIB="#define HAVE_ZLIB 1"
fi
done
if [ -z "$ZLIB" ]
then
echo "not found."
echo " Without Zlib Node will lack compression support"
echo " See INSTALL for more information."
echo
fi
# Global protocol definition symbols for programmers that want to conditionally
# compile
HAVEAX25="#undef HAVE_AX25"
HAVEFLEX="#undef HAVE_FLEX"
FLEXNET=" "
IN="#"
HAVENETROM="#undef HAVE_NETROM"
HAVEROSE="#undef HAVE_ROSE"
HAVEMHEARD="#undef HAVE_MHEARD"
2015-11-22 14:56:30 +00:00
HAVEAUTOROUTE="#undef HAVE_AUTOROUTE"
2015-09-03 20:01:45 +01:00
HAVETCPIP="#undef HAVE_TCPIP"
HAVEMOTD="#undef HAVE_MOTD"
MOTDPATH=
# echo -n "Include support for the AX.25 protocol ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-ax25"
else
whiptail --title "URONode Options:" --yesno "Support AX25?" 7 22
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
fi
#
# echo -n "Include support for the FlexNet protocol ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-flexnet"
else
whiptail --title "URONode Options:" --yesno "Support FlexNet?" 7 22
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
HAVEFLEX="#define HAVE_FLEX 1"
FLEXNET="flexd"
IN=""
fi
#
# echo -n "Include support for the NetRom protocol ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-netrom"
else
whiptail --title "URONode Options:" --yesno "Support NetRom?" 7 22
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
HAVENETROM="#define HAVE_NETROM 1"
fi
#
# echo -n "Include support for the Rose protocol ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-rose"
else
whiptail --title "URONode Options:" --yesno "Support ROSE?" 7 22
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
2015-11-22 14:56:30 +00:00
HAVEROSE="#define HAVE_ROSE 1"
2015-09-03 20:01:45 +01:00
fi
#
# echo -n "Include support for MHeard ports listen ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-mheard"
else
whiptail --title "URONode Options:" --yesno "Support MHeard?" 7 22
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
HAVEMHEARD="#define HAVE_MHEARD 1"
fi
#
2015-11-22 14:56:30 +00:00
# echo -n "Include support for ax25 AutoRouter ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-autorouter"
else
whiptail --title "URONode Options:" --yesno "Support AutoRouter?" 7 23
fi
if [ $? -ne 1 ]
then
HAVEAX25="#define HAVE_AX25 1"
HAVEAUTOROUTE="#define HAVE_AUTOROUTE 1"
fi
#
2015-09-03 20:01:45 +01:00
# echo -n "Include support for TCP/IP functions ? [Y/n]: "; read answer
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" = 1 ]
then
echo "$@" | grep -vqe "--without-tcpip"
else
whiptail --title "URONode Options:" --yesno "Support TCP/IP?" 7 22
fi
if [ $? -ne 1 ]
then
HAVETCPIP="#define HAVE_TCPIP 1"
HAVEMOTD="#define HAVEMOTD"
MOTDPATH='"/etc/ax25/uronode.motd"'
fi
echo "Creating Makefile"
sed -e "s~@FLEXNET@~$FLEXNET~g; \
s~@IN@~$IN~g" <Makefile.in > Makefile
echo "Creating Makefile.include"
sed -e "s~@ARCH@~$ARCH~g; \
s~@ETC_DIR@~$ETC_DIR~g; \
s~@LIB_DIR@~$LIB_DIR~g; \
s~@SBIN_DIR@~$SBIN_DIR~g; \
s~@BIN_DIR@~$BIN_DIR~g; \
s~@VAR_DIR@~$VAR_DIR~g; \
2015-11-22 14:56:30 +00:00
s~@DATA_DIR@~$DATA_DIR~g; \
2015-09-03 20:01:45 +01:00
s~@MAN_DIR@~$MAN_DIR~g; \
s~@ZLIB@~$ZLIB~g" <Makefile.include.in >Makefile.include
echo "Creating config.h"
sed -e "s~@ETC_DIR@~$ETC_DIR~g; \
s~@LIB_DIR@~$LIB_DIR~g; \
s~@SBIN_DIR@~$SBIN_DIR~g; \
s~@BIN_DIR@~$BIN_DIR~g; \
s~@VAR_DIR@~$VAR_DIR~g; \
s~@MAN_DIR@~$MAN_DIR~g; \
2015-11-22 14:56:30 +00:00
s~@DATA_DIR@~$DATA_DIR~g; \
2015-09-03 20:01:45 +01:00
s~@HAVEAX25@~$HAVEAX25~g; \
s~@HAVEFLEX@~$HAVEFLEX~g; \
s~@HAVENETROM@~$HAVENETROM~g; \
s~@HAVEROSE@~$HAVEROSE~g; \
s~@HAVEMHEARD@~$HAVEMHEARD~g; \
2015-11-22 14:56:30 +00:00
s~@HAVEAUTOROUTE@~$HAVEAUTOROUTE~g; \
2015-09-03 20:01:45 +01:00
s~@HAVETCPIP@~$HAVETCPIP~g; \
s~@HAVEMOTD@~$HAVEMOTD~g; \
s~@MOTDPATH@~$MOTDPATH~g; \
s~@HAVEZLIB@~$HAVEZLIB~g" <config.h.in >config.h
echo "Creating dependancy files..."
make depend > /dev/null 2>&1
echo "Configuration successful!!"
_sleep 1
echo "about the authors..."
_sleep 3
echo "URONode is a combined effort of years worth of work. Those who's code"
echo "is included in this flavor of a linux based node are:"
_sleep 1
echo "Brian Rogers N1URO (current maintainer), "
_sleep 1
echo "Marius Petrescu YO2LOJ (current team member),"
_sleep 1
echo "Bob Tenty VE3TOK (current team member),"
_sleep 1
echo "Stefano Noferi IZ5AWZ (AWZNode)"
_sleep 1
echo -n "Tomi Manninen OH2BNS, "
_sleep 1
echo -n "Alan Cox GW4PTS, "
_sleep 1
echo "and Roy Van Zundert PE1RJA"
echo ""
_sleep 1
echo "Special thanks to: Morgan, sm6tky for his security report"
echo "and Barry K2MF for his input on some of my routines and supplying"
echo "some source code."
_sleep 1
echo ""
#echo -n "Shall I run the make command for you ? [Y/n]: "
_whiptail --title "Shall I make URONode?" --yesno "Yes to make or No to exit" 7 30
# if [ "$answer" = "Y" -o "$answer" = "y" -o "$answer" = "" ]
if [ "$NON_INTERACTIVE" != 1 -a $? -ne 1 ]
then
# echo "Making URONode! Please be patient."
# _sleep 1
# echo "compile errors will be in make.debug."
# echo ""
# _sleep 1
# echo "You may not see anything until the process is complete..."
_whiptail --title "Making URONODE..." --msgbox "Making. Check make.debug for errors. Hit OK to continue. You may not see anything for a minute..." 10 45
make >> make.debug
echo "let's check for binary errors..."
_sleep 1
echo -n "nodeusers: "
_sleep 1
if [ -x ./nodeusers ]; then
echo "SUCCESS!"
else
echo "FAILED!"
fi
_sleep 1
echo -n "uronode: "
_sleep 1
if [ -x ./uronode ]; then
echo "SUCCESS!"
else
echo "FAILED!"
fi
_sleep 1
echo -n "axdigi: "
_sleep 1
if [ -x ./axdigi ]; then
echo "SUCCESS!"
fi
2016-04-01 16:06:32 +01:00
_sleep 1
echo -n "calibrate: "
_sleep 1
if [ -x ./calibrate ]; then
echo "SUCCESS!"
fi
2015-09-03 20:01:45 +01:00
_sleep 1
echo -n "flexd: "
_sleep 1
if [ -x ./flexd ]; then
echo "SUCCESS!"
_sleep 1
else
echo "FAILED! - perhaps you didn't want flexnet?"
echo "This is not an error if you chose NO to flexnet."
echo "This only means the flexnet daemon binary was not found."
echo ""
echo "Process complete!"
echo ""
fi
_sleep 1
_whiptail --title "URONode" --msgbox "Check the file make.debug if you had errors. If no errors, type: make install (new install) or make upgrade (existing install) and edit your files in /usr/local/etc/ax25/\n\n**WARNING: if you haven't already, add the following to your startup scripts:\n/usr/local/sbin/axdigi & \nto insure cross-port digipeating.\n\nFor help and release news join the forum at\nhttps://www.n1uro.net/forum\n\nEnjoy URONode - 73 de Brian N1URO" 20 50
# echo "Check the file make.debug if you had errors."
# echo "If no errors, type: make install or make upgrade"
# echo "and edit your files in /etc/ax25/"
# echo "**WARNING: if you haven't already, add the following to your"
# echo "startup scripts:"
# echo "/usr/sbin/axdigi &"
# echo "to insure cross-port digipeating."
# echo ""
# echo "For support and release news join the forum"
# echo "at https://www.n1uro.net/forum"
# echo ""
# echo "Enjoy URONode! 73 de N1URO."
fi
exit 0