Git buildpackage Rectification

GitHub|GitHub

At the moment this page is just a log of my first Debian package builded for ArcheOS using. Thanks to ORNis for his teaching, I've built a Rectification .deb package. Rectification is an abandoned module from e-foto photogrammetry suit. A complete tutorial will follow.

Packaging workflow
"If you are making a Debian package with an upstream program, the typical workflow of Debian package building involves generating several specifically named files for each step as follows."


 * Get a copy of the upstream software, cloning the source code with . You may need to adjust package name and upstream version by renaming the upstream source to follow Debian Policy and existing convention.
 * package-version


 * Create a non-native source package in 3.0 (quilt) format with.
 * package_version.orig.tar.gz: the original upstream source code tarball.


 * And add Debian-specific packaging modifications to the upstream program under the debian directory.


 * Init a Git repository with:
 * master branch holds the current development work
 * upstream branch holds the upstream releases
 * pristine-tar branch holds the necessary additional information to recreate the original tarball from the upstream-branch
 * debian/version tags for each upload


 * Build with  the Debian binary packages, which are ordinary installable package files in .deb format.
 * package_version-revision_arch.deb: the completed binary package.
 * package_version-revision.debian.tar.gz: tarball with the debian changes.
 * package_version-revision.dsc: a summary of the contents of the source code.


 * Test the package with


 * Upload the package

Install
"Before you start anything, you should make sure that you have properly installed some additional packages needed for development. [...] The most important package to install on your development system is the build-essential package. Once you try to install that, it will pull in other packages required to have a basic build environment. [...] However, there is another set of packages that while not essential for all package builds are useful to have installed or may be required by your package:"

Config
Set up.

Edit the file ~/.gbp.conf.

"Configure to use pristine-tar. Pristine-tar allows you to store the upstream tarball directly in Git in an extremely space-efficient way, which means that the Git repository is then all you need to build a Debian package."

[DEFAULT] builder = git-pbuilder cleaner = fakeroot debian/rules clean pristine-tar = True

[git-buildpackage] export-dir = ../build-area/ builder = /usr/bin/git-pbuilder -sa dist = wheezy pbuilder = True
 * 1) tarball-dir = ../tarballs/

[git-import-orig] filter = .git filter = .gitignore
 * 1) filter = .svn
 * 2) filter = .hg

Prepare the development environment
To create a work environment for ArcheOS development work:

To create the necessary cowbuilder chroot for Wheezy use:

Make
You should see some output asking you what sort of package you want to create.This execution of  creates a copy of the upstream tarball as rectification_1.2.orig.tar.gz in the parent directory and many template files are created in the source under the debian directory.

Done. Please edit the files in the debian/ subdirectory now. You should also check that the rectification Makefiles install into $DESTDIR and not in /.

Add Debian-specific packaging modifications
Now you will need to modify the upstream source for Debian.

Edit the files in debian/ directory. control, changelog, copyright, and rules are required for all packages. If you accidentally erased some template files while working on them, you can recover them by running  with the   option again in a Debian package source tree.

Import the original tarball in upstream branch
What will be the source package name? [rectification] What is the upstream version? [1.2]

Edit control

 * 

This file contains various values which dpkg, dselect, apt-get, apt-cache, aptitude, and other package management tools will use to manage the package.

Source: rectification Section: graphics Priority: extra Maintainer: Domenico Giusti  Build-Depends: debhelper (>= 9.0.0), libqt4-dev (>=4.8.0) Standards-Version: 3.9.4.0 Homepage: http://www.efoto.eng.uerj.br/ Vcs-Git: git://github.com/dncgst/rectification-archeos.git Vcs-Browser: https://github.com/dncgst/rectification-archeos.git

Package: rectification Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: ArcheOS rectification module from e-foto photogrammetry suite. Rectification is a module from e-foto photogrammetry suite. Rectification aims to make the correction of a digital photographic image originally distorted, projecting it onto a horizontal plane through geometric transformations.

Edit copyright

 * 

This file contains information about the copyright and license of the upstream sources. can give you a template copyright file. You must fill in missing information to complete this file, such as the place you got the package from, the actual copyright notice, and the license.

Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: rectification Source: http://sourceforge.net/projects/e-foto/

Files: * Copyright: 2012 E-Foto Project  License: GPL-2.0+

Files: debian/* Copyright: 2013 Domenico Giusti  License: GPL-2.0+

License: GPL-2.0+ [...]

Edit changelog

 * 

Changes in the Debian version of the package should be briefly explained. This includes modifications made in the Debian package compared to the upstream one as well as other changes and updates to the package.

rectification (1.2-0archeos1) unstable; urgency=low

* Initial release (Closes: #nnnn) 

-- Domenico Giusti  Wed, 13 Mar 2013 21:33:18 +0100

Other files under the debian directory

 * 

Edit README.Debian
Documents any extra details or discrepancies between the original package and your Debian version. If you have nothing to be documented, remove this file.

Edit README.source
rectification for ArcheOS -

Rectification is an abandoned module from e-foto photogrammetry suite. Homepage: http://www.efoto.eng.uerj.br/ Upstream page: http://sourceforge.net/projects/e-foto/

Rectification has been packaged by Domenico Giusti for ArcheOS.

Edit compat
Defines the  compatibility level.

9

Edit debian/rectification.install
"Most third-party software installs itself in the /usr/local directory hierarchy. On Debian this is reserved for private use by the system administrator, so packages must not use directories such as /usr/local/bin but should instead use system directories such as /usr/bin, obeying the Filesystem Hierarchy Standard (FHS)."

rect /usr/bin

Edit menu
X Window System users usually have a window manager with a menu that can be customized to launch programs. If they have installed the Debian menu package, a set of menus for every program on the system will be created for them.

?package(rectification):needs="X11" section="Applications/Graphics"\ title="rectification" command="/usr/bin/rect"

Check errors and warnings
The  command runs many test scripts to check for many common packaging errors.

W: rectification: wrong-bug-number-in-closes l3:#nnnn W: rectification: binary-without-manpage usr/bin/rect

command error output:

QPixmap::fromMimeSource: Cannot find pixmap "images/identity.png" in the mime source factory QPixmap::fromMimeSource: Cannot find pixmap "images/limpar.png" in the mime source factory QPixmap::fromMimeSource: Cannot find pixmap "images/gnome-dev-floppy.png" in the mime source factory QPixmap::fromMimeSource: Cannot find pixmap "images/identity.png" in the mime source factory

Modifying the source

 * 

Description:   Author:  Origin: , :  Forwarded:  Applied-Upstream:  Last-Update:  --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/

Patches are applied incrementally on top of the base tree plus all preceding patches. They can be pushed on top of the stack (quilt push)

and popped off the stack  (quilt  pop)