Stop data retention! Click here & act! Are you a webmaster and want to participate? Here you can find all necessary material for your website - Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Chris Karakas Online Forum Index Karakas Online
 FAQFAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
How to install po4a from source and build the RPM package



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
   Chris Karakas Online Forum Index -> SGML, XML and DocBook Forum RSS Feed of this Forum
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea  View previous topic :: View next topic  
Author Message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Wed Mar 30, 2005 10:27 am    Post subject: How to install po4a from source and build the RPM package
Reply with quote

The po4a (po for anything) project goal is to ease translations (and more interestingly, the maintenance of translations) using gettext tools on areas where they were not expected like documentation. From the introduction to po4a:

Code:

The whole point of po4a is to make the documentation translation maintainable. The idea is to reuse the gettext methodology to this new field. Like in gettext, texts are extracted from their original locations in order to be presented in a uniform format to the translators. The classical gettext tools help them updating their works when a new release of the original comes out. But to the difference of the classical gettext model, the translations are then re-injected in the structure of the original document so that they can be processed and distributed just like the English version.

Thanks to this, discovering which parts of the document were changed and need an update becomes very easy. Another good point is that the tools will make almost all the work when the structure of the original document gets fundamentally reorganized and when some chapters are moved around, merged or split. By extracting the text to translate from the document structure, it also keeps you away from the text formatting complexity and reduces your chances to get a broken document (even if it does not completely prevent you to do so).


The great advantage of po4a against xml2po is that it supports Docbook SGML (as opposed to DocBook XML), which is the vocabulary I use in my documents, like the PHP-Nuke HOWTO (on the other hand, it does not support XML, so that po4a and xml2po can be seen as complementary projects). It allows one to transform a DocBook SGML document to a file in the PO format. The PO file contains all text that must be translated - but not the SGML markup (well, not exactly: it still contains inline markup like <emphasis> for example - but that's easy to cope with in a translation). Thus the translator does not see all the SGML markup of the document and is not distracted by it. He only has to use a tool, like poedit, and translte all text snippets, one by one:

Image

At the end of the translation, he only has to send the translated PO file to the author who, using tools of the po4a package like po4a-translate, will produce the final translated document with the simple invocation:

Code:

po4a-translate -f <format> -m <master.doc> -p <doc-XX.po> -l <XX.doc>


Of course, in order for the author to use po4a, he must first install it. In the following posts I will describe what steps are needed for the installation of po4a - stay tuned! Very Happy
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Wed Mar 30, 2005 11:27 am    Post subject:
Reply with quote

The installation of po4a from source degenerates very fast to a real installation orgy of dependent packages (package names refer to a SuSE Linux system, so that "perl-Text-WrapI18N", for example, means that you need the Perl Text::WrapI18N module):

To use poedit, you need these packages:

  • perl >= 5.006
  • gettext >= 0.12.2 (older versions don't support Perl, see xgettext: language 'Perl' unknown), which needs (maybe only for build):
    • autoconf >= 2.58, which, in turn, is good to have the current automake package:
      • automake
  • perl-gettext (Perl module Locale::gettext)
  • perl-Text-WrapI18N, which needs:
    • perl-Text-CharWidth
  • perl-TermReadKey
  • opensp
  • perl-SGMLS


To build po4a from source, you need (additionally to a base build system, as described by a minimum usedforbuild line):

  • gettext-devel >= 0.12.2 (see above for the version constraint)
  • perl-Module-Build, which in turn needs:
    • perl-Archive-Tar >= 1.08, which again needs:
      • perl-Compress-Zlib
      • perl-IO-Zlib
    • perl-ExtUtils-ParseXS, which needs:
      • perl-ExtUtils-CBuilder
    • perl-Module-Info
    • perl-YAML
  • XFree86


Arrow Incredible but true: you really need XFree86 on your build system, if you want to build po4a from source - even though the tools you will build are all command-line! Without XFree86, you will get this error during compilation:

Code:

X Translate binary manpages to it
Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. at /usr/lib/perl5/vendor_perl/5.8.1/i586-linux-thread-multi/Term/ReadKey.pm line 343.
Died at /usr/src/packages/BUILD/po4a-0.20/_build/lib/My/Builder.pm line 151.
make: *** [all] Error 127
error: Bad exit status from /var/tmp/rpm-tmp.93110 (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.93110 (%build)


It seems that, for some reason, the size of the X terminal must be determined through the resize command, which resides in /usr/X11R6/bin/resize. On a build system that contains only a minimal installation, such as the SuSE build system, you will get the above error if XFree86 is not installed.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Wed Mar 30, 2005 12:04 pm    Post subject:
Reply with quote

I have compiled ready-to-use RPM packages (both binary and source) for all the extra software listed above. Use the command

Code:

rpm -Uhv xxx.rpm


to install the binary RPMs. I used the build package of SuSE to compile my own source RPMs from source, as described for example in Compiling SuSE Source Packages. Note that up to and including version 9.0, SuSE uses the usedforbuild string on a comment line of the spec file to list all needed files for a successful compilation of the package.

All packages are build for SuSE 9.0. To rebuild a package for your own version of (SuSE) Linux, use the source RPMs and the build and/or rpmbuild commands, as described in How to compile an older version for a newer system in RPM.

Binary RPMs:



Source RPMs:



Finally, here are the po4a binary and source RPMs:



Happy installing! Enjoy! Very Happy

Arrow Note: Any other package listed in the previous post and not present in the above lists can be safely installed from the standard SuSE 9.0 (or later) distribution.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Wed Mar 30, 2005 9:47 pm    Post subject:
Reply with quote

See Greek Translation of the PHP-Nuke How-To for my first experiences with the use of po4a in "getextsizing" the PHP-Nuke HOWTO. It turns out that there is a bug in po4a and processing of the HOWTO cannot continue before the issue is resolved.

This does not mean that you should not give po4a a try with your SGML document - YMMV. It simply means that the SGML code of the PHP-Nuke HOWTO is an excellent "torture" test suite for po4a. Twisted Evil
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6267
Location: Outer Space

PostPosted: Wed Jul 05, 2006 4:34 pm    Post subject:
Reply with quote

I have compiled source and binary RPMs for the latest po4a version 0.26:



The bug I reported above should have been corrected (according to the author at least, didn't check it myself though - but I will! Wink)

Enjoy! Very Happy
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea 
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
   Chris Karakas Online Forum Index -> SGML, XML and DocBook Forum
Page 1 of 1
This page contains valid HTML 4.01 Transitional - click here to check it!
This page contains a valid CSS - click here to check it!

 

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group