Re: How to create langpacks for a rpm package?

2016-01-11 Thread Petr Pisar
On 2016-01-08, Mark Wielaard  wrote:
> On Fri, 2016-01-08 at 08:31 +, Petr Pisar wrote:
>> RPM has a run-time macro allowing to exclude localization files from
>> installing them. That's the reason why the message catalog files, if
>> packaged properly, carry a language attribute in the binary RPM package
>> metadata.
>
> Is there a description of this so I can check I did it correctly for my
> package?
>
There was rpm2xml (or something like that) tool that listed RPM package
content in XML format and it printed file attributes that carry the
language value. But the tool was removed from rpm. I cannot remember any
other way how to obtain the data.

Basically, if your spec file uses %find_lang to gather and mark the
language attributes, the package should be fine.

>> Utilizing this feature (as well as documentation stripping) is job for
>> a package manager. For DNF.
>
> How does DNF do this?
> How would I (de)install/scrub (un)needed translations from my system?
>
I think DNF does not support it.

But it should work on rpm level. See %_install_langs in
/usr/lib/rpm/macros. I guess if you set the macro to empty or `C' value,
and reinstall a package, its locale files should disappear from the file
system.

And because DNF uses rpm for installation, I believe it should affect
packages installed by DNF too.

-- Petr

--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org


Re: How to create langpacks for a rpm package?

2016-01-11 Thread Honza Å ilhan
> From: "Petr Pisar" 
> On 2016-01-08, Mark Wielaard  wrote:
> > On Fri, 2016-01-08 at 08:31 +, Petr Pisar wrote:
> >> Utilizing this feature (as well as documentation stripping) is job for
> >> a package manager. For DNF.
> >
> > How does DNF do this?
> > How would I (de)install/scrub (un)needed translations from my system?
> >
> I think DNF does not support it.

There's a proposal to have langpacks defined by weak and rich dependency
feature of rpm [1] without rpm macros and plugin code. That way the unneeded
langpack would be automatically erased when the package it belongs to
does not exist on your system anymore or you have removed the language.

> But it should work on rpm level. See %_install_langs in
> /usr/lib/rpm/macros. I guess if you set the macro to empty or `C' value,
> and reinstall a package, its locale files should disappear from the file
> system.
> 
> And because DNF uses rpm for installation, I believe it should affect
> packages installed by DNF too.

exactly

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1114422#c22
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org


Re: How to create langpacks for a rpm package?

2016-01-08 Thread Petr Pisar
On 2016-01-07, Mark Wielaard  wrote:
> Hi,
>
> I noticed one of my packages (elfutils libelf) installs a small library
> of 90K but also 1MB of .mo locale files. Given that this package will
> always be installed because it is on the critical path I thought it
> might be nice to split the locale files out into language packs so
> that you could create a smaller install. But I cannot find documentation
> on how to create langpacks. Is there a description of the conventions
> used for language packs and/or example rpm macros to help create them?
>
I'm against this because then elfutils will behave differnently than any
other packages. If you don't care about elfutils messages, you probably
don't care about other package's messages too.

RPM has a run-time macro allowing to exclude localization files from
installing them. That's the reason why the message catalog files, if
packaged properly, carry a language attribute in the binary RPM package
metadata.

Utilizing this feature (as well as documentation stripping) is job for
a package manager. For DNF.

(There is another hypothetical approach based on sub-packaging the
message catalogs that resembles your idea, but the approach was
postponed until Fedora will have support rich dependencies.)

-- Petr
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org


Re: How to create langpacks for a rpm package?

2016-01-08 Thread Mark Wielaard
On Fri, 2016-01-08 at 08:31 +, Petr Pisar wrote:
> On 2016-01-07, Mark Wielaard  wrote:
> > I noticed one of my packages (elfutils libelf) installs a small library
> > of 90K but also 1MB of .mo locale files. Given that this package will
> > always be installed because it is on the critical path I thought it
> > might be nice to split the locale files out into language packs so
> > that you could create a smaller install. But I cannot find documentation
> > on how to create langpacks. Is there a description of the conventions
> > used for language packs and/or example rpm macros to help create them?
> >
> I'm against this because then elfutils will behave differnently than any
> other packages. If you don't care about elfutils messages, you probably
> don't care about other package's messages too.

Yes. I wouldn't want the package to be (too) different from others.
I was just concerned that the installed package files are mostly
overhead that are not needed by most installs.

> RPM has a run-time macro allowing to exclude localization files from
> installing them. That's the reason why the message catalog files, if
> packaged properly, carry a language attribute in the binary RPM package
> metadata.

Is there a description of this so I can check I did it correctly for my
package?

> Utilizing this feature (as well as documentation stripping) is job for
> a package manager. For DNF.

How does DNF do this?
How would I (de)install/scrub (un)needed translations from my system?

Thanks,

Mark
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org


Re: How to create langpacks for a rpm package?

2016-01-07 Thread Parag Nemade
On Thu, Jan 7, 2016 at 8:34 PM, Mark Wielaard  wrote:
> Hi,
>
> I noticed one of my packages (elfutils libelf) installs a small library
> of 90K but also 1MB of .mo locale files. Given that this package will
> always be installed because it is on the critical path I thought it
> might be nice to split the locale files out into language packs so
> that you could create a smaller install. But I cannot find documentation
> on how to create langpacks. Is there a description of the conventions
> used for language packs and/or example rpm macros to help create them?

Generally langpack packages used to have their own separate sources, I
am not sure if you really require to create langpack packages for
elfutils.
But, if you want to create langpacks then just add subpackages per
available translation language which follows package naming guidelines
https://fedoraproject.org/wiki/Packaging:NamingGuidelines#Addon_Packages_.28langpacks.29

Then you need to add entry for your package in langpacks section which
is at the end of comps file.

Regards,
Parag.
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org