            ----------------------------------
            Krusader installation instructions
            ----------------------------------


--- Note

Krusader-2.5.0 versions and higher use libraries like Qt5 and KF5, and will not
work anymore on KDE Plasma 4 or older.

--- Supported Platforms

* All POSIX (Linux®/BSD/UNIX®-like OSes), Solaris™

At the moment, for some libraries like KF5, there are no full ports for Windows
or Mac® OS X, which means these platforms are not supported.


========================================
Installation on Linux® and BSD platforms
========================================


--- Preliminary steps if Krusader was already installed

If Krusader was already installed: it's better to backup its settings before
uninstalling Krusader and installing a new version. Those folders can be
backed up (just in case):
        ~/.local
        ~/.kde
        ~/.config


--- Krusader dependencies

The next packages are needed when running the Krusader binary.

This is a list of the package names that Kubuntu/Ubuntu 20.04 (LTS) use, other
Linux distros will probably use similar names:

- plasma-framework      Plasma Runtime components
- libc6                 GNU C Library: Shared libraries
- libgcc1               GCC support library
- libqt5dbus5           Qt 5 D-Bus module
- libqt5xml5            Qt 5 XML module
- libqt5core5           Qt 5 core module
- libqt5gui5            Qt 5 GUI module
- libqt5printsupport5   Qt 5 print support module
- libstdc++6            The GNU Standard C++ Library v3
- zlib1g                compression library - runtime


--- Suggested packages

The next packages are optional but they will make Krusader much more powerful and useful.

This is a list of the package names that Debian and Ubuntu/Kubuntu 20.04 (LTS) use, other Linux
distros will probably use similar names:

- ark                   archive utility by KDE

- breeze-icon-theme     Breeze icons

- bzip2                 high-quality block-sorting file compressor - utilities
- cpio                  GNU cpio -- a program to manage archives of files

- kate                  Powerful Text Editor
or ktexteditor-katepart Provides text editing services

- kde-cli-tools         tools required to edit file types from Properties dialog
                        or run Krusader in root mode

- keditbookmarks        Bookmark manager used for editing bookmarks

- khelpcenter           KDE help viewer

- kio-extras            Enables transparent handling of various archive types
                        such as .tar and network protocols like SFTP

- kdiff3                compares and merges 2 or 3 files or directories
or kompare              file difference viewer
or xxdiff               a graphical file and directories comparison and merge tool

- konsole               X terminal emulator
- krename               Powerful batch renamer by KDE

- md5deep               enhanced message digest calculator
or cfv                  versatile file checksum creator and verifier

- p7zip                 7zr file archiver with high compression ratio
- rpm                   Red Hat package manager

- unrar                 Unarchiver for .rar files (non-free version)
or unrar-free           Unarchiver for .rar files
or rar                  Archiver for .rar files

- unzip                 De-archiver for .zip files
- zip                   Archiver for .zip files


--- Compilation requirements

The next packages are needed for compiling the Krusader sourcecode, if you only
run the Krusader binary you don't need to install these packages.

