wok-6.x view get-texlive/stuff/get-texlive @ rev 1561

get-texlive: inform user that it will install 31Mo
author Pierre-Jean Fichet <sygne@ombres.eu>
date Mon Oct 13 14:50:22 2008 +0200 (2008-10-13)
parents 18a8e54602a2
children 473dba2a800f
line source
1 #!/bin/sh
2 # download, pack and install a minimal texlive scheme.
4 PACKAGE="texlive"
5 VERSION="2008"
6 CATEGORY="office"
7 SHORT_DESC="latex text processor"
8 MAINTAINER="sygne@ombres.eu"
9 DEPENDS="wget"
10 SOURCE="install-tl"
11 TARBALL="$SOURCE-unx.tar.gz"
12 WEB_SITE="http://www.tug.org/$PACKAGE/"
13 WGET_URL="http://mirror.ctan.org/systems/$PACKAGE/tlnet/$VERSION/$TARBALL"
15 # TexLive is a big package. We must inform user.
16 PACKED_SIZE="10.7Mo"
17 UNPACKED_SIZE="31.0Mo"
20 # Check if we are root
21 if test $(id -u) != 0 ; then
22 echo -e "\nYou must be root to run `basename $0`."
23 echo -e "Please use 'su' and root password to become super-user.\n"
24 exit 0
25 fi
27 # Avoid reinstall
28 if [ -d /var/lib/tazpkg/installed/$PACKAGE ]; then
29 echo -e "\n$PKG package is already installed.\n"
30 exit 0
31 fi
33 # We need softwares.
34 for pkg in $DEPENDS
35 do
36 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
37 tazpkg get-install $pkg
38 fi
39 done
42 # Make working directory
43 TMP=/tmp/$(basename $0)$$
44 mkdir -p $TMP
45 TOP=$PWD
46 cd $TMP
48 # Get files
49 echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
50 wget $WGET_URL
51 tar -xzf $TARBALL
54 # launch texlive install script
55 echo -e "\033[1;33m Launching $PACKAGE install script\033[0m"
56 cd $SOURCE
57 PREFIX="$PACKAGE-$VERSION/fs/usr/local/$PACKAGE"
58 mkdir -p $PREFIX
60 cat > slitaz.profile <<EOT
61 # slitaz profile for texlive
62 # we only want the minimum
64 selected_scheme scheme-minimal
65 TEXDIR $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION
66 TEXDIRW $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION
67 TEXMFHOME ~/.texmf
68 TEXMFLOCAL $PACKAGE-$VERSION/fs/usr/local/texlive/texmf-local
69 TEXMFSYSCONFIG $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION/texmf-config
70 TEXMFSYSVAR $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION/texmf-var
71 collection-basic 1
72 option_doc 0
73 option_fmt 1
74 option_letter 0
75 option_src 0
76 option_symlinks 0
77 EOT
79 # some mirrors are too slow, if so, add this option:
80 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
81 ./install-tl -profile slitaz.profile
84 # Creat receipt
85 cat > $PACKAGE-$VERSION/receipt <<EOT
86 # SliTaz package receipt.
88 PACKED_SIZE="$PACKED_SIZE"
89 UNPACKED_SIZE="$UNPACKED_SIZE"
91 PACKAGE="$PACKAGE"
92 VERSION="$VERSION"
93 CATEGORY="$CATEGORY"
94 SHORT_DESC="$SHORT_DESC"
95 DEPENDS="$DEPENDS"
96 WEB_SITE="$WEB_SITE"
98 post_install()
99 {
100 # add texlive dir to PATH.
101 cp /etc/profile /etc/profile.old
102 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
103 /etc/profile >> profile
104 mv profile /etc/profile
106 echo -e "
108 \033[1;33m - A texlive minimal scheme is now installed - \033[0;m
110 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
111 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
113 To improve texlive, run \033[1mtlmgr\033[0m as root.
114 If you prefer graphicals interfaces, install perl-tk,
115 and run\033[1mtlmgr gui\033[0m.
117 The tlmgr man page can be found here:
118 http://tug.org/texlive/doc/tlmgr.html
119 "
120 }
121 EOT
124 # Pack
125 tazpkg pack $PACKAGE-$VERSION
126 # Install pseudo package
127 tazpkg install $PACKAGE-$VERSION.tazpkg
129 # Clean
130 cd $TOP
131 rm -rf $TMP
133 exit 0