forked from piface/pifacedigitalio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·52 lines (45 loc) · 1.13 KB
/
install.sh
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
#!/bin/bash
#: Description: Installs pifacedigitalio and its dependecies
# check if the script is being run as root
if [[ $EUID -ne 0 ]]
then
printf 'This script must be run as root.\nExiting..\n'
exit 1
fi
#installs python3
pacman -S --needed python
#installs make
pacman -S --needed make
#installs gcc dependency for make
pacman -S --needed gcc
# depends on pifacecommon
python3 -c "import pifacecommon" # is it installed?
if [ $? -ne 0 ]
then
# install pifacecommon
printf "Downloading pifacecommon...\n"
git clone https://github.com/piface/pifacecommon.git
cd pifacecommon
#python3 setup.py install
./install.sh
cd -
printf "\n"
fi
# depends on gpio-admin (no point re-inventing the wheel)
type gpio-admin > /dev/null 2>&1 # is it installed?
if [ $? -ne 0 ]
then
# install gpio-admin
printf "Installing gpio-admin...\n"
git clone https://github.com/quick2wire/quick2wire-gpio-admin.git
cd quick2wire-gpio-admin
make
make install
gpasswd -a pi gpio
cd -
printf "\n"
fi
# install python library
printf "Installing pifacedigitalio...\n"
python3 setup.py install
printf "Done!\n"