Compilation and installation
============================

This text is extracted from Krusader Handbook version 1.40.01 (17/05/2004)
The Krusader Handbook is available in the Help menu of Krusader
(after installing Krusader).

For the HTML version look at:
http://krusader.sourceforge.net/handbook/installation.html

The FAQ can be found at:
http://krusader.sourceforge.net/handbook/faq.html

After the Krusader installation instructions you will find generic
installation instructions for KDE applications.


I have downloaded the Sources for Krusader. What now?
=====================================================

Check the environment variables KDEDIR - QTDIR.

Unpack the tarball and go to the Krusader source directory.
If you have done a download from CVS you will have to run the following
command to create the "./configure" script:
$ make -f Makefile.cvs

In order to compile and install Krusader on your system, type the following
in the base directory of the Krusader package:

$ ./configure
$ make
$ su -c 'make install'

When you install a Krusader cvs or beta version and if Krusader was previously
installed on your computer, there is a possibility that you will have to update
the krusaderui.rc file. Please read the FAQ for more info.

Since Krusader uses autoconf and automake you should have no trouble compiling
it. Should you run into problems please read the detailed installation
instructions below.


Detailed installation instructions
==================================

The next section will explain step by step in detail how to install Krusader.
This question has been asked many times and especially users new to Linux often
have problems compiling software from source. Therefore we are trying to keep
the explanations as detailed as possible even if they are mostly not Krusader
specific. Experienced users may easily skip most of the steps.


If you encounter problems with installing Krusader, please read  this
installation procedure first and then the FAQ, if this does not solve the
problem then feel free to ask for help with an help request.
Please read the FAQ if you don't know how to send a help request (FAQ number 9).


1. Open your favourite terminal emulator (e.g. konsole).

2. We recommend to create a separate directory to keep all the sources you
   compile in. This will give you a better overview of installed programs and
   makes it easier to uninstall them later.

   $ mkdir ~/source
   The chosen directory is just an example, any other will work.

3. Copy the sources to the ~/source directory and unpack them.

   $ cp /"your_dir"/krusader-x.xx.tar.gz ~/source
   $ cd ~/source
   $ tar -xzvf krusader-x.xx.tar.gz


4. Optional step: the tarball is no longer needed at this point, you can
   delete it if you want.

   $ rm  krusader-x.xx.tar.gz


5. Change to the directory containing the sources.

   $ cd  krusader-x.xx


6. Check the environment variables QTDIR and KDEDIR.
   Krusader's ./configure script needs to know where the Qt and
   KDE directories are.

   QTDIR : <path to your Qt installation> e.g. /usr/lib/qt3 or /usr/qt3
   KDEDIR : <path to your KDE installation> e.g. /usr or /opt/kde3

  Normally your distribution will set them for you, but experience has shown
  that some don't. You can easily check the values with the echo command.

  $ echo $QTDIR
  /usr/lib/qt3
  $ echo $KDEDIR
  /usr
  $
  If both commands give an output, the enviroment variables are set (the above
  example are the settings of Mandrake). In case you just receive empty lines,
  the variables are not set and you have to set them it manually. To check the
  values of the variables use the find command or ask your distributor.

  $ find /usr /opt -name qtconfig -type f -perm +111
  /usr/lib/qt3/bin/qtconfig
  $ find  /usr /opt -name startkde -type f -perm +111
  /usr/bin/startkde
  $

  In this case /usr/lib/qt3 is your QTDIR and /usr is your KDEDIR. The
  installed binaries will go to /usr/bin. Now we will set the enviroment
  variables with the export command.

  $ export QTDIR=<replace with your QTDIR>
  $ export KDEDIR=<replace with your KDEDIR>

  Note
  These enviroment variables are only set for the lifetime of your current
  shell. if you close your terminal and open a new one they will be gone.
  Assuming Krusader is not the only Qt/KDE program you want to compile,
  we recommend to make these settings permanent (e.g. append both export
  commands to your /etc/profile) file.


