wok-6.x rev 1556

add get-texlive: a script to get tex, latex...
author Pierre-Jean Fichet <sygne@ombres.eu>
date Sun Oct 12 23:15:25 2008 +0200 (2008-10-12)
parents 1783302c22a4
children e8fa5f0b1fb0
files get-texlive/receipt get-texlive/stuff/get-texlive
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-texlive/receipt	Sun Oct 12 23:15:25 2008 +0200
     1.3 @@ -0,0 +1,25 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-texlive"
     1.7 +VERSION="2008"
     1.8 +CATEGORY="office"
     1.9 +SHORT_DESC="get texlive distribution for tex, latex..."
    1.10 +MAINTAINER="sygne@ombres.eu"
    1.11 +
    1.12 +
    1.13 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.14 +genpkg_rules()
    1.15 +{
    1.16 +	mkdir -p $fs/usr/bin
    1.17 +	cp stuff/$PACKAGE $fs/usr/bin
    1.18 +}
    1.19 +
    1.20 +
    1.21 +post_install()
    1.22 +{
    1.23 +	echo -e "
    1.24 +To get texlive, run \033[1mget-texlive\033[0m as root.
    1.25 +This will install about 10 Mo of tools in /usr/local/texlive
    1.26 +"
    1.27 +}
    1.28 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-texlive/stuff/get-texlive	Sun Oct 12 23:15:25 2008 +0200
     2.3 @@ -0,0 +1,127 @@
     2.4 +#!/bin/sh
     2.5 +# download, pack and install a minimal texlive scheme.
     2.6 +
     2.7 +PACKAGE="texlive"
     2.8 +VERSION="2008"
     2.9 +CATEGORY="office"
    2.10 +SHORT_DESC="latex text processor"
    2.11 +MAINTAINER="sygne@ombres.eu"
    2.12 +DEPENDS="wget"
    2.13 +SOURCE="install-tl"
    2.14 +TARBALL="$SOURCE-unx.tar.gz"
    2.15 +WEB_SITE="http://www.tug.org/$PACKAGE/"
    2.16 +WGET_URL="http://mirror.ctan.org/systems/$PACKAGE/tlnet/$VERSION/$TARBALL"
    2.17 +
    2.18 +
    2.19 +
    2.20 +# Check if we are root
    2.21 +if test $(id -u) != 0 ; then
    2.22 +        echo -e "\nYou must be root to run `basename $0`."
    2.23 +	echo -e "Please use 'su' and root password to become super-user.\n"
    2.24 +	exit 0
    2.25 +fi
    2.26 +
    2.27 +# Avoid reinstall
    2.28 +if [ -d /var/lib/tazpkg/installed/$PACKAGE ]; then
    2.29 +	echo -e "\n$PKG package is already installed.\n"
    2.30 +	exit 0
    2.31 +fi
    2.32 +
    2.33 +# We need softwares.
    2.34 +for pkg in $DEPENDS
    2.35 +do
    2.36 +        if [ ! -d /var/lib/tazpkg/installed/$pkg ]; then
    2.37 +		tazpkg get-install $pkg
    2.38 +	fi
    2.39 +done
    2.40 +
    2.41 +
    2.42 +# Make working directory
    2.43 +TMP=/tmp/$(basename $0)$$
    2.44 +mkdir -p $TMP
    2.45 +TOP=$PWD
    2.46 +cd $TMP
    2.47 +
    2.48 +# Get files
    2.49 +echo -e "\033[1;33m Getting $PACKAGE install script\033[0m"
    2.50 +wget $WGET_URL
    2.51 +tar -xzf $TARBALL
    2.52 +
    2.53 +
    2.54 +# launch texlive install script
    2.55 +echo -e "\033[1;33m Launching $PACKAGE install script\033[0m" 
    2.56 +cd $SOURCE
    2.57 +PREFIX="$PACKAGE-$VERSION/fs/usr/local/$PACKAGE"
    2.58 +mkdir -p $PREFIX
    2.59 +
    2.60 +cat > slitaz.profile <<EOT
    2.61 +# slitaz profile for texlive
    2.62 +# we only want the minimum
    2.63 +
    2.64 +selected_scheme scheme-minimal
    2.65 +TEXDIR $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION
    2.66 +TEXDIRW $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION
    2.67 +TEXMFHOME ~/.texmf
    2.68 +TEXMFLOCAL $PACKAGE-$VERSION/fs/usr/local/texlive/texmf-local
    2.69 +TEXMFSYSCONFIG $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION/texmf-config
    2.70 +TEXMFSYSVAR $PACKAGE-$VERSION/fs/usr/local/texlive/$VERSION/texmf-var
    2.71 +collection-basic 1
    2.72 +option_doc 0
    2.73 +option_fmt 1
    2.74 +option_letter 0
    2.75 +option_src 0
    2.76 +option_symlinks 0
    2.77 +EOT
    2.78 +
    2.79 +# some mirrors are too slow, if so, add this option:
    2.80 +# 	-location ftp://ftp.inria.fr/pub/TeX/CTAN/systems/texlive/tlnet/2008/
    2.81 +./install-tl -profile slitaz.profile
    2.82 +
    2.83 +
    2.84 +# Creat receipt
    2.85 +cat > $PACKAGE-$VERSION/receipt <<EOT
    2.86 +# SliTaz package receipt.
    2.87 +
    2.88 +PACKAGE="$PACKAGE"
    2.89 +VERSION="$VERSION"
    2.90 +CATEGORY="$CATEGORY"
    2.91 +SHORT_DESC="$SHORT_DESC"
    2.92 +DEPENDS="$DEPENDS"
    2.93 +WEB_SITE="$WEB_SITE"
    2.94 +
    2.95 +post_install()
    2.96 +{
    2.97 +	# add texlive dir to PATH.
    2.98 +	cp /etc/profile /etc/profile.old
    2.99 +	sed "/^PATH=\"/ aPATH=\"/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/:\\\$PATH\"" \
   2.100 +	/etc/profile >> profile
   2.101 +	mv profile /etc/profile
   2.102 +
   2.103 +	echo -e "
   2.104 +
   2.105 +\033[1;33m - A texlive minimal scheme is now installed - \033[0;m
   2.106 +
   2.107 +Verify that \033[1mPATH\033[0m is well formatted in /etc/profile,
   2.108 +and contain \033[1m/usr/local/\$PACKAGE/\$VERSION/bin/i386-linux/\033[0m
   2.109 +
   2.110 +To improve texlive, run \033[1mtlmgr\033[0m as root.
   2.111 +If you prefer graphicals interfaces, install perl-tk,
   2.112 +and run\033[1mtlmgr gui\033[0m.
   2.113 +
   2.114 +The tlmgr man page can be found here:
   2.115 +http://tug.org/texlive/doc/tlmgr.html
   2.116 +"
   2.117 +}
   2.118 +EOT
   2.119 +
   2.120 +
   2.121 +# Pack
   2.122 +tazpkg pack $PACKAGE-$VERSION
   2.123 +# Install pseudo package
   2.124 +tazpkg install $PACKAGE-$VERSION.tazpkg
   2.125 +
   2.126 +# Clean
   2.127 +cd $TOP
   2.128 +rm -rf $TMP
   2.129 +
   2.130 +exit 0