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

get-*: do not create empty packages
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 14 10:01:38 2009 +0200 (2009-08-14)
parents aaea09f5ebb3
children 007b91d3da0b
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 # launch texlive install script
57 echo -e "\033[1;33m Launching $PACKAGE install script\033[0m"
58 cd $SOURCE
59 PREFIX="$TMP/$SOURCE/$PACKAGE-$VERSION/fs/usr/local/$PACKAGE"
60 mkdir -p $PREFIX
62 cat > slitaz.profile <<EOT
63 # slitaz profile for texlive
64 # we only want the minimum
66 selected_scheme scheme-minimal
67 TEXDIR $PREFIX/$VERSION
68 TEXDIRW $PREFIX/$VERSION
69 TEXMFHOME ~/.texmf
70 TEXMFLOCAL $PREFIX/texmf-local
71 TEXMFSYSCONFIG $PREFIX/$VERSION/texmf-config
72 TEXMFSYSVAR $PREFIX/$VERSION/texmf-var
73 collection-basic 1
74 option_doc 0
75 option_fmt 1
76 option_letter 0
77 option_src 0
78 option_symlinks 0
79 EOT
81 # some mirrors are too slow, if so, add this option:
82 # -location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
83 ./install-tl -profile slitaz.profile
86 # Creat receipt
87 cat > $PACKAGE-$VERSION/receipt <<EOT
88 # SliTaz package receipt.
90 PACKAGE="$PACKAGE"
91 VERSION="$VERSION"
92 CATEGORY="$CATEGORY"
93 SHORT_DESC="$SHORT_DESC"
94 DEPENDS="$DEPENDS"
95 WEB_SITE="$WEB_SITE"
97 post_install()
98 {
99 # add texlive dir to PATH.
100 if ! grep -q "/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/" /etc/profile
101 then
102 echo "adding /usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/ to PATH"
103 cp /etc/profile /etc/profile.old
104 sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
105 /etc/profile >> profile
106 mv profile /etc/profile
107 fi
109 echo -e "
111 \033[1;33m - A texlive minimal scheme is now installed - \033[0m
113 Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
114 and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
116 To improve texlive, run \033[1mtlmgr\033[0m as root.
117 If you prefer graphicals interfaces, install perl-tk,
118 and run\033[1m tlmgr gui\033[0m.
120 The tlmgr man page can be found here:
121 http://tug.org/texlive/doc/tlmgr.html
122 "
123 }
124 EOT
127 # Pack
128 tazpkg pack $PACKAGE-$VERSION
131 CONFIRM="y"
132 if [ -z "$ROOT" ]; then
133 echo "Unpacked size: 34M"
134 echo -e -n "\nPlease confirm installation of $PACKAGE-$VERSION (y/N): "
135 read CONFIRM
136 fi
137 if [ $CONFIRM = "y" ]
138 then
139 # Install pseudo package
140 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
141 fi
143 # Clean
144 cd $TOP
145 rm -rf $TMP
147 exit 0