This policy details how language support is implemented in ROSA Linux.


Contents

RPM Macros

%lang

A file can be flagged %lang(LANG). This means it will only be installed if LANG is in %installlangs:

$ cat /etc/rpm/macros
%''install''langs en:fr:ja

Normally, you should not mark files by yourself. You should always use %find_lang which should do everything for you.


%find_lang

Use macro %find_lang to collect and mark locale-dependent files.

Synopsis:

%find_lang name [filelist]

The macro %find_lang searches the directories /usr/share/locale and /usr/share/locale/*/LC_MESSAGES for name.mo files. It also searches gnome/help/name and kde/share/doc/HTML/'/name directories for a localized documentation. Then it creates the file filelist where the files are marked by the respective %lang(locale) tag and also by the %doc tag. Such a file list can be then passed to the %files tag via -f option. See below for an example.

The optional filelist defines the name of the file where the generated list of files is stored. name.lang is used if not defined.

Example:

%install
...
%find_lang %{name}              # generate a special file list
...

%files -f %{name}.lang          # use the special file list
%defattr(-,root,root)           # list the other files
%doc README
...


Explicit %lang

In some cases, you may need to add things not handled by %find_lang. Example from numlock.spec:

%files
%defattr(755,root,root)
...
%lang(cs) /usr/X11R6/man/cs/man1/*
%lang(et) /usr/X11R6/man/et/man1/*
%lang(eu) /usr/X11R6/man/eu/man1/*
...


%lang drawback

When adding a language on a installed system, the %lang flagged files in already installed packages are not added. This is why localedrake only propose languages chosen during installation.


One package per language

%lang is quite nice for "not too big" language dependent files. When the size is quite big, it's interesting to create separate packages:

The per language package should:


Note:
This Policy is based on the Mandriva Packaging and Localization Policy.