# AppImage

This page describes building of AppImage binary package.

The building process is easy: download the required software and run `appimage.sh` script.

## The script

The shell script

- `dist/appimage.sh`

in Munipack source tree is AppImage packager.

## Prerequisites

The software listed below is mandatory for building:

- Fortran 95 and C++ compilers
- GTK3 development libraries
- Both make and cmake
- fuse (why?)

All the requirements are available in any good Linux distribution.

## AppImage tools

The main utility appimagetool is left unused. The packaging itself is provided by

- linuxdeploy (download) having
- module for GTK (download).

In the terminology of AppImage, Munipack is build by Manual way into the standard directory tree by AppDir specification.

## Source packages

These packages are required to build AppImage for Munipack:

- Munipack
- Oakleaf
- cFITSIO
- PLPLot
- Minpack, available in Debian's source package as .tar.gz
- wxWidgets

## Directory structure

The building script `dist/appimage.sh` requires the set of source packages collected into a directory. The tree structure as it will be referenced below:

        appimage/
           bin/
           src/

`appimage/src/` is the place where `linuxdeploy-x86_64.AppImage` and `linuxdeploy-plugin-gtk.sh` are available.

`appimage/src/` is the place where the source packages are collected.

## Building

The previous steps guaranties to be all requisites are ready. Now, it's the moment of truth:

      $ APPDIR=/path/to/appimage/
      $ MUNIPACK=/path/to/munipack-X.Y.Z/
      $ PATH=$PATH:$APPDIR/bin sh $MUNIPACK/dist/appimage.sh $APPDIR/src/

If the building process is successful, a new package does appear in the current working directory. Be patient, it take a while.

## Usage

A simple launch (by hand in terminal or by click of an icon in a file manager) invokes `xmunipack` by default.

Munipack's command line interface `munipack` is activated by making the link:

        $ ln -s Munipack-x86_64.AppImage munipack

It is base on the trick representing `argv[0]` as the current executable file name.

## See Also

Installation.