16 ?
*) echo "The path must start with a \`/'";;
18 echo OK
, using default value.
24 # Create the directory if it doesn't exist. Exit if it can't be created.
26 if [ ! -d "$1" ]; then
27 mkdir
-p "$1" || die
"Can't create $1 directory!"
33 printf "[yes/no] >>> "
44 echo Testing the filer...
47 die
"Filer doesn't work! Giving up..."
55 **************************************************************************
57 Where would you like to install the filer?
58 Normally, you should choose (1) if you have root access, or (2) if not.
61 2) Inside my home directory
63 4) Specify paths manually
73 1) APPDIR
=/usr
/local
/apps
75 SHAREDIR
=/usr
/local
/share
76 CHOICESDIR
=${SHAREDIR}/Choices
77 MANDIR
=/usr
/local
/man
# (not under share!)
79 2) APPDIR
=${HOME}/Apps
81 if [ -n "$CHOICESPATH" ]; then
82 CHOICESDIR
=`echo $CHOICESPATH | sed -e 's/^\([^:]*\).*$/\\1/'`
84 if [ ! -n "$CHOICESDIR" ]; then
85 CHOICESDIR
=${HOME}/Choices
87 if [ -n "$XDG_DATA_HOME" ]; then
88 SHAREDIR
=${XDG_DATA_HOME}
90 SHAREDIR
=${HOME}/.local
/share
93 if [ ! -d "$MANDIR" ]; then
100 CHOICESDIR
=${SHAREDIR}/Choices
101 MANDIR
=${SHAREDIR}/man
103 4) echo "Where should the ROX-Filer application go?"
104 get_dir
"/usr/local/apps"
107 echo "Where should the launcher script go?"
108 get_dir
"/usr/local/bin"
111 echo "Where should the shared resources (eg, MIME data) go?"
112 get_dir
"/usr/local/share"
115 echo "Where should the default icons and run actions go?"
116 get_dir
"$SHAREDIR/Choices"
119 echo "Where should the man pages go?"
120 get_dir
"/usr/local/man"
123 *) die
"Invalid choice!";;
126 MIMEDIR
=${SHAREDIR}/mime
128 MIMEINFO
="${MIMEDIR}/packages/rox.xml"
131 The application directory will be:
134 The launcher script will be:
137 Icons and run actions will be in:
144 if [ ! -f rox
.1 ]; then
145 echo '*** The ROX-Filer manpage (rox.1) is missing.'
146 echo '*** It can be created from Manual.xml by running'
147 echo "*** 'make' in the ROX-Filer/src/Docs directory."
148 echo '*** The daily CVS snapshots have it ready-built'
153 if [ -n "$MANDIR" ]; then
154 echo "The manual pages will be:"
155 echo " $MANDIR/man1/rox.1"
156 echo " $MANDIR/man1/ROX-Filer.1"
158 echo "The manual page will not be installed."
168 if [ -n "$MANDIR" ]; then
169 echo "Installing manpage..."
172 cp rox
.1 "$MANDIR/man1/rox.1" || die
"Can't install manpage!"
173 rm -f "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
174 ln -s "$MANDIR/man1/rox.1" "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
177 echo "Installing icons (existing icons will not be replaced)..."
178 endir
"$CHOICESDIR/MIME-icons"
179 endir
"$CHOICESDIR/MIME-types"
180 cd Choices || die
"Choices missing"
181 for file in MIME-
*/*; do
182 if [ -f "$file" ]; then
183 dest
="$CHOICESDIR/$file"
184 if [ ! -f "$dest" ]; then
185 if [ ! -d "$dest" ]; then
186 echo Install
$file as
$dest
195 endir
"$MIMEDIR/packages"
196 cp rox.xml
"$MIMEINFO" || die
"Failed to create $MIMEINFO"
197 update-mime-database
"$MIMEDIR" || die
"update-mime-database failed
198 Make sure you have installed the shared MIME database from:
199 http://www.freedesktop.org/standards/shared-mime-info.html"
201 echo "Installing application..."
204 (cd ROX-Filer
/src
&& make clean
) > /dev
/null
2>&1
205 if [ -d "$APPDIR/ROX-Filer" ]; then
206 echo "ROX-Filer is already installed - delete the existing"
210 rm -rf "$APPDIR/ROX-Filer"
212 cp -r ROX-Filer
"$APPDIR"
214 echo "Installing launcher script..."
217 cat > "$BINDIR/rox" << EOF
219 exec $APPDIR/ROX-Filer/AppRun "\$@"
221 [ $?
-eq 0 ] || die
"Failed to install 'rox' script"
222 chmod a
+x
"$BINDIR/rox"
226 Script installed. You can run the filer by simply typing 'rox'
227 Make sure that $BINDIR is in your PATH though - if it isn't then
232 ****************************
233 *** Now read the manual! ***
234 ****************************
236 Run ROX and click on the help icon on the toolbar: