Add permission manager facility
[conkeror.git] / install.sh
blobae5a6e0b6943a975aff3398cb4b1c174fd243c43
1 #! /bin/bash
3 # (C) Copyright 2004-2007 Shawn Betts
4 # (C) Copyright 2007 John J. Foerch
6 # Use, modification, and distribution are subject to the terms specified in the
7 # COPYING file.
9 ## BUILD
11 ## Whether to build the xulapp. This is just a shortcut for developers and hackers.
13 BUILD=""
16 ## PREFIX
18 ## Install prefix. Conkeror will be installed to $PREFIX/lib/conkeror and a
19 ## symlink to the stub binary will be placed in $PREFIX/bin/conkeror
21 PREFIX=/usr/local
23 while [[ "$1" = -* ]]; do
24 case "$1" in
25 -build) BUILD=1 ;;
26 -prefix) PREFIX="${2%/}" ; shift ;;
28 echo "Unrecognized option. Please read the source."
29 exit 1
30 esac
31 shift
32 done
36 function assert_conkeror_src () {
37 if [[ ! -e build.sh ]]; then
38 echo "The current directory does not appear to contain the Conkeror source code."
39 exit 1
44 if [[ -n "$BUILD" ]]; then
45 ## -build has been requested.
46 ## assert we are in the conkeror source directory
47 assert_conkeror_src
48 bash build.sh xulapp
51 ### conkeror.xulapp should be in the current directory
52 if [[ ! -e conkeror.xulapp ]]; then
53 echo "conkeror.xulapp not found. install cannot continue."
54 exit 1
58 ### spawn-process-helper should be in the current directory
59 if [[ ! -e spawn-process-helper ]]; then
60 echo " spawn-process-helper not found. install cannot continue."
61 exit 1
66 echo -n "Installing conkeror to $PREFIX/lib/conkeror ..."
67 xulrunner --install-app conkeror.xulapp "$PREFIX/lib/"
68 echo ok
70 echo -n "Installing spawn-process-helper to $PREFIX/lib/conkeror ..."
71 cp spawn-process-helper $PREFIX/lib/conkeror/
72 echo ok
75 if [[ -e "$PREFIX/bin/conkeror" ]]; then
76 rm "$PREFIX/bin/conkeror"
78 echo -n "Creating symlink to stub binary in $PREFIX/bin ..."
79 pushd "$PREFIX/bin" > /dev/null
80 ln -s ../lib/conkeror/conkeror conkeror
81 popd > /dev/null
82 echo ok
84 echo "Done. If you get an error that the correct GRE version"
85 echo "cannot be found, try one of the following commands:"
86 echo "for system-wide install: xulrunner --register-global"
87 echo "for single-user install: xulrunner --register-user"