]> arthur.barton.de Git - netdata.git/commitdiff
Replace README info with detection of autotools
authorPhilip Whineray <phil@firehol.org>
Sat, 9 Apr 2016 09:48:13 +0000 (10:48 +0100)
committerPhilip Whineray <phil@firehol.org>
Sat, 9 Apr 2016 09:48:13 +0000 (10:48 +0100)
This will ensure people get informed about the necessary tools and
how to get the package pre-configured without requiring the readme
to be modified when packaged.

In addition, the script will not run autoreconf unilaterally so when
people have an old version it will not attempt to overwrite the
pre-existing configure script.

Should solve #131 and also #93 as well as recent comments on README.md

Makefile.am
README.md
configure.ac
netdata-installer.sh

index 9d57ca59bd6efc940a7f3793f90c73ba978158f3..8c7e1949bb6cd4ecdcaaa010b5e78fdec91915d9 100644 (file)
@@ -19,7 +19,7 @@ MAINTAINERCLEANFILES= \
 EXTRA_DIST = \
        .gitignore \
        autogen.sh \
-       README \
+       README.md \
        LICENSE.md \
        COPYING \
        autogen.sh \
@@ -37,15 +37,6 @@ SUBDIRS = \
        web \
        $(NULL)
 
-if GIT_TREE
-
-all-local: README
-
-README: README.md
-       sed -e '/^## Git/,/^$$/{d;p}' $< > $@
-
-endif
-
 dist_noinst_DATA = netdata.spec
 
 # until integrated within build
index c20179232842101f562f6cdefeba5ed6304c17e0..c38fff242c2b4f354a664ffbb27b92d9e7d5a112 100644 (file)
--- a/README.md
+++ b/README.md
@@ -109,14 +109,3 @@ It should run on any Linux system. We have tested it on:
 ## Documentation
 
 Check the **[netdata wiki](https://github.com/firehol/netdata/wiki)**.
-
-
-## Git sources
-
-You are looking at a version of the sources extracted directly from git.
-If you want a version of the source package where `configure` and any
-documentation has been built for you, please get an official
-[netdata package download](https://firehol.org/download/netdata/).
-The `unsigned/master` folder tracks the head of the git tree and
-released packages are also available.
-
index ab1550614fc629698933586d47979bc1403d50f6..1474bffdbaeaae7192fd9fbfe32e380bfb45ee3a 100644 (file)
@@ -14,8 +14,6 @@ PACKAGE_RPM_RELEASE="0.0.$(echo VERSION_SUFFIX | sed 's/^_//')"
 
 AC_INIT([netdata], VERSION_NUMBER[]VERSION_SUFFIX)
 
-AM_CONDITIONAL([GIT_TREE], [test -f README.md])
-
 AM_MAINTAINER_MODE([disable])
 if test x"$USE_MAINTAINER_MODE" = xyes; then
 AC_MSG_NOTICE(***************** MAINTAINER MODE *****************)
index c67b72d698a849ac78b69ebc868557c2b5c97cf8..ab5a2bf9bd67315a5a7c7df8727cdfe2a2520290 100755 (executable)
@@ -127,6 +127,58 @@ if [ ! "${UID}" = 0 -o "$1" = "-h" -o "$1" = "--help" ]
        exit 1
 fi
 
+have_autotools=
+if [ "$(type autoreconf 2> /dev/null)" ]
+then
+       autoconf_maj_min() {
+               local maj min IFS=.-
+
+               maj=$1
+               min=$2
+
+               set -- $(autoreconf -V | sed -ne '1s/.* \([^ ]*\)$/\1/p')
+               eval $maj=\$1 $min=\$2
+       }
+       autoconf_maj_min AMAJ AMIN
+
+       if [ "$AMAJ" -gt 2 ]
+       then
+               have_autotools=Y
+       elif [ "$AMAJ" -eq 2 -a "$AMIN" -ge 60 ]
+       then
+               have_autotools=Y
+       else
+               echo "Found autotools $AMAJ.$AMIN"
+       fi
+else
+       echo "No autotools found"
+fi
+
+if [ ! "$have_autotools" ]
+then
+       if [ -f configure ]
+       then
+               echo "Will skip autoreconf step"
+       else
+               cat <<-"EOF"
+
+       Sorry, you do not seem to have autotools 2.60 or later, which is
+       required to build from the git sources of netdata.
+
+       You can either install a suitable version of autotools and automake
+       or download a netdata package which does not have these dependencies.
+
+       Source packages where autotools have already been run are available
+       here:
+              https://firehol.org/download/netdata/
+
+       The unsigned/master folder tracks the head of the git tree and released
+       packages are also available.
+       EOF
+               exit 1
+       fi
+fi
+
 if [ ${DONOTWAIT} -eq 0 ]
        then
        if [ ! -z "${NETDATA_PREFIX}" ]
@@ -155,6 +207,8 @@ You many need to check these:
 
    gcc make autoconf automake pkg-config
 
+   Autoconf version 2.60 or higher is required
+
 3. If your system cannot find ZLIB, although it is installed
    run me with the option:  --zlib-is-really-here
 
@@ -189,8 +243,11 @@ fi
 
 trap build_error EXIT
 
-echo >&2 "Running ./autogen.sh ..."
-run ./autogen.sh || exit 1
+if [ "$have_autotools" ]
+then
+       echo >&2 "Running ./autogen.sh ..."
+       run ./autogen.sh || exit 1
+fi
 
 echo >&2 "Running ./configure ..."
 run ./configure \