20 Debian Packaging Hackathon
luisibanez edited this page 2012-06-13 14:00:29 -07:00

This page summarizes the status of the Debian Packaging of fis-gtm.

We will use this page as a working document for an hackathon on June 13th 2012.

Overview

The goal of this project is to create a fis-gtm package for the Debian Linux distribution.

Approach

Dependencies

fis-gtm is written in C, and at configuration time it uses the GTM compiler to generate additional C files. Due to this configuration process, a gtm compiler turns out to be needed in order to build the gtm compiler, creating a circular dependency.

In order to break this circular dependency, we:

  • ran the initial part of the fis-gtm configuration
  • captured the C files that were generated
  • put them in a subdirectory
  • put the original C files and the generated files in a repository

The resulting set of original C files plus the newly generated C files becomes then a C-only project that only needs the GCC compiler to be built.

The repository that combines these C-only source files is:

https://github.com/luisibanez/fis-gtm

The generated C files are in the branch: "cmakeifiedv55"

https://github.com/luisibanez/fis-gtm/tree/cmakeifiedv55

in the subdirectory: "fis-gtm-src-extras"

https://github.com/luisibanez/fis-gtm/tree/cmakeifiedv55/fis-gtm-src-extras

Debian Packaging

fisglobal and the Debian community have work together on packaging fis-gtm for several years.

In 2011, Andreas Tille started a mentoring initiative (MoM)(http://wiki.debian.org/DebianMed/MoM) to educate new packagers and due to common interests fis-gtm was picked as pilot project for the initiative.

The files needed to creating the fis-gtm are all in the SVN repository:

svn+ssh://svn.debian.org/svn/debian-med/trunk/packages/fis-gtm

It has three main sub-directories:

  1. fis-gtm
  2. fis-gtm-initial
  3. fis-gtm-server

The last two are now deprecated. They were created as an attempt to solve the bootstrapping circularity that requires a GTM compiler to build the GTM compiler.

For the rest of this document we will only need the "fis-gtm" directory, where the packaging has been configured based on the source code tree where C generated files have been combined with the original files.

To be more explicit, we will only focus now on

svn+ssh://svn.debian.org/svn/debian-med/trunk/packages/fis-gtm

Debian Files

get-orig-source

This file describes how the source code of the fis-gtm package will be obtained.

It is essentially a four steps process

  1. Obtain fis-gtm 5.5 source tarball from sourceforge http://sourceforge.net/projects/fis-gtm/files/GT.M-x86-Linux-src/

  2. Obtain fis-gtm C generated files from Kitware file server (temporary method) http://public.kitware.com/pub/itk/OSEHRA , more specifically the tarball: gtm_V55000_linux_i686_src_extras.tar.gz

  3. Expand both tarballs

  4. Repackage into a single tarball:

Currently, this is all nicely configured to grab the most recent version of fis-gtm, which is 5.5.

NOTE: Some recent security fixes has been applied to fis-gtm in version 5.5, but have not been ported yet to the github repository. This probably should be one of the first tasks of the hackathon on June 13.

The hosting of files at Kitware must be replaced with a more secured mechanism. For example, by fisglobal generating these files again, and posting them as an additional tarball in sourceforge. In this way, the integrity of the code can better be ensured by the upstream development team.

rules

The "rules" file is the core of how we instruct the Debian build system to configure, build and install fis-gtm.

The current process is sketched as:

  1. Use uscan to get the source code as defined in the get-orig-source file.
  2. Copy the extra (C generated files) in to the common source tree
  3. Run CMake to configure the whole
  4. Make

Some of these rules are implicit, and therefore the "rules" file only has to define the parts of the process that differ from a standard typical Debian build process.

Building the Package

We have been doing this in a Virtual Machine with Debian Testing installed.

The current recipe to build in this VM is the following

  • cd /home/ibanez/src/debian-med/trunk/packages/fis-gtm/fis-gtm/trunk
  • make -f debian/rules get-orig-source
  • cd ..
  • cp tarballs/fis-gtm_5.5-000.orig.tar.gz .
  • tar -xzf *orig.tar.gz
  • cp -a trunk/debian/ fis-gtm-5.5-000/
  • cd fis-gtm-5.5-000/
  • make -f debian/rules
  • make

CMake-ification

fis-gtm is currently configured by using a tcsh script that fully controls the process of architecture customization, configuration, building and installation.

Why CMakeify ?

The Debian build process attempts to build the package for many architectures. In order to support multiple architectures, fis-gtm carries in its source code multiple versions (ports) of certain C files, that have been customized to specific architectures. The current architectural configuration of fis-gtm manipulates the order in which the C header files are located, in order to ensure that the ones belonging to the proper architecture are visited first.

Among the methods used for enforcing the order in which the heardes are found, the tcsh scripts that builds fis-gtm uses the (now deprecated) GCC option "-I-".

When confronted with the challenge of adjusting this configuration process to many platforms we choose to rewrite the fis-gtm configuration using CMake. This, is admitedly, a biased choice based on our familiarity with CMake. We think that the CMake-ification will also bring additional advantages, such as the ability to build fis-gtm in MacOS and MinGW.

How

The process of CMake-ification requires simply to add CMakeLists.txt files to the subdirectories of fis-gtm, and henceforth it can be done without disturbing, nor having to replace the curreent fis-gtm configuration and build system.

Currently the CMakeLists.txt files are placed in the github repository, see, for example:

https://github.com/luisibanez/fis-gtm/blob/cmakeifiedv55/sr_i386/CMakeLists.txt

Hackathon Agenda

The proposed agenda for the hackathon is:

  1. Fork and clone the fis-gtm repository in github
  2. Apply most recent 5.5 security updates to the fis-gtm github tree
  3. Regenerate the C files and review them with the upstream team
  4. Review the correctness of the current CMake configuration
    1. Libraries
    1. Executables
  5. Script in CMake the subsequent configuration steps of fis-gtm
  6. Script in CMake the installation steps of fis-gtm
  7. Encode the above in the Debian svn repository
  8. Cross check with Debian mentors on the correctness of the system
  9. Test, Test, Test.

Pending Tasks to Solve After the Hackathon

Upstream Team

  1. README and COPYING files have executable permissions.

Debian Packaging Team

  1. Manage Release Notes - probably as a XML file with the sources of the HTML release notes that are now in the fis web site