7. If you have downloaded a stable version "krusader-x.xx.tar.gz" or a beta
   version "krusader-x.xx-betax.tar.gz", you can skip this step, in this case
   the ./configure script is provided.

   If you have downloaded a CVS build or nightly tarball
   "krusader-cvs-yyyy-mm-dd.tar.gz", you will have to run the following
   command to create the ./configure script:

   $ make -f  Makefile.cvs

   If everything is ok you will see the following output on your screen:

   $ make -f  Makefile.cvs
   This Makefile is only for the CVS repository
   This will be deleted before making the distribution
   *** Creating acinclude.m4
   *** Creating list of subdirectories
   *** Creating configure.in
   *** Creating aclocal.m4
   *** Creating configure
   *** Creating config.h template
   *** Creating Makefile templates
   *** Postprocessing Makefile templates
   *** Creating date/time stamp
   *** Finished
   Don't forget to run ./configure
   If you haven't done so in a while, run ./configure --help
   $

   Note
   You will need to have: autoconf 2.52, 2.53 or 2.54 and automake 1.6
   (or higher) to run the make -f Makefile.cvs command

   Tip
   If you encounter problems with this command, Krusader provides 2 nightly
   builds (snapshots) one with a ./configure script and one without. Look at:
   http://krusader.sourceforge.net/cvs.php


8. Now you are ready to run the ./configure script.

   $ ./configure

   This will take about 1 minute, if everything goes well it will e.g. end
   with the following messages:

   foo
   Krusader Project:
   -----------------
   Source code location: .
   C Compiler:           gcc
   C Compiler flags:     -ansi -W -Wall -pedantic -Wchar-subscripts -Wshadow
   -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500
   -D_BSD_SOURCE -O2 -Wformat-security -Wmissing-format-attribute
   C++ Compiler:         g++
   prefix:               /usr
   kde_libraries:        /usr/include
   kde_includes:         /usr/lib
   kde_locale:           /usr/share/locale
   qt_libraries:         /usr/lib/qt3/lib
   qt_includes:          /usr/lib/qt3/include
   KDEDIR:               /usr
   QTDIR:                /usr/lib/qt3
   Install path:         /usr/bin
   krusader version:     1.30
   krusader binary:      /usr/bin/krusader     (after 'make install')
   Thank you for using Krusader

   Good - your configure finished. Start make now
   $

   This is the output for Mandrake 9.1, other distributions may give a
   different output.

   Tip
   At the end of the ./configure script you will find a summary of the most
   important settings, e.g. where the Krusader binary will be installed
   (after the 'make install' command).

   Usually the Krusader binary will be installed in the KDEDIR/bin directory.
   If you would prefer to install Krusader in a different directory, you can
   do this with the following command: ./configure --prefix=/usr/local. In this
   case the Krusader binary will be installed in the /usr/local/bin directory.

   This part will also display a warning if the environment variables
   KDEDIR - QTDIR are empty.

   Use ./configure --help to see more options or read the INSTALL file in the
   Krusader sources.

   If ./configure fails, take a look at FAQ "missing libs or headers".


