Please replace PKG with gnatcoll as this documentation is shared by most
Adacore packages.

Three versioning schemes are involved.
* Commercial non GPL releases are numbered MAJOR.MINOR on Adacore
  website.
* Development builds between MAJOR.MINOR and NEXTMAJOR.NEXTMINOR
  releases are numbered NEXTMAJOR.NEXTMINORw (w as wavefront).
* Every year, a tarball is distributed on http://libre.adacore.com
  with the current year as version number, and every header stripped
  from the paragraph granting the GCC Runtime Library Exception.
* Each Debian package is based on a GPL release, but numbered
  MAJOR.MINOR.YEAR in order to ease comparison with other versions.

Upstream history is visible on GitHub at https://github.com/AdaCore/PKG.
The version number is always visible in first line of ./configure.in.
Each commercial release is tagged PKG-MAJOR.MINOR.
Each GPL release is prepared in a branch named gpl-$YEAR.

When packaging a new version for Debian:
choose a version according to the git history,
then rename the symlink or the repackaged archive accordingly.
# uscan
# mv ../PKG_YEAR.orig.tar.xz ../PKG_MAJOR.MINOR.YEAR.orig.tar.xz

Use of the version control system
---------------------------------

You may either create an empty Monotone database
# mtn -d $db db init
or use an existing one.

A branch tracks the unpatched repackaged upstream archives, another
adds the debian/ subdirectory.
# upstream_branch=com.adacore.libgnatcoll
# debian_branch=org.debian.libgnatcoll

Download the two branches from the server to your database.  The first
time you contact this server, monotone will show its key. You should
check that it matches f8a11727e8983cf9083c08c6a2acaa27e439dd39.
# server=www.ada-france.org
# mtn -d $db pull mtn://$server?$upstream_branch
# mtn -d $db pull mtn://$server?$debian_branch

Create a workspace with the head of debian branch.
# mtn -d $db checkout -r h:$debian_branch libgnatcoll
# cd libgnatcoll

Recreate the orig archive from a tag in upstream branch.
# mtn checkout -r t:libgnatcoll-1.6gpl2014 kilroy
# tar caf ../libgnatcoll_1.6gpl2014.orig.tar.xz kilroy --exclude=_MTN
# rm -fr kilroy

Build the package
# debuild

Beware that:
- mtn status does not list all changes. Try "mtn list missing", "mtn
  list unknown", "mtn list ignored" and "mtn status" to get the
  equivalent of "git status".
- Monotone will detect changes outside debian/ caused by patches.
  Always "quilt pop -a" when preparing a commit.

 -- Nicolas Boulenguez <nicolas@debian.org>, Sun,  9 Jul 2017 17:25:01 +0200
