Hello,
You can find here a spec file for latex2html. I use it for both ix86
architectures running GNU/Linux and sparc architectures running
Solaris. You should update it to reflect your configuration (mainly
your TeX configuration) before use.
To construct both a binary and source package, you should put the spec
file in your SPEC dir and the archive file in your SOURCES DIR as in
the following example :
/home/luc/rpm/SPEC/latex2html-98.2b6.spec
/home/luc/rpm/SOURCES/l2h98_2beta6.tar.gz
Then you should run the following command in your SPEC directory :
rpm -ba --clean --buildarch noarch latex2html-98.2b6.spec
This will create two files :
/home/luc/rpm/RPMS/latex2html-98.2b6-1.noarch.rpm
/home/luc/rpm/SRPMS/latex2html-98.2b6-1.src.rpm
To install the package, run the following command :
rpm -Uvh latex2html-98.2b6-1.noarch.rpm
If you have any problem, ask me (I can for example provide you the
spec files I use for TeX, Latex2e, netpbm, ghostscript).
-------------------- latex2html-98.2b6.spec --------------------
Name: latex2html
Summary: conversion tool between LaTeX and HTML
Version: 98.2b6
Release: 1
Copyright: GNU
Group: Applications/Publishing/TeX
Source:
http://cdc-server.cdc.informatik.tu-darmstadt.de/~latex2html/l2h98_2beta6.tar.gz
URL: http://www-dsed.llnl.gov/files/programs/unix/latex2html/manual/
Packager: Luc Maisonobe <[EMAIL PROTECTED]>
Buildroot: /tmp/latex2html-root
Exclusivearch: noarch
# The "Requires" tag is highly dependant on existing system :
# latex2e and dvipsk are often distributed under tetex main package
# copyright restriction prevent RedHat to distribute version 5 of ghostscript
Requires: latex2e, dvipsk, netpbm, ghostscript = 5.10, perl >= 5.004
# Change this if your main TeX/LaTeX tree is not under /usr/local
%define TDSroot /usr/local/share/texmf
%description
latextohtml is a conversion tool that allows documents written in
LaTeX to become part of the World-Wide Web. In addition, it offers an
easy migration path towards authoring complex hyper-media documents
using familiar word-processing concepts, including the power of a
LaTeX-like macro language capable of producing correctly structured
HTML tags.
%prep
%setup -n latex2html
ltohdir=${RPM_BUILD_ROOT}/usr/local/share/latex2html
sed -e "s,^\( *\$LATEX2HTMLDIR\)=.*,\1=\"$ltohdir\";," \
-e "s,^\( *\$DVIPS *\)=.*,\1= \"dvips -E\";," \
-e "s,^\( *\$PK_GENERATION *\)=.*,\1= 1;," \
-e "s,^# *\(\$DVIPS_MODE *=.*\),\1," \
< latex2html.config > latex2html.config.new
mv latex2html.config.new latex2html.config
%build
tail +3 makemap > makemap.new
echo "#!/usr/local/bin/perl" | cat - makemap.new > makemap
# Some Linux distributions put perl in /usr/bin
if [ -f /usr/bin/perl ] ; then
for f in configure-pstoimg install-test latex2html makemap \
pstoimg pstoimg_nopipes texexpand ; do
sed "s,^#! */usr/local/bin/perl,#!/usr/bin/perl," < $f > $f.new
if [ ! -w $f ] ; then
chmod u+w $f
cat $f.new > $f
chmod u-w $f
else
cat $f.new > $f
fi
rm $f.new
done
fi
%install
ltohdir=${RPM_BUILD_ROOT}/usr/local/share/latex2html
texdir=${RPM_BUILD_ROOT}%{TDSroot}/tex/latex/latex2html
bindir=${RPM_BUILD_ROOT}/usr/local/bin
mkdir -p $ltohdir $texdir $bindir
(cd texinputs ; tar cf - .) | (cd $texdir ; tar xvf -)
cp install-test Override.pm latex2html \
latex2html.config makemap pstoimg configure-pstoimg \
texexpand $ltohdir
tar cf - styles versions icons.gif icons.png | (cd $ltohdir ; tar xvf -)
cd $ltohdir
# warning, the empty lines below are important !
# the "g" as the last line means : generates GIF images
./install-test <<EOF
g
EOF
for f in install-test Override.pm local.pm \
latex2html.config latex2html makemap \
pstoimg configure-pstoimg texexpand ; do
sed "s,${RPM_BUILD_ROOT}/usr/local,/usr/local,g" \
< $ltohdir/$f > $ltohdir/$f.new
cat $ltohdir/$f.new > $ltohdir/$f
rm $ltohdir/$f.new
done
mv $ltohdir/latex2html $bindir
%post
sed -e "/latex2e_inputs *=/s,:\.\.,,g" \
-e "/latex2e_inputs *=/s,=\(.*[^ ]\) *,=\1:..," \
< %{TDSroot}/web2c/texmf.cnf \
> %{TDSroot}/web2c/texmf.cnf.new
rm %{TDSroot}/web2c/texmf.cnf
mv %{TDSroot}/web2c/texmf.cnf.new \
%{TDSroot}/web2c/texmf.cnf
TEXMFCNF=%{TDSroot}/web2c ; export TEXMFCNF
TEXMFLS_R=%{TDSroot} ; export TEXMFLS_R
PATH=/usr/local/bin:$PATH ; export PATH
mktexlsr || true
%postun
if [ $1 = 0 ] ; then
sed -e "/latex2e_inputs *=/s,:\.\.,,g" \
< %{TDSroot}/web2c/texmf.cnf \
> %{TDSroot}/web2c/texmf.cnf.new
rm %{TDSroot}/web2c/texmf.cnf
mv %{TDSroot}/web2c/texmf.cnf.new \
%{TDSroot}/web2c/texmf.cnf
TEXMFCNF=%{TDSroot}/web2c ; export TEXMFCNF
TEXMFLS_R=%{TDSroot} ; export TEXMFLS_R
PATH=/usr/local/bin:$PATH ; export PATH
mktexlsr || true
fi
%clean
rm -fr $RPM_BUILD_ROOT
%files
%attr(-,root,root) %doc Changes MANIFEST README README.dvips
%attr(-,root,root) %doc TODO dot.latex2html-init
%attr(-,root,root) %doc readme.hthtml docs example
%attr(-,root,root) %config /usr/local/share/latex2html/latex2html.config
%attr(-,root,root) /usr/local/share/latex2html/install-test
%attr(-,root,root) /usr/local/share/latex2html/Override.pm
%attr(-,root,root) /usr/local/share/latex2html/local.pm
%attr(-,root,root) /usr/local/share/latex2html/makemap
%attr(-,root,root) /usr/local/share/latex2html/pstoimg
%attr(-,root,root) /usr/local/share/latex2html/configure-pstoimg
%attr(-,root,root) /usr/local/share/latex2html/texexpand
%attr(-,root,root) /usr/local/share/latex2html/styles
%attr(-,root,root) /usr/local/share/latex2html/versions
%attr(-,root,root) /usr/local/bin/latex2html
%attr(-,root,root) %{TDSroot}/tex/latex/latex2html
-------------------- latex2html-98.2b6.spec --------------------
--
------------------------------------------------------------------------------
Luc Maisonobe - DTS/MPI/MS/AM | Tel : (33) 05-61-28-26-31
CNES | Fax : (33) 05-61-27-35-40
18 avenue E. Belin |
31401 Toulouse CEDEX 4 - FRANCE | Email: [EMAIL PROTECTED]
------------------------------------------------------------------------------