-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurePulse.patch
More file actions
199 lines (190 loc) · 7.72 KB
/
Copy pathConfigurePulse.patch
File metadata and controls
199 lines (190 loc) · 7.72 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
--- rpm/ConfigurePulse.sh 2016-08-17 03:41:33.000000000 -0700
+++ rpm/ConfigurePulse.sh.new 2016-12-17 23:05:35.393015061 -0800
@@ -1,8 +1,5 @@
#!/bin/bash
INSTALLDIR=/usr/local/pulse
-LOG=$INSTALLDIR/postinstall.log
-# Redirect the stdout/stderr into postinstall log
-echo "Starting Post Install Script " > $LOG
# no-same-owner is required to get root permission
WEBKITGTK_1_SUPPORTED_VERSION=6
WEBKITGTK_3_SUPPORTED_VERSION=7
@@ -10,10 +7,19 @@
PACKAGE_TYPE_RPM=1
PACKAGE_TYPE_DEB=2
SCRNAME=`basename $0`
-readMeEchoMsg="Please refer /usr/local/pulse/README for instructions to launch the Pulse Client"
-SUPPORTED_OSTYPES_LIST=( CENTOS_6 CENTOS_7 UBUNTU_14 UBUNTU_15 UBUNTU_16 FEDORA RHEL_7 UNSUPPORTED)
+SUPPORTED_OSTYPES_LIST=( ARCH CENTOS_6 CENTOS_7 UBUNTU_14 UBUNTU_15 UBUNTU_16 FEDORA RHEL_7 UNSUPPORTED)
+#Arch
+ARCH_DEPENDENCIES=( glibc \
+ nss \
+ zlib \
+ glib-networking \
+ webkitgtk \
+ xulrunner \
+ libproxy \
+ libxmu \
+ )
#RPM Based
CENTOS_6_DEPENDENCIES=( glibc \
nss-softokn-freebl \
@@ -151,7 +157,12 @@
#determine the OS TYPE
determine_os_type() {
- if [ -f /etc/centos-release ]; then
+ if [ -f /etc/arch-release ]; then
+ OS_TYPE=${SUPPORTED_OSTYPES_LIST[$ARCH]}
+ OS_MAJOR_VERSION=$WEBKITGTK_1_SUPPORTED_VERSION
+ INSTALLDIR=/opt/pulse
+ elif [ -f /etc/centos-release ]; then
+ INSTALLDIR=/usr/local/pulse
OS_MAJOR_VERSION=$(cat /etc/centos-release | grep -o '.[0-9]'| head -1|sed -e 's/ //')
if [ $OS_MAJOR_VERSION = $WEBKITGTK_1_SUPPORTED_VERSION ]; then
OS_TYPE=${SUPPORTED_OSTYPES_LIST[$CENTOS_6]}
@@ -161,9 +172,11 @@
OS_TYPE=${SUPPORTED_OSTYPES_LIST[$UNSUPPORTED]}
fi
elif [ -f /etc/fedora-release ]; then
+ INSTALLDIR=/usr/local/pulse
OS_MAJOR_VERSION=6 #Fedora uses webkitgtk-1.0
OS_TYPE=${SUPPORTED_OSTYPES_LIST[$FEDORA]}
elif [ -f /etc/redhat-release ]; then
+ INSTALLDIR=/usr/local/pulse
OS_MAJOR_VERSION=$(cat /etc/redhat-release | grep -o '.[0-9]'| head -1|sed -e 's/ //')
if [ $OS_MAJOR_VERSION = $WEBKITGTK_3_SUPPORTED_VERSION ]; then
OS_TYPE=${SUPPORTED_OSTYPES_LIST[$RHEL_7]}
@@ -171,6 +184,7 @@
OS_TYPE=${SUPPORTED_OSTYPES_LIST[$UNSUPPORTED]}
fi
else
+ INSTALLDIR=/usr/local/pulse
OS_MAJOR_VERSION=6 #Every other flavour uses webkitgtk-1.0
OSNAME=$(lsb_release -d |grep -o "Ubuntu")
if [ "X$OSNAME" != "X" ]; then
@@ -186,23 +200,32 @@
fi
fi
fi
+ LOG=$INSTALLDIR/postinstall.log
+ # Redirect the stdout/stderr into postinstall log
+ echo "Starting Post Install Script " > $LOG
+ readMeEchoMsg="Please refer to $INSTALLDIR/README for instructions to launch the Pulse Client"
}
install_binaries() {
- if [ $OS_MAJOR_VERSION = $WEBKITGTK_3_SUPPORTED_VERSION ] ; then
- mv $INSTALLDIR/pulseUi_centos_7 $INSTALLDIR/pulseUi
- mv $INSTALLDIR/libpulseui.so_centos_7 $INSTALLDIR/libpulseui.so
- else
- mv $INSTALLDIR/pulseUi_centos_6 $INSTALLDIR/pulseUi
- mv $INSTALLDIR/libpulseui.so_centos_6 $INSTALLDIR/libpulseui.so
+ if [ ! $OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$ARCH]} ]; then
+ if [ $OS_MAJOR_VERSION = $WEBKITGTK_3_SUPPORTED_VERSION ] ; then
+ mv $INSTALLDIR/pulseUi_centos_7 $INSTALLDIR/pulseUi
+ mv $INSTALLDIR/libpulseui.so_centos_7 $INSTALLDIR/libpulseui.so
+ else
+ mv $INSTALLDIR/pulseUi_centos_6 $INSTALLDIR/pulseUi
+ mv $INSTALLDIR/libpulseui.so_centos_6 $INSTALLDIR/libpulseui.so
+ fi
fi
}
handle_common_installation() {
- tar --no-same-owner -xzf /usr/local/pulse/pulse.tgz -C /usr/local/pulse >/dev/null
- chmod +rws /usr/local/pulse/pulsesvc
- mv /usr/local/pulse/pulseUi.desktop /usr/share/applications
+ echo "Unpacking binaries to $INSTALLDIR"
+ tar --no-same-owner -xzf $INSTALLDIR/pulse.tgz -C $INSTALLDIR >/dev/null
+ chmod +rws $INSTALLDIR/pulsesvc
+ if [ ! $OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$ARCH]} ]; then
+ mv $INSTALLDIR/pulseUi.desktop /usr/share/applications
+ fi
}
handle_uninstallation() {
@@ -214,8 +237,8 @@
if [ "X$UNINSTALL" != "X" ]; then
killall pulseUi 2&>/dev/null
killall pulsesvc 2&>/dev/null
- rm -rf /usr/local/pulse/*
- rmdir /usr/local/pulse
+ rm -rf $INSTALLDIR/*
+ rmdir $INSTALLDIR
rm -f /usr/share/applications/pulseUi.desktop
read -p "Do you want to clean up the connection store? [Yy/Nn] " -n 1 -r
echo # (optional) move to a new line
@@ -225,9 +248,9 @@
fi
exit
fi
- chown $USER: /usr/local/pulse/PulseClient.sh
- chown $USER: /usr/local/pulse/version.txt
- chown $USER: /usr/local/pulse/pulse.tgz
+ chown $USER: $INSTALLDIR/PulseClient.sh
+ chown $USER: $INSTALLDIR/version.txt
+ chown $USER: $INSTALLDIR/pulse.tgz
fi
}
@@ -235,11 +258,14 @@
if [ $OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$UNSUPPORTED]} ]; then
return
fi
+ isArchBased=0
isRpmBased=0
isDebBased=0
dependencyListName=${OS_TYPE}_DEPENDENCIES
dependencyListNameWithVersion=${OS_TYPE}_DEPENDENCIES_WITH_VERSION
- if [[ ($OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$CENTOS_6]}) || \
+ if [[ $OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$ARCH]} ]]; then
+ isArchBased=1
+ elif [[ ($OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$CENTOS_6]}) || \
($OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$CENTOS_7]}) || \
($OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$FEDORA]}) || \
($OS_TYPE = ${SUPPORTED_OSTYPES_LIST[$RHEL_7]})]]; then
@@ -250,7 +276,30 @@
isDebBased=1
fi
- if [ $isRpmBased = 1 ]; then
+ if [ $isArchBased = 1 ]; then
+ eval "depListArr=(\${${dependencyListName}[@]})"
+ # eval "depListArrWithVersion=(\${${dependencyListNameWithVersion}[@]})"
+ tam=${#depListArr[@]}
+ PKGREQ=""
+ for ((i=0; i < $tam; i++)); do
+ depPkgName=${depListArr[i]}
+ curPkgVar=`pacman -Q | grep -i $depPkgName`
+ if [ "X$curPkgVar" = "X" ]; then
+ echo "$depPkgName is missing in the machine" > $LOG
+ PKGREQ="$PKGREQ ${depListArr[i]}"
+ fi
+ done
+ if [ "X" != "X$PKGREQ" ]; then
+ # Install respective packages based on the current installation
+ echo ""
+ echo "Please execute below commands to install missing dependent packages "
+ for i in `echo $PKGREQ`
+ do
+ echo "pacman -S $i"
+ done
+ fi
+ echo $readMeEchoMsg
+ elif [ $isRpmBased = 1 ]; then
eval "depListArr=(\${${dependencyListName}[@]})"
eval "depListArrWithVersion=(\${${dependencyListNameWithVersion}[@]})"
tam=${#depListArr[@]}
@@ -297,7 +346,7 @@
echo ""
echo "OR"
echo "You can install the missing dependency packages by running the below script "
- echo " /usr/local/pulse/PulseClient.sh install_dependency_packages"
+ echo " $INSTALLDIR/PulseClient.sh install_dependency_packages"
echo ""
fi
echo $readMeEchoMsg
@@ -327,7 +376,7 @@
echo ""
echo "OR"
echo "You can install the missing dependency packages by running the below script "
- echo " /usr/local/pulse/PulseClient.sh install_dependency_packages"
+ echo " $INSTALLDIR/PulseClient.sh install_dependency_packages"
echo ""
fi
echo $readMeEchoMsg