- build-essential        a group of packages needed to compile source code
- cmake                  a cross-platform, open-source make system
- extra-cmake-modules    extra cmake modules for compiling KDE Frameworks
- git                    a revision control system 
- gettext                GNU Internationalization utilities
- zlib1g-dev             in order to make building easier (https://stackoverflow.com/a/49072832)

The following packages should install (through dependencies) all the packages
you need to compile KF5 software:
- libkf5archive-dev      development files for karchive
- libkf5doctools-dev     development files for kdoctools5
- libkf5kio-dev          resource and network access abstraction
- libkf5notifications-dev   framework for desktop notifications
- libkf5parts-dev        development files for kparts
- libkf5wallet-dev       development files for kwallet-framework
- libkf5xmlgui-dev       user configurable main windows


--- Krusader source code download

Krusader is developed on Invent KDE hub at https://invent.kde.org/utilities/krusader.

To download the latest source code, clone the repository with git:
$ git clone https://invent.kde.org/utilities/krusader
$ cd krusader

You'll land on the 'master' branch that has the latest development updates and features but potentially could have regressions.
If you'd like switch to the 'stable' branch, which contains backported bug fixes on top of the latest release, run
$ git checkout -b stable origin/stable

You can also use one of the released snapshots available at https://download.kde.org/stable/krusader/.
Besides the source code, the snapshots contain translations.
Unpack the archive with:
$ tar -xvf krusader-x.y.z.tar.xz
$ mv krusader-x.y.z krusader
$ cd krusader


--- Build configuration

These are some CMake options that can be used, it's not necessary to use
them all (later there's an example):

-DCMAKE_INSTALL_PREFIX=/usr
  is the location where Krusader will be installed with the make command.
  Another example is: -DCMAKE_INSTALL_PRFIX=/opt/krusader
  to install the compiled Krusader in an other directory to not overwrite
  the Krusader version installed by your package manager.

-DCMAKE_CXX_FLAGS="-O2 -fPIC"
  this flag is required if you have a 64 bit system

-DQT_PLUGIN_INSTALL_DIR=
  many system force this path to keep kde4 plugins separated from the kde5 ones

-DKDESU_PATH=/foo/bar/kdesu
  this needs to be set on distributions that override default kdesu installation
  path (libexec/kf5/kdesu) or if your install prefix doesn't match KDE's.

-DENABLE_SYNCHRONIZER=OFF
  disables building the Synchronizer module. This module caused data loss, now
  it is fixed, but we treat it as the thin ice.

Example steps to configure the build:
$ cd ..
$ ls krusader/app/main.cpp || echo "Incorrect starting dir"
$ mkdir krusader-build
$ cd krusader-build
$ cmake ../krusader -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_C_FLAGS="-O2 -fPIC" -DCMAKE_CXX_FLAGS="-O2 -fPIC"

Note: An example of an output of cmake can be seen in https://invent.kde.org/utilities/krusader/snippets/1024

Note: If Krusader is going to be built under the 16.04 LTS version of Ubuntu (or Kubuntu, etc.) then
installing Qt 5.9 (or newer) is needed (it could be downloaded from https://www.qt.io/offline-installers) and
the aforementioned cmake command would need (at its end) an additional argument like:
    -DCMAKE_PREFIX_PATH=/opt/Qt/5.9/gcc_64/
if e.g. Qt 5.9 was installed inside /opt


--- Compilation and installation

Execute:
# Note: On a multi cpu/core system you might want to speed up the compile process by increasing the number of jobs (e.g. `make -j4`)
$ make

# At the beginning of the following command: `sudo` must be added if Kubuntu, Ubuntu, Debian, or similar is being used
$ su -c "make install"

Note: An example of an output of make can be seen in https://invent.kde.org/utilities/krusader/snippets/1025


--- To achieve that Krusader uses another language

There is a list of translation files in the [10n.kde.org Krusader page](https://l10n.kde.org/stats/gui/trunk-kf5/po/krusader.po/index.html).
In that list anyone can look for his desired translation file, hover the mouse cursor over its link, see its tooltip to look up the
appropriate LANGUAGE_CODE (which is shown between parentheses, e.g. if on the tooltip it's seen "German (de)" that means that
LANGUAGE_CODE is: de), click on the link (in order to download the proper krusader.po file), and execute:

    # Transform the downloaded file
    msgfmt krusader.po -o krusader.mo

    # At the beginning of the following command: `sudo` must be added if Kubuntu, Ubuntu, Debian, or similar is being used.
    # In the following command, the text XXXXXXX must be replaced by the LANGUAGE_CODE that was previously found
    su -c "cp -a krusader.mo /usr/share/locale/XXXXXXX/LC_MESSAGES/"

Note: If, in the future, someone would need to automate the downloading of a krusader.po file, he could use:
    # In the following command, the text XXXXXXX must be replaced by the LANGUAGE_CODE that was previously found
    $ wget -U "Mozilla/5.0" https://websvn.kde.org/*checkout*/trunk/l10n-kf5/XXXXXXX/messages/extragear-utils/krusader.po


--- Execution

Finally, Krusader can be executed this way:
$ krusader


--- Uninstall

# At the beginning of the following command: `sudo` must be added if Kubuntu, Ubuntu, Debian, or similar is being used
$ su -c "make uninstall"
