Summary of changes for po4a-build methods
by Neil Williams
(The list doesn't seem to like attachments - that Makefile never made
it, so these are included directly.)
These are just for review, there are some extra files that actually
make the whole thing work, as well as a few updates in po4a-build
itself.
First, the changes to Build.PL - mainly simplification.
(Module::Build insists on foo.1p.gz and foo.3pm.gz, despite po4a-build
doing the right thing, so there's a simple `find -delete` to ensure the
po4a-build versions are used. The changes also leave the compression to
debhelper.)
diff -u po4a-cvs/Build.PL po4a-adapt/Build.PL
--- po4a-cvs/Build.PL 2009-07-21 17:38:56.000000000 +0100
+++ po4a-adapt/Build.PL 2009-11-10 18:31:49.000000000 +0000
@@ -13,12 +13,8 @@
$self->depends_on('code');
$self->depends_on('docs');
$self->depends_on('distmeta'); # regenerate META.yml
- $self->depends_on('man');
$self->depends_on('postats');
- }
- sub perl_scripts {
- return ('po4a-gettextize', 'po4a-updatepo', 'po4a-translate',
- 'po4a-normalize', 'po4a', 'scripts/msguntypot');
+ $self->depends_on('shell');
}
sub ACTION_install {
my $self = shift;
@@ -32,169 +28,26 @@
$mandir =~ s/\/man1$//;
$install_map{'blib/man'} = $mandir;
- my $localedir = $mandir;
- $localedir =~ s/\/man$/\/locale/;
- $install_map{'blib/po'} = $localedir;
-
ExtUtils::Install::install(\%install_map, 1, 0, $self->{args}{uninst}||0);
+ system ("cp -R _build/po4a/man/* $mandir");
+ system ("find . -name '*.1p' -delete");
+ system ("find . -name '*.3pm' -delete");
}
- sub ACTION_binpo {
- my $self = shift;
-
- my @files = sort((perl_scripts(), @{$self->rscan_dir('lib',qr{\.pm$})}));
- unless ($self->up_to_date(\@files, "po/bin/po4a.pot")) {
- print "XX Update po/bin/po4a.pot\n";
- my $podfiles = join ("", map {" ../../".$_ } @files);
- my $cmd = "cd po/bin; xgettext ";
- $cmd .= "--from-code=utf-8 ";
- $cmd .= "-L Perl ";
- $cmd .= "--msgid-bugs-address po4a-devel\(a)lists.alioth.debian.org ";
- $cmd .= "--package-name po4a ";
- $cmd .= "--package-version ".$self->dist_version()." ";
- $cmd .= "$podfiles ";
- $cmd .= "-o po4a.pot.new";
- system($cmd) && die;
- if ( -e "po/bin/po4a.pot") {
- $diff = qx(diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/po4a.pot po/bin/po4a.pot.new);
- if ( $diff eq "" ) {
- unlink "po/bin/po4a.pot.new" || die;
- # touch it
- my ($atime, $mtime) = (time,time);
- utime $atime, $mtime, "po/bin/po4a.pot";
- } else {
- rename "po/bin/po4a.pot.new", "po/bin/po4a.pot" || die;
- }
- } else {
- rename "po/bin/po4a.pot.new", "po/bin/po4a.pot" || die;
- }
- } else {
- print "XX po/bin/po4a.pot uptodate.\n";
- }
-
- # update languages
- @files = @{$self->rscan_dir('po/bin',qr{\.po$})};
- foreach (@files) {
- next if m|/.#|;
- $_ =~ /.*\/(.*)\.po$/;
- my $lang = $1;
-
- unless ($self->up_to_date("po/bin/po4a.pot","po/bin/$lang.po")) {
- print "XX Sync po/bin/$lang.po: ";
- system("msgmerge --previous po/bin/$lang.po po/bin/po4a.pot -o po/bin/$lang.po.new") && die;
- # Typically all that changes was a date. I'd
- # prefer not to cvs commit such changes, so
- # detect and ignore them.
- $diff = qx(diff -q -I'#:' -I'POT-Creation-Date:' -I'PO-Revision-Date:' po/bin/$lang.po po/bin/$lang.po.new);
- if ($diff eq "") {
- unlink "po/bin/$lang.po.new" || die;
- # touch it
- my ($atime, $mtime) = (time,time);
- utime $atime, $mtime, "po/bin/$lang.po";
- } else {
- rename "po/bin/$lang.po.new", "po/bin/$lang.po" || die;
- }
- } else {
- print "XX po/bin/$lang.po uptodate.\n";
- }
- unless ($self->up_to_date("po/bin/$lang.po","blib/po/$lang/LC_MESSAGES/po4a.mo")) {
- system("mkdir -p blib/po/$lang/LC_MESSAGES") && die;
- system("msgfmt -o blib/po/$lang/LC_MESSAGES/po4a.mo po/bin/$lang.po") && die;
- }
- }
-
- }
- sub ACTION_manpo {
- my $self = shift;
-
- my $cmd = "PERL5LIB=lib perl po4a "; # Use this version of po4a
- $cmd .= "--previous ";
- $cmd .= "--no-translations ";
- $cmd .= "--msgid-bugs-address po4a-devel\(a)lists.alioth.debian.org ";
- $cmd .= "--package-name po4a ";
- $cmd .= "--package-version ".$self->dist_version()." ";
- $cmd .= "po/pod.cfg";
- system($cmd)
- and die;
- }
- sub ACTION_man {
- my $self = shift;
-
- use Pod::Man;
- use Encode;
-
- # Translate binaries manpages
- my %options;
- $options{utf8} = 1;
- my $parser = Pod::Man->new (%options);
+ sub ACTION_shell {
+ my ($self) = @_;
- system("PERL5LIB=lib perl po4a --previous po/pod.cfg") and die;
system("mkdir -p blib/man/man7") and die;
system("mkdir -p blib/man/man1") and die;
- system("cp doc/po4a.7.pod blib/man/man7") and die;
-
- foreach $file (@{$self->rscan_dir('blib/man',qr{\.pod$})}) {
- next if $file =~ m/^man7/;
- my $out = $file;
- $out =~ s/\.pod$//;
- $section = $2;
- $parser->{name} = $out;
- $parser->{name} =~ s/^.*\///;
- $parser->{name} =~ s/^(.*).(1p|3pm|7)/$1/;
- $parser->{section} = $2;
- if ($parser->{section} ne "3pm") {
- $parser->{name} = uc $parser->{name};
- }
-
- my $lang = $out;
- $lang =~ s/^blib\/man\/([^\/]*)\/.*$/$1/;
-
- if ($lang eq "man7") {
- $parser->{release} = $parser->{center} = "Po4a Tools";
- } else {
- my $command;
- $command = "msggrep -K -E -e \"Po4a Tools\" po/pod/$lang.po |";
- $command .= "msgconv -t UTF-8 | ";
- $command .= "msgexec /bin/sh -c '[ -n \"\$MSGEXEC_MSGID\" ] ";
- $command .= "&& cat || cat > /dev/null'";
-
- my $title = `$command 2> /dev/null`;
- $title = "Po4a Tools" unless length $title;
- $title = Encode::decode_utf8($title);
- $parser->{release} = $parser->{center} = $title;
- }
- $parser->parse_from_file ($file, $out);
-
- system("gzip -9 -f $out") and die;
- system("rm -f $file") and die;
- }
-
# Install the manpages of the Shell scripts
system ("cp scripts/po4aman-display-po.1 scripts/po4apod-display-po.1 blib/man/man1/") and die;
+ system ("cp -R share/doc/po4a/* blib/");
foreach $file (@{$self->rscan_dir('blib/man',qr{\.1$})}) {
- system ("gzip -9 -f $file") and die;
+# system ("gzip -9 -f $file") and die;
}
}
- sub ACTION_dist {
- my ($self) = @_;
-
- $self->depends_on('test');
- $self->depends_on('distdir');
-
- my $dist_dir = $self->dist_dir;
-
- if ( -e "$dist_dir.tar.gz") {
- # Delete the distfile if it already exists
- system ("rm $dist_dir.tar.gz") && die;
- }
-
- $self->make_tarball($dist_dir);
- $self->delete_filetree($dist_dir);
- }
sub ACTION_postats {
my $self = shift;
- $self->depends_on('binpo');
- $self->depends_on('manpo');
$self->postats("po/bin");
$self->postats("po/pod");
}
@@ -235,12 +88,14 @@
},
script_files => ['po4a-gettextize', 'po4a-updatepo',
'po4a-translate', 'po4a-normalize', 'po4a', 'scripts/msguntypot',
- 'scripts/po4aman-display-po', 'scripts/po4apod-display-po'],
+ 'scripts/po4aman-display-po', 'scripts/po4apod-display-po',
+ 'share/po4a-build'],
add_to_cleanup => ['t/tmp','messages.mo', 'blib',
'po/pod/po4a-pod.pot~', 'po4a.log'],
dist_abstract => 'Tools for helping translation of documentation',
dist_author => ['Martin Quinson (mquinson#debian.org)',
- 'Denis Barbier <barbier(a)linuxfr.org>']
+ 'Denis Barbier <barbier(a)linuxfr.org>',
+ 'Neil Williams <linux(a)codehelp.co.uk>']
);
$b->create_build_script;
A few changes in the Makefile (using new files in po/bin, mostly copied
from the share/ examples):
Only in po4a-adapt/po/bin/: LINGUAS
Only in po4a-adapt/po/bin/: Makefile
Only in po4a-adapt/po/bin/: Makevars
Only in po4a-adapt/po/bin/: POTFILES.in
diff -u po4a-cvs/Makefile po4a-adapt/Makefile
--- po4a-cvs/Makefile 2005-02-26 23:38:15.000000000 +0000
+++ po4a-adapt/Makefile 2009-11-10 19:00:32.000000000 +0000
@@ -1,4 +1,6 @@
all: Build
+ ./share/po4a-build -f share/po4a-build.conf
+ ./share/po4a-build -f po4a-build.conf
@./Build
Build: Build.PL
@@ -6,11 +8,17 @@
install: Build
@./Build install destdir=$(DESTDIR)
+ make -C po/bin install DESTDIR=$(DESTDIR)
clean: Build
@./Build realclean
+ $(MAKE) -C share clean
+ $(MAKE) -C po/bin clean
dist: Build
+ ./share/po4a-build --pot-only -f ./share/po4a-build.conf
+ ./share/po4a-build --pot-only -f ./po4a-build.conf
+ $(MAKE) -C po/bin pot
@./Build dist
stats: Build
(It may be worth moving po4a-build into scripts/ but that doesn't
affect the translation of the other shell scripts - doclifter can
generate XML and po4a can then translate it and po4a-build keep the
translated manpages in line.)
Add the po4a-build files to the manifest:
diff -u po4a-cvs/MANIFEST po4a-adapt/MANIFEST
--- po4a-cvs/MANIFEST 2009-11-10 19:43:30.000000000 +0000
+++ po4a-adapt/MANIFEST 2009-11-10 12:29:26.000000000 +0000
@@ -91,6 +91,20 @@
po4a-normalize
po4a-translate
po4a-updatepo
+share/po4a-build
+
+# support files
+share/Makevars-perl.example
+share/po4a-build.conf
+share/ChangeLog
+share/Makevars-shell.example
+share/po4a-build.make
+share/README
+share/po4a-build.conf.example
+share/doc/po4a-build.xml
+share/po/Makevars
+share/po/POTFILES.in
+share/po/Makefile
# the random additional cool scripts
scripts/msguntypot
Changes in debian/control: (po4a-build, being shell, uses an XML
manpage and therefore build-depends are needed for xsltproc and the
XSL. This can also add support for the other shell scripts which are
translated by hand, AFAICT.
diff -u po4a-cvs/debian/control po4a-adapt/debian/control
--- po4a-cvs/debian/control 2009-08-30 15:34:19.000000000 +0100
+++ po4a-adapt/debian/control 2009-11-10 18:46:36.000000000 +0000
@@ -2,9 +2,11 @@
Section: text
Priority: optional
Maintainer: Nicolas FRANCOIS (Nekral) <nicolas.francois(a)centraliens.net>
-Uploaders: Martin Quinson <mquinson(a)debian.org>, Pierre Machard <pmachard(a)debian.org>
+Uploaders: Martin Quinson <mquinson(a)debian.org>, Pierre Machard <pmachard(a)debian.org>,
+ Neil Williams <codehelp(a)debian.org>
Standards-Version: 3.8.3
-Build-Depends-Indep: perl-modules (>= 5.10.0-16), libmodule-build-perl, gettext (>= 0.16)
+Build-Depends-Indep: perl-modules (>= 5.10.0-16), libmodule-build-perl, gettext (>= 0.16),
+ xsltproc, docbook-xsl
Build-Depends: debhelper (>> 7.0.0)
Homepage: http://po4a.alioth.debian.org/
Vcs-Cvs: :pserver:anonymous@cvs.alioth.debian.org:/cvsroot/po4a
A few changes in debian/rules:
diff -u po4a-cvs/debian/rules po4a-adapt/debian/rules
--- po4a-cvs/debian/rules 2009-07-21 18:13:09.000000000 +0100
+++ po4a-adapt/debian/rules 2009-11-10 18:52:39.000000000 +0000
@@ -27,16 +27,15 @@
fi;
$(PERL) Build.PL installdirs=vendor create_packlist=0
- $(PERL) Build
+ $(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
-
- -$(PERL) Build clean
+ $(RM) -r html t/tmp po/www
rm -rf _build build-stamp Build
-
+ $(MAKE) clean
dh_clean
install: build
@@ -44,14 +43,8 @@
dh_testroot
dh_prep
dh_installdirs
-
+ $(MAKE) install DESTDIR=$(DESTDIR) prefix=/usr
# $(PERL) Build test
- $(PERL) Build install destdir=$(DESTDIR)
-
- for man in $(DESTDIR)/usr/share/man/man3/*.3pm; do \
- sed -i -e "s/ç/\\[,c]/g;s/Ç/\\[,C]/g" \
- -e "s/ü/\\[:u]/g;s/é/\\['e]/g" $$man; \
- done
# Build architecture-independent files here.
binary-indep: build install
@@ -60,6 +53,9 @@
dh_installdocs NEWS
dh_installchangelogs changelog
dh_installexamples
+ dh_lintian
dh_compress
dh_fixperms
dh_installdeb
(lintian is to override the results of #555330)
Overall, these changes aren't that large and mainly involve removing
the duplication that arises from adding a build method to the package
that can be used by the package itself.
These look OK?
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/
15 years
Section 3 manpages for modules
by Neil Williams
po4a currently builds files like:
/usr/share/man/fr/man3/Locale::Po4a::Common.3pm.gz
I think this should be:
/usr/share/man/fr/man3/Locale::Po4a::Common.3.gz
i.e. there is no man section "3pm", there is a section '3'.
A lot of the files I can find on my system that are listed as in section
'3pm' by dwww are from perl modules but 'man' does not accept the 3pm
and assumes (3) as long as you don't specify '3pm'.
po4a-build will create files in section '3', if there are any problems
with that (there's no override support at this time), let me know.
In the output, man does this with the current files:
Locale::Po4a::Chooser(3pm) User Contributed Perl Documentation
Locale::Po4a::Chooser(3pm)
and this with the new files:
Locale::Po4a::Chooser(3) User Contributed Perl Documentation
Locale::Po4a::Chooser(3)
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/
15 years
build methods
by Neil Williams
How is po4a built from CVS?
I've tried:
$ cvs-buildpackage -U HEAD
but that gives me a horrid .diff.gz:
Debian:
e8c7aa6930fc609ec474b6167119bb6f431bbd74 7226 po4a_0.36.6-1.diff.gz
Mine:
f01a5802f0e3874a3e56a2a40beffe7a4c1c3e68 301791 po4a_0.36.6-1.diff.gz
$ lsdiff -z /opt/debian/cvsdeb/po4a/po4a_0.36.6-1.diff.gz|wc -l
80
Is there a custom script, not in CVS?
I've already noticed that building inside the CVS working copy is a
problem - the changes to the PO files cause dozens of conflicts.
What's the procedure?
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/
15 years
Addendum.es and Vim txt files
by Omar Campagne
Hello:
I submitted today the update for po4a/po/pod/es.po, BTS 554771, and I
wanted to ask if somebody with access to the sources could please put my
name and email on the addendum.es file as second translator. I would
also like to maintain the po's in po4a, so please contact me whenever
these are modified to offer a timely update.
On the other hand, last time I wrote to this mail list it seemed that
the problem with how po4a handled vim's help files was solved on Nicolas
side (judging by what he sent to me on the basis of the fixes).
My questions are: Will those fixes get to the next release? Are they
already available in any form? Nicolas commented on the possibility of
using the fixes without building from sources. In case the later is not
possible, when is next the po4a coming out?
Just out of curiosity, and to know at which point of the translation
project I'll have to re-order the git repository to make it more
suitable for po4a.
Thanks.
Omar Campagne
15 years
po4a-build and associated files.
by Neil Williams
I'm exploring po4a-build and associated files.
I added a share/ directory so that I can work without affecting other
areas. (Problem with CVS is that adding and removing stuff is more
awkward than with svn etc.) I chose share because 'build' is already in
use and other files for po4a-build need to be shared amongst other
packages - like the Makefile derived from autotools (called
po4a-build.make to keep it separate from the Makefile itself).
I'm thinking of this kind of layout:
share/po4a-build
share/Makefile
share/po4a-build.make
share/po4a-build-Makevars.example
share/po/
share/po/Makefile
share/po/Makevars
share/po/POTFILES.in
po4a might actually want to use the po4a-build system itself - at least
for the binaries, or the current po4a binary translation system could
migrate into something portable to other packages (as the po4a-build
one is portable).
Before that's decided, the po4a-build system for it's own binary needs
to go somewhere, I need to document it and people need to see it. :-)
I'm thinking of basically working almost independently within the
share/ directory and then merging once the bugs are ironed out. Almost
using share/ as a branch but retaining share/ even in the long-term to
carry the files that need to go into /usr/share/po4a/ (rather than
/usr/share/doc/po4a/ because other packages need to be able to execute
these files as well as copy or symlink them).
svn-buildpackage and emdebian-rootfs would then include the po4a-build
Makefile for their po directory, copy and adapt the example Makevars
and set POTFILES.in to setup their own script output translations.
po4a-build itself is then called elsewhere in the svn-buildpackage and
emdebian-rootfs build to prepare the translated manpages and other
content.
po4a-build itself only has a few translatable strings but the
po4a-build system is already in use in SVN for svn-buildpackage and
emdebian-rootfs. (It's designed for packages that want script output
translation but don't use autotools, just make.)
I won't add share to the top level Makefile at this stage, it won't
affect the rest of the build that way.
Documentation will be DocBook XML and use po4a-build for translation.
I'm expecting to find lots of bugs in po4a-build - a few hidden
assumptions and things - and I'll continue migrating changes into the
genmanpages scripts in svn-buildpackage and emdebian-rootfs until
po4a-build is ready for a release as genuine part of po4a.
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/
15 years
build errors
by Neil Williams
On Fri, 06 Nov 2009 21:04:33 +0000
Nicolas FRAN__OIS <nekral-guest(a)alioth.debian.org> wrote:
> Update of /cvsroot/po4a/po4a/doc
> In directory alioth:/tmp/cvs-serv9750/doc
My build is currently failing after the es.po update.
Addendum doc/addendum_man.es does not exist.
Died at /opt/working/po4a/_build/lib/My/Builder.pm line 125.
make: *** [all] Error 2
??
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/
15 years