[Po4a-commits] r2587 - in /trunk: Po4aBuilder.pm po/bin/LINGUAS po/bin/Makefile po/bin/Makevars po/bin/POTFILES.in po/pod.cfg
barbier at users.alioth.debian.org
barbier at users.alioth.debian.org
Sun Sep 23 19:55:24 UTC 2012
Author: barbier
Date: Sun Sep 23 19:55:24 2012
New Revision: 2587
URL: http://svn.debian.org/wsvn/po4a/?sc=1&rev=2587
Log:
Revert " * Build.PL: Convert to the po4a-build build system."
We want to add --porefs=counter options to po4a options, it is easier
to do that with po/pod.cfg. This will also push back addenda in
translations, which had been discarded when switching to po4a-build.
Removed:
trunk/po/bin/LINGUAS
trunk/po/bin/Makefile
trunk/po/bin/Makevars
trunk/po/bin/POTFILES.in
Modified:
trunk/Po4aBuilder.pm
trunk/po/pod.cfg
Modified: trunk/Po4aBuilder.pm
URL: http://svn.debian.org/wsvn/po4a/trunk/Po4aBuilder.pm?rev=2587&op=diff
==============================================================================
--- trunk/Po4aBuilder.pm (original)
+++ trunk/Po4aBuilder.pm Sun Sep 23 19:55:24 2012
@@ -10,8 +10,9 @@
sub ACTION_build {
my $self = shift;
$self->depends_on('code');
- $self->depends_on('po4a_build');
+ $self->depends_on('docs');
$self->depends_on('distmeta'); # regenerate META.yml
+ $self->depends_on('man');
$self->depends_on('postats');
}
@@ -23,15 +24,6 @@
my $current_mode = stat($file)->mode;
chmod $current_mode | oct(200), $file;
}
-}
-
-sub ACTION_po4a_build {
- my $self = shift;
- $self->depends_on('binpo');
- $self->make_files_writable("po/pod");
- system("./share/po4a-build -f po4a-build.conf") && die;
- File::Path::mkpath( File::Spec->catdir( 'blib', 'manl10n' ), 0, oct(777) );
- system ("cp -R _build/po4a/man/* blib/manl10n") && die;
}
sub perl_scripts {
@@ -167,6 +159,87 @@
$self->delete_filetree($dist_dir);
}
+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\@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);
+
+ 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 (perl_scripts()) {
+ $file =~ m,([^/]*)$,;
+ system ("cp $file blib/man/man1/$1.1p.pod") and die;
+ }
+
+ foreach $file (@{$self->rscan_dir('blib/man',qr{\.pod$})}) {
+ next if $file =~ m/^man7/;
+ my $out = $file;
+ $out =~ s/\.pod$//;
+ $parser->{name} = $out;
+ $parser->{name} =~ s/^.*\///;
+ $parser->{name} =~ s/^(.*).(1p|3pm|5|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 =~ m/man\d/) {
+ $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;
+ unlink "$file" || die;
+ }
+
+ # Install the manpages written in XML DocBook
+ system ("cp share/doc/po4a-build.xml share/doc/po4aman-display-po.xml share/doc/po4apod-display-po.xml blib/man/man1/") and die;
+ foreach $file (@{$self->rscan_dir('blib/man',qr{\.xml$})}) {
+ if ($file =~ m,(.*/man(.))/([^/]*)\.xml$,) {
+ my ($outdir, $section, $outfile) = ($1, $2, $3);
+ system("xsltproc -o $outdir/$outfile.$section --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $file") and die;
+ system ("gzip -9 -f $outdir/$outfile.$section") and die;
+ }
+ unlink "$file" || die;
+ }
+}
+
sub ACTION_postats {
my $self = shift;
$self->depends_on('binpo');
Modified: trunk/po/pod.cfg
URL: http://svn.debian.org/wsvn/po4a/trunk/po/pod.cfg?rev=2587&op=diff
==============================================================================
--- trunk/po/pod.cfg (original)
+++ trunk/po/pod.cfg Sun Sep 23 19:55:24 2012
@@ -1,10 +1,33 @@
[po_directory] po/pod
+[po4a_alias:docbook] docbook opt:"-M UTF-8 -L UTF-8"
[po4a_alias:pod] pod opt:"-M UTF-8 -L UTF-8"
-
[po4a_alias:man] man opt:"-M UTF-8 -L UTF-8"
+[type:docbook] share/doc//po4a-build.xml $lang:share/doc//$lang/po4a-build.xml
+
+[type:docbook] share/doc//po4aman-display-po.xml $lang:share/doc//$lang/po4aman-display-po.xml
+
+[type:docbook] share/doc//po4apod-display-po.xml $lang:share/doc//$lang/po4apod-display-po.xml
+
+[type: pod] po4a $lang:blib/man/$lang/man1/po4a.1p.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] po4a-gettextize $lang:blib/man/$lang/man1/po4a-gettextize.1p.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] po4a-normalize $lang:blib/man/$lang/man1/po4a-normalize.1p.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] po4a-translate $lang:blib/man/$lang/man1/po4a-translate.1p.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] po4a-updatepo $lang:blib/man/$lang/man1/po4a-updatepo.1p.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] scripts/msguntypot $lang:blib/man/$lang/man1/msguntypot.1p.pod \
+ add_$lang:?doc/addendum.$lang
+
+[type: pod] doc/po4a-build.conf.5.pod $lang:blib/man/$lang/man5/po4a-build.conf.5.pod \
+ add_$lang:?doc/addendum.$lang
[type: pod] doc/po4a.7.pod $lang:blib/man/$lang/man7/po4a.7.pod \
+ add_$lang:?doc/addendum.$lang
+[type: pod] doc/po4a-runtime.7.pod $lang:blib/man/$lang/man7/po4a-runtime.7.pod \
add_$lang:?doc/addendum.$lang
[type: pod] lib/Locale/Po4a/BibTeX.pm $lang:blib/man/$lang/man3/Locale::Po4a::BibTeX.3pm.pod \
@@ -60,27 +83,3 @@
# deprecated, use Text instead
#[type: pod] lib/Locale/Po4a/NewsDebian.pm $lang:blib/man/$lang/man3/Locale::Po4a::NewsDebian.3pm.pod \
# add_$lang:?doc/addendum.$lang
-
-[type: pod] po4a $lang:blib/man/$lang/man1/po4a.1p.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] po4a-gettextize $lang:blib/man/$lang/man1/po4a-gettextize.1p.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] po4a-normalize $lang:blib/man/$lang/man1/po4a-normalize.1p.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] po4a-translate $lang:blib/man/$lang/man1/po4a-translate.1p.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] po4a-updatepo $lang:blib/man/$lang/man1/po4a-updatepo.1p.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] scripts/msguntypot $lang:blib/man/$lang/man1/msguntypot.1p.pod \
- add_$lang:?doc/addendum.$lang
-
-[type: pod] doc/po4a-build.conf.5.pod $lang:blib/man/$lang/man5/po4a-build.conf.5.pod \
- add_$lang:?doc/addendum.$lang
-[type: pod] doc/po4a-runtime.7.pod $lang:blib/man/$lang/man7/po4a-runtime.7.pod \
- add_$lang:?doc/addendum.$lang
-
-[type: man] scripts/po4aman-display-po.1 $lang:blib/man/$lang/man1/po4aman-display-po.1 \
- add_$lang:?doc/addendum_man.$lang
-[type: man] scripts/po4apod-display-po.1 $lang:blib/man/$lang/man1/po4apod-display-po.1 \
- add_$lang:?doc/addendum_man.$lang
-
More information about the Po4a-commits
mailing list