forked from ConSol-Monitoring/omd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·46 lines (41 loc) · 1.17 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# This is no real configure script. But it makes
# sure that all build dependencies are installed,
# if you are running on a well known distribution.
DISTRO=$(./distro _) || { \
echo "Your linux distribution is unknown. Good luck!"
exit 1
}
echo "You are running on $DISTRO."
M=distros/Makefile.$DISTRO
if [ ! -e "$M" ]
then
echo "This distribution is not supported. You might succeed anyway."
echo "Good luck!"
exit 1
fi
if ! make --version >/dev/null 2>&1; then
echo 'Please install "make" before executing this script.'
exit 1
fi
BUILD_PACS=$( make -f echo.mk FILE=$M VAR=BUILD_PACKAGES )
PACKAGER=$( make -f echo.mk FILE=$M VAR=PACKAGE_INSTALL )
BECOME_ROOT=$( make -f echo.mk FILE=$M VAR=BECOME_ROOT )
echo "Packages needed for compilation:"
for PAC in $BUILD_PACS; do
echo -n " $PAC"
done
echo
CMD="$PACKAGER $BUILD_PACS"
if [ $UID != 0 ]
then
CMD="$BECOME_ROOT '$CMD'"
fi
echo "Going to run >>>$CMD<<<..."
if eval "$CMD" ; then
echo "OK - You are now ready for 'make && make pack'"
else
echo "ERROR. Some packages could not be installed. You will get "
echo "Problems while compiling if something is missing."
exit 1
fi