| 1 |
codehelp |
16 |
[[meta title="DEP-4: Translation packages in Debian (TDebs)"]] |
| 2 |
codehelp |
14 |
|
| 3 |
|
|
Date: March 2008 |
| 4 |
|
|
Drivers: Neil Williams <codehelp@debian.org> |
| 5 |
|
|
Joerg Jaspert <joerg@debian.org> |
| 6 |
|
|
Thomas Viehmann <tv@beamnet.de> |
| 7 |
|
|
Mark Hymers <mhy@debian.org> |
| 8 |
|
|
Frank Lichtenheld <djpig@debian.org> |
| 9 |
codehelp |
49 |
URL: http://dep.debian.net/deps/dep4/ |
| 10 |
codehelp |
14 |
Abstract: This document provides an overview of the TDeb format, TDeb |
| 11 |
|
|
design and usage. This specification should be considered as a work in |
| 12 |
codehelp |
49 |
progress. |
| 13 |
codehelp |
50 |
Source: http://svn.debian.org/viewsvn/dep/web/deps/dep4.mdwn?view=markup |
| 14 |
|
|
Version 0.0.3 |
| 15 |
codehelp |
14 |
|
| 16 |
vorlon |
45 |
[[!toc levels=2]] |
| 17 |
|
|
|
| 18 |
|
|
--- |
| 19 |
|
|
|
| 20 |
codehelp |
14 |
# TDeb Specification |
| 21 |
vorlon |
45 |
|
| 22 |
codehelp |
14 |
--- |
| 23 |
|
|
|
| 24 |
|
|
This is where the Draft TDeb Specification, created at the ftp-master/i18n |
| 25 |
|
|
meeting in Extremadura, will be developed and improved. |
| 26 |
|
|
|
| 27 |
vorlon |
45 |
--- |
| 28 |
|
|
|
| 29 |
codehelp |
14 |
## Motivation |
| 30 |
vorlon |
45 |
|
| 31 |
codehelp |
14 |
--- |
| 32 |
|
|
|
| 33 |
|
|
1. Updates to translations should not require source NMU's. |
| 34 |
vorlon |
45 |
2. Translation data should not be distributed in architecture-dependent |
| 35 |
|
|
packages. |
| 36 |
|
|
3. Translators should have a common interface for getting updates into |
| 37 |
|
|
Debian (possibly with automated TDeb generation after i18n team review). |
| 38 |
codehelp |
14 |
|
| 39 |
codehelp |
15 |
## Copyright © 2008 |
| 40 |
|
|
|
| 41 |
|
|
* Neil Williams <email>codehelp@debian.org</email>, |
| 42 |
|
|
* Joerg Jaspert <email>joerg@debian.org</email>, |
| 43 |
|
|
* Thomas Viehmann <email>tv@beamnet.de</email>, |
| 44 |
|
|
* Mark Hymers <email>mhy@debian.org</email>, |
| 45 |
|
|
* Frank Lichtenheld <email>djpig@debian.org</email>, |
| 46 |
|
|
* partially based on dpkg man pages, © by the original authors. |
| 47 |
|
|
|
| 48 |
vorlon |
45 |
This document is free software; you can redistribute it and/or |
| 49 |
|
|
modify it under the terms of the GNU General Public License as published |
| 50 |
|
|
by the Free Software Foundation; either version 2 of the License, or (at your |
| 51 |
|
|
option) any later version. |
| 52 |
codehelp |
15 |
|
| 53 |
vorlon |
45 |
For more details, on Debian GNU/Linux systems, see the file |
| 54 |
|
|
/usr/share/common-licenses/GPL-2 for the full license. |
| 55 |
codehelp |
15 |
|
| 56 |
vorlon |
45 |
--- |
| 57 |
|
|
|
| 58 |
codehelp |
15 |
# Format of binary translation packages (tdeb) |
| 59 |
|
|
|
| 60 |
|
|
## Summary |
| 61 |
|
|
The tdeb binary package format is a variation of the deb binary |
| 62 |
codehelp |
50 |
package format. It has the same structure as deb, but the (single) data |
| 63 |
|
|
member is replaced by bzip2-compressed members for each LOCALE_ROOT |
| 64 |
|
|
supported. |
| 65 |
codehelp |
15 |
|
| 66 |
codehelp |
50 |
## Locale-root members |
| 67 |
|
|
|
| 68 |
|
|
The new locale root data members are designed to support easier |
| 69 |
|
|
management of the translations, including allowing |
| 70 |
|
|
users to only install the translations that are needed for one |
| 71 |
|
|
particular installation. |
| 72 |
|
|
|
| 73 |
|
|
e.g. a standard .deb contains debian-binary, control.tar.gz and |
| 74 |
|
|
data.tar.gz whereas a typical TDeb could contain: |
| 75 |
|
|
|
| 76 |
|
|
$ ar -t ../pilot-qof-tdeb_0.1.7-1_all.tdeb |
| 77 |
|
|
debian-binary |
| 78 |
|
|
control.tar.gz |
| 79 |
|
|
t.de.tar.bz2 |
| 80 |
|
|
t.en.tar.bz2 |
| 81 |
|
|
t.fr.tar.bz2 |
| 82 |
|
|
t.pt.tar.bz2 |
| 83 |
|
|
t.ru.tar.bz2 |
| 84 |
|
|
t.sv.tar.bz2 |
| 85 |
|
|
t.vi.tar.bz2 |
| 86 |
|
|
|
| 87 |
|
|
t.pt.tar.bz2 would contain translations for pt and pt_BR: |
| 88 |
|
|
|
| 89 |
|
|
./usr/share/locale/pt/LC_MESSAGES/pilot-qof.mo |
| 90 |
|
|
./usr/share/locale/pt_BR/LC_MESSAGES/pilot-qof.mo |
| 91 |
|
|
|
| 92 |
|
|
This allows later tools to extract only the requested translations from |
| 93 |
|
|
the TDeb upon installation. |
| 94 |
|
|
|
| 95 |
|
|
TDebs are based on the .deb format, it is only a small change in the |
| 96 |
|
|
organisation of the data.tar.gz but it simplifies various stages of |
| 97 |
|
|
handling the resulting packages in the repository, in upload rules and |
| 98 |
|
|
in other support tools. |
| 99 |
|
|
|
| 100 |
|
|
## Use of the .tdeb suffix |
| 101 |
|
|
|
| 102 |
|
|
Various file-based tools exist to handle .deb files and it will be easier |
| 103 |
|
|
for such tools to be able to reliably tell the difference between a .deb |
| 104 |
|
|
and a .tdeb from the filename rather than having to add new support in |
| 105 |
|
|
the codebase to detect the absence of data.tar.gz and work out how to |
| 106 |
|
|
handle the t.$root.bz2 members. The suffix also makes it easier to manage |
| 107 |
|
|
TDebs in various repository situations. Although closely related to the |
| 108 |
|
|
.deb format, the .tdeb format is sufficiently different to merit a subtle |
| 109 |
|
|
change to the suffix in a similar manner to .udeb. |
| 110 |
|
|
|
| 111 |
codehelp |
15 |
## Format specification |
| 112 |
|
|
The file is an ar archive with a magic number of !<arch>. |
| 113 |
|
|
|
| 114 |
|
|
The first member is named debian-binary and contains a series of lines, |
| 115 |
codehelp |
49 |
separated by newlines. Currently only one line is present, the format |
| 116 |
|
|
version number, 2.0 at the time the original dpkg manual page was written. |
| 117 |
|
|
Programs which read new-format archives should be prepared for the minor |
| 118 |
|
|
number to be increased and new lines to be present, and should ignore |
| 119 |
|
|
these if this is the case. |
| 120 |
codehelp |
15 |
|
| 121 |
codehelp |
49 |
If the major number has changed, an incompatible change has been made |
| 122 |
codehelp |
15 |
and the program should stop. If it has not, then the program should be |
| 123 |
|
|
able to safely continue, unless it encounters an unexpected member in |
| 124 |
|
|
the archive (except at the end), as described below. |
| 125 |
|
|
|
| 126 |
codehelp |
49 |
The second required member is named control.tar.bz2. It is a tar |
| 127 |
codehelp |
15 |
archive compressed with bzip2 which contains the package control |
| 128 |
codehelp |
49 |
information, as a series of plain files, of which the file control |
| 129 |
codehelp |
15 |
is mandatory and contains the core control information. The control |
| 130 |
|
|
tarball may optionally contain an entry for '.', the current directory. |
| 131 |
|
|
|
| 132 |
|
|
The members following the control.tar.bz2 are named t.${LOCALE_ROOT}.tar.bz2. |
| 133 |
|
|
Each contains the filesystem archive for the locale root, as a tar archive |
| 134 |
|
|
compressed with bzip2. |
| 135 |
|
|
|
| 136 |
|
|
LOCALE_ROOT must match the regular expression [a-z]{2,3} |
| 137 |
|
|
|
| 138 |
|
|
These members must occur in this exact order. Current implementations |
| 139 |
|
|
should ignore any additional members after the t.${LOCALE_ROOT}.tar.bz2 |
| 140 |
|
|
members. Further members may be defined in the future, and (if possible) will |
| 141 |
|
|
be placed after these. Any additional members that may need to be inserted |
| 142 |
|
|
before t.${LOCALE_ROOT}.tar.bz2 and which should be safely ignored by older |
| 143 |
|
|
programs, will have names starting with an underscore, '_'. |
| 144 |
|
|
|
| 145 |
|
|
Those new members which will not be able to be safely ignored will be |
| 146 |
|
|
inserted before the t.${LOCALE_ROOT}.tar.bz2 members with names starting |
| 147 |
|
|
with something other than underscores, or will (more likely) cause the |
| 148 |
|
|
major version number to be increased. |
| 149 |
|
|
|
| 150 |
vorlon |
45 |
--- |
| 151 |
|
|
|
| 152 |
codehelp |
15 |
# Source format |
| 153 |
|
|
|
| 154 |
|
|
## +t1.diff.gz |
| 155 |
|
|
|
| 156 |
|
|
TDebs will use a source format for translation updates that will not |
| 157 |
vorlon |
45 |
cause any changes in the package binaries. The foo_1.2.3-4+t1.diff.gz |
| 158 |
|
|
will be created for changes made by translators and tools will need to |
| 159 |
|
|
apply the translation diff after applying the .diff.gz prepared |
| 160 |
|
|
(and signed) by the Debian maintainer. |
| 161 |
codehelp |
15 |
|
| 162 |
vorlon |
45 |
The +t[0-9] update will need to be built from the source package but |
| 163 |
|
|
only details changes in the translated content. No changes will be |
| 164 |
|
|
allowed in the package binaries or untranslated content. |
| 165 |
codehelp |
15 |
|
| 166 |
vorlon |
45 |
Translation updates are source-package based and translation updates |
| 167 |
|
|
are denoted by the +t[0-9] suffix where 0 is assumed to be the original |
| 168 |
|
|
upload by the Debian maintainer. |
| 169 |
codehelp |
15 |
|
| 170 |
|
|
e.g. for a non-native package foo: |
| 171 |
|
|
|
| 172 |
vorlon |
45 |
source version 1.2.3-4, |
| 173 |
|
|
the first TDeb update would be foo_1.2.3-4+t1 |
| 174 |
|
|
the changes from -4 to -4+t1 will be in foo_1.2.3-4+t1.diff.gz |
| 175 |
codehelp |
15 |
|
| 176 |
vorlon |
45 |
BinNMU versions are not affected as it is source based. |
| 177 |
|
|
|
| 178 |
codehelp |
15 |
The +t1.diff.gz needs dpkg support which is being implemented: |
| 179 |
|
|
|
| 180 |
|
|
New translations and translation fixes are currently tracked in the BTS. |
| 181 |
vorlon |
45 |
Tdeb uploads shall be able to close those bugs. Using a changelog might |
| 182 |
|
|
be the easiest way. |
| 183 |
codehelp |
15 |
|
| 184 |
vorlon |
45 |
During the transition, those bugs will remain. After the transition, |
| 185 |
|
|
those bugs will go away so there should be no need for a closure method. |
| 186 |
|
|
We'll need to rely on i18n.debian.org for translation tracking after |
| 187 |
|
|
Squeeze. |
| 188 |
|
|
|
| 189 |
|
|
--- |
| 190 |
|
|
|
| 191 |
codehelp |
15 |
# TDeb contents |
| 192 |
|
|
|
| 193 |
|
|
## What goes into a TDeb? |
| 194 |
|
|
|
| 195 |
vorlon |
45 |
(With the exception of debconf templates, untranslated content remains |
| 196 |
|
|
in the original package). |
| 197 |
codehelp |
15 |
|
| 198 |
|
|
* Translations from upstream -/usr/share/locale/*/LC_MESSAGES/*.mo |
| 199 |
|
|
* Other localisation files from upstream - /usr/share/locale/*/LC_*/* |
| 200 |
|
|
|
| 201 |
|
|
Translated content, including: |
| 202 |
|
|
|
| 203 |
|
|
* Translated manpages |
| 204 |
|
|
* Translated info documents (if supported by info) |
| 205 |
vorlon |
45 |
* Translated documentation. With provisos that packages with |
| 206 |
codehelp |
15 |
large amounts of translated documentation and debconf templates |
| 207 |
|
|
would create two tdebs, one minimal tdeb for debconf and one for |
| 208 |
|
|
the rest. |
| 209 |
|
|
* Debconf templates file<item>Not the config or other related scripts. |
| 210 |
|
|
The regular deb will need to contain a untranslated copy of the |
| 211 |
|
|
templates file, too. See "TDebs and Debconf" below. |
| 212 |
|
|
|
| 213 |
codehelp |
50 |
# TDeb uploads |
| 214 |
|
|
|
| 215 |
|
|
## Initial uploads - +t0 |
| 216 |
|
|
|
| 217 |
|
|
The initial TDeb will be generated by the maintainer, effectively |
| 218 |
|
|
+t0, containing whatever translations are currently supported. The |
| 219 |
|
|
TDeb is uploaded alongside the binary and .dsc. It is up to the |
| 220 |
|
|
maintainer to incorporate any +t1.diff.gz containing updated or new |
| 221 |
|
|
translations that may exist already into each new Debian version. |
| 222 |
|
|
|
| 223 |
|
|
If the new version has changed translated strings then those will only |
| 224 |
|
|
available in English until the +t1 TDeb can be prepared. |
| 225 |
|
|
|
| 226 |
|
|
Maintainers are advised to always seek translation updates |
| 227 |
|
|
prior to the upload of the initial TDeb. If maintainers implement a |
| 228 |
|
|
string freeze and wait for translation updates before uploading, the |
| 229 |
|
|
chances of a +t1.diff.gz being required by time of the next release |
| 230 |
|
|
by the maintainer are lower. |
| 231 |
|
|
|
| 232 |
|
|
See also Timeline. |
| 233 |
|
|
|
| 234 |
|
|
Maintainers will be creating TDebs in Squeeze+1, using debian/rules, |
| 235 |
|
|
using debhelper calls and uploading TDebs each time they would |
| 236 |
|
|
currently upload any package that contains /usr/share/locale/LC_*/ etc. |
| 237 |
|
|
Those TDebs are, effectively, +t0 - only updates by translators start |
| 238 |
|
|
the +t1 sequence. |
| 239 |
|
|
|
| 240 |
|
|
Maintainer uploads (non-native package example): |
| 241 |
|
|
|
| 242 |
codehelp |
51 |
foo_1.2.3-4_amd64.deb |
| 243 |
|
|
foo-tdeb_1.2.3-4_all.tdeb |
| 244 |
|
|
foo-bar_1.2.3-4_amd64.deb |
| 245 |
|
|
foo_1.2.3-4.diff.gz |
| 246 |
|
|
foo_1.2.3.orig.tar.gz |
| 247 |
|
|
foo_1.2.3-4.dsc |
| 248 |
|
|
foo_1.2.3-4_amd64.changes |
| 249 |
|
|
|
| 250 |
codehelp |
50 |
Maintainer uploads (native package example): |
| 251 |
|
|
|
| 252 |
codehelp |
51 |
foo_1.2.3_amd64.deb |
| 253 |
|
|
foo-tdeb_1.2.3_all.tdeb |
| 254 |
|
|
foo-bar_1.2.3_amd64.deb |
| 255 |
|
|
foo_1.2.3.tar.gz |
| 256 |
|
|
foo_1.2.3.dsc |
| 257 |
|
|
foo_1.2.3_amd64.changes |
| 258 |
|
|
|
| 259 |
codehelp |
50 |
The foo-tdeb package will be listed in the .changes anyway so existing |
| 260 |
|
|
tools will simply add it to the list of files to be uploaded to |
| 261 |
|
|
ftp-master or wherever. foo-tdeb_1.2.3-4_all.tdeb is, effectively, |
| 262 |
|
|
foo-tdeb_1.2.3-4+t0_all.tdeb |
| 263 |
|
|
|
| 264 |
|
|
When the maintainer makes a new release, foo_1.2.3-5, which incorporates |
| 265 |
|
|
the TDeb changes, it is done in a similar manner to how an NMU is |
| 266 |
codehelp |
52 |
included. All files matching foo\*1.2.3-4\* are removed by dak when the |
| 267 |
codehelp |
50 |
new version is uploaded. The updated translations now exist in |
| 268 |
|
|
foo-tdeb_1.2.3-5_all.tdeb - uploaded by the maintainer and there is no |
| 269 |
|
|
+t1.diff.gz or +t1_all.tdeb until the package translations need to be |
| 270 |
|
|
touched again. |
| 271 |
|
|
|
| 272 |
|
|
## Translator updates |
| 273 |
|
|
|
| 274 |
|
|
Updates to translations will update the existing TDeb, creating |
| 275 |
|
|
+t2.diff.gz and +t3.diff.gz etc. All supported languages go into the |
| 276 |
|
|
existing TDeb, organised by locale root. |
| 277 |
|
|
|
| 278 |
|
|
Unless a package needs more than one TDeb for the debconf plus large |
| 279 |
|
|
amounts of translated documentation corner case, each source package |
| 280 |
|
|
should only expect to have one TDeb for all binary packages and all |
| 281 |
|
|
locales. |
| 282 |
|
|
|
| 283 |
|
|
Translation teams can work together to make uploads in a coordinated |
| 284 |
|
|
manner - similar to the current method of requesting deadlines for i18n |
| 285 |
|
|
bugs, a nominated person can collate the various translations prior to |
| 286 |
|
|
a deadline chosen by the teams themselves, according to the needs of |
| 287 |
|
|
that particular package. |
| 288 |
|
|
|
| 289 |
|
|
Translator updates of TDebs do not necessarily need to use typical |
| 290 |
|
|
package building tools like 'dpkg-buildpackage'. All that is needed |
| 291 |
|
|
is to put the .mo files into the relevant directory hierarchy (or use |
| 292 |
|
|
dh_gentdeb) and then call dpkg-deb --tdeb -b: |
| 293 |
|
|
|
| 294 |
|
|
dpkg-deb --tdeb -b debian/pilot-qof-tdeb ../pilot-qof-tdeb_0.1.7-1_all.tdeb |
| 295 |
|
|
|
| 296 |
|
|
This means that translators can build updated TDebs without needing the |
| 297 |
|
|
full dependency chain needed for a source rebuild - only dpkg (at a version |
| 298 |
|
|
that includes the TDeb support) is strictly necessary. |
| 299 |
|
|
|
| 300 |
|
|
Translator update uploads would contain: |
| 301 |
|
|
|
| 302 |
codehelp |
51 |
foo-tdeb_1.2.3-4+t1_all.tdeb |
| 303 |
|
|
foo_1.2.3-4+t1.diff.gz |
| 304 |
|
|
foo_1.2.3-4+t1.dsc |
| 305 |
|
|
foo_1.2.3-4+t1_all.changes |
| 306 |
|
|
|
| 307 |
codehelp |
50 |
The key point is that a +t1 revision can happen *during a release |
| 308 |
|
|
freeze* without touching the source, without changing any of the |
| 309 |
|
|
binaries. Once the release is out and unstable is accessible again, the |
| 310 |
|
|
maintainer adds +t1.diff.gz to their next upload. |
| 311 |
|
|
|
| 312 |
|
|
## dpkg source formats |
| 313 |
|
|
|
| 314 |
|
|
Format 3.0 should not be any more difficult than 1.0 or anything that |
| 315 |
|
|
follows. 3.0 has to deal with incorporating patches and changes from |
| 316 |
|
|
the Debian Bug Tracking System, so +t1.diff.gz is no different. |
| 317 |
|
|
|
| 318 |
|
|
What matters is that the maintainer gets the +t1.diff.gz and applies it |
| 319 |
|
|
onto the source package prior to the next upload. It's no different to |
| 320 |
|
|
how the same maintainer would handle a patch or new translations |
| 321 |
|
|
file sent to the BTS. |
| 322 |
|
|
|
| 323 |
|
|
--- |
| 324 |
|
|
|
| 325 |
codehelp |
15 |
# TDeb resources. |
| 326 |
|
|
|
| 327 |
|
|
## Packages and patches |
| 328 |
|
|
|
| 329 |
|
|
The main changes to support TDebs will be concentrated in the archive tools |
| 330 |
|
|
and central packaging tools (dpkg, apt, debhelper). |
| 331 |
|
|
|
| 332 |
|
|
Test packages are available via Emdebian: |
| 333 |
|
|
|
| 334 |
codehelp |
49 |
* <http://www.emdebian.org/toolchains/search.php?package=emdebian-tdeb&arch=&distro=unstable> |
| 335 |
|
|
* <http://packages.debian.org/emdebian-tdeb> |
| 336 |
|
|
* <http://buildd.emdebian.org/svn/browser/current/host/trunk/emdebian-grip/trunk/tdeb> |
| 337 |
codehelp |
15 |
* (SVN is regularly updated) |
| 338 |
|
|
|
| 339 |
|
|
Patches for current tools are handled in repositories for the relevant tools: |
| 340 |
|
|
|
| 341 |
codehelp |
49 |
* <http://git.debian.org/?p=users/codehelp/debhelper.git;a=summary> |
| 342 |
|
|
* <http://git.debian.org/?p=users/codehelp/dpkg.git;a=summary> |
| 343 |
codehelp |
15 |
|
| 344 |
codehelp |
50 |
--- |
| 345 |
|
|
|
| 346 |
codehelp |
15 |
# TDeb Architectures |
| 347 |
|
|
|
| 348 |
|
|
## TDebs are architecture-independent |
| 349 |
|
|
|
| 350 |
|
|
TDebs must only be used for Architecture-independent data. There will |
| 351 |
|
|
be NO support for Architecture-dependent TDebs outside Emdebian. |
| 352 |
|
|
|
| 353 |
|
|
Any translation system that does not use gettext can choose to use |
| 354 |
|
|
TDebs as long as the translation files are architecture-independent. |
| 355 |
|
|
|
| 356 |
codehelp |
50 |
--- |
| 357 |
|
|
|
| 358 |
codehelp |
15 |
# TDebs and LINGUAS |
| 359 |
|
|
|
| 360 |
|
|
## Avoiding changes to the source package |
| 361 |
|
|
|
| 362 |
|
|
Many packages using autotools use the LINGUAS support of gettext but this |
| 363 |
|
|
requires changes within the source of the package - sometimes po/LINGUAS |
| 364 |
|
|
but more commonly configure.ac|in. Changing configure.ac and regenerating |
| 365 |
|
|
the autotools build system completely undermines the objective of TDebs |
| 366 |
|
|
being able to be used independently of maintainer uploads and NMUs. |
| 367 |
|
|
Existing TDeb support ignores the LINGUAS method, therefore: |
| 368 |
|
|
|
| 369 |
|
|
If a $lang.po file exists in a recognisable po directory (${top_srcdir}/po/ |
| 370 |
|
|
or ${top_srcdir}/po-*/, TDeb handlers will process that .po file even if it |
| 371 |
|
|
is not listed in LINGUAS. If the PO file is valid, the generated .mo file |
| 372 |
|
|
will be included into the TDeb. |
| 373 |
|
|
|
| 374 |
|
|
Packages will no longer be able to have unactivated or unused translations. |
| 375 |
vorlon |
45 |
(This is a debhelper / other packaging tool implementation problem, not |
| 376 |
|
|
a dpkg one) |
| 377 |
codehelp |
15 |
|
| 378 |
|
|
As a result of this requirement, the debhelper tdeb tool (dh_gentdeb) |
| 379 |
vorlon |
45 |
handles finding the translations, preparing the binary translation |
| 380 |
|
|
files and moving the translations to suitable directories within the |
| 381 |
|
|
package build. |
| 382 |
codehelp |
15 |
|
| 383 |
vorlon |
45 |
## TDebs and binary packages |
| 384 |
codehelp |
15 |
|
| 385 |
vorlon |
45 |
The filesystem contents of TDebs and their associated binary packages |
| 386 |
|
|
must be mutually exclusive, so that dpkg doesn't need any special |
| 387 |
|
|
replace handling. We will still need some Replaces for the transition, |
| 388 |
|
|
but that can be handled like any other Replaces. |
| 389 |
codehelp |
15 |
|
| 390 |
|
|
## Migrating packages to TDeb support |
| 391 |
vorlon |
45 |
|
| 392 |
codehelp |
15 |
Maintainers will need to make a variety of changes to support TDebs: |
| 393 |
|
|
|
| 394 |
|
|
* Replaces Add the recommended $src-tdeb package name with |
| 395 |
|
|
Replaces: $binaries (<< $srcversion) |
| 396 |
|
|
where $srcversion is a fixed string for the version prior to TDebs |
| 397 |
vorlon |
45 |
|
| 398 |
|
|
e.g. Replaces: apt (<< 0.7.19), apt-utils (<< 0.7.19) |
| 399 |
|
|
|
| 400 |
codehelp |
15 |
* Remove translated content from all *.install files in debian/ |
| 401 |
|
|
* Remove any lines in debian/rules that handle translated content |
| 402 |
|
|
* Ensure that dh_gentdeb is called in debian/rules (CDBS will be |
| 403 |
|
|
patched to implement this support automatically). |
| 404 |
|
|
|
| 405 |
vorlon |
45 |
--- |
| 406 |
|
|
|
| 407 |
codehelp |
15 |
# Resolution of corner cases |
| 408 |
|
|
|
| 409 |
|
|
## TDeb documentation duplication |
| 410 |
|
|
|
| 411 |
|
|
Basing the TDeb on the source package means that the TDeb could include |
| 412 |
|
|
large amounts of translated documentation. This results in a corner case |
| 413 |
|
|
where a package with debconf templates and a large amount of translated |
| 414 |
|
|
documentation would result in the docs being installed merely to obtain |
| 415 |
|
|
the translated templates. In order to resolve this, each source package |
| 416 |
|
|
may have one or more tdebs. If a source package has |
| 417 |
|
|
translations, it <strong>must</strong> have a tdeb named after the |
| 418 |
|
|
source package (suffixed with -tdeb) and all |
| 419 |
|
|
debconf templates must be placed in it. Such a package should place all |
| 420 |
vorlon |
45 |
architecture independent documentation (even in the native language) |
| 421 |
|
|
into a tdeb. If a package contains documentation which is not always |
| 422 |
|
|
required (for example API documentation or user documentation), the |
| 423 |
|
|
source package may provide additional |
| 424 |
|
|
${source}-${foo}-tdeb_$version_all.tdeb files. |
| 425 |
codehelp |
15 |
|
| 426 |
|
|
If tdebs are revised by the translation teams, the suffix +t[0-9]+ |
| 427 |
|
|
must be used and all tdebs for the source package must be revised |
| 428 |
|
|
at the same time. |
| 429 |
|
|
|
| 430 |
codehelp |
50 |
--- |
| 431 |
|
|
|
| 432 |
codehelp |
15 |
# TDebs and package managers |
| 433 |
|
|
|
| 434 |
|
|
Package managers can find out whether a package has a base tdeb by examining |
| 435 |
|
|
the Packages file for Translation-Version: [0-9]+. In the case of |
| 436 |
|
|
Translation-Version: 0, the tdeb name and version is the same as the source file |
| 437 |
|
|
with -tdeb appended. |
| 438 |
|
|
|
| 439 |
|
|
In the case of Translation-Version: 1 or higher, the tdeb name is |
| 440 |
vorlon |
45 |
${source}-tdeb_$version+t[0-9]+_all.tdeb. Additional tdebs are |
| 441 |
|
|
referenced in the Packages file in the following way: |
| 442 |
|
|
Additional-Translations: ${source}-api-tdeb, ${source}-user-tdeb |
| 443 |
|
|
|
| 444 |
codehelp |
15 |
In cases where a base tdeb is present, package managers *must* call |
| 445 |
|
|
dpkg with the tdeb and the deb in the same invocation in order to ensure that |
| 446 |
|
|
all debconf templates can be extracted before the config script is run. |
| 447 |
|
|
|
| 448 |
|
|
There is no need to unpack in order to obtain the debconf templates - the |
| 449 |
|
|
tdeb merely has to be locatable by debconf which will call apt-extracttemplates |
| 450 |
|
|
and load the translated debconf strings into memory. See TDebs and debconf: |
| 451 |
|
|
|
| 452 |
codehelp |
50 |
--- |
| 453 |
|
|
|
| 454 |
codehelp |
15 |
# TDebs and debconf |
| 455 |
|
|
|
| 456 |
|
|
apt-extracttemplates is used by debconf's dpkg-preconfigure to extract |
| 457 |
|
|
templates from the not-yet-extracted .debs right after download. |
| 458 |
|
|
This needs to take tdebs into account. Note that the templates |
| 459 |
|
|
are per-binary while tdebs are per-source. Also, the .deb should |
| 460 |
|
|
have non-translated templates. |
| 461 |
|
|
|
| 462 |
codehelp |
50 |
--- |
| 463 |
|
|
|
| 464 |
codehelp |
15 |
# TDebs and multiple templates files |
| 465 |
|
|
|
| 466 |
|
|
If a source package builds multiple binaries that use debconf, the debian/ |
| 467 |
|
|
directory will contain foo.templates and bar.templates. The TDeb will retain |
| 468 |
|
|
all templates files under the original names. apt-extracttemplates and po-debconf |
| 469 |
|
|
will need to work together to ensure that all templates files are available to |
| 470 |
|
|
debconf so that debconf can selectively load only the templates files required. |
| 471 |
|
|
|
| 472 |
codehelp |
50 |
--- |
| 473 |
|
|
|
| 474 |
codehelp |
15 |
# Tdebs and usr/share/doc |
| 475 |
codehelp |
50 |
|
| 476 |
codehelp |
15 |
A tdeb needs usr/share/doc/copyright and changelog.Debian and dpkg will create |
| 477 |
|
|
the necessary files, just as with a normal .deb. |
| 478 |
|
|
|
| 479 |
codehelp |
50 |
--- |
| 480 |
|
|
|
| 481 |
codehelp |
15 |
# Lintian support |
| 482 |
|
|
|
| 483 |
|
|
## PO translations |
| 484 |
|
|
|
| 485 |
vorlon |
45 |
* No source changes - The Tdeb packages should not add messages not |
| 486 |
|
|
related to a message of the original source package. How to check this? |
| 487 |
|
|
If there is a POT file, then it is possible to do the comparison with |
| 488 |
|
|
the gettext msg* tools. POT file will not be in the tdeb, only in the |
| 489 |
|
|
main source package. When a PO file is modified, lintian can get the |
| 490 |
|
|
POT file of the same directory from the source package. |
| 491 |
|
|
* msgfmt warnings - Modification of upstream PO files should be avoided. |
| 492 |
|
|
A warning could be produced. |
| 493 |
codehelp |
15 |
* File naming rules |
| 494 |
|
|
* Location of PO files in the source package (+t1.diff.gz) |
| 495 |
|
|
* Location of mo files in the binary packages (tdeb) |
| 496 |
|
|
* Location of manpages in the binary packages (tdeb). (current check |
| 497 |
|
|
can be reused) |
| 498 |
|
|
* Name of the manpages in the binary packages (tdeb). An english |
| 499 |
|
|
manpage shall remain, with the same name, in the original binary package. |
| 500 |
|
|
|
| 501 |
codehelp |
50 |
--- |
| 502 |
|
|
|
| 503 |
codehelp |
15 |
# TDeb maintainers |
| 504 |
|
|
|
| 505 |
|
|
Rather than allow repeat uploads of the same change in multiple |
| 506 |
|
|
languages, coordinate builds of tdebs to make a single upload with as |
| 507 |
vorlon |
45 |
many changes as possible at one time. Translation-Maintainers: in |
| 508 |
|
|
debian/control and Localisation Assistants. |
| 509 |
codehelp |
15 |
|
| 510 |
codehelp |
50 |
--- |
| 511 |
|
|
|
| 512 |
codehelp |
15 |
# TDeb implementation |
| 513 |
|
|
|
| 514 |
codehelp |
50 |
## Incorporation of the tdiff in the next source package |
| 515 |
codehelp |
15 |
|
| 516 |
|
|
A process will be needed to help maintainers including the tdiff when they |
| 517 |
|
|
prepare a new source package (kind of NMU acknowledgement?) Automated so that |
| 518 |
|
|
the +t1.diff.gz is automatically applied if it exists. Problem still exists |
| 519 |
|
|
with maintainers who don't check apt-get source first. Possible method is to |
| 520 |
|
|
modify uscan and uupdate. |
| 521 |
|
|
|
| 522 |
|
|
When the maintainer prepare a new package, he applies the tdiff and |
| 523 |
|
|
"acknownledge the new translations". (This tdiff has great chances not |
| 524 |
|
|
to be applicable if the upstream source changed) |
| 525 |
|
|
|
| 526 |
|
|
The i18n infrastructure can check that this acknowledgement is really |
| 527 |
|
|
performed (e.g. merge the old translations in the new one and check if the |
| 528 |
|
|
translation statistics changed) |
| 529 |
|
|
|
| 530 |
|
|
Automation in uscan should be possible |
| 531 |
|
|
|
| 532 |
|
|
This issue can be postponed until tdebs appear for non-native packages (squeeze+1) |
| 533 |
|
|
|
| 534 |
codehelp |
50 |
--- |
| 535 |
codehelp |
15 |
|
| 536 |
codehelp |
50 |
## L10N Infrastructure |
| 537 |
|
|
|
| 538 |
codehelp |
15 |
i18n.debian.net gathers the translation material from the packages. It needs |
| 539 |
|
|
to support tdebs too (tdiff). |
| 540 |
|
|
|
| 541 |
|
|
i18n.debian.net can check that translation material from the tdiff were |
| 542 |
|
|
merged in new versions of the source package |
| 543 |
|
|
|
| 544 |
|
|
i18n.debian.net needs to help "Localisation Assistants" in gathering the new |
| 545 |
|
|
translations before the preparation of a new tdeb |
| 546 |
|
|
|
| 547 |
codehelp |
50 |
--- |
| 548 |
codehelp |
15 |
|
| 549 |
codehelp |
50 |
## Timeline |
| 550 |
codehelp |
15 |
|
| 551 |
codehelp |
50 |
### Sequence |
| 552 |
|
|
|
| 553 |
|
|
* Archive and tools support (Squeeze) |
| 554 |
|
|
* Debconf translation will form the first TDebs (Squeeze + 1) |
| 555 |
|
|
* Native packages with program translations next |
| 556 |
|
|
* Non-native packages with Debian maintainers who are also the upstream |
| 557 |
|
|
|
| 558 |
|
|
### What needs to be done for Squeeze ? |
| 559 |
|
|
|
| 560 |
codehelp |
15 |
* tdeb binary file definition - (ratification and review) |
| 561 |
|
|
* tdeb source file definition - (development and testing) |
| 562 |
codehelp |
53 |
* dpkg-deb and dpkg --install support - (partially implemented in git) |
| 563 |
codehelp |
50 |
|
| 564 |
|
|
There will be no TDebs in Squeeze. |
| 565 |
|
|
|
| 566 |
|
|
### What needs to be done for Squeeze + 1? |
| 567 |
|
|
|
| 568 |
codehelp |
15 |
* debhelper support for both tdebs explicitly, and also marking files into |
| 569 |
vorlon |
45 |
classes in general (partially implemented via dh_gentdeb in git) |
| 570 |
codehelp |
15 |
* provide a patch to cdbs for running dh_gentdeb in the right place. |
| 571 |
codehelp |
50 |
(Done - only remains for the patch to be filed and applied). |
| 572 |
codehelp |
15 |
* apt/aptitude support for pulling in and removing tdebs |
| 573 |
|
|
* lintian support |
| 574 |
|
|
* debdiff support |
| 575 |
|
|
* devscripts support (debc) |
| 576 |
|
|
* dak support (run away, run away) run faster |
| 577 |
codehelp |
50 |
|
| 578 |
|
|
First generation of TDebs: |
| 579 |
|
|
|
| 580 |
|
|
* packages using debconf |
| 581 |
|
|
* native packages using gettext (optional) |
| 582 |
|
|
|
| 583 |
|
|
### What will be done for Squeeze + 2 or later? |
| 584 |
|
|
|
| 585 |
|
|
* dpkg class support - (make it easier to selectively install translations |
| 586 |
|
|
for specific locale roots). |
| 587 |
codehelp |
15 |
* support for packages using non-gettext translations. Packages using |
| 588 |
|
|
non-gettext mechanisms include OOo, mozilla, Qt or Java properties, menus, |
| 589 |
|
|
desktop.) |
| 590 |
|
|
|
| 591 |
codehelp |
50 |
* any remaining debconf packages not yet using TDebs |
| 592 |
|
|
* remaining native packages using gettext |
| 593 |
|
|
* non-native packages with a Debian maintainer on upstream team |
| 594 |
|
|
* starting support for non-gettext packages |
| 595 |
codehelp |
16 |
|
| 596 |
codehelp |
50 |
--- |
| 597 |
|
|
|
| 598 |
codehelp |
16 |
# Changes |
| 599 |
codehelp |
50 |
|
| 600 |
codehelp |
16 |
----- |
| 601 |
|
|
|
| 602 |
|
|
2009-03-08 - [Neil Williams] |
| 603 |
|
|
* Convert to DEP. |
| 604 |
codehelp |
49 |
|
| 605 |
vorlon |
45 |
2009-03-19 - [Neil Williams] |
| 606 |
|
|
* Add a table of contents via ikiwiki |
| 607 |
codehelp |
49 |
|
| 608 |
|
|
2009-04-14 - [Neil Williams] |
| 609 |
|
|
* Tweak some of the links to become active. |
| 610 |
|
|
* Update the URL |
| 611 |
codehelp |
50 |
* Fold in the results of the discussions so far on -devel. |