tutorial.html: copying text section
[conkeror.git] / install.sh
blob4d16a5639a79da52e932082a2c247ac7966b7e44
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
55 echo -n "Installing conkeror to $PREFIX/lib/conkeror ..."
56 xulrunner --install-app conkeror.xulapp "$PREFIX/lib/"
57 echo ok
59 if [[ -e "$PREFIX/bin/conkeror" ]]; then
60 rm "$PREFIX/bin/conkeror"
62 echo -n "Creating symlink to stub binary in $PREFIX/bin ..."
63 pushd "$PREFIX/bin" > /dev/null
64 ln -s ../lib/conkeror/conkeror conkeror
65 popd > /dev/null
66 echo ok
68 echo "Done. If you get an error that the correct GRE version"
69 echo "cannot be found, try one of the following commands:"
70 echo "for system-wide install: xulrunner --register-global"
71 echo "for single-user install: xulrunner --register-user"