
Debian package installation:
============================
GKrellM is in the Debian archives, you can install using apt-get:

  apt-get update
  apt-get install gkrellm


Installation from source:
=========================
First untar the tarball:
------------------------
  tar -xvjf gkrellm-X.Y.Z.tar.bz2
  cd gkrellm-X.Y.Z

Next compile and install GKrellM for your target system.
BSD systems need to use gmake (GNU make) instead of the BSD make.
See below for custom gkrellmd server installs and for installs
into specific directories.
--------------------------------------------------------

Linux
-----
  make
  make install


FreeBSD
-----------
  gmake freebsd
  gmake install_freebsd


NetBSD 2.X, 3.X and later
---------------------------------
  make netbsd2
  make install_netbsd


NetBSD 1.5 - 1.6.X
---------------------------------
  make netbsd1
  make install_netbsd


OpenBSD
---------------------------------
  make openbsd
  make install_openbsd

Note: install_openbsd makes gkrellm setgid kmem so it can be run non-root, ie:
  chgrp kmem /usr/local/bin/gkrellm
  chmod g+sx /usr/local/bin/gkrellm


Solaris 2.x (8 tested so far)
-----------------------------
  make solaris
  make install_solaris

Note: install_solaris makes gkrellm setgid sys so it can be run non-root, ie:
  chgrp sys /usr/local/bin/gkrellm
  chmod g+s /usr/local/bin/gkrellm
  (see below for additional Solaris install notes)


Windows (needs Windows XP or newer)
---------------------------------------
  make windows
  make PREFIX=C:\gkrellm install_windows

See:
  http://www.srcbox.net/projects/gkrellm/

Needed software for building gkrellm on win32 systems:
  - MinGW
  - MSYS (gkrellm makefiles are NOT compatible with cmd.exe)
  - GTK >= 2.24 Development files (see http://www.gtk.org/download-windows.html)
  - OpenSSL or GnuTLS (optional)
  - libntlm (optional)

Note: Installing gkrellm on windows needs INSTALLROOT set, the default path
      (/usr/local) probably won't work


BSD make Problems
-----------------
On BSD systems, errors like:
    "Makefile", line 21: Missing dependency operator
result from using BSD make.  You need to use gmake.

If you get the error:
    ld: invalid command option `-E'
re-run the make without any link flags, eg:
    gmake openbsd LINK_FLAGS=


==========================================================================
Customizing the install directory locations
-------------------------------------------
The default install ends up under /usr/local, and this is the default directory
install tree:

/usr/local                         installation root
          /bin/                    both gkrellm and gkrellmd
          /etc/                    gkrellmd default configuration
          /include/gkrellm2/       development include files
          /lib/pkgconfig/          gkrellm.pc
          /lib/systemd/system/     gkrellmd systemd service unit
          /share/applications/     gkrellm.desktop
          /share/icons/hicolor/XX/apps/  gkrellm application icon (XX is 16x16, 32x32, ...)
          /share/locale/XX/        LC_MESSAGES/gkrellm.mo (XX is cs, de, ...)
          /share/man/man1/         gkrellm.1 and gkrellmd.1
          /share/metainfo/         gkrellm AppStream MetaInfo

The installation root and/or individual install directory locations can be
controlled via the following make variables:

- PREFIX: installation root
- ICONDIR: path for application icons (default: PREFIX/share/icons)
- INCLUDEDIR: development include files (default: PREFIX/include)
- INSTALLDIR: prefix for gkrellm binary (default: PREFIX/bin)
- LOCALEDIR: path for compiled i18n files (default: PREFIX/share/locale)
- MANDIR: path for gkrellm manual (default: PREFIX/share/man/man1)
- MANSECTION: man-page section for gkrellm manual (default: 1, also applies to default MANDIR path)
- MENUDIR: path for desktop file (default: PREFIX/share/applications)
- METAINFODIR: path for AppStream MetaInfo file (default: PREFIX/share/metainfo)
- PKGCONFIGDIR: path for pkg-config development file (default: PREFIX/lib/pkgconfig)
- SINSTALLDIR: path for gkrellmd binary (default: PREFIX/bin)
- SMANDIR: path for gkrellmd manual (default: PREFIX/share/man/man1)
- SMANSECTION: man-page section for gkrellmd manual (default: 1, also applies to default SMANDIR path)

For package maintainers the make rules support a PREFIX and DESTDIR variable
to construct the effective installation prefix.

For example to install everything under /usr and put the server into the sbin
directory instead of the default bin directory:

    make all PREFIX=/usr SBINDIR=/usr/sbin

During packaging the installation can be installed into a staging area by
setting DESTDIR in addition to the previous variables:

    make install DESTDIR=/tmp/packaging PREFIX=/usr SBINDIR=/usr/sbin

The install of i18n translation files is additionally sensitive to the
environment variable LOCALEDIR if it set.  A command line LOCALEDIR takes
precedence over an environment variable LOCALEDIR. See the po/README file
for examples.  Also, the install of translation files may be omitted with:

    make install enable_nls=0


==========================================================================
Custom gkrellmd server installs:
--------------------------------
If the target server has glib installed but no gtk or Xlibs, then gkrellmd
may be built on the target server by working in the gkrellmd server
directory:

    cd gkrellm-2.x.y/server
    make
    make install

If not on Linux, remember to specify a make target as for a top level
make.  That is, use "gmake freebsd", etc and "gmake install_freebsd", etc.
This installs gkrellmd into /usr/local/bin and gkrellmd.1 into
/usr/local/share/man/man1, but if you want to install somewhere else,
do for example:

    make PREFIX=/usr SMANSECTION=8 SINSTALLDIR=/usr/sbin install


==========================================================================
Other make flags:
-----------------

The following flags can be provided to "make" to further configure some build
types:

- "debug=1" enables debug symbols (disabled by default)
- "enable_nls=0" disables i18n/nls support (enabled by default)
- "optimize=0" disables code optimization (enabled by default)
- "profile=1" enables debug symbols & profiling (disabled by default)


==========================================================================
==========================================================================
Solaris install notes:
----------------------
Tested to be built as 32bit application with gcc on UltraSPARC only.
It should work on both 32bit and 64bit kernel. The Solaris port currently
utilizes kvm to get a value for proc.n_forks. It imposes a few restrictions:

1) gkrellm for Solaris should be setgid sys as mentioned above.

2) On Solaris, 32bit binary of gkrellm cannot run on 64bit kernel while
   maintaining its full functionality and vice versa.

   a) It cannot acquire "number of forks" on a different data model of
      the kernel image from its own origin (i.e. binary incompatibility
      between 32bit and 64bit). This is caused by restriction of kvm just
      as mentioned above. For more details, refer to kvm_open(3kvm).
   b) Since a single driver called 'sd' takes control over both hard drives
      and cdroms, "Disks" monitor includes not just i/o activity of hard
      drives but of CDROM or CD-RW's. I don't like this, so a function
      called isharddisk() is implemented in order to exclude i/o activity
      of removable media. If you don't use "composite disk" for monitoring
      and pick drives of your interest, this wouldn't bother you anyway.

   Failure of these functions is silently ignored and it proceeds without
   the failed functionalities. Separate executable should be built for each
   data models (32bit and 64bit kernel) to enjoy full functionality
   including ones described above.

Functionalities not supported currently are: Battery, CPU/Motherboard
sensor, Net Timer (PPP) and swap in/out chart.
