eee82deab8b0e3c77710e2eb34353260e4714250
[ardour.git] / tools / linux_packaging / stage2.run
1 #!/bin/sh
2
3 ####################################
4 #
5 #       stage2.run
6 #       Ardour/Mixbus bundle installer
7 #       Todd Naugle
8 #
9 ###################################
10
11
12
13 PGM_NAME="Ardour"
14 PGM_VENDOR="Ardour"
15 PGM_EXEC_FILE="ardour3"
16
17 INSTALL_DEST_BASE="/opt"
18
19 PGM_NAME_LOWER=$(echo $PGM_NAME | tr '[:upper:]' '[:lower:]')
20
21 USER_NAME=$(logname)
22
23 #### Global Variables ####
24 HAS_XDG="T"
25
26 ########################
27 # Function Definitions
28 ########################
29
30 VaildateYesNoQuestion ()
31 {
32         # $1 = Question Text
33         
34         local INPUT_OK="n"
35         local USER_INPUT=""
36
37         until test "y" = $INPUT_OK;
38         do
39                 echo ""
40                 read -p "$1 [y/n]: " USER_INPUT
41                 echo ""
42
43                 if [ ! -z $USER_INPUT ]; 
44                 then            
45                         if [ "Y" = $USER_INPUT -o "y" = $USER_INPUT -o "n" = $USER_INPUT -o "N" = $USER_INPUT ];
46                         then
47                                 INPUT_OK="y"
48                         fi
49                 fi
50         done
51         
52         echo $USER_INPUT | tr '[:upper:]' '[:lower:]'
53         
54 }
55
56 SystemInstall ()
57 {
58
59         # Determine which software install app to use and then install requested package
60         # $1 = Package Name
61
62         if which yum > /dev/null;
63         then
64                 ${SUPER} yum -y install $1
65                 rtrn=$?
66
67                 if [ $rtrn -ne 0 ];
68                 then
69                         echo ""
70                         echo "!!! ERROR !!! yum install failed for an unknown reason."
71                         echo "Please install package $1 after this installer completes."
72                         echo ""
73                 fi
74
75         elif which apt-get > /dev/null;
76         then
77                 ${SUPER} apt-get -y install $1
78                 rtrn=$?
79
80                 if [ $rtrn -ne 0 ];
81                 then
82                         echo ""
83                         echo "!!! ERROR !!! apt-get install failed for an unknown reason."
84                         echo "Please install package $1 after this installer completes."
85                         echo ""
86                 fi
87
88         else
89                 echo ""
90                 echo "!!! ERROR !!! - Not able to detect which software install tool to use (yum or apt-get)."
91                 echo "Please install package $1 using the system software install tool."
92                 echo ""
93                 rtrn=1
94         fi
95         
96         return $rtrn
97
98 }
99
100 ########################################################################
101 #                                 Main
102 ########################################################################
103
104 # If you double click a script, some systems don't get the PWD correct.
105 # Force it to be correct
106 PKG_PATH=$(dirname "$(readlink -f "$0")")
107 cd "${PKG_PATH}"
108
109 echo ""
110 echo "Welcome to the ${PGM_NAME} installer"
111 echo ""
112 echo "${PGM_NAME} will be installed for user ${USER_NAME} in ${INSTALL_DEST_BASE}"
113 echo ""
114
115 ###############################
116 # Check for install destination
117 ###############################
118
119 if [ ! -d ${INSTALL_DEST_BASE} ];
120 then
121         echo ""
122         echo "!!! ERROR !!! - Installation location ${INSTALL_DEST_BASE} does not exist!"
123         echo "Installation will not complete."
124         echo ""
125         read -p "Press ENTER to exit installer:" BLAH
126         exit 1
127 fi
128
129 #############################
130 # Check for root privileges
131 #############################
132
133 SUPER=""
134 NORM_USER=""
135
136 if [ "$(id -u)" != "0" ]; then
137
138         if ! which sudo > /dev/null;
139         then
140                 echo ""
141                 echo "!!! ERROR !!!"
142                 echo ""
143                 echo "This installer requires root privileges. It is currently not"
144                 echo "running as root AND the program sudo is missing from this system."
145                 echo ""
146                 echo "Please correct this by installing and configuring sudo or running"
147                 echo "the installer as root (su -c)."
148                 echo ""
149                 read -p "Press ENTER to exit installer:" BLAH
150                 exit 1
151         fi
152
153         if ! sudo date;
154         then
155                 echo ""
156                 echo "!!! ERROR !!!"
157                 echo ""
158                 echo "This installer requires root privileges. It is currently not"
159                 echo "running as root AND an attempt to use sudo failed."
160                 echo ""
161                 echo "Please correct this by installing and configuring sudo or running"
162                 echo "the installer as root (su -c)."
163                 echo ""
164                 read -p "Press ENTER to exit installer:" BLAH
165                 exit 1
166         fi
167         SUPER="sudo"
168         
169         # The quoting reqired for the su sanityCheck method does not work when used without
170         # su. Using sh -c in the normal case gets around that, but is a bit of a hack.
171         NORM_USER="sh -c"
172 else
173         NORM_USER="su -l $USER_NAME -c" 
174 fi
175
176 ############################
177 # Determine processor type
178 ############################
179
180 case `uname -m` in
181         i[3456789]86|x86|i86pc)
182                 echo "Architecture is x86"
183                 ARCH='x86'
184                 ;;
185         x86_64|amd64|AMD64)
186                 echo "Architecture is x86_64"
187                 ARCH='x86_64'
188                 ;;
189         *)
190                 echo ""
191                 echo "!!! ERROR !!! - Unknown architecture `uname -m`"
192                 echo ""
193                 read -p "Press ENTER to exit installer:" BLAH
194                 exit 1
195                 ;;
196 esac
197
198 ####################
199 # Check disk space
200 ####################
201
202 # We have to check the current folder and the INSTALL_DEST_BASE just
203 # in case they are on different devices
204 echo "Checking for required disk space"
205
206 if [ ! -e .${PGM_NAME}_${ARCH}-*.size ]; then
207         echo ""
208         echo "!!! ERROR !!! Can't locate .size file for ${ARCH} bundle."
209         echo "This package is broken or does not support ${ARCH}."
210         echo ""
211         read -p "Press ENTER to exit installer:" BLAH
212         exit 1
213 else
214         REQUIRED_BYTES=$(cat .${PGM_NAME}_${ARCH}-*.size)
215
216         #Installer needs 2x the space since the bundle is unpacked locally and then copied
217         REQUIRED_BYTES=$(($REQUIRED_BYTES + $REQUIRED_BYTES))
218
219         #Check space in current folder
220         FREE_BYTES=$(df -P -B 1 "${PKG_PATH}" | grep / | awk '{print $4}')
221
222         if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
223                 echo ""
224                 echo "!!! ERROR !!! - Insufficient disk space in ${PKG_PATH}"
225                 echo "Install requires ${REQUIRED_BYTES} bytes and
226                 echo "there is only ${FREE_BYTES} bytes of free space"
227                 echo ""
228                 read -p "Press ENTER to exit installer:" BLAH
229                 exit 1
230         fi
231
232         #Check space in INSTALL_DEST_BASE
233         FREE_BYTES=$(df -P -B 1 ${INSTALL_DEST_BASE} | grep / | awk '{print $4}')
234
235         if [ ${FREE_BYTES} -le ${REQUIRED_BYTES} ] ; then
236                 echo ""
237                 echo "!!! ERROR !!! - Insufficient disk space in ${INSTALL_DEST_BASE}"
238                 echo "Install requires ${REQUIRED_BYTES} bytes and
239                 echo "there is only ${FREE_BYTES} bytes of free space"
240                 echo ""
241                 read -p "Press ENTER to exit installer:" BLAH
242                 exit 1
243         fi
244 fi
245
246 #####################
247 # Unpack the bundle
248 #####################
249
250 # untar the correct bundle for us to install
251 echo "Unpacking bundle for $ARCH"
252
253 if [ ! -e ${PGM_NAME}_${ARCH}-*.tar.bz2 ]; then
254         echo ""
255         echo "!!! ERROR !!! Can't locate ${ARCH} bundle file."
256         echo ""
257         read -p "Press ENTER to exit installer:" BLAH
258         exit 1
259 fi
260
261 tar -xjf ${PGM_NAME}_${ARCH}-*.tar.bz2
262 BUNDLE_DIR=$(basename `find -maxdepth 1 -type d -name "${PGM_NAME}_${ARCH}-*"`)
263
264
265 #######################
266 # Check for xdg utils
267 #######################
268
269 #load the file that contains the translated names of the users directories
270 if [ -e /home/${USER_NAME}/.config/user-dirs.dirs ]; then
271         . /home/${USER_NAME}/.config/user-dirs.dirs
272 fi
273
274 if [ "$(id -u)" != "0" ]; then
275         USER_DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop}
276 else
277         #running as root with su makes this more difficult
278         DESKTOP_FOLDER=$(echo ${XDG_DESKTOP_DIR:-$HOME/Desktop} | awk -F/ '{print $NF}')
279         USER_DESKTOP_DIR="/home/${USER_NAME}/${DESKTOP_FOLDER}"
280 fi
281
282 XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
283 if [ -z "$XDG_MENU_VER" ];
284 then
285         echo "System does not have xdg-desktop-menu installed"
286         HAS_XDG="F"
287 fi
288
289 XDG_ICON_VER=$(xdg-icon-resource --version 2> /dev/null)
290 if [ -z "$XDG_ICON_VER" ];
291 then
292         echo "System does not have xdg-icon-resource installed"
293         HAS_XDG="F"
294 fi
295
296 #################################################
297 # Check if system libs are OK (libc, etc)
298 #################################################
299
300 echo ""
301 echo "Checking system libs to see if they are compatible with ${PGM_NAME}."
302 echo ""
303
304 LIB_ERROR="F"
305 LD_PATH=`pwd`/${BUNDLE_DIR}/lib
306
307 # check the main App
308 LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd ${BUNDLE_DIR}/bin/${PGM_NAME_LOWER}-* 2>&1 > /dev/null)
309
310 if [ -n "$LDD_RESULT" ];
311 then
312         echo "$LDD_RESULT"
313         LIB_ERROR="T"
314 fi
315         
316 # check the libs
317 LIB_FILES=$(find ${BUNDLE_DIR}/lib -name "*.so")
318
319 for path in $LIB_FILES
320 do
321         LDD_RESULT=$(LD_LIBRARY_PATH=${LD_PATH} ldd $path 2>&1 > /dev/null)
322         if [ -n "$LDD_RESULT" ];
323         then
324                 echo "$LDD_RESULT"
325                 LIB_ERROR="T"
326         fi
327 done
328
329 if test "T" = $LIB_ERROR;
330 then
331         echo ""
332         echo "!!! ERROR !!! - Missing library detected!"
333         echo "This system does not have the correct libs to run ${PGM_NAME}."
334         echo "Installation will not complete. Please use a compatible distro."
335         echo ""
336         read -p "Press ENTER to exit installer:" BLAH
337         exit 1
338 fi
339
340 ################################
341 # Setup derived variables
342 ################################
343 PGM_VERSION=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $2 }' | awk 'BEGIN { FS = "_"} ; { print $1}')
344 PGM_BUILD=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $2 }' | awk 'BEGIN { FS = "_"} ; { print $2}')
345 PGM_BUILDTYPE=$(echo ${BUNDLE_DIR} | awk 'BEGIN { FS = "-" } ; { print $3 }')
346
347 if [ -z ${PGM_BUILDTYPE} ];
348 then
349         PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}_${PGM_BUILD}"
350         ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}"                    #no dash between name and version since dash seperates vendor from program
351         MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}.desktop"    #no dash between name and version since dash seperates vendor from program
352         DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}.desktop"
353 else
354         PGM_FULL_NAME="${PGM_NAME}-${PGM_VERSION}_${PGM_BUILD}-${PGM_BUILDTYPE}"
355         ICON_NAME="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}"                   #no dash between name and version since dash seperates vendor from program
356         MENU_FILE="${PGM_VENDOR}-${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"   #no dash between name and version since dash seperates vendor from program
357         DESKTOP_LINK_FILE="${PGM_NAME}_${PGM_VERSION}_${PGM_BUILDTYPE}.desktop"
358 fi
359
360 PGM_EXEC_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/${PGM_EXEC_FILE}"
361 ICON_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/etc/icons"
362 MENU_FILE_PATH="${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/share"
363
364 ################################
365 # Install bundle and Menu/Link
366 ################################
367
368 # uninstall any older versions
369 UNINSTALLERS=$(find ${INSTALL_DEST_BASE} -maxdepth 1 -type f -name "${PGM_NAME}*.uninstall.sh")
370 if [ ! -z "$UNINSTALLERS" ];
371 then
372         for i in $UNINSTALLERS; do
373                 echo ""
374                 echo "Found existing ${PGM_NAME} installation."
375                 
376                 ANSWER=$(VaildateYesNoQuestion "Do you want to run the uninstaller ${i} ?")
377
378                 if test "y" = $ANSWER;
379                 then
380                         echo ""
381                         echo "Running uninstaller $i"
382                         
383                         ${i}
384                         ${SUPER} rm -f ${i}
385                 fi
386         done
387 fi
388
389
390 # install 
391
392 echo ""
393 echo "Installing ${PGM_NAME} ${PGM_VERSION} built from ${PGM_BUILD} in ${INSTALL_DEST_BASE}"
394 echo ""
395
396 # Copy the new version in the install directory
397 ${SUPER} mkdir ${INSTALL_DEST_BASE}/${PGM_FULL_NAME} 
398 ${SUPER} cp -Rf ${BUNDLE_DIR}/* ${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/
399
400 # write the desktop/menu file
401 echo "[Desktop Entry]" > /tmp/${MENU_FILE}
402 echo "Encoding=UTF-8" >> /tmp/${MENU_FILE}
403 echo "Version=1.0" >> /tmp/${MENU_FILE}
404 echo "Type=Application" >> /tmp/${MENU_FILE}
405 echo "Terminal=false" >> /tmp/${MENU_FILE}
406 echo "Exec=${PGM_EXEC_PATH}" >> /tmp/${MENU_FILE}
407 if [ -z ${PGM_BUILDTYPE} ];
408 then
409         echo "Name=${PGM_NAME}-${PGM_VERSION}" >> /tmp/${MENU_FILE}
410 else
411         echo "Name=${PGM_NAME}-${PGM_VERSION}-${PGM_BUILDTYPE}" >> /tmp/${MENU_FILE}
412 fi
413 echo "Icon=${ICON_NAME}" >> /tmp/${MENU_FILE}
414 echo "Comment=Digital Audio Workstation" >> /tmp/${MENU_FILE}
415 echo "Categories=AudioVideo;AudioEditing;Audio;Recorder;" >> /tmp/${MENU_FILE}
416
417 chmod ugo+rx /tmp/${MENU_FILE}
418 ${SUPER} mv /tmp/${MENU_FILE} ${MENU_FILE_PATH}/.
419
420 # install the Menu, Link, and Icon(s)
421 if [ "T" = ${HAS_XDG} ];
422 then
423         echo "Adding ${PGM_NAME} to the applications menu"
424         ${SUPER} xdg-icon-resource install --context apps --size 16 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_16px.png ${ICON_NAME}
425         ${SUPER} xdg-icon-resource install --context apps --size 22 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_22px.png ${ICON_NAME}
426         ${SUPER} xdg-icon-resource install --context apps --size 32 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_32px.png ${ICON_NAME}
427         ${SUPER} xdg-icon-resource install --context apps --size 48 ${ICON_PATH}/${PGM_NAME_LOWER}_icon_48px.png ${ICON_NAME}
428
429         if [ -e ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg -a -d /usr/share/icons/hicolor/scalable/apps ]; 
430         then
431                 ${SUPER} cp -f ${ICON_PATH}/${PGM_NAME_LOWER}_icon.svg  /usr/share/icons/hicolor/scalable/apps/${ICON_NAME}.svg
432         fi
433
434         ${SUPER} xdg-desktop-menu install ${MENU_FILE_PATH}/${MENU_FILE}
435         ${SUPER} xdg-desktop-menu forceupdate --mode system                     # Some systems need an extra kick
436         
437         echo ""
438         echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
439         cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
440         chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
441 else
442         echo ""
443         echo "Creating a desktop link for ${PGM_NAME} in ${USER_DESKTOP_DIR}"
444         cp ${MENU_FILE_PATH}/${MENU_FILE} ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
445         chmod ugo+rwx ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
446 fi
447
448 echo ""
449 echo "Copying uninstall script to ${INSTALL_DEST_BASE}"
450 echo ""
451
452 ${SUPER} cp -f ${BUNDLE_DIR}/bin/*.uninstall.sh ${INSTALL_DEST_BASE}/.
453
454 ###########################
455 # Check Jack and qjackctl
456 ###########################
457
458 echo ""
459 echo "Checking to see if Jack is installed"
460 echo ""
461
462 if ! which jackd > /dev/null;
463 then
464         echo ""
465         echo "The program Jack is missing from this system. Jack is a required component of $PGM_NAME."
466         echo ""
467
468         ANSWER=$(VaildateYesNoQuestion "Install jack using system software repository?")
469
470         if test "y" = $ANSWER;
471         then
472                 echo "Attempting to install Jack"
473                 SystemInstall "jackd"
474
475                 if [ $? -ne 0 ];
476                 then
477                         echo ""
478                         read -p "Press ENTER to continue:" BLAH
479                 fi
480         fi
481 else
482         echo "Jack OK"
483 fi
484
485
486 if ! which qjackctl > /dev/null;
487 then
488         echo ""
489         echo "The program QjackCtl is missing from this system."
490         echo "QjackCtl is an extremely useful tool for any system that runs JACK applications like $PGM_NAME."
491         echo "We recommend that you install it."
492         echo ""
493
494         ANSWER=$(VaildateYesNoQuestion "Install QjackCtl using system software repository?")
495
496         if test "y" = $ANSWER;
497         then
498                 echo "Attempting to install QjackCtl"
499                 SystemInstall "qjackctl"
500
501                 if [ $? -ne 0 ];
502                 then
503                         echo ""
504                         read -p "Press ENTER to continue:" BLAH
505                 fi
506         fi
507 fi
508
509
510 ########################
511 # Run Sanity Check
512 ########################
513
514 USER_GROUP_ADJUSTED="f"
515
516 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -a > /dev/null";
517 then
518         echo ""
519         echo "System failed the quick sanity check... Looking for the cause"
520
521         if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -rt > /dev/null";
522         then
523                 echo ""
524                 echo "System does not allow realtime for the current user... Looking for a solution"            
525                 
526                 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasaudiogroup > /dev/null";
527                 then
528                         if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memberaudiogroup > /dev/null 2>&1";
529                         then
530                                 ## This is an odd case. We have an audio group and are a member.
531                                 echo ""
532                                 echo "!!! WARNING !!! - The current user can not execute realtime processes."
533                                 echo "This will adversely affect audio latency."
534                                 echo "This system has an audio group and the user is a member. If jack was"
535                                 echo "just installed, a simple log out/in may fix this."
536                                 echo ""
537                                 echo "For best results, please correct this on your system."
538                                 echo "(Hint: check /etc/security/limits.conf or /etc/security/limits.d/)" 
539                                 echo ""
540                                 read -p "Press ENTER to continue:" BLAH
541                         else
542                                 # Not a member of an audio group. Try to fix it.
543                                 
544                                 if ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasgroup audio > /dev/null && find /etc/security -type f -name "*.conf" | xargs grep -q "^@audio.*rtprio" ";
545                                 then
546                                         # add user to audio group
547                                         echo ""
548                                         echo "Adding user ${USER_NAME} to the audio group."
549                                         echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
550                                         echo ""
551                                         read -p "Press ENTER to continue:" BLAH
552
553                                         if ${SUPER} usermod -a -G audio ${USER_NAME};
554                                         then
555                                                 USER_GROUP_ADJUSTED="t"
556                                         else
557                                                 echo ""
558                                                 echo "!!! ERROR !!! - Not able to add user to the audio group (usermod failed)!"
559                                                 echo ""
560                                                 echo "Please add yourself to the audio group and re-login"
561                                                 echo ""
562                                                 read -p "Press ENTER to continue:" BLAH
563                                         fi
564
565                                 elif ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -hasgroup jackuser > /dev/null && find /etc/security -type f -name "*.conf" | xargs grep -q "^@jackuser.*rtprio" ";
566                                 then
567                                         # add user to jackuser group
568                                         echo ""
569                                         echo "Adding user ${USER_NAME} to the jackuser group."
570                                         echo "This should allow you to run realtime tasks. Please re-login for this change to take affect."
571                                         echo ""
572                                         read -p "Press ENTER to continue:" BLAH
573
574                                         if ${SUPER} usermod -a -G jackuser ${USER_NAME};
575                                         then
576                                                 USER_GROUP_ADJUSTED="t"
577                                         else
578                                                 echo ""
579                                                 echo "!!! ERROR !!! - Not able to add user to the jackuser group."
580                                                 echo ""
581                                                 echo "Please add yourself to the audio group and re-login"
582                                                 echo ""
583                                                 read -p "Press ENTER to continue:" BLAH
584                                         fi
585                                         
586
587                                 fi
588                         fi
589                 else
590                         # No audio group found on this system!
591                         echo ""
592                         echo "!!! WARNING !!! - The system does not seem to have an audio group (audio or jackuser)."
593                         echo ""
594                         echo "We will not attempt to fix this. Please configure your system to allow"
595                         echo "non-root users to execute realtime tasks."
596                         echo ""
597                         read -p "Press ENTER to continue:" BLAH
598                 fi
599         fi
600
601         if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -freqscaling > /dev/null";
602         then
603                 echo ""
604                 echo "!!! WARNING !!! - Your system seems to use frequency scaling."
605                 echo "This can have a serious impact on audio latency. You have two choices:"
606                 echo "(1) turn it off, e.g. by chosing the 'performance' governor."
607                 echo "(2) Use the HPET clocksource by passing \"-c h\" to JACK"
608                 echo "(this second option only works on relatively recent computers)"
609                 echo ""
610                 read -p "Press ENTER to continue:" BLAH
611         fi
612
613         if [ "f" = $USER_GROUP_ADJUSTED ];
614         then
615                 if ! ${NORM_USER} "${INSTALL_DEST_BASE}/${PGM_FULL_NAME}/bin/sanityCheck -memlock > /dev/null";
616                 then
617                         echo ""
618                         echo "!!! WARNING !!! - You are not allowed to lock memory."
619                         echo ""
620                         echo "We will not attempt to fix this. Please configure your system to allow"
621                         echo "non-root users to execute lock memory."
622                         echo ""
623                         read -p "Press ENTER to continue:" BLAH
624                 fi
625         fi
626 fi
627
628
629 ########################
630 # Install Complete
631 ########################
632
633 echo ""
634 echo "Cleaning up"
635 rm -rf ${BUNDLE_DIR}/
636
637 echo ""
638 echo "!!! Install Complete !!!"
639
640 if [ "t" = $USER_GROUP_ADJUSTED ];
641 then
642         echo "You will need to logout and then login again for all changes to be complete"
643 fi
644
645 echo ""
646 read -p "Press ENTER to exit installer:" BLAH
647
648