Bug#951398: Rebuild pax

2020-02-17 Thread Norbert Preining
BTW, you messed up the $dist variable, the pax.jar needs to go to
texmf-dist/scripts/pax/ not texmf-dist/tex/latex/pax/

The correct replacement in the build file is that

+  

Norbert

--
PREINING Norbert  https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#951398: Rebuild pax

2020-02-17 Thread Norbert Preining
On Mon, 17 Feb 2020, Bastien ROUCARIES wrote:
> They need to be replaced by link to their respective package (normally
> it is symlink to /usr/share/commons-logging.jar)

THanks, this is what I already implemented and test-building now.

Norbert

--
PREINING Norbert  https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#951398: Rebuild pax

2020-02-17 Thread Bastien ROUCARIES
On Mon, Feb 17, 2020 at 10:12 PM Norbert Preining  wrote:
>
> Hi Bastien,
>
> On Mon, 17 Feb 2020, Bastien ROUCARIES wrote:
> > For rebuilding pax you need to apply this patch then from
>
> Ok, it is not that easy but done that now.
>
> > source/pax/latex/pax run ant
>
> ok.
>
> This script generates **three** files:
> texmf-dist/tex/latex/pax/pax.jargood
> texmf-dist/tex/latex/pax/lib/commons-logging.jar
> texmf-dist/tex/latex/pax/lib/pdfbox.jar
>
> Are the last two necessary there, i.e., should we replace them with
> links to the respective files in the installed packages?

They need to be replaced by link to their respective package (normally
it is symlink to /usr/share/commons-logging.jar)

Best

Bastien
>
> Best
>
> Norbert
>
> --
> PREINING Norbert  https://www.preining.info
> Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
> GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#951398: Rebuild pax

2020-02-17 Thread Norbert Preining
Hi Bastien,

On Mon, 17 Feb 2020, Bastien ROUCARIES wrote:
> For rebuilding pax you need to apply this patch then from

Ok, it is not that easy but done that now.

> source/pax/latex/pax run ant

ok.

This script generates **three** files:
texmf-dist/tex/latex/pax/pax.jargood
texmf-dist/tex/latex/pax/lib/commons-logging.jar
texmf-dist/tex/latex/pax/lib/pdfbox.jar

Are the last two necessary there, i.e., should we replace them with
links to the respective files in the installed packages?

Best

Norbert

--
PREINING Norbert  https://www.preining.info
Accelia Inc. + IFMGA ProGuide + TU Wien + JAIST + TeX Live + Debian Dev
GPG: 0x860CDC13   fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13



Bug#951398: Rebuild pax

2020-02-17 Thread Bastien ROUCARIES
control: tags -1 + patch
control: severity -1 serious

Hi,

For rebuilding pax you need to apply this patch then from
source/pax/latex/pax run ant

It will create the whole stuff under script directory.

You will need to add depends to pdfbox and common-logging java package
but it work

When I will upload the TDS package you will need to remove the
latex/pax/ .jar files and remove the ant file.

Could you apply the patch, rebuild and test ?

Thanks

Bastien
diff --git a/scripts/pax/pax.jar b/scripts/pax/pax.jar
deleted file mode 100644
index 36371e2..000
Binary files a/scripts/pax/pax.jar and /dev/null differ
diff --git a/scripts/pax/pdfannotextractor.pl b/scripts/pax/pdfannotextractor.pl
index 085dc43..fd5dc30 100755
--- a/scripts/pax/pdfannotextractor.pl
+++ b/scripts/pax/pdfannotextractor.pl
@@ -39,18 +39,15 @@ ${title}Syntax:   $program [options] 
 Options:
   --help  print usage
   --version   print version number
-  --install   try installing PDFBox library
   --debug debug informations
 END_OF_USAGE
 
 my $help = 0;
 my $debug = 0;
-my $install = 0;
 my $opt_version = 0;
 use Getopt::Long;
 GetOptions(
   'debug!' => \$debug,
-  'install!' => \$install,
   'help!' => \$help,
   'version!' => \$opt_version,
 ) or die $usage;
@@ -59,24 +56,13 @@ if ($opt_version) {
   print "$name $date v$version\n";
   exit(0);
 }
-!$install and (@ARGV >= 1 or die $usage);
+(@ARGV >= 1 or die $usage);
 
 print $title;
 
 my $error = '!!! Error:';
