Rsynctips1 First Setup Sh


  1. Takes the same arguments as mtx-update
  1. suggested by Tobias Florek to check for ruby & rsync

if [ ! -x "`which rsync`" ]; then
echo "You need to install rsync first."
exit 1
if [ ! -x "`which ruby`" ]; then
echo "You might want to install Ruby first if you want to use pdfTeX or XeTeX."

system=`uname -s`
cpu=`uname -m`

case "$system" in
# linux
case "$cpu" in
i*86) platform="linux" ;;
x86_64|ia64) platform="linux-64" ;;
# a little bit of cheating with ppc64 (won't work on Gentoo)
ppc|ppc64) platform="linux-ppc" ;;
*) platform="unknown" ;;
esac ;;
# Mac OS X
case "$cpu" in
i*86) platform="osx-intel" ;;
x86_64) platform="osx-64" ;;
ppc*|powerpc|power*|Power*) platform="osx-ppc" ;;
*) platform="unknown" ;;
esac ;;
# FreeBSD
case "$cpu" in
i*86) platform="freebsd" ;;
x86_64) platform="freebsd" ;; # no special binaries are available yet
amd64) platform="freebsd-amd64" ;;
*) platform="unknown" ;;
esac ;;
# kFreeBSD (debian)
case "$cpu" in
i*86) platform="kfreebsd-i386" ;;
amd64) platform="kfreebsd-amd64" ;;
*) platform="unknown" ;;
esac ;;
# SunOS/Solaris
case "$cpu" in
sparc) platform="solaris-sparc" ;;
i86pc) platform="solaris-intel" ;;
*) platform="unknown" ;;
esac ;;
*) platform="unknown"

  1. temporary patch for 64-bit Leopard with 32-bit kernel

if test "$platform" = "osx-intel"; then
# if running Snow Leopard or later
# better: /usr/bin/sw_vers -productVersion
if test `uname -r|cut -f1 -d"."` -ge 10 ; then
# if working on 64-bit hardware
if test `sysctl -n hw.cpu64bit_capable` = 1; then
# snowleopard32=TRUE

if test "$platform" = "unknown" ; then
echo "Error: your system \"$system $cpu\" is not supported yet."
echo "Please report to the ConTeXt mailing-list (ln.gtn|txetnoc-gtn#ln.gtn|txetnoc-gtn)"

  1. Uncomment the line below if you want to force 64-bit Mac OS X binaries on Snow Leopard,
  2. but keep in mind that you also need to adjust the "setuptex" script.
  3. You should either create your own version of setuptex script where you set the platform
  4. to osx-64 explicitely or you can set up the path in .bash_profile.


  1. But the best option is most probably to just boot into 64-bit mode.
  2. See for instructions.


export PATH=$PWD/bin:$PATH

  1. download or rsync the latest scripts first

rsync -rlptv rsync://$platform/bin .

  1. download or update the distribution
  2. you may remove the —context=beta switch if you want to use "current"

mtxrun —verbose —script ./bin/mtx-update.lua —update —make —force —engine=all —context=beta —platform=$platform —texroot=$PWD/tex $@

  1. if [ "x$snowleopard32" = "xTRUE" ];
  2. then
  3. echo
  4. echo "You appear to be running Snow Leopard on 64-bit hardware with 32-bit kernel."
  5. echo "If you want to run 64-bit TeX binaries modify this installer or reboot"
  6. echo "with 64-bit kernel."
  7. echo
  8. fi

echo "When you want to use context, you need to initialize the tree by typing:"
echo " . $PWD/tex/setuptex"
echo "in your shell or add"
echo " \"$PWD/tex/texmf-$platform/bin\""
echo "to PATH variable if you want to set it permanently."
echo "This can usually be done in .bashrc, .bash_profile"
echo "(or whatever file is used to initialize your shell)."

if [ ! -x "`which ruby`" ]; then
echo "You might want to install Ruby first if you want to use pdfTeX or XeTeX."

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.