Skip to content

Instantly share code, notes, and snippets.

@hvrauhal
Last active August 29, 2015 14:19
Show Gist options
  • Save hvrauhal/e0cb62b193a9fda37657 to your computer and use it in GitHub Desktop.
Save hvrauhal/e0cb62b193a9fda37657 to your computer and use it in GitHub Desktop.
Install TexLive on openshift as a portable install with network install
#!/bin/bash
set -e
TMP_INSTALL_DIR=$(mktemp --directory --tmpdir texlive-install-XXXXXXXX)
trap "rm -rf $TMP_INSTALL_DIR" EXIT
pushd $TMP_INSTALL_DIR
# Following line from http://stackoverflow.com/a/2916159/61175
perl -p -i -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' < ${OPENSHIFT_REPO_DIR}/texlive.profile.template > $TMP_INSTALL_DIR/texlive.profile
curl http://www.nic.funet.fi/pub/TeX/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz | tar xzf -
pushd install-tl*
./install-tl -profile $TMP_INSTALL_DIR/texlive.profile || cat <<EOF
If installation failed with:
Could not load TeX Live Database from http://www.ctan.org/tex-archive/...
just retry, it might be that you got redirected to an ftp host, which is not supported by our proxy
EOF
popd
popd
# The MIT License (MIT)
#
# Copyright (c) <year> <copyright holders>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# texlive.profile written on Fri Apr 17 05:57:11 2015 UTC
# It will NOT be updated and reflects only the
# installation profile at installation time.
selected_scheme scheme-custom
TEXDIR ${OPENSHIFT_DATA_DIR}/latex
TEXMFCONFIG $TEXMFSYSCONFIG
TEXMFHOME $TEXMFLOCAL
TEXMFLOCAL ${OPENSHIFT_DATA_DIR}/latex/texmf-local
TEXMFSYSCONFIG ${OPENSHIFT_DATA_DIR}/latex/texmf-config
TEXMFSYSVAR ${OPENSHIFT_DATA_DIR}/latex/texmf-var
TEXMFVAR $TEXMFSYSVAR
binary_x86_64-linux 1
collection-basic 1
collection-fontsrecommended 1
collection-fontutils 1
collection-genericrecommended 1
collection-langeuropean 1
collection-latex 1
collection-latexrecommended 1
in_place 0
option_adjustrepo 1
option_autobackup 1
option_backupdir tlpkg/backups
option_desktop_integration
option_doc 0
option_file_assocs
option_fmt 1
option_letter 0
option_menu_integration
option_path
option_post_code 1
option_src 0
option_sys_bin /usr/local/bin
option_sys_info /usr/local/share/info
option_sys_man /usr/local/share/man
option_w32_multi_user 1
option_write18_restricted 1
portable 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment