-
Notifications
You must be signed in to change notification settings - Fork 55
/
mkdsm_validate.sh
161 lines (131 loc) · 2.73 KB
/
mkdsm_validate.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/bash
#
# Validate that we have all the stuff we need...
#
# Say hi...
echo ""
echo "Validating the environment..."
if [ "$DSMBUILDER" != "good" ] ;then
echo " please run ./mkdsm.sh"
exit 1
fi
#
# Stuff that everybody needs...
#
# cmake
echo " ...checking for cmake (linux only)"
if [ "$OSNAME" != "macosx" ] ;then
if ! which cmake &> /dev/null; then
echo " Please install 'cmake'..."
exit 1
fi
fi
# dos2unix/fromdos
echo " ...checking for dos2unix/dos2unix"
export DOS2UNIX=dos2unix
if ! which dos2unix &> /dev/null; then
export DOS2UNIX=fromdos
if ! which fromdos &> /dev/null; then
export DOS2UNIX="perl -pi -e 's/\r\n|\n|\r/\n/g'"
if ! which perl &> /dev/null; then
echo " Please install 'dos2unix' or 'tofrodos'..."
exit 1
fi
fi
fi
echo " ...using ${DOS2UNIX}"
# g++
echo " ...checking for g++"
if ! which g++ &> /dev/null; then
echo " Please install 'g++'..."
exit 1
fi
# make
echo " ...checking for make"
if ! which make &> /dev/null; then
echo " Please install 'build-essentials'..."
exit 1
fi
#
# Stuff that Ubuntu and Kylin needs...
#
if [ "$OSNAME" == "ubuntu" ] || [ "$OSNAME" == "kylin" ]; then
# debhelper
echo " ...checking for debhelper"
if [ ! -e /usr/share/debhelper ]; then
echo " Please install 'debhelper'..."
exit 1
fi
# debuild
echo " ...checking for debuild"
if ! which debuild &> /dev/null; then
echo " Please install 'devscripts'..."
exit 1
fi
# gpg
echo " ...checking for gpg"
if ! which gpg &> /dev/null; then
echo " Please install 'gpg'..."
exit 1
fi
#
# Stuff that Debian needs...
#
elif [ "$OSNAME" == "debian" ]; then
# debhelper
echo " ...checking for debhelper"
if [ ! -e /usr/share/debhelper ]; then
echo " Please install 'debhelper'..."
exit 1
fi
# debuild
echo " ...checking for debuild"
if ! which debuild &> /dev/null; then
echo " Please install 'devscripts'..."
exit 1
fi
# gpg
echo " ...checking for gpg"
if ! which gpg &> /dev/null; then
echo " Please install 'gpg'..."
exit 1
fi
#
# Stuff that NeoKylin needs...
#
elif [ "$OSNAME" == "neokylin" ]; then
# rpmbuild
echo " ...checking for rpmbuild"
if ! which rpmbuild &> /dev/null; then
echo " Please install 'rpmbuild'..."
exit 1
fi
#
# Stuff that SuSE needs...
#
elif [ "$OSNAME" == "suse" ]; then
# rpmbuild
echo " ...checking for rpmbuild"
if ! which rpmbuild &> /dev/null; then
echo " Please install 'rpmbuild'..."
exit 1
fi
#
# Stuff that Mac OS X needs...
#
elif [ "$OSNAME" == "macosx" ]; then
# xcodebuild
echo " ...checking for xcodebuild"
if ! which xcodebuild &> /dev/null; then
echo " Please install 'xcode'..."
exit 1
fi
#
# Ruh-roh...
#
else
echo " unsupported os..." $OSNAME
exit 1
fi
# Bye-bye...
exit 0