Ticket #28276: arb_macsetup.3.diff
File arb_macsetup.3.diff, 3.5 KB (added by matt.cottrell@…, 14 years ago) |
---|
-
arb_macsetup
old new 29 29 # 30 30 31 31 # This is the arb_macsetup script 32 # Use it to set the ARBHOME and PATH variables a fter installing ARB using MacPorts.32 # Use it to set the ARBHOME and PATH variables and to install a .xmodmap file after installing ARB using MacPorts. 33 33 34 34 # Derived from the MacPorts postflight script 35 35 # Provided by: Matthew Cottrell 36 # October 1, 200936 # January 31, 2011 37 37 38 38 # Abstraction variables: 39 39 PREFIX=@@PREFIX@@ … … 42 42 MANPAGES=${PREFIX}/share/man 43 43 TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S") 44 44 BACKUP_SUFFIX=macports-saved_${TIMESTAMP} 45 XMODMAP_FILE=xmodmap 45 46 OUR_STRING="ARB Installer addition on ${TIMESTAMP}" 46 47 47 48 # Determine the user's shell, in order to choose an appropriate configuration file we'll be tweaking. … … 104 105 echo "An appropriate ${1} variable has been added to your shell environment by the ${3} installer." 105 106 } 106 107 108 function write_xmodmap_setting () { 109 if [ -f ${HOME}/.${XMODMAP_FILE} ] && ! grep "${OUR_STRING}" ${HOME}/.${XMODMAP_FILE} > /dev/null; then 110 echo "Backing up your ${HOME}/.${XMODMAP_FILE} keyboard confguration file as ${HOME}/.${XMODMAP_FILE}.${BACKUP_SUFFIX} before adapting it for ARB." 111 /bin/cp -fp ${HOME}/.${XMODMAP_FILE} "${HOME}/.${XMODMAP_FILE}.${BACKUP_SUFFIX}" || { 112 echo "An attempt to backup your original configuration file failed! Please set your ARB compatible environment manually." 113 114 exit 1 115 } 116 echo -e "\n##\n# Your previous ${HOME}/.${XMODMAP_FILE} file was backed up as ${HOME}/.${XMODMAP_FILE}.${BACKUP_SUFFIX}\n##" >> ${HOME}/.${XMODMAP_FILE} 117 fi 118 echo -e "${1}\n${2}\n${3}\n${4}\n${5}\n${6}\n${7}\n" > ${HOME}/.${XMODMAP_FILE} 119 chown ${USER} ${HOME}/.${XMODMAP_FILE} || echo "Warning: unable to adapt permissions on your ${HOME}/.${XMODMAP_FILE} shell configuration file!" 120 echo "An appropriate xmodmap file has been added to your home folder by the ${8} installer." 121 } 122 107 123 # Confirm that MacPorts has been configured for this user: 108 124 if ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/printenv PATH" | grep ${PREFIX} > /dev/null; then 109 125 echo "Your shell already has the right PATH environment variable for use with MacPorts!" … … 148 164 write_setting ARBHOME "${PREFIX}/share/arb" ARB 149 165 fi 150 166 167 #write the .xmodmap file for easy keyboard shortcutsin the ARB sequence editor 168 write_xmodmap_setting "clear Mod1" "clear Mod2" "keycode 63 = Mode_switch" "keycode 66 = Meta_L" "keycode 69 = Meta_R" "add Mod1 = Meta_L Meta_R" "add Mod2 = Mode_switch" ARB 169 151 170 # arb_setenv script is done with its job - exit gracefully! 152 171 echo "" 153 172 echo "You have succesfully installed ARB" 154 173 echo "" 155 174 echo "Open a new terminal window and type arb to launch ARB" 156 175 echo "" 157 echo "A demo data base is located at ${ prefix}/share/arb.demo.arb"176 echo "A demo data base is located at ${PREFIX}/share/arb.demo.arb" 158 177 echo "" 159 178 echo "************************************************************************************************" 160 echo "Note: To set up ARB for another user log into their account and type ${ prefix}/bin/arb_macsetup"179 echo "Note: To set up ARB for another user log into their account and type ${PREFIX}/bin/arb_macsetup" 161 180 echo "************************************************************************************************" 162 181 echo "" 163 182 echo "Please cite: Wolfgang Ludwig, et al. (2004) ARB: a software environment for sequence data. Nucleic Acids Research. 32:1363-1371"