9.  Start the compilation process with the make command.

    $ make
    This will take about 5 minutes, if everything goes well it will e.g. end
    with the following messages:

    foo
    make[2]: Leaving directory `/foo/krusader-cvs-YYYY-MM-DD/krArc'
    make[2]: Entering directory `/foo/krusader-cvs-YYYY-MM-DD'
    make[2]: Nothing to be done for `all-am'.
    make[2]: Leaving directory `/foo/krusader-cvs-YYYY-MM-DD'
    make[1]: Leaving directory `/foo/krusader-cvs-YYYY-MM-DD'
    $

   If ./configure was successful and make failed for some reason, continue to
   read this page. If you can't find any solution for your problem then feel
   free to post a help request (FAQ number 9) at our Krusader Forum.


10. If nothing went wrong, you can now install Krusader.

    $ su -c 'make install'

    You will be asked to enter your root password.


11. When you install a Krusader cvs or beta version and if Krusader was
    previously installed on your computer, there is a possibility that you
    will have to update the krusaderui.rc file.
    Please read the FAQ for more info.


12. Now you can start Krusader.
    Type "krusader" at a command prompt.
    $ krusader
    You can create shortcut on your desktop or create an entry in the KDE menu.
    Read the FAQ if Krusader doesn't start.


13. Optional step: if you want you can clean up to save some diskspace.
    Note: in this case all the compiled files created with the make command
    will be deleted.

    $ make clean


14. If you ever want to uninstall Krusader, just use

    $ su -c 'make uninstall'

    You will be asked to enter your root password.


If you encounter problems with installing Krusader please read first the FAQ.
If this installation procedure and the FAQ does not solve the problem,
feel free to ask for help with an help request (FAQ number 9).




Installation FAQ
================

1.
I have followed all steps but configure complains about missing libs or
headers. What do I need to do?

Please install them. ;-)

Here is a (possibly incomplete) list of Krusader's dependencies:
 gcc-cpp gcc-c++ glibc libgcc1 (other compilers may work but haven't been tested)
 autoconf (e.g. autoconf-2.x-xmdk.i586.rpm)
 automake (e.g. automake1.x-x.x.x-xmdk.i586.rpm)
 XFree: libxfree86 libfreetype6 libfontconfig1 libnas2 libexpat0
 libqt3 libqt-devel (all Krusader versions >=1.02 are Qt 3.x only)
 kdelibs kdelibs-devel (all Krusader versions >=1.02 are KDE 3.x only)
 libjpeg62 libjpeg-devel libpng3 libmng1
 fam and famlibs (e.g. fam-2.x.x-xmdk.rpm and libfam0-devel-2.x.x-5mdk.i586.rpm)
 zlib1 arts libart_lgpl2 libstdc++5 libpcre0

Most RPM-based distributions separate the headers from the libs.
The headers are needed to compile Krusader.
Look for packages in the form foo-devel-*.rpm
(e.g. kdelibs-devel-3.1-58mdk.i586.rpm)
or foo-dev-*.deb for Debian based distributions. They most likely come with
your distribution.

Tip
If you can't find the needed package, use the www.rpmfind.net and click
'missing lib or header' in the search line. Or use apt-cache search foo to
find the corresponding package for Debian based distributions.


2.
I have successfully installed Krusader from source.
Everything went fine but I can't start it. What's going wrong here?

The Krusader binary is obviously not in your PATH.

Use the find command to locate the binary.

$  find /usr /opt -name  krusader -type f -perm +111
/usr/local/bin/krusader
Here, the binary somehow made it into /usr/local/bin. It is most likely,
that your KDEDIR enviroment variable wasn't set properly,
look at "6. Check the environment variables QTDIR and KDEDIR" of the
"Detailed installation instructions" for more info.

If you don't want to recompile Krusader, just add /usr/local/bin to your PATH.
To do this for all users, append the following line in your /etc/profile file
(or any other file your shell sources at startup).

$ export  PATH=$PATH:/usr/local/bin


3.
I have downloaded the Source RPM krusader-x.xx.dist.src.rpm  What now?


Change the ownership and the permissions on /usr/src/RPM/ and all recursive
directories so that your normal user can read-write-execute in these
directories.

To produce the binary RPM for your computer, do this:
$ rpm --rebuild </path/to/rpmfile/> krusader-x.xx.dist.src.rpm

If all dependencies are ok, a binary RPM krusader-x.xx.dist.rpm will be created
at /usr/src/RPM/RPMS/i586 (replace i586 with your architecture).

Test the binary RPM before installing:
$ rpm -i --test </path/to/rpmfile> krusader-x.xx.dist.rpm
If the prompt returns without a message, than everything is ok.

Install the binary RPM as usual, for example:
$ su -c 'rpm -Uvh </path/to/rpmfile> krusader-x.xx.dist.rpm'
You will be asked to enter your root password.

Now you can start Krusader.

TIP For more information about RPM, take a look at the Maximum RPM Book
    at http://www.rpm.org/max-rpm
    This book is verry good but it dates from the year 2000, so some issues
    are obsolete/changed/improved now.

4.
I'm trying to install binary foo (RPM or DEB package), but it fails.
What's wrong?

Since we only provide (and use) the source, we don't know.
Please test the binary RPM before installing:
$ rpm -i --test </path/to/rpmfile> krusader-x.xx.dist.rpm
If the prompt returns without any message, than everything is ok.</para>

If it is not ok, try to find another package at Linux software archives such as
www.freshmeat.net or www.kde-apps.org. If you still can't find a package for
your Linux distribution, we recommend searching for it with www.rpmfind.net or
rpm.pbone.net.

In general, a package for an older version of your distrubution or even for an
other distribution might work on your computer, but it is always the best that
it matches your distribution.
If you can't find a package that matches your distribution version, architecture
or distribution, than use a source RPM. Because when you use a source RPM, the
Krusader sources will be build on your computer, it will build a suitable binary
RPM for your distribution and architecture. Please read the previous question,
it explains howto install a source RPM. The best solution is explained in the
next question.

5.
I can't find a RPM or DEB package for Krusader, What now?

Compile Krusader from source :)
Even when you think that you have no skills, you will probably succeed in
compiling Krusader! We provide a verry detailled installation procedure
(this file) This will allow that even newcomers will be able to compile Krusader
from source, even when you dit never before a compilation.
Feel free to post a help request (FAQ number 9) if you encounter problems.


6.
I've installed Krusader, but when I start it, only the "Help" menu appears. Why?

In this case only the "Help" menu is visible and all the other menu items like
e.g. "File" and "Mark" are gone. This is because some distributions put the
krusaderui.rc file in a wrong directory. To solve the problem, just copy the
krusaderui.rc file from the package krusader_kde3/krusader/krusaderui.rc to
$KDEDIR/share/apps/krusader/krusaderui.rc and
~/.kde/share/apps/krusader/krusaderui.rc and re-run Krusader. If you have
compiled Krusader from sources this is often caused when the KDEDIR - QTDIR
enviroment variables are not right set, the result is that the krusaderui.rc
file is installed in a wrong directory.
Please read also the next question.


7.
Some new menu items are missing after updating Krusader, what is wrong?

The krusaderui.rc file is stored in $KDEDIR/share/apps/krusader/krusaderui.rc.
When you change the "Toolbar", KDE makes a copy of that file in the home
directory at ~/.kde/share/apps/krusader/krusaderui.rc. If Krusader was
previously installed on your computer, and you install a newer Krusader version
the ~/.kde/share/apps/krusader/krusaderui.rc file must be replaced with
the newer version.

The first line of krusaderui.rc contains the version number.
After installing a newer Krusader stable version, KDE will replace automatiqly
the old ~/.kde/share/apps/krusader/krusaderui.rc with the newer version when
starting the new Krusader stable for the first time (KDE will detect the newer
version number in the first line). In the past this was not the case due to a bug,
this bug was resolved since "krusader-cvs-2004-02-24".
When you install a Krusader CVS or beta version you will have to replace the
~/.kde/share/apps/krusader/krusaderui.rc manually.

If the ~/.kde/share/apps/krusader/krusaderui.rc file is too old, then the new
menu elements will not be shown. Read the previous question for information on
how to update the krusaderui.rc file. If krusaderui.rc is missing or in a wrong
directory, only the "Help" menu appears, please read the previous question.


8.
When I run make it complains about libfam.la

The ./configure script does not check for the presence of libfam.la, and make
needs libfam.la to compile Krusader. If you know how this can be solved, please
let us know. Install libfam0-devel-foo.rpm. Note: when you install Mandrake 9.1
with the default settings, this package is not installed. If you need more
information take a look at FAQ missing libs or headers.


9.
I am having trouble compiling and installing Krusader,
how do I send a help request?

Please read our detailed installation procedure and the FAQ. If you can't find
a solution to your problem then feel free to post a help request at our Krusader
forum. But before posting a help request at our Krusader forum, please regard
the following:

Use the Search function of the Krusader Forum, your problem might be solved or
discussed already.

If you can't find a solution, please take a note of the following issues:

the used Krusader version
the used Linux distribution + version
a good description of the problem

Without this information, it is very difficult for us to help you.

Note
If you give us the error messages (e.g. make error messages) please start with
the FIRST error message, all the error messages who are following the first
error message are consequences and not the cause of your problem.

Post a help request with the information of the previous point at our
General Discussion Forum.

Thanks for your cooperation!


10.
How can i build a RPM package for Krusader?

If you have experiance with compiling from source, you will probably be able to
build a Krusader RPM too. Follow the next steps to build a RPM.

WARNING Never, ever build RPMs when logged in as root. Mistakes in buildings
packages (e.g. a bad krusader.specfile) can serious damage your system when
logged in as root.

Compile Krusader from source to check that the compilation works fine.

Change the ownership and the permissions on /usr/src/RPM/ and all recursive
directories so that your normal user can read-write-execute in these
directories.

copy kusader1.xx.tar.gz to /usr/scr/RPM/SOURCE copy kusader.spec to
/usr/scr/RPM/SPECS
Tip: the latest kusader.spec can be found in CVS.

Edit kusader.spec and add your name, your e-mail adress, the rpm name, ...
(please read the comments in kusader.spec.
Maybe other changes are needed if rpmbuild fails.

Build the binary and the source RPM with:
$ rpmbuild -ba /usr/scr/RPM/SPECS/krusader.spec
If everything went ok you will have a binaryRPM in /usr/src/RPM/RPMS/i586
(depending on your architecture) and a sourceRPM in /usr/src/RPM/SRPMS/
e.g. krusader-1.40-beta1.suse90.i586.rpm and krusader-1.40-beta1.suse90.src.rpm

If it is not ok you will receive an error message during the rpmbuild process,
try to fix it and run rpmbuild again.

And final: test (FAQ number 3) the RPM before sending it in .



More FAQ can be found at:
- the Krusader Handbook available from the "help" menu of Krusader or
- read it online at
  http://krusader.sourceforge.net/handbook/index.html
----------------------------------------------------------------------------




The following text are generic installation instructions for KDE applications
(normally you will not need it). The following text is not written by us,
but is automaticly generated by Kdevelop.


Basic Installation
==================

   These are generic installation instructions.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.

   The file `configure.in' is used to create `configure' by a program
