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

libxfcegui4: xfce_setenv is removed in libxfce4util 4.11.0
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue May 13 08:32:11 2014 +0000 (2014-05-13)
parents 007b91d3da0b
children f56bb28aea97
line source
1 #!/bin/sh
2 # download, pack and install a minimal texlive scheme.
4 PACKAGE="texlive"
5 CATEGORY="office"
6 SHORT_DESC="latex text processor"
7 MAINTAINER="sygne@ombres.eu"
8 DEPENDS="wget perl openssl"
9 SOURCE="install-tl"
10 TARBALL="$SOURCE-unx.tar.gz"
11 WEB_SITE="http://www.tug.org/$PACKAGE/"
12 WGET_URL="http://mirror.ctan.org/systems/$PACKAGE/tlnet/$TARBALL"
13 ROOT="$1"
15 # Check if we are root
16 if test $(id -u) != 0 ; then
17 echo -e "\nYou must be root to run `basename $0`."
18 echo -e "Please use 'su' and root password to become super-user.\n"
19 exit 0
20 fi
22 # Avoid reinstall
23 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
24 echo -e "\n$PKG package is already installed.\n"
25 exit 0
26 fi
28 # We need softwares.
29 for pkg in $DEPENDS
30 do
31 if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
32 tazpkg get-install $pkg
33 fi
34 done
37 # Make working directory
38 TMP=/tmp/$(basename $0)$$
39 mkdir -p $TMP
40 TOP=$PWD
41 cd $TMP
43 # Get files
44 echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
45 wget $WGET_URL
46 if [ ! -f $TARBALL ]; then
47 cd $TOP
48 rm -rf $TMP
49 echo "Could not download $TARBALL. Exiting."
50 exit 1
51 fi
53 tar -xzf $TARBALL
54 VERSION="$(ls -d $SOURCE*/ | sed 's|/*$||')"
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