wok annotate get-texlive/stuff/get-texlive @ rev 3835

Add: stoqlib (0.9.10)
author Claudinei Pereira <claudinei@slitaz.org>
date Fri Aug 07 00:03:35 2009 +0000 (2009-08-07)
parents 962995a7d54a
children 32959e7975fc
rev   line source
sygne@2829 1 #!/bin/sh
sygne@2829 2 # download, pack and install a minimal texlive scheme.
sygne@2829 3
sygne@2829 4 PACKAGE="texlive"
sygne@2829 5 VERSION="2008"
sygne@2829 6 CATEGORY="office"
sygne@2829 7 SHORT_DESC="latex text processor"
sygne@2829 8 MAINTAINER="sygne@ombres.eu"
sygne@2829 9 DEPENDS="wget perl openssl"
sygne@2829 10 SOURCE="install-tl"
sygne@2829 11 TARBALL="$SOURCE-unx.tar.gz"
sygne@2829 12 WEB_SITE="http://www.tug.org/$PACKAGE/"
sygne@2829 13 WGET_URL="http://mirror.ctan.org/systems/$PACKAGE/tlnet/$VERSION/$TARBALL"
sygne@2829 14 ROOT="$1"
sygne@2829 15
sygne@2831 16 # Check if we are root
sygne@2829 17 if test $(id -u) != 0 ; then
sygne@2829 18 echo -e "\nYou must be root to run `basename $0`."
sygne@2829 19 echo -e "Please use 'su' and root password to become super-user.\n"
sygne@2829 20 exit 0
sygne@2829 21 fi
sygne@2829 22
sygne@2831 23 # Avoid reinstall
sygne@2829 24 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
sygne@2829 25 echo -e "\n$PKG package is already installed.\n"
sygne@2829 26 exit 0
sygne@2829 27 fi
sygne@2829 28
sygne@2829 29 # We need softwares.
sygne@2829 30 for pkg in $DEPENDS
sygne@2829 31 do
sygne@2829 32 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
sygne@2829 33 tazpkg get-install $pkg
sygne@2829 34 fi
sygne@2829 35 done
sygne@2829 36
sygne@2829 37
sygne@2829 38 # Make working directory
sygne@2829 39 TMP=/tmp/$(basename $0)$$
sygne@2829 40 mkdir -p $TMP
sygne@2829 41 TOP=$PWD
sygne@2829 42 cd $TMP
sygne@2829 43
sygne@2829 44 # Get files
sygne@2829 45 echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
sygne@2829 46 wget $WGET_URL
sygne@2829 47 tar -xzf $TARBALL
sygne@2829 48
sygne@2829 49
sygne@2829 50 # launch texlive install script
sygne@2829 51 echo -e "\033[1;33m Launching $PACKAGE install script\033[0m"
sygne@2829 52 cd $SOURCE
sygne@2829 53 PREFIX="$TMP/$SOURCE/$PACKAGE-$VERSION/fs/usr/local/$PACKAGE"
sygne@2829 54 mkdir -p $PREFIX
sygne@2829 55
sygne@2829 56 cat > slitaz.profile <<EOT
sygne@2829 57 # slitaz profile for texlive
sygne@2829 58 # we only want the minimum
sygne@2829 59
sygne@2829 60 selected_scheme scheme-minimal
sygne@2829 61 TEXDIR $PREFIX/$VERSION
sygne@2829 62 TEXDIRW $PREFIX/$VERSION
sygne@2829 63 TEXMFHOME ~/.texmf
sygne@2829 64 TEXMFLOCAL $PREFIX/texmf-local
sygne@2829 65 TEXMFSYSCONFIG $PREFIX/$VERSION/texmf-config
sygne@2829 66 TEXMFSYSVAR $PREFIX/$VERSION/texmf-var
sygne@2829 67 collection-basic 1
sygne@2829 68 option_doc 0
sygne@2829 69 option_fmt 1
sygne@2829 70 option_letter 0
sygne@2829 71 option_src 0
sygne@2829 72 option_symlinks 0
sygne@2829 73 EOT
sygne@2829 74
sygne@2829 75 # some mirrors are too slow, if so, add this option:
sygne@2829 76 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
sygne@2829 77 ./install-tl -profile slitaz.profile
sygne@2829 78
sygne@2829 79
sygne@2829 80 # Creat receipt
sygne@2829 81 cat > $PACKAGE-$VERSION/receipt <<EOT
sygne@2829 82 # SliTaz package receipt.
sygne@2829 83
sygne@2829 84 PACKAGE="$PACKAGE"
sygne@2829 85 VERSION="$VERSION"
sygne@2829 86 CATEGORY="$CATEGORY"
sygne@2829 87 SHORT_DESC="$SHORT_DESC"
sygne@2829 88 DEPENDS="$DEPENDS"
sygne@2829 89 WEB_SITE="$WEB_SITE"
sygne@2829 90
sygne@2829 91 post_install()
sygne@2829 92 {
sygne@2829 93 # add texlive dir to PATH.
sygne@2829 94 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
sygne@2829 95 then
sygne@2829 96 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
sygne@2829 97 cp /etc/profile /etc/profile.old
sygne@2829 98 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
sygne@2829 99 /etc/profile >> profile
sygne@2829 100 mv profile /etc/profile
sygne@2829 101 fi
sygne@2829 102
sygne@2829 103 echo -e "
sygne@2829 104
sygne@2829 105 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
sygne@2829 106
sygne@2829 107 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
sygne@2829 108 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
sygne@2829 109
sygne@2829 110 To improve texlive, run \033[1mtlmgr\033[0m as root.
sygne@2829 111 If you prefer graphicals interfaces, install perl-tk,
sygne@2829 112 and run\033[1m tlmgr gui\033[0m.
sygne@2829 113
sygne@2829 114 The tlmgr man page can be found here:
sygne@2829 115 http://tug.org/texlive/doc/tlmgr.html
sygne@2829 116 "
sygne@2829 117 }
sygne@2829 118 EOT
sygne@2829 119
sygne@2829 120
sygne@2829 121 # Pack
sygne@2829 122 tazpkg pack $PACKAGE-$VERSION
sygne@2829 123
sygne@2829 124
sygne@2829 125 CONFIRM="y"
sygne@2829 126 if [ -z "$ROOT" ]; then
sygne@2829 127 echo "Unpacked size: 34M"
sygne@2829 128 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
sygne@2829 129 read CONFIRM
sygne@2829 130 fi
sygne@2829 131 if [ $CONFIRM = "y" ]
sygne@2829 132 then
sygne@2829 133 # Install pseudo package
sygne@2829 134 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
sygne@2829 135 fi
sygne@2829 136
sygne@2829 137 # Clean
sygne@2829 138 cd $TOP
sygne@2829 139 rm -rf $TMP
sygne@2829 140
sygne@2829 141 exit 0