|
@@ -51,6 +51,8 @@ if [ "${PIDOF}" = "" ]; then
|
51
|
51
|
fi;
|
52
|
52
|
fi;
|
53
|
53
|
|
|
54
|
+ISFREEBSD=`uname -s | grep -i FreeBSD`
|
|
55
|
+
|
54
|
56
|
## Helper Functions
|
55
|
57
|
if [ "${PIDOF}" != "" ]; then
|
56
|
58
|
ISKDE=`${PIDOF} -x -s kdeinit`
|
|
@@ -124,17 +126,34 @@ questiondialog() {
|
124
|
126
|
|
125
|
127
|
showLicense() {
|
126
|
128
|
# Get License Text
|
127
|
|
- FILE=`mktemp -p ${PWD} license.XXXXXXXXXXXXXX`
|
128
|
|
-
|
129
|
|
- # Location of license start
|
130
|
|
- STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
|
131
|
|
- STARTLINE=$((${STARTLINE%%:*} + 1))
|
132
|
|
- # Location of license end
|
133
|
|
- ENDLINE=`grep ${GREPOPTS} "Do you agree to the above license terms?" jre.bin`
|
134
|
|
- ENDLINE=$((${ENDLINE%%:*} - 2))
|
135
|
|
-
|
136
|
|
- head -n ${ENDLINE} jre.bin | tail ${TAILOPTS}${STARTLINE} > ${FILE}
|
137
|
|
-
|
|
129
|
+ FILE=`mktemp license.XXXXXXXXXXXXXX`
|
|
130
|
+ if [ "${ISFREEBSD}" != "" ]; then
|
|
131
|
+ WGET=`which wget`
|
|
132
|
+ FETCH=`which fetch`
|
|
133
|
+ CURL=`which curl`
|
|
134
|
+
|
|
135
|
+ ARCH=`uname -m`
|
|
136
|
+ RELEASE=`uname -r`
|
|
137
|
+ URL="http://www.dmdirc.com/getjavalicense/`uname -s`/${ARCH}/${RELEASE}"
|
|
138
|
+
|
|
139
|
+ if [ "${WGET}" != "" ]; then
|
|
140
|
+ ${WGET} -q -O ${FILE} ${URL}
|
|
141
|
+ elif [ "${FETCH}" != "" ]; then
|
|
142
|
+ ${FETCH} -q -o ${FILE} ${URL}
|
|
143
|
+ elif [ "${CURL}" != "" ]; then
|
|
144
|
+ ${CURL} -s -o ${FILE} ${URL}
|
|
145
|
+ fi;
|
|
146
|
+ else
|
|
147
|
+ # Location of license start
|
|
148
|
+ STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
|
|
149
|
+ STARTLINE=$((${STARTLINE%%:*} + 1))
|
|
150
|
+ # Location of license end
|
|
151
|
+ ENDLINE=`grep ${GREPOPTS} "Do you agree to the above license terms?" jre.bin`
|
|
152
|
+ ENDLINE=$((${ENDLINE%%:*} - 2))
|
|
153
|
+
|
|
154
|
+ head -n ${ENDLINE} jre.bin | tail ${TAILOPTS}${STARTLINE} > ${FILE}
|
|
155
|
+ fi;
|
|
156
|
+
|
138
|
157
|
# Send text to console.
|
139
|
158
|
echo ""
|
140
|
159
|
echo "-----------------------------------------------------------------------"
|
|
@@ -169,9 +188,13 @@ messagedialog "Java Install" "Before java can be installed, please review the fo
|
169
|
188
|
showLicense
|
170
|
189
|
questiondialog "Java Install" "Do you agree to the Java License?"
|
171
|
190
|
if [ $? -eq 0 ]; then
|
172
|
|
- # Look to see where the JRE wants to install to
|
173
|
|
- JREJAVAHOME=`grep ${GREPOPTS} "^javahome=" jre.bin`
|
174
|
|
- JREJAVAHOME=${JREJAVAHOME##*=}
|
|
191
|
+ if [ "${ISFREEBSD}" != "" ]; then
|
|
192
|
+ JREJAVAHOME="diablo-jre1.6.0_07"
|
|
193
|
+ else
|
|
194
|
+ # Look to see where the JRE wants to install to
|
|
195
|
+ JREJAVAHOME=`grep ${GREPOPTS} "^javahome=" jre.bin`
|
|
196
|
+ JREJAVAHOME=${JREJAVAHOME##*=}
|
|
197
|
+ fi;
|
175
|
198
|
|
176
|
199
|
echo "JREJAVAHOME: ${JREJAVAHOME}"
|
177
|
200
|
|
|
@@ -188,33 +211,40 @@ if [ $? -eq 0 ]; then
|
188
|
211
|
echo "installdir: ${installdir}"
|
189
|
212
|
|
190
|
213
|
if [ ! -e ${installdir} ]; then
|
191
|
|
- # Hack jre.bin to allow us to install without asking for a license, or failing
|
192
|
|
- # the checksum.
|
|
214
|
+ messagedialog "Java Install" "Java install will begin when you press OK.\nThis may take some time, so please wait.\n\nYou will be informed when the installation is completed."
|
|
215
|
+ if [ "${ISFREEBSD}" != "" ]; then
|
|
216
|
+ mv jre.bin jre.tar.bz2
|
|
217
|
+ tar -jxvf jre.tar.bz2
|
|
218
|
+ mv jre.tar.bz2 jre.bin
|
|
219
|
+ else
|
|
220
|
+ # Hack jre.bin to allow us to install without asking for a license, or failing
|
|
221
|
+ # the checksum.
|
|
222
|
+
|
|
223
|
+ # Location of license start
|
|
224
|
+ STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
|
|
225
|
+ STARTLINE=${STARTLINE%%:*}
|
|
226
|
+ # Location of license end
|
|
227
|
+ ENDLINE=`grep ${GREPOPTS} "If you don't agree to the license you can't install this software" jre.bin`
|
|
228
|
+ ENDLINE=$((${ENDLINE%%:*} + 3))
|
|
229
|
+ # Location of checksum start
|
|
230
|
+ CSSTARTLINE=`grep ${GREPOPTS} "^if \[ -x /usr/bin/sum \]; then$" jre.bin`
|
|
231
|
+ CSSTARTLINE=${CSSTARTLINE%%:*}
|
|
232
|
+ # Location of checksum end
|
|
233
|
+ CSENDLINE=`grep ${GREPOPTS} "Can't find /usr/bin/sum to do checksum" jre.bin`
|
|
234
|
+ CSENDLINE=$((${CSENDLINE%%:*} + 2))
|
|
235
|
+ # Location of script end
|
|
236
|
+ SCENDLINE=`grep ${GREPOPTS} "^echo \"Done.\"$" jre.bin`
|
|
237
|
+ SCENDLINE=$((${SCENDLINE%%:*} + 2 - (${ENDLINE} - ${STARTLINE}) - (${CSENDLINE} - ${CSSTARTLINE})))
|
|
238
|
+ # Remove the license and checksum stuff!
|
|
239
|
+ head -n $((${STARTLINE} -1)) jre.bin > jre.bin.tmp
|
|
240
|
+ tail ${TAILOPTS}$((${ENDLINE})) jre.bin | head -n $((${CSSTARTLINE} -1 - ${ENDLINE})) >> jre.bin.tmp
|
|
241
|
+ echo "tail \${tail_args} +${SCENDLINE} \"\$0\" > \$outname" >> jre.bin.tmp
|
|
242
|
+ tail ${TAILOPTS}$((${CSENDLINE})) jre.bin >> jre.bin.tmp
|
193
|
243
|
|
194
|
|
- # Location of license start
|
195
|
|
- STARTLINE=`grep ${GREPOPTS} "^more <<\"EOF\"$" jre.bin`
|
196
|
|
- STARTLINE=${STARTLINE%%:*}
|
197
|
|
- # Location of license end
|
198
|
|
- ENDLINE=`grep ${GREPOPTS} "If you don't agree to the license you can't install this software" jre.bin`
|
199
|
|
- ENDLINE=$((${ENDLINE%%:*} + 3))
|
200
|
|
- # Location of checksum start
|
201
|
|
- CSSTARTLINE=`grep ${GREPOPTS} "^if \[ -x /usr/bin/sum \]; then$" jre.bin`
|
202
|
|
- CSSTARTLINE=${CSSTARTLINE%%:*}
|
203
|
|
- # Location of checksum end
|
204
|
|
- CSENDLINE=`grep ${GREPOPTS} "Can't find /usr/bin/sum to do checksum" jre.bin`
|
205
|
|
- CSENDLINE=$((${CSENDLINE%%:*} + 2))
|
206
|
|
- # Location of script end
|
207
|
|
- SCENDLINE=`grep ${GREPOPTS} "^echo \"Done.\"$" jre.bin`
|
208
|
|
- SCENDLINE=$((${SCENDLINE%%:*} + 2 - (${ENDLINE} - ${STARTLINE}) - (${CSENDLINE} - ${CSSTARTLINE})))
|
209
|
|
- # Remove the license and checksum stuff!
|
210
|
|
- head -n $((${STARTLINE} -1)) jre.bin > jre.bin.tmp
|
211
|
|
- tail ${TAILOPTS}$((${ENDLINE})) jre.bin | head -n $((${CSSTARTLINE} -1 - ${ENDLINE})) >> jre.bin.tmp
|
212
|
|
- echo "tail \${tail_args} +${SCENDLINE} \"\$0\" > \$outname" >> jre.bin.tmp
|
213
|
|
- tail ${TAILOPTS}$((${CSENDLINE})) jre.bin >> jre.bin.tmp
|
|
244
|
+ yes | sh jre.bin.tmp
|
|
245
|
+ rm -Rf jre.bin.tmp
|
|
246
|
+ fi;
|
214
|
247
|
|
215
|
|
- messagedialog "Java Install" "Java install will begin when you press OK.\nThis may take some time, so please wait.\n\nYou will be informed when the installation is completed."
|
216
|
|
- yes | sh jre.bin.tmp
|
217
|
|
- rm -Rf jre.bin.tmp
|
218
|
248
|
mv ${JREJAVAHOME} ${installdir}
|
219
|
249
|
|
220
|
250
|
if [ "0" = "${UID}" ]; then
|
|
@@ -230,13 +260,12 @@ if [ $? -eq 0 ]; then
|
230
|
260
|
ln -s ${installdir}/bin/java ${PWD}/java-bin
|
231
|
261
|
else
|
232
|
262
|
# Add to path.
|
233
|
|
- if [ -e ${HOME}/.profile ]; then
|
234
|
|
- echo "" >> ${HOME}/.profile
|
235
|
|
- echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
|
236
|
|
- echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
|
237
|
|
- echo " PATH=~/${JREJAVAHOME}/bin:\${PATH}" >> ${HOME}/.profile
|
238
|
|
- echo "fi" >> ${HOME}/.profile
|
239
|
|
- fi
|
|
263
|
+ echo "" >> ${HOME}/.profile
|
|
264
|
+ echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.profile
|
|
265
|
+ echo "if [ -d ~/${JREJAVAHOME}/bin ] ; then" >> ${HOME}/.profile
|
|
266
|
+ echo " PATH=~/${JREJAVAHOME}/bin:\${PATH}" >> ${HOME}/.profile
|
|
267
|
+ echo "fi" >> ${HOME}/.profile
|
|
268
|
+
|
240
|
269
|
if [ -e ${HOME}/.cshrc ]; then
|
241
|
270
|
echo "" >> ${HOME}/.cshrc
|
242
|
271
|
echo "# set PATH so it includes user's private java if it exists" >> ${HOME}/.cshrc
|