Include systemd(1) configuration with release
[nsca-ng.git] / build-aux / make-confuse
blobe25cd2527109e192a51eac980282ba79d87db17b
1 #!/bin/sh
3 set -e
4 set -u
6 myself=`echo "$0" | sed 's,.*/,,'`
8 say()
10 echo "$myself: $@."
13 die()
15 echo >&2 "$myself: $@."
16 exit 1
19 if [ $# -eq 1 ]
20 then
21 version=$1
22 else
23 version=2.7
26 if [ ! -f lib/system.h ]
27 then
28 if [ -f ../lib/system.h ]
29 then
30 cd ..
31 else
32 die 'Please call me from the NSCA-ng source directory'
36 install_dir=`pwd`/lib/confuse
37 tarball="confuse-$version.tar.gz"
39 if [ ! -f "$tarball" ]
40 then
41 if type curl >/dev/null 2>&1
42 then
43 get="curl -L -o $tarball"
44 elif type wget >/dev/null 2>&1
45 then
46 get=wget
47 else
48 say 'Cannot find an HTTP client'
49 die "Please download '$tarball' into `pwd`"
52 $get "http://download.savannah.gnu.org/releases/confuse/$tarball"
53 test -f "$tarball" || die "Downloading '$tarball' failed"
56 gzip -c -d "$tarball" | tar xf -
57 cd `expr "$tarball" : '\(.*\)\.tar\.gz$'`
59 ./configure --prefix="$install_dir" --enable-static --disable-shared
60 make
61 make install
63 say 'Success'
65 # vim:set joinspaces noexpandtab textwidth=80: