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