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
66 Enter 1, 2, 3, 4 or 5:
74 1) APPDIR
=/usr
/local
/apps
76 SHAREDIR
=/usr
/local
/share
77 #CHOICESDIR=${SHAREDIR}/Choices
78 XDGDATADIR
=/usr
/local
/share
80 MANDIR
=/usr
/local
/man
# (not under share!)
82 2) APPDIR
=${HOME}/Apps
84 if [ -n "$XDG_DATA_HOME" ]; then
85 SHAREDIR
=${XDG_DATA_HOME}
87 SHAREDIR
=${HOME}/.local
/share
89 if [ -n "$XDG_CONFIG_HOME" ]; then
90 CHOICESDIR
=${XDG_CONFIG_HOME}
92 CHOICESDIR
=${HOME}/.config
96 if [ ! -d "$MANDIR" ]; then
104 MANDIR
=${SHAREDIR}/man
106 4) echo "Where should the ROX-Filer application go?"
107 get_dir
"/usr/local/apps"
110 echo "Where should the launcher script go?"
111 get_dir
"/usr/local/bin"
114 echo "Where should the shared resources (eg, MIME data) go?"
115 get_dir
"/usr/local/share"
118 echo "Where should the default run actions go?"
122 echo "Where should the man pages go?"
123 get_dir
"/usr/local/man"
126 5) echo "What prefix should I use?"
130 SHAREDIR
="$DIR/share"
132 MANDIR
="$DIR/man" # (not under share!)
135 *) die
"Invalid choice!";;
138 MIMEDIR
=${SHAREDIR}/mime
140 MIMEINFO
="${MIMEDIR}/packages/rox.xml"
143 The application directory will be:
146 The launcher script will be:
149 Run actions will be in:
156 if [ ! -f rox
.1 ]; then
157 echo '*** The ROX-Filer manpage (rox.1) is missing.'
158 echo '*** It can be created from Manual.xml by running'
159 echo "*** 'make' in the ROX-Filer/src/Docs directory."
160 echo '*** The daily CVS snapshots have it ready-built'
165 if [ -n "$MANDIR" ]; then
166 echo "The manual pages will be:"
167 echo " $MANDIR/man1/rox.1"
168 echo " $MANDIR/man1/ROX-Filer.1"
170 echo "The manual page will not be installed."
180 if [ -n "$MANDIR" ]; then
181 echo "Installing manpage..."
184 cp rox
.1 "$MANDIR/man1/rox.1" || die
"Can't install manpage!"
185 rm -f "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
186 ln -s "$MANDIR/man1/rox.1" "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
189 echo "Installing run actions (existing actions will not be replaced)..."
190 endir
"$CHOICESDIR/rox.sourceforge.net/MIME-types"
191 cd Choices || die
"Choices missing"
192 for file in MIME-types
/*; do
193 if [ -f "$file" ]; then
194 dest
="$CHOICESDIR/rox.sourceforge.net/$file"
195 if [ ! -f "$dest" ]; then
196 if [ ! -d "$dest" ]; then
197 echo Install
$file as
$dest
206 endir
"$MIMEDIR/packages"
207 cp rox.xml
"$MIMEINFO" || die
"Failed to create $MIMEINFO"
208 update-mime-database
"$MIMEDIR" || die
"update-mime-database failed
209 Make sure you have installed the shared MIME database from:
210 http://www.freedesktop.org/software/shared-mime-info"
212 echo "Installing application..."
215 (cd ROX-Filer
/src
&& make clean
) > /dev
/null
2>&1
216 if [ -d "$APPDIR/ROX-Filer" ]; then
217 echo "ROX-Filer is already installed - delete the existing"
221 # Move it away first. If $APPDIR is on an nfs mount then deleting
222 # the binary may fail.
223 old
="$APPDIR/.ROX-Filer.old"
224 if [ -d "$old" ]; then
225 echo "Cleaning up old copy from previous install."
228 mv "$APPDIR/ROX-Filer" "$old"
229 rm -rf "$old" ||
echo "Could not delete old copy.
230 This is usually because it is still executing. When it exits you may like
233 cp -r ROX-Filer
"$APPDIR"
235 echo "Installing launcher script..."
238 cat > "$BINDIR/rox" << EOF
240 exec $APPDIR/ROX-Filer/AppRun "\$@"
242 [ $?
-eq 0 ] || die
"Failed to install 'rox' script"
243 chmod a
+x
"$BINDIR/rox"
247 Script installed. You can run the filer by simply typing 'rox'
248 Make sure that $BINDIR is in your PATH though - if it isn't then
253 ****************************
254 *** Now read the manual! ***
255 ****************************
257 Run ROX and click on the help icon on the toolbar: