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

Fix get-texlive for 2008 version, add collection-latex, fix for build on x86_64 (2008 don't support it)
author Stanislas Leduc <shann@slitaz.org>
date Fri Feb 16 19:48:00 2024 +0100 (3 months ago)
parents f56bb28aea97
children
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="ftp://ftp.math.utah.edu/pub/tex/historic/systems/$PACKAGE/2008/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="$(grep 'texlive-' $SOURCE*/release-texlive.txt | 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 collection-latex 1
78 option_doc 0
79 option_fmt 1
80 option_letter 0
81 option_src 0
82 option_symlinks 0
83 EOT
85 # some mirrors are too slow, if so, add this option:
86 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
87 setarch linux32 ./install-tl -profile slitaz.profile -location ftp://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2008/tlnet/tlpkg/
89 cd "$TMP/$SOURCE"
91 # Creat receipt
92 cat > $PACKAGE-$VERSION/receipt <<EOT
93 # SliTaz package receipt.
95 PACKAGE="$PACKAGE"
96 VERSION="$VERSION"
97 CATEGORY="$CATEGORY"
98 SHORT_DESC="$SHORT_DESC"
99 DEPENDS="$DEPENDS"
100 WEB_SITE="$WEB_SITE"
102 post_install()
103 {
104 # add texlive dir to PATH.
105 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
106 then
107 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
108 cp /etc/profile /etc/profile.old
109 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
110 /etc/profile >> profile
111 mv profile /etc/profile
112 fi
114 . /etc/profile
116 echo -e "
118 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
120 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
121 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
123 To improve texlive, run \033[1mtlmgr\033[0m as root.
124 If you prefer graphicals interfaces, install perl-tk,
125 and run\033[1m tlmgr gui\033[0m.
127 The tlmgr man page can be found here:
128 http://tug.org/texlive/doc/tlmgr.html
129 "
130 }
131 EOT
134 # Pack
135 tazpkg pack $PACKAGE-$VERSION
137 # Clean to save RAM memory
138 rm -rf $PACKAGE-$VERSION
140 CONFIRM="y"
141 if [ -z "$ROOT" ]; then
142 echo "Unpacked size: 34M"
143 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
144 read CONFIRM
145 fi
146 if [ $CONFIRM = "y" ]
147 then
148 # Install pseudo package
149 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
150 fi
152 # Clean
153 cd $TOP
154 rm -rf $TMP
156 exit 0