Munipack's logo

DEB binary package

This page describes canonical way of building of a binary package for DEB-based distributions (Ubuntu, Mint, Debian). The quick and easy preparation of portable packages for different architectures is the expected purpose.

A review of building of DEB packages is described in detail by New Maintainers' Guide. Munipack package has been prepared on base of AstropyPackagingTutorial. The tutorial contains instructions how a software can be cloned, modified, patched and re-build.

Debian GIT Repository

Debian project maintains own repositories for packages. Every package, as well as Munipack, has three branches: upstream (meaning the source code of a project itself), master (Debian specific files under debian/ directory) and pristine-tar (with an original archive). The files specific to Debian should be independent on the original archive ones.

Mercurial Repositories

The separation of Debian specific and original project files is reflected also in structure of my development Mercurial repositories:

Munipack-debian repository contains a script and Debian control files needs for building of development branch packages.

Prerequisites

Tools listed below are required for the building:

All the tools are included in any standard distributions.

We will install Mercurial (execute the command under root account or use sudo) as the initial step:

  # apt-get install mercurial

Getting Copy of Munipack-Debian

As a next step, we need a clone of munipack-debian repository (Munipack itself will be cloned later in a script). The task can be done under a regular user accout:

  $ hg clone http://munipack.physics.muni.cz/hg/munipack-debian

A crucial matter for building is a script file munipack-debian/munipack_hg.sh. It will be made all for us.

Once before building, required software tools defined in munipack-debian/debian/control should to by presented:

  $ grep Build-Depends munipack-debian/debian/control
  Build-Depends: debhelper (>= 9), dh-autoreconf, gfortran, g++ (>=4.7), libcfitsio-dev, libwxgtk3.0-dev, minpack-dev

All the required, or any missing, utilities can be installed as:

# apt-get install gfortran g++ libwxgtk3.0-dev libcfitsio3-dev debhelper dh-autoreconf, minpack-dev

Build of DEB Packages

The previous steps garanties to be all prerequisites available. Now, it's the moment of truth:

  $ bash -x munipack-debian/munipack_hg.sh

If the building process is successful, new packages does appear (see examples below) in the current working directory:

  $ ls
munipack/                             munipack-doc_0.5.7+hg1500_all.deb
munipack-0.5.7+hg1500/                munipack-gui_0.5.7+hg1500_amd64.deb
munipack-0.5.7+hg1500.tar.gz          munipack_0.5.7+hg1500.dsc
munipack-cli_0.5.7+hg1500_amd64.deb   munipack_0.5.7+hg1500.tar.xz
munipack-core_0.5.7+hg1500_amd64.deb  munipack_0.5.7+hg1500_amd64.changes
munipack-debian/                      munipack_0.5.7+hg1500_amd64.deb

Installation of DEB Packages

The packages can be installed as:

  # dpkg -i munipack_*.deb munipack-gui_*.deb munipack-doc_*.deb \
            munipack-core_*.deb munipack-cli_*.deb

Or, they can be uninstalled analogically:

  dpkg -r munipack munipack-gui munipack-doc munipack-core munipack-cli

Personal Distribution Repository

This section illustrates how a Munipack own repository can be established. The repository is served via a HTTP server. Lets the directory is REPDIR which means a path in a HTTP server directory tree structure. find does copy of files of the current work directory to REPDIR (consider removing of older files). The list of packages for apt is created by scanning of packages (the commands are included in dpkg-dev):

  # apt-get install dpkg-dev
  # cd [work directory]
  # REPDIR=/home/www/...../jessie
  # find . -maxdepth 1 -type f -name 'munipack*.*' -exec cp '{}' $REPDIR ';'
  # cd ${REPDIR}/..
  # dpkg-scanpackages -m jessie > jessie/Packages
  # dpkg-scansources jessie > jessie/Sources

To use the repository, add record to /etc/apt/sources.list, update sources and install Munipack:

  # echo "# Munipack" >> /etc/apt/sources.list
  # echo "deb http://localhost/path jessie/" >> /etc/apt/sources.list
  # apt-get update
  # apt-get install munipack

More detailed description can be found in Debian Repository HOWTO.

See Also

Installation, DEB bundle builder.