10 : ${REPO=http://ftp.distorted.org.uk/ftp/pub/mdw/profile}
12 export PATH
=/usr
/local/bin
:$HOME$sub/bin
:/usr
/bin
:/usr
/ccs
/bin
:/bin
14 ### Sort out command line
16 while [ $# -gt
0 ]; do
21 -*) echo >&2 "$0: bad option"; exit 1;;
27 ### Find out where I am
30 ### Suss out how to print things
31 out
=$
(echo -n
"foo"; echo "bar")
32 if [ "$out" = "foobar" ]; then
40 ### Create the necessary directories
41 echo "Creating directories..."
42 for i
in bin lib
/emacs src
; do
44 if [ -d
$HOME$sub/$i ]; then
45 echo " already exists."
53 ### Find out how to fetch things over the net
54 $echon "Finding URL fetcher:$echoc"
55 if curl
>/dev
/null
2>&1 --version ||
[ $?
-eq
2 ]; then
58 elif wget
>/dev
/null
2>&1 --version
; then
63 echo >&2 "$0: failed to find URL fetcher"
67 ### Install necessary things
68 echo "Installing useful scripts..."
71 lesspipe.sh start-ssh-agent svnwrap"
72 for script in $scripts; do
73 $echon " $script:$echoc"
75 for p
in /bin
/usr
/bin
/usr
/local/bin $
(echo $PATH |
tr : ' '); do
76 if $false [ -x
$p/$script ]; then
82 echo " already installed."
84 $echon " downloading$echoc"
85 $GETURL $HOME$sub/bin
/$script $REPO/$script
86 chmod +x
$HOME$sub/bin
/$script
93 ### Install some more complicated programs
94 echo "Installing packages..."
99 [ "$xstuff" ] && systems
="$systems
102 for system
in $systems; do
103 set -- $
(echo $system |
tr : ' ')
104 sys
=$1 ver
=$2 prog
=$3
105 $echon " $sys:$echoc"
106 if $false $prog >/dev
/null
2>&1 --version
; then
107 echo " already installed."
110 $echon " downloading$echoc"
112 rm -rf
$sys-$ver.
tar.gz
$sys-$ver
113 $GETURL $sys-$ver.
tar.gz
$REPO/$sys-$ver.
tar.gz
114 $echon " unpacking$echoc"
115 gzip -cd $sys-$ver.
tar.gz |
tar xf
-
116 $echon " configuring$echoc"
120 ..
/configure
--prefix
=$HOME$sub >>buildlog
2>&1
121 $echon " building$echoc"
123 $echon " installing$echoc"
124 make install >>buildlog
2>&1
131 ### Install global configuration
132 echo -n
"Installing dotfile configuration:"
133 if [ -f
$HOME$sub/.mdw.conf
]; then
134 echo " already installed."
136 cp mdw.conf
$HOME$sub/.mdw.conf
140 ### Symlink the various dotfiles into place
142 bash_profile bash_logout bashrc inputrc bash_completion
149 lisp-init.lisp:.cmucl-init.lisp
150 lisp-init.lisp:.sbclrc
151 lisp-init.lisp:.clisprc.lisp
152 lisp-init.lisp:.eclrc
153 dircolors colordiffrc screenrc cvsrc indent.pro"
154 [ "$xstuff" ] && dotfiles
="$dotfiles
155 xinitrc xsession Xdefaults vncrc vncsession
156 putty-defaults:.putty/sessions/Default%20Settings
157 e-keybindings.cfg:.enlightenment/keybindings.cfg
158 evnc-keybindings.cfg:.enlightenment-vnc/keybindings.cfg
159 e16-bindings:.e16/bindings.cfg
160 e16-config:.e16/e_config--1.0.cfg
161 jue-peek.jpg:.enlightenment/backgrounds/jue-peek.jpg
162 jue-peek.jpg:.e16/backgrounds/jue-peek.jpg"
163 echo "Installing dotfiles..."
164 for d
in $dotfiles; do
167 *:*) target
=${d#*:} d
=${d%%:*};;
172 ln -s
$here/$d $ft.new
178 ### Install useful scripts included in this package
184 [ "$xstuff" ] && scripts
="$scripts
187 echo "Installing scripts..."
188 mkdir
-p
$HOME$sub/bin
189 for s
in $scripts; do
191 ln -s
$here/$s $ft.new
197 ### Set up the Emacs config
198 $echon "Finding a suitable emacs:$echoc"
200 for i
in emacs22 emacs21 emacs
; do
201 if type -p
>/dev
/null
$i; then
206 if [ $emacs = no
]; then
213 echo "Installing Emacs packages..."
216 git git-blame vc-git stgit
218 for elib
in $emacspkg; do
219 $echon " $elib:$echoc"
220 if $false $emacs >/dev
/null
2>&1 --no-site-file
--batch --eval '
222 (setq load-path (nconc load-path (list "~/lib/emacs")))
223 (kill-emacs (condition-case nil
224 (progn (load-library "'"$elib"'") 0)
226 echo " already installed."
228 $echon " downloading$echoc"
229 $GETURL $HOME$sub/lib
/emacs
/$elib.el
$REPO/$elib.el
230 $echon " compiling$echoc"
231 (cd $HOME$sub/lib
/emacs
;
232 $emacs >/dev
/null
2>&1 --no-site-file
--batch \
233 --eval '(byte-compile-file "'"$elib.el"'")')
239 $echon "Setting up Emacs configuration:$echoc"
240 $echon " linking$echoc"
241 for link
in dot-emacs.el
:dot-emacs.el emacs-Makefile
:Makefile
; do
242 set -- $
(echo $link |
tr : ' ')
244 ln -s
$here/$from $HOME$sub/lib
/emacs
/$to.new
245 mv $HOME$sub/lib
/emacs
/$to.new
$HOME$sub/lib
/emacs
/$to
247 $echon " compiling$echoc"
248 make >/dev
/null
2>&1 -C
$HOME$sub/lib
/emacs EMACS
=$emacs