wok view get-texlive/stuff/get-texlive @ rev 10460

tcpdump: update bdeps
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed May 25 11:19:32 2011 +0200 (2011-05-25)
parents 32959e7975fc
children f4bf102ffcf9
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 perl openssl"
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"
14 ROOT="$1"
16 # Check if we are root
17 if test $(id -u) != 0 ; then
18 echo -e "\nYou must be root to run `basename $0`."
19 echo -e "Please use 'su' and root password to become super-user.\n"
20 exit 0
21 fi
23 # Avoid reinstall
24 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
25 echo -e "\n$PKG package is already installed.\n"
26 exit 0
27 fi
29 # We need softwares.
30 for pkg in $DEPENDS
31 do
32 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
33 tazpkg get-install $pkg
34 fi
35 done
38 # Make working directory
39 TMP=/tmp/$(basename $0)$$
40 mkdir -p $TMP
41 TOP=$PWD
42 cd $TMP
44 # Get files
45 echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
46 wget $WGET_URL
47 if [ ! -f $TARBALL ]; then
48 cd $TOP
49 rm -rf $TMP
50 echo "Could not download $TARBALL. Exiting."
51 exit 1
52 fi
54 tar -xzf $TARBALL
56 # extracted pkg can be removed: Save RAM before packing
57 rm -rf $TARBALL
59 # launch texlive install script
60 echo -e "\033[1;33m Launching $PACKAGE install script\033[0m"
61 cd $SOURCE
62 PREFIX="$TMP/$SOURCE/$PACKAGE-$VERSION/fs/usr/local/$PACKAGE"
63 mkdir -p $PREFIX
65 cat > slitaz.profile <<EOT
66 # slitaz profile for texlive
67 # we only want the minimum
69 selected_scheme scheme-minimal
70 TEXDIR $PREFIX/$VERSION
71 TEXDIRW $PREFIX/$VERSION
72 TEXMFHOME ~/.texmf
73 TEXMFLOCAL $PREFIX/texmf-local
74 TEXMFSYSCONFIG $PREFIX/$VERSION/texmf-config
75 TEXMFSYSVAR $PREFIX/$VERSION/texmf-var
76 collection-basic 1
77 option_doc 0
78 option_fmt 1
79 option_letter 0
80 option_src 0
81 option_symlinks 0
82 EOT
84 # some mirrors are too slow, if so, add this option:
85 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
86 ./install-tl -profile slitaz.profile
89 # Creat receipt
90 cat > $PACKAGE-$VERSION/receipt <<EOT
91 # SliTaz package receipt.
93 PACKAGE="$PACKAGE"
94 VERSION="$VERSION"
95 CATEGORY="$CATEGORY"
96 SHORT_DESC="$SHORT_DESC"
97 DEPENDS="$DEPENDS"
98 WEB_SITE="$WEB_SITE"
100 post_install()
101 {
102 # add texlive dir to PATH.
103 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
104 then
105 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
106 cp /etc/profile /etc/profile.old
107 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
108 /etc/profile >> profile
109 mv profile /etc/profile
110 fi
112 echo -e "
114 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
116 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
117 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
119 To improve texlive, run \033[1mtlmgr\033[0m as root.
120 If you prefer graphicals interfaces, install perl-tk,
121 and run\033[1m tlmgr gui\033[0m.
123 The tlmgr man page can be found here:
124 http://tug.org/texlive/doc/tlmgr.html
125 "
126 }
127 EOT
130 # Pack
131 tazpkg pack $PACKAGE-$VERSION
133 # Clean to save RAM memory
134 rm -rf $PACKAGE-$VERSION
136 CONFIRM="y"
137 if [ -z "$ROOT" ]; then
138 echo "Unpacked size: 34M"
139 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
140 read CONFIRM
141 fi
142 if [ $CONFIRM = "y" ]
143 then
144 # Install pseudo package
145 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
146 fi
148 # Clean
149 cd $TOP
150 rm -rf $TMP
152 exit 0