@cryptotaxi247 / netdata-1 / commits / bbde26d52

Replace README info with detection of autotools

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

Philip Whineray committed Apr 9, 2016 at 10:48 UTC bbde26d52a004172e9d95367cbc82ff5128e2bca
4 files changed +60 -25
Makefile.am
+1 -10
@@ -19,7 +19,7 @@ MAINTAINERCLEANFILES= \
19 EXTRA_DIST = \
20 .gitignore \
21 autogen.sh \
22 - README \
22 + README.md \
23 LICENSE.md \
24 COPYING \
25 autogen.sh \
@@ -37,15 +37,6 @@ SUBDIRS = \
37 web \
38 $(NULL)
39
40 -if GIT_TREE
41 -
42 -all-local: README
43 -
44 -README: README.md
45 - sed -e '/^## Git/,/^$$/{d;p}' $< > $@
46 -
47 -endif
48 -
40 dist_noinst_DATA = netdata.spec
41
42 # until integrated within build
README.md
-11
@@ -109,14 +109,3 @@ It should run on any Linux system. We have tested it on:
109 ## Documentation
110
111 Check the **[netdata wiki](https://github.com/firehol/netdata/wiki)**.
112 -
113 -
114 -## Git sources
115 -
116 -You are looking at a version of the sources extracted directly from git.
117 -If you want a version of the source package where `configure` and any
118 -documentation has been built for you, please get an official
119 -[netdata package download](https://firehol.org/download/netdata/).
120 -The `unsigned/master` folder tracks the head of the git tree and
121 -released packages are also available.
122 -
configure.ac
-2
@@ -14,8 +14,6 @@ PACKAGE_RPM_RELEASE="0.0.$(echo VERSION_SUFFIX | sed 's/^_//')"
14
15 AC_INIT([netdata], VERSION_NUMBER[]VERSION_SUFFIX)
16
17 -AM_CONDITIONAL([GIT_TREE], [test -f README.md])
18 -
17 AM_MAINTAINER_MODE([disable])
18 if test x"$USE_MAINTAINER_MODE" = xyes; then
19 AC_MSG_NOTICE(***************** MAINTAINER MODE *****************)
netdata-installer.sh
+59 -2
@@ -127,6 +127,58 @@ if [ ! "${UID}" = 0 -o "$1" = "-h" -o "$1" = "--help" ]
127 exit 1
128 fi
129
130 +have_autotools=
131 +if [ "$(type autoreconf 2> /dev/null)" ]
132 +then
133 + autoconf_maj_min() {
134 + local maj min IFS=.-
135 +
136 + maj=$1
137 + min=$2
138 +
139 + set -- $(autoreconf -V | sed -ne '1s/.* \([^ ]*\)$/\1/p')
140 + eval $maj=\$1 $min=\$2
141 + }
142 + autoconf_maj_min AMAJ AMIN
143 +
144 + if [ "$AMAJ" -gt 2 ]
145 + then
146 + have_autotools=Y
147 + elif [ "$AMAJ" -eq 2 -a "$AMIN" -ge 60 ]
148 + then
149 + have_autotools=Y
150 + else
151 + echo "Found autotools $AMAJ.$AMIN"
152 + fi
153 +else
154 + echo "No autotools found"
155 +fi
156 +
157 +if [ ! "$have_autotools" ]
158 +then
159 + if [ -f configure ]
160 + then
161 + echo "Will skip autoreconf step"
162 + else
163 + cat <<-"EOF"
164 +
165 + Sorry, you do not seem to have autotools 2.60 or later, which is
166 + required to build from the git sources of netdata.
167 +
168 + You can either install a suitable version of autotools and automake
169 + or download a netdata package which does not have these dependencies.
170 +
171 + Source packages where autotools have already been run are available
172 + here:
173 + https://firehol.org/download/netdata/
174 +
175 + The unsigned/master folder tracks the head of the git tree and released
176 + packages are also available.
177 + EOF
178 + exit 1
179 + fi
180 +fi
181 +
182 if [ ${DONOTWAIT} -eq 0 ]
183 then
184 if [ ! -z "${NETDATA_PREFIX}" ]
@@ -155,6 +207,8 @@ You many need to check these:
207
208 gcc make autoconf automake pkg-config
209
210 + Autoconf version 2.60 or higher is required
211 +
212 3. If your system cannot find ZLIB, although it is installed
213 run me with the option: --zlib-is-really-here
214
@@ -189,8 +243,11 @@ fi
243
244 trap build_error EXIT
245
192 -echo >&2 "Running ./autogen.sh ..."
193 -run ./autogen.sh || exit 1
246 +if [ "$have_autotools" ]
247 +then
248 + echo >&2 "Running ./autogen.sh ..."
249 + run ./autogen.sh || exit 1
250 +fi
251
252 echo >&2 "Running ./configure ..."
253 run ./configure \