called `autoconf'.  You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.

The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.  If you're
     using `csh' on an old version of System V, you might need to type
     `sh ./configure' instead to prevent `csh' from trying to execute
     `configure' itself.

     Running `configure' takes a while.  While running, it prints some
     messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Type `make install' to install the programs and any data files and
     documentation.

  4. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.

Compilers and Options
=====================

   Some systems require unusual options for compilation or linking that
the `configure' script does not know about.  You can give `configure'
initial values for variables by setting them in the environment.  Using
a Bourne-compatible shell, you can do that on the command line like
this:
     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the `env' program, you can do it like this:
     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure

Compiling For Multiple Architectures
====================================

   You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.

   If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory.  After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.

Installation Names
==================

   By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc.  You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.

   If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.

Optional Features
=================

   Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System).  The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.

   For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.

Specifying the System Type
==========================

   There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on.  Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
     CPU-COMPANY-SYSTEM

See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.

   If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.

Sharing Defaults
================

   If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Operation Controls
==================

   `configure' recognizes the following options to control how it
operates.

`--cache-file=FILE'
     Use and save the results of the tests in FILE instead of
     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
     debugging `configure'.

`--help'
     Print a summary of the options to `configure', and exit.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`--version'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`configure' also accepts some other, not widely useful, options.
