summaryrefslogtreecommitdiff
path: root/Master/tlpkg/libexec/ctan2tds
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-03-29 21:29:15 +0000
committerKarl Berry <karl@freefriends.org>2013-03-29 21:29:15 +0000
commit6144e158828b4bf657bf525ddbb73c73725af6d5 (patch)
tree61b598a76225cc72108cb4b5a430c668f397cc44 /Master/tlpkg/libexec/ctan2tds
parent74af3538d2e25cc0e6a663296f9debd9ac8d5f76 (diff)
toptesi (28mar13)
git-svn-id: svn://tug.org/texlive/trunk@29550 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/libexec/ctan2tds')
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds114
1 files changed, 82 insertions, 32 deletions
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index b04c32ec0c3..306a7e0ceed 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -2995,40 +2995,35 @@ sub dotype1{
#
sub doscripts {
my $pwd = getcwd();
-
- my $build_tldir = "texk/texlive";
- my $build_scriptsdir = "$build_tldir/linked_scripts";
- my $builddir = "$BUILDDEST/$build_scriptsdir/$package";
- #
my $scriptsdir = "$DEST/scripts/$package";
- #
- my @scripts = ();
+ # in the .tds.zip case, we will already be in the scripts dir
+ # and they will already be installed, ipso facto.
+ my $tds_zip = $pwd eq $scriptsdir;
+
+ my @scripts = ();
# first do the user-visible bindir entries.
$scriptpatt = $specialscripts_bin{$package};
if ($scriptpatt) {
- if ($pwd ne $scriptsdir) {
- # in the .tds.zip case, we will already be in the scripts dir.
+ if (! $tds_zip) {
&install ($scriptsdir, $scriptpatt);
&SYSTEM ("chmod a+x $scriptsdir/*");
}
- #
# determine list of scripts from scriptpatt, since a .tds.zip (e.g.,
# adhocfilelist) might have unpacked others into the scripts/ dir.
chomp (@scripts = grep (/$scriptpatt/, `ls $scriptsdir`));
#
# update the copy in Build (the reason we do the bindir ones first).
- &xmkdir ($builddir);
for my $s (@scripts) {
- &SYSTEM ("$CP $scriptsdir/$s $builddir/");
+ &build_scripts_copy ("$scriptsdir/$s");
}
}
# then do the ones that go only under scripts/ and not in the bindirs.
+ # (and hence also not in Build.)
my $nobin_scriptpatt = $specialscripts_nobin{$package};
if ($nobin_scriptpatt) {
- if ($pwd ne $scriptsdir) {
- # in the .tds.zip case, we will already be in the scripts dir.
+ if (! $tds_zip) {
&install ($scriptsdir, $nobin_scriptpatt);
&SYSTEM ("chmod a+x $scriptsdir/*");
}
@@ -3037,18 +3032,12 @@ sub doscripts {
# List of scripts we just copied in for installing in the bindirs.
return unless @scripts;
- # For each, give a warning if missing from the Makefile.am in the sources.
- # Also, if not already present, create the platform-specific bindir entries.
+ # If not already present, create the platform-specific bindir entries.
#
- my $scripts_Makefile = "$Build/$build_scriptsdir/Makefile.in";
+ my $build_tldir = "texk/texlive";
chomp (my @platforms = `cd $Master/bin && ls`);
#
for my $s (@scripts) {
- system ("grep $package/$s $scripts_Makefile >&/dev/null");
- if ($? != 0) {
- print "*** $package/$s not in $scripts_Makefile\n";
- }
-
(my $linkname = $s) =~ s/\..*$//;
for my $p (@platforms) {
my $platdir = "$TOPDEST/bin/$p";
@@ -3076,7 +3065,7 @@ sub doscripts {
my $w32_wrapper = "$Build/$build_tldir/w32_wrapper/runscript.exe";
&SYSTEM ("$CP $w32_wrapper $platdir/$linkname.exe");
&SYSTEM ("$CP $w32_wrapper $platdir/r$linkname.exe")
- if $linkname =~ /pdfcrop|epstopdf/; # rpdfcrop.exe, repstopdf.exe
+ if $linkname =~ /pdfcrop|epstopdf/; # r{pdfcrop,epstopdf}.exe
}
}
}
@@ -4908,23 +4897,23 @@ sub POSTcontext {
print "still POST$package - user-level executables\n";
# similar to biber, executables go in both the Master bin dir and the
# Build linked_scripts dir. The executables are cherry-picked from
- # two different directories.
+ # ConTeXt's stubs directory.
my $w32_bindir = "$TOPDEST/bin/win32";
&xmkdir ($w32_bindir);
#
- &xchdir ("$DEST/scripts/$package/stubs/unix");
+ my $pkg_subdir = "stubs/unix"; # where hans keeps them
+ &xchdir ("$DEST/scripts/$package/$pkg_subdir");
my @exec = ();
- for my $exec (qw(context luatools texexec texmfstart)) {
+ for my $exec (qw(context ctxtools luatools
+ mtxrun pstopdf texexec texmfstart)) {
+ &bindirs_symlink ($exec);
+ &build_scripts_copy ($exec, $pkg_subdir);
&SYSTEM ("$CP ../mswin/$exec.exe $w32_bindir/");
push (@exec, $exec);
}
- #for my $exec (qw(ctxtools pstopdf)) {
- #
- #}
- #
# mtxrun on Windows needs more than just the .exe.
&xchdir ("../mswin");
- &SYSTEM ("$CP mtxrun.exe mtxrun.dll mtxrun.lua $w32_bindir/");
+ &SYSTEM ("$CP mtxrun.dll mtxrun.lua $w32_bindir/");
print "still POST$package - man pages\n";
&xchdir ("$DEST/doc/$package/scripts");
@@ -4935,10 +4924,71 @@ sub POSTcontext {
my $mansrc = (-r "mkii/$exec.man" ? "mkii/$exec.man" : "mkiv/$exec.man");
&SYSTEM ("$CP $mansrc $mandest/$exec.1");
}
+ # In addition, there is mtx-*.man for subcommands in mkiv.
+ &xchdir ("mkiv");
+ for my $mtxman (<mtx-*.man>) {
+ (my $mtxmanbase = $mtxman) =~ s/\.man$//;
+ &SYSTEM ("$CP $mtxman $mandest/$mtxmanbase.1");
+ }
&tl_man_to_pdf ();
}
-
+# Called for the ConTeXt scripts, though conceivably could be used for
+# other things. Make a symlink in each Unix bindir (Windows is not
+# handled here) to EXEC, assuming its location is relative to pwd.
+#
+sub bindirs_symlink {
+ my ($exec) = @_;
+
+ chomp (my $pwd = `pwd`);
+ (my $intermediate_dirs = $pwd) =~ s,^.*/$DEST_TREE/,,;
+ #
+ my $linktarget = "../../$DEST_TREE";
+ $linktarget .= "/$intermediate_dirs";
+ $linktarget .= "/$exec";
+ #
+ (my $linkname = $exec) =~ s,.*/,,; # just the basename
+
+ chomp (my @platforms = `cd $Master/bin && ls`);
+ for my $p (@platforms) {
+ next if $p eq "win32"; # windows handled separately
+ my $platdir = "$TOPDEST/bin/$p";
+ &xmkdir ($platdir);
+ &SYSTEM ("ln -s $linktarget $platdir/$linkname");
+ }
+}
+
+# Called both for ConTeXt and from doscripts: Update copy of EXEC under
+# Build/.../linked_scripts. If second arg INTERMEDIATE_DIRS is given
+# (done by ConTeXt), that path is appended under linked_scripts/. In
+# any case, just the basename of EXEC is used in the destination, and
+# the full EXEC, whatever it is, is used for the source of the copy.
+#
+sub build_scripts_copy {
+ my ($exec,$intermediate_dirs) = @_;
+
+ # prepend / to INTERMEDIATE_DIRS if fiven.
+ $intermediate_dirs = ($intermediate_dirs ? "/$intermediate_dirs" : "");
+
+ my $build_tldir = "texk/texlive";
+ my $build_scriptsdir = "$build_tldir/linked_scripts";
+ my $build_subdir = "$package$intermediate_dirs";
+ my $builddir = "$BUILDDEST/$build_scriptsdir/$build_subdir";
+ &xmkdir ($builddir);
+ #
+ &SYSTEM ("$CP $exec $builddir/");
+
+ # Warn if missing from the Makefile.am in the sources.
+ (my $exec_basename = $exec) =~ s,^.*/,,;
+ my $scripts_Makefile = "$Build/$build_scriptsdir/Makefile.in";
+ my $pattern = "\\b$build_subdir/$exec_basename\\b";
+ system ("grep '$pattern' $scripts_Makefile >/dev/null");
+ if ($? != 0) {
+ print "*** $build_subdir/$exec_basename not in $scripts_Makefile\n";
+ }
+}
+
+
sub POSTcontext_games {
print "POST$package - remove duplicated fonts\n";
&SYSTEM ("$RM -rf fonts");