wok annotate get-texlive/stuff/get-texlive @ rev 11128
Up: xplanet to 1.2.2.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Wed Oct 26 20:31:21 2011 +0000 (2011-10-26) |
parents | 32959e7975fc |
children | f4bf102ffcf9 |
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 |
pascal@3893 | 47 if [ ! -f $TARBALL ]; then |
pascal@3893 | 48 cd $TOP |
pascal@3893 | 49 rm -rf $TMP |
pascal@3893 | 50 echo "Could not download $TARBALL. Exiting." |
pascal@3893 | 51 exit 1 |
pascal@3893 | 52 fi |
pascal@3893 | 53 |
sygne@2829 | 54 tar -xzf $TARBALL |
sygne@2829 | 55 |
jozee@4994 | 56 # extracted pkg can be removed: Save RAM before packing |
jozee@4994 | 57 rm -rf $TARBALL |
jozee@4994 | 58 |
sygne@2829 | 59 # launch texlive install script |
sygne@2829 | 60 echo -e "\033[1;33m Launching $PACKAGE install script\033[0m" |
sygne@2829 | 61 cd $SOURCE |
sygne@2829 | 62 PREFIX="$TMP/$SOURCE/$PACKAGE-$VERSION/fs/usr/local/$PACKAGE" |
sygne@2829 | 63 mkdir -p $PREFIX |
sygne@2829 | 64 |
sygne@2829 | 65 cat > slitaz.profile <<EOT |
sygne@2829 | 66 # slitaz profile for texlive |
sygne@2829 | 67 # we only want the minimum |
sygne@2829 | 68 |
sygne@2829 | 69 selected_scheme scheme-minimal |
sygne@2829 | 70 TEXDIR $PREFIX/$VERSION |
sygne@2829 | 71 TEXDIRW $PREFIX/$VERSION |
sygne@2829 | 72 TEXMFHOME ~/.texmf |
sygne@2829 | 73 TEXMFLOCAL $PREFIX/texmf-local |
sygne@2829 | 74 TEXMFSYSCONFIG $PREFIX/$VERSION/texmf-config |
sygne@2829 | 75 TEXMFSYSVAR $PREFIX/$VERSION/texmf-var |
sygne@2829 | 76 collection-basic 1 |
sygne@2829 | 77 option_doc 0 |
sygne@2829 | 78 option_fmt 1 |
sygne@2829 | 79 option_letter 0 |
sygne@2829 | 80 option_src 0 |
sygne@2829 | 81 option_symlinks 0 |
sygne@2829 | 82 EOT |
sygne@2829 | 83 |
sygne@2829 | 84 # some mirrors are too slow, if so, add this option: |
sygne@2829 | 85 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/ |
sygne@2829 | 86 ./install-tl -profile slitaz.profile |
sygne@2829 | 87 |
sygne@2829 | 88 |
sygne@2829 | 89 # Creat receipt |
sygne@2829 | 90 cat > $PACKAGE-$VERSION/receipt <<EOT |
sygne@2829 | 91 # SliTaz package receipt. |
sygne@2829 | 92 |
sygne@2829 | 93 PACKAGE="$PACKAGE" |
sygne@2829 | 94 VERSION="$VERSION" |
sygne@2829 | 95 CATEGORY="$CATEGORY" |
sygne@2829 | 96 SHORT_DESC="$SHORT_DESC" |
sygne@2829 | 97 DEPENDS="$DEPENDS" |
sygne@2829 | 98 WEB_SITE="$WEB_SITE" |
sygne@2829 | 99 |
sygne@2829 | 100 post_install() |
sygne@2829 | 101 { |
sygne@2829 | 102 # add texlive dir to PATH. |
sygne@2829 | 103 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile |
sygne@2829 | 104 then |
sygne@2829 | 105 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH" |
sygne@2829 | 106 cp /etc/profile /etc/profile.old |
sygne@2829 | 107 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \ |
sygne@2829 | 108 /etc/profile >> profile |
sygne@2829 | 109 mv profile /etc/profile |
sygne@2829 | 110 fi |
sygne@2829 | 111 |
sygne@2829 | 112 echo -e " |
sygne@2829 | 113 |
sygne@2829 | 114 \033[1;33m - A texlive minimal scheme is now installed - \033[0m |
sygne@2829 | 115 |
sygne@2829 | 116 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile, |
sygne@2829 | 117 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m |
sygne@2829 | 118 |
sygne@2829 | 119 To improve texlive, run \033[1mtlmgr\033[0m as root. |
sygne@2829 | 120 If you prefer graphicals interfaces, install perl-tk, |
sygne@2829 | 121 and run\033[1m tlmgr gui\033[0m. |
sygne@2829 | 122 |
sygne@2829 | 123 The tlmgr man page can be found here: |
sygne@2829 | 124 http://tug.org/texlive/doc/tlmgr.html |
sygne@2829 | 125 " |
sygne@2829 | 126 } |
sygne@2829 | 127 EOT |
sygne@2829 | 128 |
sygne@2829 | 129 |
sygne@2829 | 130 # Pack |
sygne@2829 | 131 tazpkg pack $PACKAGE-$VERSION |
sygne@2829 | 132 |
jozee@4994 | 133 # Clean to save RAM memory |
jozee@4994 | 134 rm -rf $PACKAGE-$VERSION |
sygne@2829 | 135 |
sygne@2829 | 136 CONFIRM="y" |
sygne@2829 | 137 if [ -z "$ROOT" ]; then |
sygne@2829 | 138 echo "Unpacked size: 34M" |
sygne@2829 | 139 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): " |
sygne@2829 | 140 read CONFIRM |
sygne@2829 | 141 fi |
sygne@2829 | 142 if [ $CONFIRM = "y" ] |
sygne@2829 | 143 then |
sygne@2829 | 144 # Install pseudo package |
sygne@2829 | 145 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT |
sygne@2829 | 146 fi |
sygne@2829 | 147 |
sygne@2829 | 148 # Clean |
sygne@2829 | 149 cd $TOP |
sygne@2829 | 150 rm -rf $TMP |
sygne@2829 | 151 |
sygne@2829 | 152 exit 0 |