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

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (2022-05-21)
parents f4bf102ffcf9
children 71d2ee2c8ab3
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 CATEGORY="office"
sygne@2829 6 SHORT_DESC="latex text processor"
sygne@2829 7 MAINTAINER="sygne@ombres.eu"
sygne@2829 8 DEPENDS="wget perl openssl"
sygne@2829 9 SOURCE="install-tl"
sygne@2829 10 TARBALL="$SOURCE-unx.tar.gz"
sygne@2829 11 WEB_SITE="http://www.tug.org/$PACKAGE/"
pascal@11653 12 WGET_URL="http://mirror.ctan.org/systems/$PACKAGE/tlnet/$TARBALL"
sygne@2829 13 ROOT="$1"
sygne@2829 14
sygne@2831 15 # Check if we are root
sygne@2829 16 if test $(id -u) != 0 ; then
sygne@2829 17 echo -e "\nYou must be root to run `basename $0`."
sygne@2829 18 echo -e "Please use 'su' and root password to become super-user.\n"
sygne@2829 19 exit 0
sygne@2829 20 fi
sygne@2829 21
sygne@2831 22 # Avoid reinstall
sygne@2829 23 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
sygne@2829 24 echo -e "\n$PKG package is already installed.\n"
sygne@2829 25 exit 0
sygne@2829 26 fi
sygne@2829 27
sygne@2829 28 # We need softwares.
sygne@2829 29 for pkg in $DEPENDS
sygne@2829 30 do
sygne@2829 31 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
sygne@2829 32 tazpkg get-install $pkg
sygne@2829 33 fi
sygne@2829 34 done
sygne@2829 35
sygne@2829 36
sygne@2829 37 # Make working directory
sygne@2829 38 TMP=/tmp/$(basename $0)$$
sygne@2829 39 mkdir -p $TMP
sygne@2829 40 TOP=$PWD
sygne@2829 41 cd $TMP
sygne@2829 42
sygne@2829 43 # Get files
sygne@2829 44 echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
sygne@2829 45 wget $WGET_URL
pascal@3893 46 if [ ! -f $TARBALL ]; then
pascal@3893 47 cd $TOP
pascal@3893 48 rm -rf $TMP
pascal@3893 49 echo "Could not download $TARBALL. Exiting."
pascal@3893 50 exit 1
pascal@3893 51 fi
pascal@3893 52
sygne@2829 53 tar -xzf $TARBALL
al@18863 54 VERSION="$(ls -d $SOURCE*/ | sed 's|/*$||' | tr -cd '0-9')"
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"
pascal@11653 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
al@18863 88 cd "$TMP/$SOURCE"
sygne@2829 89
sygne@2829 90 # Creat receipt
sygne@2829 91 cat > $PACKAGE-$VERSION/receipt <<EOT
sygne@2829 92 # SliTaz package receipt.
sygne@2829 93
sygne@2829 94 PACKAGE="$PACKAGE"
sygne@2829 95 VERSION="$VERSION"
sygne@2829 96 CATEGORY="$CATEGORY"
sygne@2829 97 SHORT_DESC="$SHORT_DESC"
sygne@2829 98 DEPENDS="$DEPENDS"
sygne@2829 99 WEB_SITE="$WEB_SITE"
sygne@2829 100
sygne@2829 101 post_install()
sygne@2829 102 {
sygne@2829 103 # add texlive dir to PATH.
sygne@2829 104 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
sygne@2829 105 then
sygne@2829 106 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
sygne@2829 107 cp /etc/profile /etc/profile.old
sygne@2829 108 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
sygne@2829 109 /etc/profile >> profile
sygne@2829 110 mv profile /etc/profile
sygne@2829 111 fi
sygne@2829 112
al@18863 113 . /etc/profile
al@18863 114
sygne@2829 115 echo -e "
sygne@2829 116
sygne@2829 117 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
sygne@2829 118
sygne@2829 119 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
sygne@2829 120 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
sygne@2829 121
sygne@2829 122 To improve texlive, run \033[1mtlmgr\033[0m as root.
sygne@2829 123 If you prefer graphicals interfaces, install perl-tk,
sygne@2829 124 and run\033[1m tlmgr gui\033[0m.
sygne@2829 125
sygne@2829 126 The tlmgr man page can be found here:
sygne@2829 127 http://tug.org/texlive/doc/tlmgr.html
sygne@2829 128 "
sygne@2829 129 }
sygne@2829 130 EOT
sygne@2829 131
sygne@2829 132
sygne@2829 133 # Pack
sygne@2829 134 tazpkg pack $PACKAGE-$VERSION
sygne@2829 135
jozee@4994 136 # Clean to save RAM memory
jozee@4994 137 rm -rf $PACKAGE-$VERSION
sygne@2829 138
sygne@2829 139 CONFIRM="y"
sygne@2829 140 if [ -z "$ROOT" ]; then
sygne@2829 141 echo "Unpacked size: 34M"
sygne@2829 142 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
sygne@2829 143 read CONFIRM
sygne@2829 144 fi
sygne@2829 145 if [ $CONFIRM = "y" ]
sygne@2829 146 then
sygne@2829 147 # Install pseudo package
sygne@2829 148 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
sygne@2829 149 fi
sygne@2829 150
sygne@2829 151 # Clean
sygne@2829 152 cd $TOP
sygne@2829 153 rm -rf $TMP
sygne@2829 154
sygne@2829 155 exit 0