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 MANDIR
=/usr
/local
/man
# (not under share!)
80 2) APPDIR
=${HOME}/Apps
82 if [ -n "$CHOICESPATH" ]; then
83 CHOICESDIR
=`echo $CHOICESPATH | sed -e 's/^\([^:]*\).*$/\\1/'`
85 if [ ! -n "$CHOICESDIR" ]; then
86 CHOICESDIR
=${HOME}/Choices
88 if [ -n "$XDG_DATA_HOME" ]; then
89 SHAREDIR
=${XDG_DATA_HOME}
91 SHAREDIR
=${HOME}/.local
/share
94 if [ ! -d "$MANDIR" ]; then
101 CHOICESDIR
=${SHAREDIR}/Choices
102 MANDIR
=${SHAREDIR}/man
104 4) echo "Where should the ROX-Filer application go?"
105 get_dir
"/usr/local/apps"
108 echo "Where should the launcher script go?"
109 get_dir
"/usr/local/bin"
112 echo "Where should the shared resources (eg, MIME data) go?"
113 get_dir
"/usr/local/share"
116 echo "Where should the default run actions go?"
117 get_dir
"$SHAREDIR/Choices"
120 echo "Where should the man pages go?"
121 get_dir
"/usr/local/man"
124 5) echo "What prefix should I use?"
128 SHAREDIR
="$DIR/share"
129 CHOICESDIR
=${SHAREDIR}/Choices
130 MANDIR
="$DIR/man" # (not under share!)
133 *) die
"Invalid choice!";;
136 MIMEDIR
=${SHAREDIR}/mime
138 MIMEINFO
="${MIMEDIR}/packages/rox.xml"
141 The application directory will be:
144 The launcher script will be:
147 Run actions will be in:
154 if [ ! -f rox
.1 ]; then
155 echo '*** The ROX-Filer manpage (rox.1) is missing.'
156 echo '*** It can be created from Manual.xml by running'
157 echo "*** 'make' in the ROX-Filer/src/Docs directory."
158 echo '*** The daily CVS snapshots have it ready-built'
163 if [ -n "$MANDIR" ]; then
164 echo "The manual pages will be:"
165 echo " $MANDIR/man1/rox.1"
166 echo " $MANDIR/man1/ROX-Filer.1"
168 echo "The manual page will not be installed."
178 if [ -n "$MANDIR" ]; then
179 echo "Installing manpage..."
182 cp rox
.1 "$MANDIR/man1/rox.1" || die
"Can't install manpage!"
183 rm -f "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
184 ln -s "$MANDIR/man1/rox.1" "$MANDIR/man1/ROX-Filer.1" || die
"Can't install manpage!"
187 echo "Installing run actions (existing actions will not be replaced)..."
188 endir
"$CHOICESDIR/MIME-types"
189 cd Choices || die
"Choices missing"
190 for file in MIME-types
/*; do
191 if [ -f "$file" ]; then
192 dest
="$CHOICESDIR/$file"
193 if [ ! -f "$dest" ]; then
194 if [ ! -d "$dest" ]; then
195 echo Install
$file as
$dest
204 endir
"$MIMEDIR/packages"
205 cp rox.xml
"$MIMEINFO" || die
"Failed to create $MIMEINFO"
206 update-mime-database
"$MIMEDIR" || die
"update-mime-database failed
207 Make sure you have installed the shared MIME database from:
208 http://www.freedesktop.org/software/shared-mime-info"
210 echo "Installing application..."
213 (cd ROX-Filer
/src
&& make clean
) > /dev
/null
2>&1
214 if [ -d "$APPDIR/ROX-Filer" ]; then
215 echo "ROX-Filer is already installed - delete the existing"
219 # Move it away first. If $APPDIR is on an nfs mount then deleting
220 # the binary may fail.
221 old
="$APPDIR/.ROX-Filer.old"
222 if [ -d "$old" ]; then
223 echo "Cleaning up old copy from previous install."
226 mv "$APPDIR/ROX-Filer" "$old"
227 rm -rf "$old" ||
echo "Could not delete old copy.
228 This is usually because it is still executing. When it exits you may like
231 cp -r ROX-Filer
"$APPDIR"
233 echo "Installing launcher script..."
236 cat > "$BINDIR/rox" << EOF
238 exec $APPDIR/ROX-Filer/AppRun "\$@"
240 [ $?
-eq 0 ] || die
"Failed to install 'rox' script"
241 chmod a
+x
"$BINDIR/rox"
245 Script installed. You can run the filer by simply typing 'rox'
246 Make sure that $BINDIR is in your PATH though - if it isn't then
251 ****************************
252 *** Now read the manual! ***
253 ****************************
255 Run ROX and click on the help icon on the toolbar: