NAME
dh_gentdeb - build debian TDeb translation packages
SYNOPSIS
dh_gentdeb [debhelper options]
DESCRIPTION
dh_gentdeb prepares localisation content for a debian Tdeb package.
Only the -p debhelper option is handled by dh_gentdeb, if none is
specified the TDeb package name will be ’$sourcepackage-tdeb’.
DESCRIPTION
dh_gentdeb is a debhelper add-on created by Emdebian to create
translation packages (tdebs). dh_gentdeb is intended to separate out
the individual translation files from the current Debian packages into
packages without any translation files and a single TDeb package, one
per source package.
Generated packages use the syntax:
$srcpackage-tdeb_$version_all.tdeb
If a second tdeb is supported by one source package, the
$srcpackage-tdeb package must contain any debconf templates used by any
of the binary packages. The second tdeb is then used for translations
of optional content.
(Note that Debian TDebs are architecture-independent, Emdebian TDebs
are architecture-dependent.)
Once a package uses dh_gentdeb, translation files must be removed from
all packages in the normal build. This includes all translated manpages
and other translated content. Original, untranslated, content should
remain.
dh_gentdeb runs as a part of the normal package build - simply add the
call to the binary-indep target of debian/rules, usually after
dh_install and before dh_builddeb. dh_gentdeb handles locating the
relevant files, a .install file is not normally necessary.
Support for a tdeb diff1.gz will be added as dh_gentdeb develops. The
extra diff is used by translators to build updated or new tdeb
packages. Tdeb packages depend on the source:Version of the mainpackage
but no packages may depend upon the tdeb. (Not even other TDebs). The
mainpackage can be specified using the -p option.
Use of diff1.gz should remove the need to create a customised source
with a debian/rules stub etc. by allowing Emdebian TDebs to be created
during an Emdebian build and Debian TDebs in a Debian build.
Translators would then be able to use:
$ apt-get source $package
$ cd $package-$version/
$ poedit po/$lang.po
To build the package, either dh_gentdeb can behave as em_installtdeb
does now and run a build only of the TDeb components or dpkg-
buildpackage could gain an option to only process the TDeb.
dh_gentdeb currently only supports gettext translation.
The locale package must use GETTEXT_PACKAGE for the eventual filename
of the binary translation file - although this may be the same as the
$dh{MAINPACKAGE}. GETTEXT_PACKAGE is determined by upstream, not
Debian. When building the whole package, the binary translation file
may be in debian/tmp/usr/share/locale/$lang/LC_MESSAGES but when in
translator mode, this location is not available. Instead retrieve
GETTEXT_PACKAGE from the POT filename, the Makefile GETTEXT_PACKAGE
macro or if that is not set, use the upstream source package name. This
may need extending.
Some packages use multiple po directories and dh_gentdeb checks for a
POT file in all usable po directories, including within the tdeb
source, along with all po files: e.g.
po/fr.po
po-lib/fr.po
po/application.pot
po-lib/library.pot
When packaged, the Debian tdeb built from this source would contain:
./fr/usr/share/locale/fr/LC_MESSAGES/application.mo
./de/usr/share/locale/de/LC_MESSAGES/application.mo
./fr/usr/share/locale/fr/LC_MESSAGES/library.mo
./de/usr/share/locale/de/LC_MESSAGES/library.mo
For more detail on Tdebs, see:
<http://www.emdebian.org/emdebian/langupdate.html>
<http://wiki.debian.org/i18n/TranslationDebs>
Note that the Debian implementation of tdebs differs from the tdebs for
Emdebian because Emdebian does not care about manpages in general, let
alone translated manpages. Once the ’nodocs’ DEB_BUILD_OPTION is
supported in debhelper, this will not be an issue as the tdebs can be
built for Emdebian without any manpages. Other translated documentation
would be omitted under ’nodocs’ too. Images containing translated text
are relatively few.
OPTIONS
The default action is to process all available po files and all
identifiable translated content.
Debconf Templates
Packages may need to rename the templates file for the template file
and change the reference in debian/po/POTFILES.in to the new file. This
results in a lintian warning:
Now running lintian...
W: dpkg-cross: no-debconf-templates
Finished running lintian.
The package probably now needs to Pre-Depend on the TDeb.
Alternatively either dpkg or debconf should automatically install a
TDeb prior to trying to configure the main package.
Templates files are the most common reason for l10n rebuilds of
packages prior to a release.
SEE ALSO
debhelper (7)
This program is based on debhelper.
AUTHOR
Neil Williams <codehelp@debian.org>
Copyright and Licence
Copyright (C) 2007-2008 Neil Williams <codehelp@debian.org>
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Use in Debian
generate_source will be removed before inclusion into Debian.
At the same time, XC-Package-Type: tdeb needs support too. Notably,
many of the scripts in the devscripts package fail to identify the TDeb
in the .changes file and certain debhelper scripts fail to handle the
TDeb package-type.
reprepro needs a patch to accept .tdeb and allow .tdeb in the
repository files:
$ reprepro --ignore=extension -b /path/ includedeb \
unstable ../qof-locale-sv_0.7.5-1em1_arm.tdeb
$ ls /opt/reprepro/locale/pool/main/q/qof/
qof-locale-sv_0.7.5-1em1_arm.deb
Filename: pool/main/q/qof/qof-locale-sv_0.7.5-1em1_arm.deb
Description: sv translation for qof (tdeb)
reprepro also needs a way to handle a .tdeb in a .changes file.
reprepro -b /opt/reprepro/locale/ include unstable
../qof_0.7.5-1em1_arm.changes
’qof-locale-id_0.7.5-1em1_arm.tdeb’ is not .deb or .udeb!
There have been errors!
Other translations
Packages may also contain translated manpages and translations for
debconf templates. These translations are not yet packaged or processed
by dpkg-gentdeb. For Tdebs to be supported in Debian, these issues will
need to be resolved such that Emdebian can continue to only package the
gettext program translations, omitting translated manpages and leaving
debconf translation support to existing tools or implement sufficient
changes in cdebconf.