forked from IgnorantGuru/udevil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·67 lines (60 loc) · 1.75 KB
/
install
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# udevil installer
# Usage: ./install [CONFIGURE-OPTIONS]
build_deps='autotools-dev build-essential libc6 libglib2.0-0 intltool pkg-config libglib2.0-dev fakeroot libudev0 (>=143) libudev-dev'
if [ "$1" = "--help" ]; then
./configure --help
exit
fi
echo "Running configure: ./configure \"$@\""
./configure "$@"
if [ $? -ne 0 ]; then
echo
echo "configure was not successful, probably due to missing build"
echo "dependencies. Examine the message above to determine what is missing"
echo "on your system, install the appropriate package, and try this installer"
echo "again."
echo
echo "Build dependencies include (package names may vary on your distro):"
echo "${build_deps}"
echo
exit 1
fi
echo
echo "Running make..."
make 2>&1 | grep "error:"
if [ ! -e src/udevil ]; then
echo
echo "make was not successful, possibly due to missing build"
echo "dependencies. Examine the errors above to determine what is missing"
echo "on your system, install the appropriate packages, and try this installer"
echo "again. If no error is displayed, you may need to follow the manual"
echo "build instructions in the README to see all of make's output."
echo
echo "Build dependencies include (package names may vary on your distro):"
echo "${build_deps}"
echo
exit 1
fi
echo
echo "udevil appears to have been built successfully. To install it, you"
echo "may need to enter your root or administrator password below..."
echo
wh_sudo="$( which sudo 2>/dev/null )"
if [ -z "$wh_sudo" ]; then
echo "Running su -c \"make install\""
su -c "make install"
else
echo "Running sudo make install"
sudo make install
fi
if [ $? -ne 0 ]; then
echo
echo "Error: make install was not successful."
echo
exit 1
fi
echo
echo "Installation appears successful."
echo
exit