[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Working version of Emdebian TDeb implementation



Emdebian SVN r2618 includes my first working implementation of
em_installtdeb. Barring a single annoyance message from dpkg, the script
works. :-)
The warning arises from the need for a modified "source" tarball that
can be uploaded alongside the .deb, containing only the sources needed
for this specific translation: debian/control, debian/changelog,
po/$lang.po  /* if any */ and po/$GETTEXT_PACKAGE.pot. Where a package
contains more than one po directory, all POT files are included and all
po files for the requested translation. This allows translations to be
updated independently of the upstream package.
I would advise using a test directory if you do want to try it, not your
main package building directory. ;-)
Output (using gpe-expenses as the demo package) in translator mode:

$ em_installtdeb sv
dpkg-deb: building package `gpe-expenses-locale-sv' in
`../gpe-expenses-locale-sv_0.1.4-1_all.deb'.
dpkg-source: warning: .orig.tar name gpe-expenses_0.1.4.tdeb.tar.gz is
not <package>_<upstreamversion>.orig.tar (wanted
gpe-expenses_0.1.4.orig.tar.(?:gz|bz2|lzma))
dpkg-source: building gpe-expenses using existing
gpe-expenses_0.1.4.tdeb.tar.gz
dpkg-source: building gpe-expenses in gpe-expenses_0.1.4-1.diff.gz
dpkg-source: building gpe-expenses in gpe-expenses_0.1.4-1.dsc
dpkg-genchanges: including full source code in upload
Format: 1.7
Date: Fri, 07 Dec 2007 00:08:39 +0000
Source: gpe-expenses
Binary: gpe-expenses-locale-sv
Architecture: source all
Version: 0.1.4-1
Distribution: unstable
Urgency: low
Maintainer: Neil Williams <codehelp@debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description:
 gpe-expenses-locale-sv - sv translation for gpe-expenses
Changes:
 gpe-expenses (0.1.4-1) unstable; urgency=low
 .
   * New upstream release
   * use machine operable debian/copyright, migrate to standards 3.7.3
Files:
 781a60eccc4396ee3f0f86a01150e755 316 misc extra gpe-expenses_0.1.4-1.dsc
 f9dd946db27ff6077f8e85f7100d3ea4 5863 misc extra
gpe-expenses_0.1.4.tdeb.tar.gz
 894f5789ee0348abfa61a5e7342ed6a7 20 misc extra gpe-expenses_0.1.4-1.diff.gz
 56f8d22c30cb5502633ff4d26862db78 4532 misc extra
gpe-expenses-locale-sv_0.1.4-1_all.deb
Package-Type: tdeb
Changes file: ../gpe-expenses_0.1.4-1_tdeb.changes
 signfile ../gpe-expenses_0.1.4-1.dsc 0x28BCB3E3

You need a passphrase to unlock the secret key for
user: "Neil Williams (Debian) <codehelp@debian.org>"
1024-bit DSA key, ID 28BCB3E3, created 2002-01-27


 signfile ../gpe-expenses_0.1.4-1_tdeb.changes 0x28BCB3E3

You need a passphrase to unlock the secret key for
user: "Neil Williams (Debian) <codehelp@debian.org>"
1024-bit DSA key, ID 28BCB3E3, created 2002-01-27


Successfully signed dsc and changes files
neil@holly:gpe-expenses$ dpkg -c ../gpe-expenses-locale-sv_0.1.4-1_all.deb
drwxr-xr-x neil/neil         0 2007-12-19 14:37 ./
drwxr-xr-x neil/neil         0 2007-12-19 14:37 ./usr/
drwxr-xr-x neil/neil         0 2007-12-19 14:37 ./usr/share/
drwxr-xr-x neil/neil         0 2007-12-19 14:37 ./usr/share/locale/
drwxr-xr-x neil/neil         0 2007-12-19 14:37 ./usr/share/locale/sv/
drwxr-xr-x neil/neil         0 2007-12-19 16:09
./usr/share/locale/sv/LC_MESSAGES/
-rw-r--r-- neil/neil      6419 2007-12-19 16:09
./usr/share/locale/sv/LC_MESSAGES/gpe-expenses.mo
-rw-r--r-- neil/neil      1796 2007-12-19 16:09
./usr/share/locale/sv/LC_MESSAGES/qofexpensesobjects.mo

