forked from coanda/dactl
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·83 lines (78 loc) · 1.87 KB
/
bootstrap
File metadata and controls
executable file
·83 lines (78 loc) · 1.87 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#
# This is less 'bootstrap-ing' and more just lame setup and work-arounds.
#
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')
#
# Test for distribution
#
if [ -f /etc/lsb-release ]; then
. /etc/lsb-release
OS=$DISTRIB_ID
VER=$DISTRIB_RELEASE
elif [ -f /etc/redhat-release ]; then
# RedHat based
OS=$(cat /etc/redhat-release | awk '{ print $1 }')
VER=$(cat /etc/redhat-release | awk '{ print $3 }')
elif [ -f /etc/debian_version ]; then
# Debian based
OS=Debian
VER=$(cat /etc/debian_version)
else
OS=$(uname -s)
VER=$(uname -r)
fi
#
# Do setup according to distribution
#
case $OS in
Arch)
echo "Nothing for Arch yet"
exit 0
;;
Gentoo)
echo "Nothing for Gentoo yet"
exit 0
;;
RedHat)
echo "Nothing for RedHat yet"
exit 0
;;
Fedora)
# XXX Not sure what's distro specific, just do everything here for now
mkdir -p /usr/local/lib/pkgconfig
mkdir -p /usr/local/share/vala/vapi
if [ ! -f /usr/local/lib/pkgconfig/comedi.pc ]; then
cp contrib/comedi.pc /usr/local/lib/pkgconfig/
fi
if [ ! -f /usr/local/share/vala/vapi/comedi.vapi ]; then
cp vapi/comedi.vapi /usr/local/share/vala/vapi
fi
case $VER in
23) ;&
24)
dnf install \
libpeas-devel \
zeromq-devel \
pygobject3-devel \
readline-devel
;;
esac
;;
Debian)
echo "Nothing for Debian yet"
exit 0
;;
Ubuntu)
echo "Nothing for Ubuntu yet"
exit 0
;;
*)
echo "No valid distribution found, exiting"
exit 1
;;
esac