diff options
author | Karl Berry <karl@freefriends.org> | 2011-03-06 00:56:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-03-06 00:56:36 +0000 |
commit | 6c3b1b3b55d858db3797bb0c390e6069f7a7110c (patch) | |
tree | 6cd3aef6667deefc3bb8828e54e40b9917404be1 /Master/tlpkg | |
parent | e3846b2d038c95de01c83cac9c00af5ff62c9c93 (diff) |
first cut at supporting biber (still incomplete),
and outputting to Build as well as Master.
git-svn-id: svn://tug.org/texlive/trunk@21612 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 112 |
1 files changed, 83 insertions, 29 deletions
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 2dd557eb481..2162113dfe0 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -35,10 +35,10 @@ $INSTALL = "install -D -m 664"; $| = 1; select ((select (STDERR), $| = 1)[0]); -$startdir = getcwd(); # where we start from (raw dir) +$RAW_DIR = getcwd(); # where we start from (raw dir) chdir "../tmp.cooked" || die "chdir(../tmp.cooked) failed: $!"; -$TDS = getcwd(); # locate destination dir -chdir $startdir || die "chdir($startdir) failed: $!"; # back to raw +$COOKED_TOP = getcwd(); # output (cooked) directory paren +chdir $RAW_DIR || die "chdir($RAW_DIR) failed: $!"; # back to raw $Master = "$mydir/../.."; @@ -128,7 +128,6 @@ $Master = "$mydir/../.."; 'bgreek', "&MAKEcopy", 'bib2ml', "die 'skipping, no self-locate?, etc.'", 'bib2xhtml', "die 'skipping, requires PDF::API2'", - 'biber', "die 'skipping, arch-dependent perl, etc.'", 'bibextract', "die 'skipping, hardwires nawk cmd name'", 'biblatex-chicago', "&MAKEflatten", 'biblatex-contrib', "die 'skipping, use subdir'", @@ -840,6 +839,7 @@ $Master = "$mydir/../.."; 'amstex' => '&POSTamstex', 'apalike' => '&POSTapalike', 'babelbib' => '&POSTbabelbib', + 'biber' => '&POSTbiber', 'bibtex' => '&POSTbibtex', 'context-games' => '&POSTcontext_games', 'coordsys' => '&POSTcoordsys', @@ -1500,6 +1500,7 @@ $standardsource='\.(c|drv|dtx|fea|fdd|ins|sfd)$|configure.*|install-sh'; 'apl', ".*", # just get everything, seems simplest 'arabxetex', 'NULL', # keep dtx with others, why not 'bbold', $standardsource . '|fonttabl.sty', + 'biber', '.*', # get everything, lots to do in post 'bigints', 'NULL', 'blacklettert1', '\.dtx|\.ins|\.pl|Makefile', 'carlisle', '\.dtx|\.ins|ltxtable\.tex', @@ -1969,7 +1970,7 @@ $standardclean = '\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot' 'xskak' => 'xskak.pdf', # no source ); -# +# (main program) # Read from config file to make local adjustments to above. readconfig(); @@ -1994,10 +1995,18 @@ for (@ARGV) { @x = split(/\//,$packagedir); $package = pop (@x); - $DEST_TREE = $specialdest{$package} || $standarddest; + my $COOKED_PKG = "$COOKED_TOP/$package"; # output directory + + if ($package eq "biber") { + $BUILDDEST = "$COOKED_PKG/Build/source"; + $TOPDEST = "$COOKED_PKG/Master"; + } else { + $BUILDDEST = "oops, no builddest should be needed?"; + $TOPDEST = $COOKED_PKG; # that is, Master + } - $TOPDEST = "$TDS/$package"; - $DEST = "$TOPDEST/$DEST_TREE"; + my $dest_tree = $specialdest{$package} || $standarddest; # usually texmf-dist + $DEST = "$TOPDEST/$dest_tree"; # goes to Master/texmf-dist or whatever $insrunner = $specialinsrunner{$package} || $standardinsrunner; @@ -2018,7 +2027,7 @@ for (@ARGV) { &donormal; } - &xchdir ($startdir); + &xchdir ($RAW_DIR); } @@ -2031,7 +2040,7 @@ sub set_dir_defaults my ($ctan_dir) = @_; my $guess = ""; - if ($ctan_dir =~ m!/tex-archive/biblio/bibtex!) { + if ($ctan_dir =~ m!/tex-archive/biblio/bib!) { $standarddocfmt = $standardsourcefmt = "bibtex"; $guess = "$standarddocfmt for docfmt/srcfmt"; @@ -2228,12 +2237,12 @@ sub donormal print "doing donormal($ctrl)...\n"; # check for tds-ready packages - if ( -e "$startdir/$packagedir/TDS_READY" ) { + if ( -e "$RAW_DIR/$packagedir/TDS_READY" ) { print "using TDS_READY tree\n"; - &SYSTEM ("$RM $startdir/$packagedir/TDS_READY"); + &SYSTEM ("$RM $RAW_DIR/$packagedir/TDS_READY"); &SYSTEM ("mkdir -p $DEST"); &xchdir ($DEST); - &SYSTEM ("$CP -r $startdir/$packagedir/* ."); + &SYSTEM ("$CP -r $RAW_DIR/$packagedir/* ."); my @docdirs = glob ("doc/*/*/"); if ($moreclean{$package} && @docdirs) { @@ -2556,7 +2565,7 @@ sub rundvi { &runjob("bibtex $FileBase"); &runjob("TEXMFLOCAL=. $TEX '\\nonstopmode\\input $FileBase$Filesuffix'"); if ($Filesuffix eq ".drv" || $Filesuffix eq ".dtx" ) { - &runjob("$CP $startdir/gind.ist ."); + &runjob("$CP $RAW_DIR/gind.ist ."); &runjob("makeindex -s gind.ist $FileBase"); unlink "gind.ist"; } else { @@ -2726,8 +2735,8 @@ sub runfonts { sub MAKEflatten { # don't to this in a tds-ready tree... - -e "$startdir/$packagedir/TDS_READY" - && die "$0: using MAKEflatten with TDS_READY tree $startdir/$packagedir.\n"; + -e "$RAW_DIR/$packagedir/TDS_READY" + && die "$0: using MAKEflatten with TDS_READY tree $RAW_DIR/$packagedir.\n"; &setup; &xchdir ("$DEST/doc/$whichdocformat/$package"); @@ -3660,19 +3669,6 @@ sub MAKExmltex &runjob("$CP manual* *xml test* *txt $DEST/doc/xmltex/base"); } -sub MAKEbase { - &SYSTEM("mkdir -p $DEST/tex/latex/base"); - &SYSTEM("mkdir -p $DEST/doc/latex/base"); - &SYSTEM("mkdir -p $DEST/doc/latex/base"); - if (-f "$packagedir/00Contents" ) { unlink "$packagedir/00Contents" ; } - &SYSTEM("$CP -r $packagedir/* $DEST/doc/latex/base"); - chdir($packagedir) || die ("ERROR: cannot open directory"); - $package="base"; - $DEST="$TDS/ltxbase/texmf-dist"; - print "!$whichformat $packagedir ($package) -> $DEST\n"; - &donormal; - } - sub MAKEfancyvrb { &setup; chdir("$DEST/doc/latex/$package"); @@ -4079,6 +4075,64 @@ sub POSTbabelbib { &SYSTEM ("cd $DEST && $MV texmf/* . && rmdir texmf"); } +sub POSTbiber { + print "POST$package - move doc, unpack and install binaries\n"; + # we've started with everything under source/. + &xchdir ("$DEST/source/bibtex/biber") + + # move doc pdf. + &SYSTEM ("$MV doc/*.pdf $DOCDIR/"); + + # biber uses different platform names. + my %tl_platform = ( + "MSWIN" => "win32", + "darwin_x86_64" => "x86_64-darwin", + "linux_x86_32" => "i386-linux", + "linux_x86_64" => "x86_64-linux", + ); + + # handle the prebuilt binaries, which are zipped or tarred. + &xchdir ("binaries"); + for my $archive (sort (<*.*>)) { + my $unarchiver = &find_unarchiver ($archive); + &SYSTEM ("$unarchiver $archive"); + # + # each .tar.gz unpacks into a single file named biber, + # .zip unpacks into biber.exe. + my $biber_binary = "biber"; + $biber_binary .= ".exe" if $archive =~ /MSWIN/i; + # + # Put the executable in the appropriate (a) Master bin directory + # and (b) Build source directory. + (my $biber_platform = $archive) =~ s/.*-(.*?)\..*/$1/; + my $tl_platform = $tl_platform{$biber_platform}; + # + my $bindir = "$TOPDEST/bin/$tl_platform"; + &SYSTEM ("mkdir -p $bindir"); + &SYSTEM ("$CP $biber_binary $bindir/"); + # + my $builddir = "$BUILDDEST/utils/biber/"; + &SYSTEM ("mkdir -p $builddir"); + &SYSTEM ("$MV $biber_binary $builddir/$biber_binary.$tl_platform"); + } + &xchdir (".."); + &SYSTEM ("$RM -r binaries"); +} + +sub find_unarchiver { + my ($archive) = @_; + my $ret; + + if ($archive =~ /\.tar\.gz$/) { + $ret = "tar xf"; + } elsif ($archive =~ /\.zip$/) { + $ret = "unzip -q"; + } else { + die "do not know unarchiver for $archive"; + } + return $ret; +} + sub POSTbibtex { print "POST$package - switch to base/\n"; &SYSTEM ("cd $DEST && $MV bibtex/bst/bibtex bibtex/bst/base"); |