string_hashset: add iterator() method
[conkeror.git] / install.sh
blobfe00c146115be316781ecdf2b1962c4c6895888c
1 #! /bin/bash
3 ## BUILD
4 ##
5 ## Whether to build the xulapp. This is just a shortcut for developers and hackers.
6 ##
7 BUILD=""
10 ## PREFIX
12 ## Install prefix. Conkeror will be installed to $PREFIX/lib/conkeror and a
13 ## symlink to the stub binary will be placed in $PREFIX/bin/conkeror
15 PREFIX=/usr/local
17 while [[ "$1" = -* ]]; do
18 case "$1" in
19 -build) BUILD=1 ;;
20 -prefix) PREFIX="${2%/}" ; shift ;;
22 echo "Unrecognized option. Please read the source."
23 exit 1
24 esac
25 shift
26 done
30 function assert_conkeror_src () {
31 if [[ ! -e build.sh ]]; then
32 echo "The current directory does not appear to contain the Conkeror source code."
33 exit 1
38 if [[ -n "$BUILD" ]]; then
39 ## -build has been requested.
40 ## assert we are in the conkeror source directory
41 assert_conkeror_src
42 bash build.sh xulapp
45 ### conkeror.xulapp should be in the current directory
46 if [[ ! -e conkeror.xulapp ]]; then
47 echo "conkeror.xulapp not found. install cannot continue."
48 exit 1
52 ### spawn-process-helper should be in the current directory
53 if [[ ! -e spawn-process-helper ]]; then
54 echo " spawn-process-helper not found. install cannot continue."
55 exit 1
60 echo -n "Installing conkeror to $PREFIX/lib/conkeror ..."
61 xulrunner --install-app conkeror.xulapp "$PREFIX/lib/"
62 echo ok
64 echo -n "Installing spawn-process-helper to $PREFIX/lib/conkeror ..."
65 cp spawn-process-helper $PREFIX/lib/conkeror/
66 echo ok
69 if [[ -e "$PREFIX/bin/conkeror" ]]; then
70 rm "$PREFIX/bin/conkeror"
72 echo -n "Creating symlink to stub binary in $PREFIX/bin ..."
73 pushd "$PREFIX/bin" > /dev/null
74 ln -s ../lib/conkeror/conkeror conkeror
75 popd > /dev/null
76 echo ok
78 echo "Done. If you get an error that the correct GRE version"
79 echo "cannot be found, try one of the following commands:"
80 echo "for system-wide install: xulrunner --register-global"
81 echo "for single-user install: xulrunner --register-user"