Commit 534c3c64 by Kai Westerkamp

Merge branch 'beamer' into 'master'

Installiere Abhängigkeiten für beamer See merge request !2
parents b16bb568 377d0c93
Pipeline #159 passed with stage
......@@ -8,6 +8,8 @@ compile_pdf:
compile_Folie:
image: tianon/latex
script:
- apt-get update && apt-get install -y curl && texlua ./install-getnonfreefonts && getnonfreefonts arial-urw
- pushd /usr/local/share/texmf && unzip "$CI_PROJECT_DIR"/Folien/KITbase.zip && unzip "$CI_PROJECT_DIR"/Folien/KITbeamer.zip && mktexlsr && popd
- cd beamer && latexmk -pdf KIT-Folien-de.tex
artifacts:
paths:
......
#! /usr/bin/env texlua
--*- Lua -*-
--  -- pretend that this is a binary file.
-- Web browsers shall download the file, not display it.
-- Copyright (C) 2009-2015 Reinhard Kotucha <kotucha@tug.org>
--
-- You may freely use, modify and/or distribute this file.
installer_release='2015-09-20'
----------------------------------------------------------------
-- The following variables are only used for TeX systems whose
-- file system layout is not identical to that created by the
-- TeX Live installer. This is usually the case for TeX systems
-- shipped with Linux/Unix distributions (binaries for a single
-- platform only, and texmf* in /usr/share).
--
-- By default we install in /usr/local in order not to interfere
-- with the package manager of your Linux/Unix distribution.
--
-- These variables have no effect if you have a TeX Live system
-- from http://texlive.org .
BINDIR='/usr/local/bin'
MANDIR='/usr/local/share/man/man1'
----------------------------------------------------------------
-- You don't have to change anything below this line.
----------------------------------------------------------------
--> !!BEGIN-INSERTED-FILES!!
-- Date: Sun Sep 20 10:19:31 2015 UTC
script=[[
#!/usr/bin/env perl
## getnonfreefonts
## Copyright 2006-2015 Reinhard Kotucha <reinhard.kotucha@web.de>
#
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either version 1.3
# of this license or (at your option) any later version.
# The latest version of this license is in
# http://www.latex-project.org/lppl.txt
#
# The current maintainer is Reinhard Kotucha.
my $TL_version='2015';
my $revision='2015-09-20';
use Getopt::Long;
$Getopt::Long::autoabbrev=0;
Getopt::Long::Configure ("bundling");
$opt_lsfonts=0;
$opt_force=0;
sub usage {
print <<'EOF';
Usage:
getnonfreefonts[-sys] [-a|--all] [-d|--debug] [-f|--force]
[-l|--lsfonts] [-r|--refreshmap] [-v|--verbose] [--version]
[-H|--http] [font1] [font2] ...
getnonfreefonts installs fonts in $TEXMFHOME.
getnonfreefonts-sys installs fonts in $TEXMFLOCAL.
Options:
-a|--all Install all fonts.
-d|--debug Provide additional messages for debugging.
-f|--force Install fonts even if they are installed already.
-h|--help Print this message.
-l|--lsfonts List all fonts available.
-r|--refreshmap Refresh map file.
-v|--verbose Be more verbose.
-H|--http Use http instead of ftp (see manual).
--version Print version number.
EOF
;
}
# GetOptions destroys @ARGV.
# We have to create a new array because assignments create references.
my @ARGS;
foreach my $arg (@ARGV) {
push (@ARGS, $arg);
}
$done=GetOptions
"all|a",
"debug|d",
"force|f",
"help|h",
"http|H",
"lsfonts|l",
"refreshmap|r",
"verbose|v",
"version",
"sys";
unless ($done) {
print "\n"; usage; exit 1;
}
$^W=1 if $opt_debug;
my $pathsep;
sub win32 {
if ($^O=~/^MSWin(32|64)/i) {
$pathsep="\\";
return 1;
} else {
$pathsep="/";
return 0;
}
}
# ANSI colors
my @supported_terminals=(
'Eterm', 'ansi', 'color-xterm', 'con132x25', 'con132x30',
'con132x43', 'con132x60', 'con80x25', 'con80x28', 'con80x30',
'con80x43', 'con80x50', 'con80x60', 'cons25', 'console', 'cygwin',
'dtterm', 'gnome', 'gnome-256color', 'konsole', 'kterm', 'linux',
'linux-c', 'mach-color', 'mlterm', 'putty', 'rxvt', 'rxvt-cygwin',
'rxvt-cygwin-native', 'rxvt-unicode', 'screen', 'screen-bce',
'screen-w', 'screen.linux', 'vt100', 'xterm', 'xterm-256color',
'xterm-color', 'xterm-debian'
);
my $term_supported=0;
if ($ENV{'TERM'}) {
foreach my $terminal (@supported_terminals) {
if ($ENV{'TERM'} eq $terminal) {
$term_supported=1;
}
}
}
sub colored {
my $text=shift;
my $color=shift;
my $esc="\e[";
my $restore="\e[0m";
%colors=(
red => '00;31m',
green => '00;32m'
);
if ($term_supported and -t 'STDOUT') {
return "${esc}$colors{$color}${text}${restore}";
} else {
return $text;
}
}
sub msg {
my $message=shift;
$msglen=length($message);
print $message;
}
sub status {
my $status=shift;
my $color=shift;
my $spaces=79-2-$msglen-length($status);
$spaces=1 if ($spaces < 1);
print ' ' x $spaces;
print ('[' . colored($status, $color) . "]\n");
}
sub expand_var {
my $var=shift;
if (win32) {
open KPSEWHICH, 'kpsewhich --expand-var=$' . "$var |";
} else {
open KPSEWHICH, 'kpsewhich --expand-var=\$' . "$var |";
}
while (<KPSEWHICH>) {
chop;
return "$_";
}
close KPSEWHICH;
}
sub var_value {
my $var=shift;
my $ret;
$ret=`kpsewhich --var-value=$var`;
chomp($ret);
return $ret;
}
@allpackages=@ARGV;
print "$TL_version\n" and exit 0 if $opt_version;
if ($opt_help or !@ARGS) {
print "\nThis is getnonfreefonts";
print '-sys' if ($sys);
print ", version $TL_version, revision $revision.\n\n";
usage;
}
sub message {
my $message=shift;
if ($message=~/^\[/) {
print "$message\n";
} else {
printf "%-60s", $message;
}
}
sub debug_msg {
my $message=shift;
if ($opt_debug) {
print STDERR "DEBUG: $message\n";
}
}
sub get_tmpdir {
if ($opt_debug) {
for my $var (qw(TMPDIR TEMP TMP)) {
if (defined $ENV{$var}) {
debug_msg "Environment variable $var='$ENV{$var}'.";
} else {
debug_msg "Environment variable $var not set.";
}
}
}
# get TMPDIR|TEMP|TMP environment variable
my $SYSTMP=undef;
$SYSTMP||=$ENV{'TMPDIR'};
$SYSTMP||=$ENV{'TEMP'};
$SYSTMP||=$ENV{'TMP'};
$SYSTMP||='/tmp';
return "$SYSTMP";
}
sub which {
my $prog=shift;
my @PATH;
my $PATH=$ENV{'PATH'};
if (&win32) {
my @PATHEXT=split ';', $ENV{'PATHEXT'};
push @PATHEXT, ''; # if argument contains an extension
@PATH=split ';', $PATH;
for my $dir (@PATH) {
$dir=~s/\\/\//g;
for my $ext (@PATHEXT) {
if (-f "$dir/$prog$ext") {
return "$dir/$prog$ext";
}
}
}
} else {
@PATH=split ':', $PATH;
for my $dir (@PATH) {
if (-x "$dir/$prog") {
return "$dir/$prog";
}
}
}
return 0;
}
sub show_path {
if ($opt_debug) {
my @PATH;
if (win32) {
@PATH=split ';', $ENV{'PATH'};
} else {
@PATH=split ':', $ENV{'PATH'};
}
my $index=0;
foreach my $dir (@PATH) {
debug_msg "PATH\[$index\]: '$dir'.";
++$index;
}
}
}
sub signals {
my @signals;
my @common_signals=qw(INT ILL FPE SEGV TERM ABRT);
my @signals_UNIX=qw(QUIT BUS PIPE);
my @signals_Win32=qw(BREAK);
if (win32) {
@signals=(@common_signals, @signals_Win32);
} else {
@signals=(@common_signals, @signals_UNIX);
}
debug_msg "Supported signals: @signals.";
return @signals;
}
sub getfont_url {
my $getfont_url;
my $HTTPS='https://tug.org/~kotucha/getnonfreefonts';
debug_msg 'Download method: HTTPS.';
$getfont_url="$HTTPS/getfont.pl";
debug_msg "Using script '$getfont_url'.";
return $getfont_url;
}
sub expand_braces {
my $var=shift;
my $pathsep;
my $retstring;
my @retlist;
if (win32) {
open KPSEWHICH, 'kpsewhich --expand-braces=$' . "$var |";
$pathsep=';';
} else {
open KPSEWHICH, 'kpsewhich --expand-braces=\$' . "$var |";
$pathsep=':';
}
$retstring=(<KPSEWHICH>);
close KPSEWHICH;
chop $retstring;
@retlist=split $pathsep, $retstring;
if ($opt_debug) {
my $index=0;
foreach my $entry (@retlist) {
debug_msg "$var\[$index\]: '$entry'.";
++$index;
}
debug_msg "Extracting the first element of the list ($var\[0\]):";
debug_msg "$var\[0\]='$retlist[0]'.";
}
return "$retlist[0]";
}
sub check_tmpdir{
my $SYSTMP=shift;
die "! ERROR: The temporary directory '$SYSTMP' doesn't exist.\n"
unless (-d "$SYSTMP");
die "! ERROR: The temporary directory '$SYSTMP' is not writable.\n"
unless (-w "$SYSTMP");
}
sub check_installroot {
my ($INSTALLROOTNAME, $INSTALLROOT)=@_;
mkdir "$INSTALLROOT" unless (-d "$INSTALLROOT");
die "! ERROR: The variable $INSTALLROOTNAME is not set.\n"
unless length ("$INSTALLROOT") > 0;
die "! ERROR: The install directory '$INSTALLROOT' doesn't " .
"exist.\n" .
" If this is the correct path, please create " .
"this directory manually.\n"
unless (-d "$INSTALLROOT");
die "! ERROR: The install directory '$INSTALLROOT' is not writable.\n"
unless (-w "$INSTALLROOT");
}
sub check_binary {
my $binary=shift;
if ($opt_debug) {
debug_msg "Search for $binary in PATH:";
my $binary=which "$binary";
debug_msg "Found '$binary'.";
}
}
debug_msg "getnonfreefonts rev. $revision (TL $TL_version).";
debug_msg ("argv[0]: '$0'");
my $nargs=@ARGS+0;
for (0..$#ARGS) {
my $i=$_;
my $arg=$ARGS[$i];
$i++;
debug_msg ("argv[$i]: '$arg'");
}
my $sys=($0=~/-sys$/)? 1:0;
if ($sys==1) {
debug_msg("sys=true, determined by filename");
} else {
debug_msg("sys=false, determined by filename");
}
$sys=1 if $opt_sys;
debug_msg("sys=true, determined by option") if $opt_sys;
##$sys=1 if (defined $ENV{'TEX_SYS_PROG'});
if (win32) {
# ugly workaround for --sys detection in runscript wrapper.
my $TEXMFVAR=var_value('TEXMFVAR');
my $TEXMFSYSVAR=var_value('TEXMFSYSVAR');
debug_msg("TEXMFVAR=$TEXMFVAR");
debug_msg("TEXMFSYSVAR=$TEXMFSYSVAR");
if ($TEXMFVAR eq $TEXMFSYSVAR) {
$sys=1;
debug_msg("sys=true, determined by kpathsea vars");
}
}
# Determine the URL.
my $getfont_url=getfont_url;
my $SYSTMP=get_tmpdir;
debug_msg "Internal variable SYSTMP set to '$SYSTMP'.";
check_binary 'kpsewhich';
# Determine INSTALLROOT.
$INSTALLROOTNAME=($sys)? 'TEXMFLOCAL':'TEXMFHOME';
$INSTALLROOT=expand_braces "$INSTALLROOTNAME";
# Remove trailing exclamation marks and double slashes.
debug_msg "Removing leading \"!!\" and trailing \"//\" " .
"and set INSTALLROOT:";
$INSTALLROOT=~s/^!!//;
$INSTALLROOT=~s/\/\/$//;
debug_msg "INSTALLROOT='$INSTALLROOT'.";
($sys)? debug_msg "sys=true.":debug_msg "sys=false.";
if ($opt_help or !@ARGS) {
print <<"ENDUSAGE";
Directories:
temporary: '$SYSTMP/getfont-<PID>'
install: '$INSTALLROOT'
ENDUSAGE
check_tmpdir $SYSTMP;
check_installroot "$INSTALLROOTNAME", "$INSTALLROOT";
exit 0;
}
check_tmpdir $SYSTMP;
check_installroot "$INSTALLROOTNAME", "$INSTALLROOT";
my $tmpdir="$SYSTMP" . $pathsep . "getfont-$$";
debug_msg "Internal variable tmpdir set to '$tmpdir'.";
mkdir "$tmpdir" or die "! ERROR: Can't mkdir '$tmpdir'.";
chdir "$tmpdir" or die "! ERROR: Can't cd '$tmpdir'.";
#install_signal_handlers $SYSTMP, $tmpdir;
sub remove_tmpdir {
debug_msg "Executing Signal Handler:";
chdir "$SYSTMP" or die "! ERROR: Can't cd '$SYSTMP'.\n";
opendir TMPDIR, "$tmpdir"
or print "! ERROR: Can't read directory '$tmpdir'.\n";
my @alltmps=readdir TMPDIR;
closedir TMPDIR;
foreach my $file (@alltmps) {
next if $file=~/^\./;
unlink "$tmpdir/$file";
debug_msg "unlink '$tmpdir/$file'.";
}
rmdir "$tmpdir" or die
"! ERROR: Can't remove directory '$tmpdir'.\n";
debug_msg "rmdir '$tmpdir'.";
}
foreach my $signal (signals) {
$SIG{"$signal"}=\&remove_tmpdir;
}
debug_msg
"Signal handlers installed. Don't expect too much on Windows.";
my $TLROOT=expand_var 'SELFAUTOPARENT';
my $BINDIR=expand_var 'SELFAUTOLOC';
my $has_wget=0;
my $WGET;
if (win32) {
$has_wget=1; ## shipped with TL.
if (-f "$TLROOT\\tlpkg\\installer\\wget\\wget.exe") {
# TL-2008+
$WGET="$TLROOT\\tlpkg\\installer\\wget\\wget.exe";
} elsif (-f "$BINDIR\\wget.exe") {
# TL-2005...TL-2007
$WGET="$BINDIR\\wget.exe";
} else {
die "ERROR: No wget binary found.\n";
}
} elsif (which "wget") {
$WGET='wget';
$has_wget=1; ## wget is in PATH.
}
show_path;
debug_msg "No wget binary found on your system, trying curl."
unless ($has_wget);
if ($has_wget) {
debug_msg "Running '$WGET $getfont_url'.";
system ("$WGET", "$getfont_url") == 0
or die "! Error: Can't execute wget.\n";
} else {
debug_msg "Running 'curl -O $getfont_url'.";
system ('curl', '-O', "$getfont_url") == 0
or die "! Error: Can't execute curl.\n";
}
# Download the fonts.
my @getfont=('perl', "./getfont.pl");
push @getfont, "--installroot=$INSTALLROOT";
push @getfont, '--lsfonts' if $opt_lsfonts;
push @getfont, '--force' if $opt_force;
push @getfont, '--debug' if $opt_debug;
push @getfont, '--verbose' if $opt_verbose;
push @getfont, '--sys' if $sys;
push @getfont, '--refreshmap' if $opt_refreshmap;
push @getfont, '--all' if $opt_all;
push @getfont, '--http' if $opt_http;
if ($has_wget) {
push @getfont, "--wget_bin=$WGET";
} else {
push @getfont, '--use_curl';
}
push @getfont, @allpackages;
my $getfont_cmd=join " ", @getfont;
debug_msg "Running '$getfont_cmd'.";
system @getfont;
# Evaluate the exit status. It will be 2 if something had been
# installed and in this case we need to run texhash/updmap.
my $exit_code=$?;
my $exit_status=int($exit_code/256);
if ($sys) {
debug_msg "Info: Execute updmap-sys if exit status is 2.";
} else {
debug_msg "Info: Execute updmap if exit status is 2.";
}
debug_msg "Exit status of getfont.pl is $exit_status.";
if ($exit_status==2) {
print "\n";
msg "Running 'mktexlsr $INSTALLROOT'...";
if (0) {
my $ret=system "mktexlsr $INSTALLROOT >NUL 2>NUL";
} else {
my $ret=system "mktexlsr $INSTALLROOT >/dev/null 2>/dev/null";
}
if ($ret) {
status 'failed', 'red';
} else {
status 'done', 'green';
}
$updmap_command=($sys)? 'updmap-sys':'updmap';
@updmap=("$updmap_command");
push @updmap, '--quiet' unless $opt_verbose;
print "\n";
msg "Updating map files ($updmap_command). Be patient...";
system @updmap;
$? ? status('failed', 'red') : status('done', 'green');
}
remove_tmpdir;
__END__
# Local Variables:
# perl-indent-level: 2
# tab-width: 2
# indent-tabs-mode: nil
# End:
# vim:set tabstop=2 expandtab:
]]
man=[[
.TH getnonfreefonts 1 "December 2009" "TeX Live" "TeX Live"
.SH NAME
getnonfreefonts \- download and install fonts which cannot be
distributed on a CD
.LP
getnonfreefonts-sys \- download and install fonts system\-wide which
cannot be distributed on a CD
.SH SYNOPSIS
.BI "getnonfreefonts [" options "] [" fontlist ]
.sp
.BI "getnonfreefonts-sys [" options "] [" fontlist ]
.SH DESCRIPTION
Some font suppliers provide fonts which can be used freely but they
disallow that money is charged for the distribution. Hence, for
distributions on CD or DVD it is usually impossible to include
these fonts.
.B "getnonfreefonts"
is a script which downloads and installs these fonts. Actually, it
first downloads the program
.BI "getfont"<year>
from tug.org which is then executed.
.BI "getfont"<year>
does the real work. It will be updated occasionally to support more
fonts.
.I <year>
denotes the TeXLive release.
.B getnonfreefonts
and
.B getnonfreefonts-sys
are identical except that
.B getnonfreefonts
installs files to $TEXMFHOME
while
.B getnonfreefonts-sys
installs files to $TEXMFLOCAL.
.BI "getfont"<year>
will not be installed permanently on your system. It only
exists in a temporary directory while
.BI getnonfreefonts
is running.
Run
.B getnonfreefonts --lsfonts
to get a list of supported fonts.
.SH OPTIONS
.TP
.BR "-a" , " --all"
.rg
Install all fonts.
.TP
.BR "-d" , " --debug"
.rg
Provide additional messages for debugging. These messages are sent to
STDERR.
.TP
.BR "-f" , " --force"
.rg
Install fonts even if they are installed already.
.TP
.BR "-h" , " --help"
.rg
Print a help message. Nothing is installed but the directories where
the fonts will be installed and the temporary directory are shown.
.BI "<" PID ">"
will be replaced by the process ID of the current
process.
.TP
.BR "-H" , " --http"
.rg
Use HTTP instead of FTP. This is useful if you are behind a firewall
which is blocking FTP. However, you can't install fonts which are on
FTP servers. Currently this is only "Adobe Euro".
.TP
.BR "-l" , " --lsfonts"
.rg
List all available fonts and tell whether they are installed already.
.TP
.BR "-r" , " --refreshmap"
.rg
Register
.B map
files for already installed fonts and run
.B updmap.
This is needed after upgrading TeX Live to a newer release.
.TP
.B --sys
.rg
If you call
.B getnonfreefonts
with the
.B --sys
option, it behaves exactly as
.BR "getnonfreefonts-sys".
.TP
.BR "-v" , " --verbose"
.rg
Be more verbose. This option is only needed for debugging.
.TP
.BR "--version"
.rg
Print version number.
.SH ENVIRONMENT
One of the environment variables
.BR "TMP" , " TEMP" ,
or
.B TMPDIR
must exist. They are used to determine where to put the temporary
files. The directory must exist and must be writable.
.B /tmp
will be used if none of the variables is defined.
.SH REQUIREMENTS
Though this program is supposed to be used with
.B TeX Live
it might work with other TeX distributions too. The programs
.BR "wget"
or
.BR "curl" ,
.BR "unzip" ,
and
.B kpsewhich
as well as a recent version of
.B updmap
which supports the
.B --enable
option are required.
.SH BUGS
Please send bug reports to Reinhard Kotucha <reinhard.kotucha@web.de>.
]]
sman=[[
.so man1/getnonfreefonts.1
]]
manpdf=[[
JVBERi0xLjUKJdDUxdAKMSAwIG9iago8PC9UeXBlL1BhZ2VzL01lZGlhQm94WzAgMCA1OTUgODQy
XS9LaWRzWzYgMCBSIDcgMCBSXS9Db3VudCAyPj5lbmRvYmoKMiAwIG9iago8PC9SNyAxMiAwIFI+
PmVuZG9iagozIDAgb2JqCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250L1RpbWVz
LUJvbGQ+PmVuZG9iago0IDAgb2JqCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250
L1RpbWVzLVJvbWFuL0VuY29kaW5nIDE0IDAgUj4+ZW5kb2JqCjUgMCBvYmoKPDwvVHlwZS9DYXRh
bG9nL1BhZ2VzIDEgMCBSPj5lbmRvYmoKNiAwIG9iago8PC9UeXBlL1BhZ2UvQ29udGVudHMgOSAw
IFIvUmVzb3VyY2VzPDwvRm9udCA4IDAgUi9FeHRHU3RhdGUgMiAwIFI+Pi9QYXJlbnQgMSAwIFI+
PmVuZG9iago3IDAgb2JqCjw8L1R5cGUvUGFnZS9Db250ZW50cyAxMSAwIFIvUmVzb3Vy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1R5cGUv
Rm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250L1RpbWVzLUl0YWxpYz4+ZW5kb2JqCjE0IDAgb2Jq
Cjw8L1R5cGUvRW5jb2RpbmcvRGlmZmVyZW5jZXNbMTQwL2ZpIDE3My9taW51c10+PmVuZG9iagox
NSAwIG9iago8PC9DcmVhdGlvbkRhdGUoRDoyMDExMDEzMDIzNTMxMCswMScwMCcpL01vZERhdGUo
RDoyMDExMDEzMDIzNTMxMCswMScwMCcpL1Byb2R1Y2VyKEdQTCBHaG9zdHNjcmlwdCA4LjcxKS9D
cmVhdG9yKGdyb2ZmIHZlcnNpb24gMS4yMC4xKT4+ZW5kb2JqCjE2IDAgb2JqCjw8L0luZm8gMTUg
MCBSL0xlbmd0aCAzNC9Sb290IDUgMCBSL1NpemUgMTcvVHlwZS9YUmVmL1dbMCAyIDBdPj5zdHJl
YW0KAAAADwBdAHoAuQEJATUBlwH7AisLkAu2ESQRTRGPEc8SZ2VuZHN0cmVhbSBlbmRvYmoKc3Rh
cnR4cmVmCjQ3MTEKJSVFT0YK
]]
script_md5='9f397d1a01aa930c8ca6df7ad93a0f5f'
man_md5='f850d910dd96ee27cecdb3772047d247'
sman_md5='fb2b0f7699db8e627d4e26b730e94928'
manpdf_md5='415b51f7c80a4abe8d0a667a04c9d525'
--> !!END-INSERTED-FILES!!
isdir=lfs.isdir
isfile=lfs.isfile
mkdir=lfs.mkdir
readdir=lfs.dir
exit=os.exit
remove=os.remove
execute=os.execute
write=io.write
kpse.set_program_name('texlua')
texdir=kpse.var_value('SELFAUTOPARENT')
bindir=kpse.var_value('SELFAUTODIR')
exedir=kpse.var_value('SELFAUTOLOC')
texmflocal=kpse.var_value('TEXMFLOCAL')
if isdir(texdir .. '/texmf') then
texmf_dir='/texmf'
else
texmf_dir='/texmf-dist'
end
scriptdir=texdir ..texmf_dir .. '/scripts'
instdir=texdir .. texmf_dir .. '/scripts/getnonfreefonts'
mandir=texdir .. texmf_dir .. '/doc/man/man1'
docdir=texmflocal .. '/doc/man/man1'
symlink='../..' .. texmf_dir .. '/scripts/getnonfreefonts/getnonfreefonts.pl'
--[[
print ('TEXDIR='..texdir)
print ('BINDIR='..bindir)
print ('EXEDIR='..exedir)
print ('SCRIPTDIR='..scriptdir)
print ('MANDIR='..mandir)
print ('INSTDIR='..instdir)
--]]
done =' [done]\n'
failed='[failed]\n'
ok =' [ok]\n'
if ltn12 then
base64dec=ltn12.filter.chain(mime.decode('base64'))
end
function message (text)
write(string.format("%-70s ", text..' ...'))
end
function detect_system ()
-- The operating system we are currently using is derived from
-- SELFAUTOLOC (exedir).
system=(string.gsub(exedir, '.*/', ''))
if string.match(system, 'bin') then
write ('Detected System: ' .. 'unknown '.. os.name .. '\n')
multiplatform=false
else
write ('Detected System: ' .. system .. '\n')
multiplatform=true
end
end
function detect_installation ()
if multiplatform then
if isdir (scriptdir) then
write('Detected Installation: '..texdir..'\n')
getnonfreefonts='getnonfreefonts.pl'
else
write('Your TeX System seems to be broken. Can\'t continue.\n')
exit (1)
end
else
write('Detected Installation: ' ..bindir..
' (installing in ' .. string.gsub(BINDIR,'/bin$','') .. ')\n')
getnonfreefonts='getnonfreefonts'
instdir=BINDIR
mandir=MANDIR
end
end
function md5.hex(s)
-- Return the MD5 sum as a hexadecimal string.
-- The argument is a string (usually the content of a file).
return (string.gsub(md5.sum(s), ".",
function (c) return string.format("%02x", string.byte(c)) end))
end
function check_md5sum (name, path, md5sum)
-- There is a bug in older versions of Lua's MD5 library which leads
-- to wrong checksums on 64 bit systems. We check wether it works
-- and skip the md5 check if necessary. Many thanks to Aditya
-- Mahajan for the proposal.
if md5.hex("abcdefghijklmnopqrstuvwxyz") ==
"c3fcd3d76192e4007dfb496cca67e13b" then
local fh=assert(io.open(path..'/'..name, 'rb'))
content=fh:read("*all")
fh:close()
local checksum=md5.hex(content)
message ('md5sum: '..checksum..' '..name)
if checksum == md5sum then
write(ok)
else
write(failed)
exit(1)
end
end
end
function install_file (name, path, content)
-- The argument 'content' refers to the content of the here-documents
mkdirhier(path)
local file = path..'/'..name
if multiplatform then
message ('Installing '..file:gsub('^'..texdir..'/', ''))
else
message ('Installing '..file)
end
-- remove existing file due to bug in former release
if isfile(file) then assert(remove(file)) end
local fh=assert(io.open(file, 'wb'))
fh:write(content)
fh:close()
write(done)
end
function check_writable (dir)
if lfs.access then
message ('Checking Permissions: ' .. perms)
if lfs.access(dir, 'w') then
write (ok)
else
write '\nSorry, you need admin privileges in order to continue.\n'
exit (1)
end
end
end
function fix_permissions ()
-- getnonfreefonts.pl must be executable on Unix. We also make sure
-- that manual pages are not executable. Necessary if someone
-- installed them under Windows.
if os.type == 'unix' then
message('Fixing File Permissions')
execute('chmod a+x '..instdir..'/'..getnonfreefonts)
execute('chmod a-x '..mandir..'/getnonfreefonts.1')
execute('chmod a-x '..mandir..'/getnonfreefonts-sys.1')
write(done)
end
end
function create_dir (dir)
if not isdir(dir) then
message('mkdir '..dir)
mkdir (dir)
if isdir(dir) then
write(done)
else
write(failed)
write("Sorry, couldn't create directory "..dir..'\n')
exit (1)
end
end
end
function mkdirhier (path)
local dirs=string.explode(path, '/')
for i=2, #dirs do
local dir=table.concat(dirs, '/', 1, i)
if not isdir(dir) then
create_dir(dir)
end
end
end
function create_symlink (dir)
if os.type == 'unix' then
execute('cd ' .. dir ..
' && ln -sf getnonfreefonts getnonfreefonts-sys')
end
end
function create_symlinks (platform, exedir)
-- We are using shell escapes here because then we don't have to
-- keep track of the current working directory.
message("Creating symlinks in 'bin/"..platform.."'")
execute('cd '..exedir..' && ln -sf '..symlink..' getnonfreefonts')
execute('cd '..exedir..' && ln -sf '..symlink..' getnonfreefonts-sys')
write(done)
end
function create_wrappers (platform, exedir)
-- We don't create a new wrapper, we simply steal an existing one.
local cp
if os.type == 'windows' then
exedir = exedir:gsub('/', '\\')
cp='copy /b "'..exedir..'\\%s" "'..exedir..'\\%s"'
else
cp='cp -p '..exedir..'/%s '..exedir..'/%s'
end
if isfile(exedir..'/rungs.exe') then
wrapper='rungs.exe';
else -- TL 2008
wrapper='rungs.bat';
end
message("Creating wrappers in 'bin/"..platform.."'")
execute(cp:format(wrapper, 'getnonfreefonts.exe'))
execute(cp:format(wrapper, 'getnonfreefonts-sys.exe'))
write(done)
end
function create_symlinks_and_wrappers (path)
local otherplatforms={}
for file in readdir(path) do
if file ~= "." and file ~= ".." then
local exedir = path..'/'..file
local platform = file
-- platform expands to something like "x86_64-linux".
if os.type == 'unix' then
if platform == 'win32' then
create_wrappers (platform, exedir)
else
create_symlinks (platform, exedir)
end
else -- We're on Windows, sigh!
-- We can't create symlinks but we can issue a warning
-- if binaries for other platforms are available.
if platform == 'win32' then
create_wrappers (platform, exedir)
else
otherplatforms[#otherplatforms+1]=platform
end
if #otherplatforms > 0 then
write('You have binaries for Unix installed.\n' ..
'Please run this script on Unix again in ' ..
'order to create the symlinks.\n')
end
end
end
end
end
function texhash (dir)
execute ('texhash '..'"'..dir..'"')
end
-- main --
detect_system ()
detect_installation ()
if multiplatform then
check_writable (scriptdir)
create_dir (instdir)
docdir=mandir
else
check_writable (instdir)
end
install_file (getnonfreefonts, instdir, script)
install_file ('getnonfreefonts.1', mandir, man)
install_file ('getnonfreefonts-sys.1', mandir, sman)
if ltn12 then
install_file ('getnonfreefonts.man1.pdf', docdir, base64dec(manpdf))
install_file ('getnonfreefonts-sys.man1.pdf', docdir, base64dec(manpdf))
end
check_md5sum (getnonfreefonts, instdir, script_md5)
check_md5sum ('getnonfreefonts.1', mandir, man_md5)
check_md5sum ('getnonfreefonts-sys.1', mandir, sman_md5)
if ltn12 then
check_md5sum ('getnonfreefonts.man1.pdf', docdir, manpdf_md5)
--check_md5sum ('getnonfreefonts-sys.man1.pdf', docdir, manpdf_md5)
end
fix_permissions ()
if multiplatform then
create_symlinks_and_wrappers (bindir)
texhash (texdir..texmf_dir)
else
create_symlink (instdir) -- for getnonfreefonts-sys
texhash (texmflocal)
end
--[[
Local Variables:
lua-indent-level: 2
tab-width: 2
indent-tabs-mode: nil
End:
vim:set tabstop=2 expandtab:
--]]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment