Hello!
I modified Robby's script to adjust it for TeX Live 2009.
My version of the script creates a working TeX Live 2009 Slackware package. However, it certainly
has some flaws, as I am not a TeX Live expert, I simply use it for my work with LaTeX.
I think the following structure has to be achieved (PLEASE CORRECT ME IF I AM WRONG):
1. All executables, i.e. the files from the "inst/bin" folder under /usr/share/texmf/bin
2. The contents of all folders named "texmf" under a single "texmf" folder: /usr/share/texmf
3. The contents of all folders named "texmf-dist" under a single "texmf-dist" folder:
/usr/share/texmf-dist
Any ideas what tweaks I need to make to achieve the above 3 goals? I already tried manually moving
the files and directories to achieve the desired structure, but it all ended with a faulty texlive
package: there were broken symlinks and/or the kpathsea library did not work. All my efforts to fix
this by setting environmental variables after the installation failed. I suppose something has to
be tuned during the configure stage, but what? Also, to fix the broken symlinks, probably a snippet
of code has to be written?
What post-install command do you recommend to be run? Currently the file, named doinst.sh, which is
executed automatically with the installation of the package, runs the following 3 commands:
Code:
chroot . /usr/share/texmf/bin/mktexlsr
chroot . /usr/share/texmf/bin/fmtutil-sys --all
chroot . /usr/share/texmf/bin/updmap-sys --syncwithtrees
I have to mention that during the trial and effort phase while I was trifling with the directory
structure, these commands failed to execute. It seems that they require the "bin" folder to be under
"/usr/share/texmf" and nowhere else.
I am posting the contents of the build folder at the end of this post because I could not attach the tar.bz2 version of the folder
. The files that you need to download are:
ftp://tug.org/historic/systems/texli...-source.tar.xz
and
ftp://tug.org/historic/systems/texli...7-texmf.tar.xz
The build time on my 2.5 GHz dualcore system is about one hour. The three files that are produced are:
9.0M texlive-20091107-i686-1.txz
534M texlive-docs-20091107-noarch-1.txz
358M texlive-texmf-20091107-i686-1.txz
Of course when uncompressed on the system they take more place
. Please take care to modify the variables at the beginning of the texlive.SlackBuild script to suit to your system
.
Any suggestions to improve the script are welcome. Above all, I wish to make it Slackware-compliant
and eventually to submit it to slackbuilds.org.
For the users of the glossaries package, please install the latest version of the package, because
the one that TeX Live 2009 ships with does not work with xindy.
Regards,
Martin Ivanov
15.11.2009
texlive.SlackBuild:
Code:
#!/bin/sh
# TexLive build script for Slackware
# Copyright 2009 Robby Workman, Northport, AL, USA
# Copyright 2009 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Modified by Martin Ivanov <tramni@abv.bg>
# URL: ftp://tug.org/historic/systems/texlive/2009
# You only need these two files:
# texlive-20091107-source.tar.xz
# texlive-20091107-texmf.tar.xz
set -e
VERSION=20091107
TEXMF_VERSION=20091107
ARCH=${ARCH:-i686}
BUILD=${BUILD:-1}
CWD=$(pwd)
TMP=${TMP:-/home/marto/build/tmp}
PKG=$TMP/package-texlive-main
PKG_TEXDOCS=$TMP/package-texlive-docs
PKG_TEXMF=$TMP/package-texlive-texmf
OUTPUT=${OUTPUT:-/home/marto/build/packages/LaTeX}
TEXLIVEDIR=${TEXLIVEDIR:-/usr/share}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
fi
rm -rf $PKG $PKG_TEXDOCS $PKG_TEXMF
mkdir -p $TMP $PKG $PKG_TEXDOCS $PKG_TEXMF $OUTPUT
cd $TMP
rm -rf texlive-$VERSION-source
tar xvf $CWD/texlive-$VERSION-source.tar.?z || exit 1
cd texlive-$VERSION-source
chown -R root:root .
chmod -R a-s .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
TL_BUILD_ENV='CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS"' \
TL_CONFIGURE_ARGS="\
--program-prefix="" \
--program-suffix="" \
--build=$ARCH-slackware-linux \
--disable-native-texlive-build \
--enable-xindy \
--enable-xindy-docs \
--enable-auto-core \
--enable-etex \
--enable-epsfwin \
--enable-hp2627win \
--enable-mftalkwin \
--enable-nextwin \
--enable-regiswin \
--enable-tektronixwin \
--enable-unitermwin \
--enable-timing \
--enable-mktextex-default \
--enable-dependency-tracking \
--with-tex-banner='TeX Live 2009/Slackware' \
--with-editor=emacs \
--with-system-xpdf \
--with-system-gd \
--with-system-freetype2 \
--with-system-t1lib \
--with-system-libpng \
--with-system-zlib \
--with-x" \
./Build
# with any of the following two options enabled the compilation fails:
# --enable-suntoolswin
# --enable-xindy-rules: the mainatainer of xindy-make-rules claims to have fixed that bug, but in
# texlive 2009 things will certainly remain as they are. Anyway this option is not necessary as the
# texmf tree already contains everything necessary for xindy to work :)
# Install the documentation from the sources while we're still here
mkdir -p $PKG/usr/doc/texlive-$VERSION
cp -aR README* ChangeLog $CWD/{texlive.SlackBuild,slack-desc*,texmf.cnf,profile.d} \
$PKG/usr/doc/texlive-$VERSION
zcat $CWD/doinst.sh.gz > $PKG/usr/doc/texlive-$VERSION/doinst.sh
find $PKG/usr/doc/texlive-$VERSION -type f -exec chmod 644 {} \;
cd $TMP
rm -rf texlive-$TEXMF_VERSION-texmf
tar xvf $CWD/texlive-$TEXMF_VERSION-texmf.tar.?z || exit 1
cd texlive-$TEXMF_VERSION-texmf
chown -R root:root .
chmod -R a-s .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# Move the docs to texlive-docs
# Perhaps consider shipping only english docs??
mkdir -p $PKG_TEXDOCS$TEXLIVEDIR/{texmf,texmf-dist}
mv texmf/doc $PKG_TEXDOCS$TEXLIVEDIR/texmf
mv texmf-dist/doc $PKG_TEXDOCS$TEXLIVEDIR/texmf-dist
cp -R $TMP/texlive-$VERSION-source/inst/texmf/doc/* $PKG_TEXDOCS$TEXLIVEDIR/texmf/doc
rm -rf $TMP/texlive-$VERSION-source/inst/texmf/doc
# Move the non-essential texmf-dist stuff into place
# texmf-dist goes into texlive-texmf
mkdir -p $PKG_TEXMF$TEXLIVEDIR
mv texmf-dist $PKG_TEXMF$TEXLIVEDIR
cp -R $TMP/texlive-$VERSION-source/inst/texmf-dist/* $PKG_TEXMF$TEXLIVEDIR/texmf-dist
# Move the required texmf stuff into place
# texmf goes into texlive-main
mkdir -p $PKG$TEXLIVEDIR
mv texmf $PKG$TEXLIVEDIR
cp -R $TMP/texlive-$VERSION-source/inst/* $PKG$TEXLIVEDIR/texmf
# Remove unnecessary symlink
rm $PKG$TEXLIVEDIR/texmf/bin/man
# create texmf-local
# add texmf.cnf to $TEXLIVEDIR to fix the texmf-local environmental variable
mkdir -p $PKG$TEXLIVEDIR/texmf-local
cp -a $CWD/texmf.cnf $PKG$TEXLIVEDIR
# Bring the man pages into the main package
mv $PKG_TEXDOCS$TEXLIVEDIR/texmf/doc/man $PKG$TEXLIVEDIR/texmf
# Compress the man pages
( cd $PKG$TEXLIVEDIR/texmf/man || exit 1
rm -f Makefile
find . -type f -name "*.pdf" -exec rm -f {} \;
find . -type f -exec gzip -9 {} \;
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
)
mkdir -p $PKG/etc/profile.d
cat $CWD/profile.d/texlive.sh > $PKG/etc/profile.d/texlive.sh
cat $CWD/profile.d/texlive.csh > $PKG/etc/profile.d/texlive.csh
chmod 0755 $PKG/etc/profile.d/*
mkdir -p $PKG/install $PKG_TEXDOCS/install $PKG_TEXMF/install
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
cat $CWD/slack-desc.texlive > $PKG/install/slack-desc
cat $CWD/slack-desc.texdocs > $PKG_TEXDOCS/install/slack-desc
cat $CWD/slack-desc.texmf > $PKG_TEXMF/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/texlive-$VERSION-$ARCH-$BUILD.txz
cd $PKG_TEXMF
/sbin/makepkg -l y -c n $OUTPUT/texlive-texmf-$TEXMF_VERSION-$ARCH-$BUILD.txz
cd $PKG_TEXDOCS
/sbin/makepkg -l y -c n $OUTPUT/texlive-docs-$TEXMF_VERSION-noarch-$BUILD.txz
In the build directory you have to make a folder named "profile.d", containing the following 2 files:
texlive.csh:
Code:
#!/bin/csh
# Add path and MANPATH for texlive:
set path = ( $path /usr/share/texmf/bin )
setenv MANPATH ${MANPATH}:/usr/share/texmf/man
and texlive.sh:
Code:
#!/bin/sh
# Add PATH and MANPATH for texlive:
PATH="$PATH:/usr/share/texmf/bin"
MANPATH="$MANPATH:/usr/share/texmf/man"
In the build directory you need 3 slack-desc files :
slack-desc.texdocs:
Code:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler-------------------------------------------------|
texlive-docs: texlive-docs (Documentation for texlive)
texlive-docs:
texlive-docs: This package contains documentation for texlive.
texlive-docs:
texlive-docs:
texlive-docs:
texlive-docs:
texlive-docs:
texlive-docs:
texlive-docs:
texlive-docs:
slack-desc.texlive:
Code:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
texlive: texlive (texlive binaries and support files)
texlive:
texlive: This package contains the binaries and support files required for
texlive: the texlive TeX distribution, such as input files for TeX, runtime
texlive: configuration files, hyphenation tables, manpages, and the computer
texlive: modern fonts.
texlive:
texlive:
texlive:
texlive:
texlive:
and slack-desc.texmf:
Code:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------|
texlive-texmf: texlive-texmf (TeX formats and packages for texlive)
texlive-texmf:
texlive-texmf: This package contains the formats (plain, LaTeX, ConTeXt, etc.)
texlive-texmf: and all the packages used by them, along with most everything
texlive-texmf: used in day-to-day TeXing except the binaries themselves.
texlive-texmf:
texlive-texmf: The contents of this package should be mostly independent.
texlive-texmf:
texlive-texmf:
texlive-texmf:
texlive-texmf:
In the build directory you also need a texmf.cnf file:
Code:
TEXMFLOCAL=/usr/share/texmf-local
and doinst.sh.gz - a gzipped doinst.sh file:
Code:
# This one shouldn't be needed, but just in case...
chroot . /usr/share/texmf/bin/mktexlsr 1>/dev/null 2>&1
# This one is definitely needed
# What I don't know is what happens if the texlive-texmf package is
# not installed yet - maybe we need to run this from it too?
chroot . /usr/share/texmf/bin/fmtutil-sys --all 1>/dev/null 2>&1
# This one also shouldn't be needed, but again, just in case...
chroot . /usr/share/texmf/bin/updmap-sys --syncwithtrees 1>/dev/null 2>&1