[tldistro] texlive 2009 package for Slackware

Martin Ivanov tramni at abv.bg
Sun Nov 15 08:57:55 CET 2009


 Dear TeX Live packagers,

I am a Slackware user who extensively uses LaTeX too. I want to package the TeX Live 2009
distribution for Slackware-13.0. 

Robby Workman from the linuxquestions Slackware forum has written a SlackBuild script for TeX Live
2008. I modified his script to adjust it for TeX Live 2009. He figured out that just two files are
needed: 
texlive-20091107-source.tar.xz and
texlive-20091107-texmf.tar.xz

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:

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:

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.

At the end of this letter I am posting the texlive.SlackBuild script I have produced so far. Any
suggestions to improve the script are welcome. If some of you are interested, a I have posted the
full contents of the build directory in
http://www.linuxquestions.org/questions/slackware-14/texlive-build-script-for-slackware-715655/
posting number 12.

Regards,

Martin Ivanov

15.11.2009

texlive.SlackBuild:

#!/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 at 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



-----------------------------------------------------------------
Вижте водещите новини от Vesti.bg!
http://www.vesti.bg


More information about the tldistro mailing list