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

updated clonezilla (3.3.10 -> 3.27.16)
author Hans-G?nter Theisgen
date Fri Feb 15 13:43:34 2019 +0100 (2019-02-15)
parents f4bf102ffcf9
children 71d2ee2c8ab3
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|/*$||' | tr -cd '0-9')"
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
88 cd "$TMP/$SOURCE"
90 # Creat receipt
91 cat > $PACKAGE-$VERSION/receipt <<EOT
92 # SliTaz package receipt.
94 PACKAGE="$PACKAGE"
95 VERSION="$VERSION"
96 CATEGORY="$CATEGORY"
97 SHORT_DESC="$SHORT_DESC"
98 DEPENDS="$DEPENDS"
99 WEB_SITE="$WEB_SITE"
101 post_install()
102 {
103 # add texlive dir to PATH.
104 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
105 then
106 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
107 cp /etc/profile /etc/profile.old
108 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
109 /etc/profile >> profile
110 mv profile /etc/profile
111 fi
113 . /etc/profile
115 echo -e "
117 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
119 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
120 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
122 To improve texlive, run \033[1mtlmgr\033[0m as root.
123 If you prefer graphicals interfaces, install perl-tk,
124 and run\033[1m tlmgr gui\033[0m.
126 The tlmgr man page can be found here:
127 http://tug.org/texlive/doc/tlmgr.html
128 "
129 }
130 EOT
133 # Pack
134 tazpkg pack $PACKAGE-$VERSION
136 # Clean to save RAM memory
137 rm -rf $PACKAGE-$VERSION
139 CONFIRM="y"
140 if [ -z "$ROOT" ]; then
141 echo "Unpacked size: 34M"
142 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
143 read CONFIRM
144 fi
145 if [ $CONFIRM = "y" ]
146 then
147 # Install pseudo package
148 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
149 fi
151 # Clean
152 cd $TOP
153 rm -rf $TMP
155 exit 0