The mapping is found in the */Makefile.pkg file, in the DEB_PKG
variable, such as

DEB_PKG="pf-xivo-monitoring"

There are two sets of directories : the software imported from a third
party (asterisk, for instance) and the software developped natively.The
source tarbal of a native package is created from a tar of the
directory, not including the directory name. For instance, the
pf-xivo-cti-server
tarbal
contains:

The source tarbal of a third party package is created with a tar of the
patches and tarballs directories alone. The rest of the files are
used during the development cycle ( such as asterisk/fetch_tarball.sh
to synchronize with the asterisk upstream ) and are out of the scope of
this discussion. For instance, the content of the dahdi-linux
tarbal
is as follows:

None of the source directories contain version numbers. A convention
involving a SVN version number (a SVN repository is used behind the GIT)
and the content of the VERSION file (1.2 for skaro) is used to
generate a version (such as the 1.2~svn10330 part of
dahdi-linux_2.4.1.0+dfsg+pf.xivo.1.2~svn10330.orig.tar.gz). A simpler
convention is being
discussed
to cope with two issues:

the SVN version is not available to the general public

the global version number (1.2 for skaro) is redundant and could be
ignored

The directory tools is not a package. It contains files shared and
duplicated in some native packages. For instance gwr.py:

In order to ensure the inclusion of the file itself when the tarbal is
created, the -h is used to store the content of the symbolic link
instead of the symbolic link itself.Some sources, such as libpri are
unmodified ports of the standard package and do not require special
handling.

Debian package SVN structure

The Debian GNU/Linux package are stored in an internal SVN and its
publication is being
discussed.
The information can be retrieved from the source packages but the
history is lost to the general public. The SVN tree is structured using
a path named after the XiVO version and the Debian GNU/Linux version it
is based on. For instance:

package=asterisk
suite=squeeze
xivo=skaro
means the packaging information will be found in
packages/branches/official/${suite}-xivo-${xivo}/${package}/trunk/debian

If the version found in debian/changelog does not reflect the source
version number (for instance 2.4.1.0+dfsg+pf.xivo.1.2\~svn10330 in the
chapter above), a new changelog entry will be created to match it. When
this sanity check is done (and assuming the source tarbal is available
in the upper directory), the source package can be created with:

dpkg-buildpackage -S -uc -us

Although most packages contain a
debian/control.in
file, the corresponding debian/control is commited to in the SVN
repository. The CDBS documentation suggests it is not a mature feature
and it could probably be ignored. The newer debhelper version
7 could prefered to
CDBS in the future.