-my $url_pdfbox = 'http://prdownloads.sourceforge.net/pdfbox/PDFBox-0.7.3.zip?download';
-my $size_pdfbox_zip = 22769102;
-my $size_pdfbox_jar = 3321771;
-my $name_pdfbox_jar = 'PDFBox-0.7.3.jar';
-my $entry_pdfbox= "PDFBox-0.7.3/lib/$name_pdfbox_jar";
 my $pdfbox = 'PDFBox';
-
 my $prg_kpsewhich = 'kpsewhich';
-my $prg_wget  = 'wget';
-my $prg_curl  = 'curl';
-my $prg_unzip = 'unzip';
-my $prg_texhash   = 'texhash';
-my $prg_mktexlsr  = 'mktexlsr';
 my $prg_java  = 'java';
 my %prg;
 
@@ -193,16 +179,11 @@ sub find_jar_pdfbox () {
 }
 }
 
+
 sub launch_pax () {
 check_prg $prg_java, 1;
 my @cmd = ($prg_java);
-my $sep = $is_win ? ';' : ':';
-my $cp = "$path_jar_pax";
-$cp .= "$sep$path_jar_pdfbox" if $path_jar_pdfbox;
-$cp .= "$sep$classpath" if $classpath;
-push @cmd, '-cp';
-push @cmd, $cp;
-push @cmd, $main_class;
+push @cmd, $path_jar_pax;
 push @cmd, @ARGV;
 debug 'System', "@cmd";
 system @cmd;
@@ -222,200 +203,6 @@ sub launch_pax () {
 return $exit_code;
 }
 
-# install part
-
-sub expand_var ($) {
-my $var = shift;
-check_prg $prg_kpsewhich, 1;
-my $cmd = $prg_kpsewhich
-  . " --progname $program"
-  . ' --expand-var';
-$cmd .= $is_win ? " \$$var" : " \\\$$var";
-debug 'Backticks', $cmd;
-my $path = `$cmd`;
-if ($? == 0) {
-chomp $path;
-debug 'Exit code', '0/success';
-debug "\$$var", $path;
-return $path;
-}
-if ($? == -1) {
-die "!!! Error: Cannot execute `$prg_kpsewhich' ($!)!\n";
-}
-if ($? & 127) {
-die "!!! Error: `$prg_kpsewhich' died with signal " . ($? & 127)
-. (($? & 128) ? ' with coredump' : '') . "!\n";
-}
-debug 'Exit code', ($? >> 8);
-return '';
-}
-
-sub ensure_dir ($) {
-my $dir = shift;
-return if -d $dir;
-mkdir $dir or die "$error Cannot create directory `$dir'!\n";
-debug 'mkdir', $dir;
-}
-
-sub file_size ($) {
-my $file = shift;
-return -1 unless -f $file;
-return (stat $file)[7];
-}
-
-if ($install) {
-# Can PDFBox already be found?
-find_jar_pdfbox;
-if ($path_jar_pdfbox) {
-print "* Nothing to do, because $pdfbox is already found:\n"
-  . "  $path_jar_pdfbox\n";
-exit(0);
-}
-
-# Find TEXMFVAR
-my $tds_root;
-foreach my $var ('TEXMFVAR', 'VARTEXMF') {
-$tds_root = expand_var $var;
-last if $tds_root;
-}
-$tds_root or die "$error Cannot find settings for `TEXMFVAR' or `VARTEXMF'!\n";
-
-# Create directories
-ensure_dir $tds_root;
-my $tds_pax = $tds_root;
-$tds_pax =~ s/(\/*)$/\/scripts/;
-ensure_dir $tds_pax;
-$tds_pax .= '/pax';
-ensure_dir $tds_pax;
-my $tds_pax_lib = "$tds_pax/lib";
-ensure_dir $tds_pax_lib;
-
-# Download
-my $dest_file = "$tds_pax/PDFBox-0.7.3.zip";
-if (file_size $dest_file == $size_pdfbox_zip) {
-debug "$pdfbox archive found", $dest_file;
-}
-else {
-my @cmd;
-my $prg_download;
-check_prg $prg_wget, 0;
-if ($prg{$prg_wget}) {
-$prg_download = $prg_wget;
-push @cmd, $prg_wget;
-push @cmd, '-O';
-}
-else {
-check_prg $prg_curl, 0;
-$prg{$prg_curl} or die "$error Cannot find programs `wget' or `curl'"
-   . " for downloading!\n";
-$prg_download = $prg_curl;
-