Hmm, that isn't right - need to check on the ownership of those files -
might be enough to use fakeroot.

$ dpkg -I ../gpe-expenses-locale-sv_0.1.4-1_all.deb
 new debian package, version 2.0.
 size 4532 bytes: control archive= 302 bytes.
     230 bytes,     9 lines      control
 Package: gpe-expenses-locale-sv
 Source: gpe-expenses
 Version: 0.1.4-1
 Architecture: all
 Maintainer: Neil Williams <codehelp@debian.org>
 Installed-Size: 44
 Section: misc
 Priority: extra
 Description: sv translation for gpe-expenses

em_installtdeb is a debhelper add-on created for Emdebian to create
translation packages (tdebs). em_installtdeb is intended to separate out
the individual translation files from the current Debian packages into
packages without any translation files and a series of tdeb locale
packages, one per translation. Generated packages use the syntax:
$package-locale-$language_code_$version_all.deb

Certain language codes need to be modified to make acceptable components
of a debian package name. Underscores are converted to hyphens, '@' is
converted to '+' and all codes are made lowercase. These changes only
apply to the package name, the installation location is unchanged.

The locale package must use GETTEXT_PACKAGE for the eventual filename of
the binary translation file - not the $dh{MAINPACKAGE} from debhelper.
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. debian/control is needed for various dpkg and
debhelper calls only.

The "source" for translators therefore includes:
debian/control
debian/changelog
po/$lang.po  /* if any */
po/$GETTEXT_PACKAGE.pot

Note that no rules file exists. (i.e. dpkg-source -x will complain when
trying to extract it later so a new wrapper is needed (not difficult).)

em_installtdeb will try to generate the necessary POT file(s) and then
create a $package_$version_tdeb.tar.gz containing the source files.

The default action is to process all available po files.

The above example uses translator mode where LANG_CODE is passed to only
handle that language. In translator mode, em_installtdeb builds a tdeb
package, a source tarball, a .dsc and a .changes file (and signs the
.dsc and .changes). In default mode, em_installtdeb builds the
package(s) but leaves the source, .dsc and .changes to the rest of the
build process.

LANG_CODE can either be the name of the locale as specified in the PO
filename (fr, en_GB, sr@Ltn etc.) or the name of the locale as specified
in the eventual package name (fr, en-gb, sr+ltn etc.).

If a po file already exists for this locale, em_installtdeb processes
just that one translation and builds a single tdeb package.

If the po file does not exist, em_installtdeb exits with an error. (Copy
the POT file from the original source to create a new po file for the
new locale and edit it to include the new translation, then run
em_installtdeb again.)

Output in default mode:
$ em_installtdeb
dpkg-deb: building package `gpe-expenses-locale-cs' in
`../gpe-expenses-locale-cs_0.1.4-1_all.deb'.
dpkg-deb: building package `gpe-expenses-locale-de' in
`../gpe-expenses-locale-de_0.1.4-1_all.deb'.
dpkg-deb: building package `gpe-expenses-locale-pt' in
`../gpe-expenses-locale-pt_0.1.4-1_all.deb'.
dpkg-deb: building package `gpe-expenses-locale-sv' in
`../gpe-expenses-locale-sv_0.1.4-1_all.deb'.
dpkg-deb: building package `gpe-expenses-locale-vi' in
`../gpe-expenses-locale-vi_0.1.4-1_all.deb'.

Next stage is to fold this into emdebian-tools so that the emdebian
patch files can be cleaned up and various complex patches to
debian/rules can also be cleaned up.
Finally, note that this only supports gettext and only supports program
translations. This is an Emdebian script written with an eye on usage in
Debian but primarily intended to meet Emdebian requirements. One locale,
one package.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: