ogajduse / rpms / texlive

Forked from rpms/texlive 5 years ago
Clone
Blob Blame History Raw
# This spec file is based on texjive project created by Michael A. Peters.
# Adopted and modified for Fedora by Jindrich Novy.

%define texlive_ver	2007
%define	ptex_src_ver	3.1.10
%define pdvipsk_ver	p1.7a
%define	mendexk_ver	2.6e
%define dvipdfm_ver	0.13.2d
%define dvipdfmx_ver	0
%define dvipng_ver	1.9
%define xdvi_ver	22.84.12

%define	enable_japanese	1

%define desktop_file_utils_version 0.9
%define default_letter_paper 0
# lcdf typetools can be easily built as a separate tool, so it should be
%define disable_lcdf_typetools 1

# These need to match what is in the texlive-texmf package.
#  since texlive-texmf is a BuildRequires, it installs an rpm macro
#  file that defines them. Change the definitions in the texlive-texmf.spec
#  file and rebuild it if you do not like where things get put.
%{!?_texmf_main: %define _texmf_main %{_datadir}/texmf}
%{!?_texmf_conf: %define _texmf_conf %{_sysconfdir}/texmf}
%{!?_texmf_var:  %define _texmf_var %{_var}/lib/texmf}

Name:		texlive
Version:	%{texlive_ver}
Release:	6%{?dist}
Summary:	Binaries for the TeX formatting system

Group:		Applications/Publishing
License:	GPLv2 and BSD and Public Domain and LGPLv2+ and GPLv2+ and LPPL
URL:		http://tug.org/texlive/

#####
# Source0-99: main sources
#####
#Source0:	http://tug.org/svn/texlive/branches/branch2007/Master/source/source.tar.bz2
# non free source files removed with texlive-generate-tarball.sh
Source0:	source-free.tar.bz2
#Source1:	xpdf-3.02.tar.bz2

Source10:	texlive.cron
# Source30 is http://xdvi.sourceforge.net/xdvi48x48.gif converted to png
Source30:	xdvi48x48.png
# Filter out bad requirements (RH bug #59819).
Source99:	texlive-filter-requires.sh
Source100:	texlive-generate-tarball.sh
%define __perl_requires %{SOURCE99}
# 1000-: Japanese pTeX
Source1000:	ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex/tetex/ptex-src-%{ptex_src_ver}.tar.gz
Source1001:	ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex/dvips/dvipsk-jpatch-%{pdvipsk_ver}.tar.bz2
Source1002:	ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex/mendex/mendexk%{mendexk_ver}.tar.gz
Source1003:	vfontmap

# Don't run brp-python-bytecompile
%define __os_install_post  /usr/lib/rpm/redhat/brp-compress /usr/lib/rpm/redhat/brp-strip %{__strip} /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} %{nil}

######
# Red Hat-specific TeX configuration patches
######

# and sane defaults to build against can be inserted via sed
Patch5: texlive-2007-browser.patch
Patch6: texlive-2007-tkdep.patch
Patch8: texlive-2007-xprint.patch
Patch9: texlive-teckit.patch

Patch21: texlive-more_paths.patch
Patch22: texlive-fedora_paths.patch

######
# TeX patches
######

Patch10: texlive-2007-dvipdfm-security.patch
Patch11: texlive-2007-makej.patch
Patch12: texlive-2007-badscript.patch
Patch15: texlive-2007-xdvi-keepflag.patch
Patch17: texlive-2007-tmpcleanup.patch
Patch19: texlive-2007-kpse-extensions.patch
Patch20: texlive-CVE-2007-4033.patch
Patch23: texlive-CVE-2007-4352-5392-5393.patch
Patch24: texlive-xdvi-maxchar.patch
Patch25: texlive-dvipsoverflow.patch
Patch26: texlive-dviljktemp.patch
Patch27: texlive-poppler.patch

######
# mpeters contributed patches
######
# fixes man pages to utf-8
Patch41: texlive-2007-kuesterei-man.patch
Patch42: texlive-2007-copyright-utf8-man.patch
# use proper shellbang
Patch43: texlive-2007-epstopdf-shellbang.patch

######
# Debian patches
###### 
Patch100:       texlive-Build_script.patch
Patch101:       texlive-mktexlsr_fixes.patch
Patch102:       texlive-fix_pkfix_invocation.patch
Patch104:       texlive-12a_fix_thumbpdf_invocation.patch
Patch105:       texlive-12b_fix_a2ping_invocation.patch
Patch106:       texlive-12c_fix_pdfcrop_invocation.patch
Patch107:       texlive-12d_fix_ebong_invocation.patch
Patch108:       texlive-12e_fix_vpe_invocation.patch
Patch109:       texlive-texdoc.patch
Patch111:       texlive-xdvi.patch
Patch114:       texlive-dvips_fontbug_fix_upstream.patch
Patch115:       texlive-maketexmf.patch
Patch117:       texlive-fmtutil_keep_failedlog.patch
Patch119:       texlive-checklib_fixes.patch
Patch120:       texlive-dvipdfm_timezone.patch
Patch123:       texlive-fix_makempx_installation.patch

######
# Mandriva patches
######
Patch202:       texlive-pdftex.patch

######
# Suse patches
###### 
Patch300:       texlive-source-icu.patch
Patch301:       texlive-source-t1lib.patch
Patch302:       texlive-source-warns.patch
Patch303:       texlive-source-x11r7.patch
Patch304:       texlive-source-xdvi-numlock.patch
Patch305:       texlive-source-xdvizilla.patch
Patch306:       texlive-source-CVE-2007-0650.patch

# 1000-: Japanese pTeX
Patch1000:	dvipsk-jpatch-pdvips.patch
# prepare from http://sourceforge.jp/projects/xdvi/
# remove patch for configure because it is regenerated from autoconf2.13.
Patch1002:	xdvik-22.84.10-j1.34.patch
Patch1003:	texlive-2007-pxdvi.patch
Patch1004:	texlive-2007-jp-platex209.patch
Patch1005:	texlive-2007-pdvips.patch
Patch1006:	texlive-2007-ptex-3.1.10.patch
Patch1007:      texlive-2007-fmtutil-ptex.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	flex bison ed xdg-utils
BuildRequires:	desktop-file-utils >= %{desktop_file_utils_version}
BuildRequires:	ncurses-devel zlib-devel libpng-devel gd-devel t1lib-devel
BuildRequires:	libSM-devel libICE-devel
# for non-modular xorg - use xorg-devel instead of above
BuildRequires:	Xaw3d-devel
BuildRequires:	poppler-devel >= 0.6.2-2
BuildRequires:	teckit-devel
# pxdvi buildrequires freetype >= 2.1.10
%if %{enable_japanese}
BuildRequires:  freetype-devel >= 2.1.10
%endif
Requires:	xdg-utils ruby
Requires:	texlive-texmf = %{version}
Requires:	texlive-texmf-errata = %{version}
# for a2ping
Requires:	ghostscript
# for ps4pdf
Requires:	texlive-dvips = %{version}-%{release}
# used to be in tetex, but is a separated project
%if %{enable_japanese}
Requires:	mendexk 
%endif
# needed by xetex
Requires:	dvipdfmx
# make sure fonts package installed before running post - since
# fmtutil-sys is symlink to fmtutil
Requires(post):	%{_bindir}/fmtutil
Obsoletes:	tetex < 3.0-99
Provides:	tetex = 3.0-99
Provides:	tex
Obsoletes:	texlive-fonts < 2007-6
Provides:	texlive-fonts = 2007-6

%description
TeXLive is an implementation of TeX for Linux or UNIX systems. TeX takes
a text file and a set of formatting commands as input and creates a
printable file as output. Usually, TeX is used in conjunction with
a higher level formatting package like LaTeX or PlainTeX, since TeX by
itself is not very user-friendly.

Install texlive if you want to use the TeX text formatting system. Consider
to install texlive-latex (a higher level formatting package which provides
an easier-to-use interface for TeX).

The TeX documentation is located in the texlive-doc package.

%package afm
Summary: A converter for PostScript(TM) font metric files, for use with TeX
Group: Applications/Publishing
Obsoletes: tetex-afm < 3.0-99
Provides:  tetex-afm = 3.0-99
Requires: texlive-texmf-afm = %{version}
Requires: texlive-texmf-errata = %{version}

%description afm
texlive-afm provides afm2tfm, a converter for PostScript(TM) font metric
files. PostScript fonts are accompanied by .afm font metric files
which describe the characteristics of each font. To use PostScript
fonts with TeX, TeX needs .tfm files that contain similar information.
Afm2tfm will convert .afm files to .tfm files.

If you are installing texlive in order to use the TeX text formatting
system and PostScript files, you will need to install texlive-afm. You will
also need to install texlive-dvips (for converting .dvi files to PostScript
format for printing on PostScript printers), texlive-latex (a higher level
formatting package which provides an easier-to-use interface for TeX), and
texlive-xdvi (for previewing .dvi files in X).

The TeX documentation is located in the texlive-doc package.

%package dvips
Summary: A DVI to PostScript converter for the TeX text formatting system
Group: Applications/Publishing
Requires: texlive = %{version}-%{release}
Requires: psutils
Obsoletes: tetex-dvips < 3.0-99
Provides:  tetex-dvips = 3.0-99
Requires: texlive-texmf-dvips = %{version}
Requires: texlive-texmf-errata = %{version}


%description dvips
Dvips converts .dvi files, for example those produced by the TeX text 
formatting system, to PostScript(TM) format.

If you are installing texlive, so that you can use the TeX text
formatting system without direct PDF compilation, consider to install
texlive-dvips. In addition, you will need to install texlive-latex 
(a higher level formatting package which provides an easier-to-use 
interface for TeX), and xdvi (for previewing .dvi files in X).

%package dviutils
Summary: A collection of utilities for working with dvi files
Group: Applications/Publishing
# not positive about this requires, pretty sure though
Requires: texlive = %{version}-%{release}
# used to be in tetex, but has a separate upstream
Requires: dvipng dvipdfm
# some dvi utilities used to be in tetex
Obsoletes: tetex < 3.0-99

%description dviutils
The texlive-dviutils package includes a set of tools for working with dvi
files. You only need this package if you plan to manipulate existing dvi files.

%package latex
Summary: The LaTeX front end for the TeX text formatting system
Group: Applications/Publishing
Requires: texlive = %{version}-%{release}, texlive-dvips = %{version}-%{release}
Requires: netpbm-progs
# make sure main and fonts package installed before running post
Requires(post): %{_bindir}/fmtutil %{_bindir}/fmtutil-sys
BuildRequires: ghostscript netpbm-progs
Obsoletes: tetex-latex < 3.0-99
Provides:  tetex-latex = 3.0-99
Requires: texlive-texmf-latex = %{version}
Requires: texlive-texmf-errata = %{version}

%description latex
LaTeX is a front end for the TeX text formatting system. Easier to
use than TeX. LaTeX is essentially a set of TeX macros which provide
convenient, predefined document formats for users. It also allows to
compile LaTeX files directly to PDF format.

The TeX documentation is located in the texlive-doc package.

%package -n kpathsea
Summary: Shared library needed by kpathsea and info files
Group:   Development/Libraries
Obsoletes: tetex-fonts < 3.0-99
Requires: texlive = %{version}-%{release}

%description -n kpathsea
Shared library needed by kpathsea and info files.

%package -n kpathsea-devel
Summary: Files needed to build software against kpathsea
Group:   Development/Libraries
Requires:  kpathsea = %{version}-%{release}

%description -n kpathsea-devel
This package includes the kpathsea header files and the libkpathsea.so
symbolic link.

You only need to install this package if you will be compiling software that
wants to link against the kpathsea library.

%package -n xdvi
Summary: An X viewer for DVI files
Group: Applications/Publishing
Requires: texlive-dvips = %{version}-%{release}
Requires(post): desktop-file-utils >= %{desktop_file_utils_version}
Version: %{xdvi_ver}
#Url: http://xdvi.sourceforge.net/
#Source0: http://downloads.sourceforge.net/xdvi/xdvik-%{xdvi_ver}.tar.gz
Obsoletes: tetex-xdvi < 3.0-99
Provides:  tetex-xdvi = 3.0-99

%description -n xdvi
Xdvik, the kpathsea version of xdvi, is a previewer for DVI files
produced e.g. by the TeX or troff typesetting systems.

If you are installing texlive and you use PlainTeX or you are using DVI files,
you will also need to install xdvi which allows you to view DVI files.
Consider installing texlive-dvips (for converting .dvi files to PostScript
format for printing on PostScript printers), and texlive-latex (a higher level
formatting package which provides an easier-to-use interface for TeX).

%package -n dvipng
Summary: DVI-to-PNG converter
Version: %{dvipng_ver}
Group: Applications/Publishing
#Url: http://savannah.nongnu.org/projects/dvipng/
#Source0: http://download.savannah.gnu.org/releases/dvipng/dvipng-%{dvipng_ver}.tar.gz

%description -n dvipng
This program makes PNG and/or GIF graphics from DVI files as obtained 
from TeX and its relatives.

%package -n mendexk
Summary: Replacement for makeindex with many enhancements
Group: Applications/Publishing
Version: %{mendexk_ver}
#Url: ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex/mendex/
#Source0: ftp://ftp.ascii.co.jp/pub/TeX/ascii-ptex/mendex/mendexk%{version}.tar.bz2

%description -n mendexk
Replacement for makeindex with many enhancements.

%package -n dvipdfm
Summary: DVI to PDF translator
Version: %{dvipdfm_ver}
Group: Applications/Publishing
#Url: http://gaspra.kettering.edu/dvipdfm/
#Source0: http://gaspra.kettering.edu/dvipdfm/dvipdfm-%{dvipdfm_ver}.tar.gz
# for dvipdft
Requires: ghostscript
# for .enc files
Requires: texlive-texmf-dvips = %{texlive_ver}

%description -n dvipdfm
DVI to PDF translator.

%package -n dvipdfmx
Summary: Extended version of the dvipdfm DVI to PDF translator
Version: %{dvipdfmx_ver}
Group: Applications/Publishing
#Url: http://project.ktug.or.kr/dvipdfmx/
#Source0: http://project.ktug.or.kr/dvipdfmx/snapshot/release/dvipdfmx-%{dvipdfmx_ver}.tar.gz
# for cmap files
Requires: texlive-texmf-fonts = %{texlive_ver}
Provides: texlive-dvipdfmx

%description -n dvipdfmx
The dvipdfmx (formerly dvipdfm-cjk) project provides an eXtended version
of the dvipdfm, a DVI to PDF translator developed by Mark A. Wicks.

The primary goal of this project is to support multi-byte character
encodings and large character sets for East Asian languages. The secondary
goal is to support as many features as pdfTeX developed by Han The Thanh.

This project is a combined work of the dvipdfm-jpn project by Shunsaku
Hirata and its modified one, dvipdfm-kor, by Jin-Hwan Cho.

# without this define, the version is overriden by separated subpackages
# versions
%define version %{texlive_ver}

%prep
%setup -q -T -c -a0

# replace old xpdf with 3.02 from upstream to fix CVE-2007-3387
#pushd libs
#rm -rf xpdf
#tar fxj %{SOURCE1}
#popd

# fix for debuginfo rpmlint happiness
chmod -x texk/dvipdfm/macglyphs.h
chmod -x texk/dvipdfm/ttf.c
chmod -x texk/dvipdfm/encodings.c

######
# Red Hat-specific TeX configuration patches
######
# Use htmlview first
%patch5 -p1 -b .browser
%patch6 -p1 -b .tkdep
%patch8 -p1 -b .xprint
%patch9 -p1 -b .teckit
%patch22 -p1 -b .fedora_paths

######
# TeX patches
######

# Don't use tmpnam() in dvipdfm.
%patch10 -p1 -b .dvipdfm-security
# Fix parallel builds.
%patch11 -p1 -b .makej
# Don't use PID for temporary file names in scripts (RH bug #41269)
%patch12 -p1 -b .badscript
# Fix xdvi - navigation with a spacebar does not keep position (RH bug #168124)
%patch15 -p1 -b .xdvi-keepflag
# Always cleanup temporary directories for texconfig, updmap, fmtutil
#  (RH #172534)
%patch17 -p1 -b .tmpcleanup
%patch19 -p0 -b .kpse-extensions
%patch20 -p1 -b .CVE-2007-4033
%patch21 -p1 -b .more_paths
#%patch23 -p1 -b .CVE-2007-4352-5392-5393
%patch24 -p1 -b .maxchar
%patch25 -p1 -b .dvipsoverflow
%patch26 -p1 -b .dviljktemp
%patch27 -p1 -b .poppler

# fix non utf man pages
%patch41 -p1 -b .notutf8
%patch42 -p1 -b .notutf8-2
# user a proper shellbang
%patch43 -p1 -b .perl

%patch100 -p3
%patch101 -p3
%patch102 -p3
%patch104 -p3
%patch105 -p3
%patch106 -p3
%patch107 -p3
%patch108 -p3
%patch109 -p1
%patch111 -p3
%patch114 -p3
%patch115 -p3
%patch117 -p3
%patch119 -p3
%patch120 -p3
%patch123 -p3

%patch202 -p1 -b .pdftex

%patch300 -p0
%patch301 -p0
%patch302 -p0
%patch303 -p0
%patch304 -p0
%patch305 -p0
%patch306 -p0

%patch1007 -p1 -b .ptex


#pushd texk/kpathsea
#%{__sed} -i 's?^TEXMF =.*?TEXMF = {\$TEXMFCONFIG,\$TEXMFVAR,\$TEXMFHOME,\$TEXMFSYSCONFIG,\!\!\$TEXMFSYSVAR,\!\!\$TEXMFLOCAL,\!\!\$TEXMFMAIN,\!\!\$TEXMFDIST}?' texmf.in
#%{__sed} -i 's?^TEXMFMAIN =.*?TEXMFMAIN = %{_texmf_main}?' texmf.in
#%{__sed} -i 's?^TEXMFDIST =.*?TEXMFDIST = %{_texmf_main}?' texmf.in
#%{__sed} -i 's?^TEXMFLOCAL =.*?TEXMFLOCAL = /usr/local/texmf?' texmf.in
#%{__sed} -i 's?^TEXMFSYSVAR =.*?TEXMFSYSVAR = %{_texmf_var}?' texmf.in
#%{__sed} -i 's?^TEXMFSYSCONFIG =.*?TEXMFSYSCONFIG = %{_texmf_conf}?' texmf.in
#popd

%if %{disable_lcdf_typetools}
pushd utils
rm -rf lcdf-typetools
popd
%endif

# allow Xaw3d enabled build of xdvi
%{__sed} -i 's|/Xaw/|/Xaw3d/|' texk/xdvik/gui/*.[ch] texk/xdvik/*.[ch]

## Japanese pTeX
%if %{enable_japanese}
# create customized cid-x.map for dvipdfmx (#418091)
cat <<EOF >> texk/dvipdfmx/data/config/cid-x.map
%%
%% ASCII pTeX Examples
%%

%% Ryumin and GothicBBB found in PostScript printers:
rml  H !Ryumin-Light
gbm  H !GothicBBB-Medium
rmlv V !Ryumin-Light
gbmv V !GothicBBB-Medium
EOF

# set platex to Japanese pLaTeX. original one is moved to platex-pl
sed -e s/^platex/platex-pl/g \
    -e s/^pdfplatex/pdfplatex-pl/g \
    -e s/platex\.ini/platex\-pl\.ini/g \
     -i texk/web2c/fmtutil.in

# Prepare pTeX
tar xfz %{SOURCE1000} -C texk/web2c/
cd texk/web2c/ptex-src-%{ptex_src_ver}
sed -i -e  's|/{ptex/{platex,generic,},tex/{latex,generic,}}|/{ptex/platex,{p,}tex/latex,{p,}tex/generic,{p,}tex}|g' -e 's/| uniq//g' mkconf
%patch1004 -p1 -b .fmts
%patch1006 -p1
cd -

# Prepare Japanese dvips
mkdir pdvipsk
tar xfj %{SOURCE1001} -C pdvipsk
cp -lR texk/dvipsk texk/pdvipsk
cd pdvipsk
%patch1005 -p0
cd -
patch -d texk/pdvipsk -p1 < pdvipsk/dvipsk-%{pdvipsk_ver}.patch
%patch1000 -p1 -b .pdvips
ln -s dvips.1 texk/pdvipsk/pdvips.1

# set up Japanese xdvi
cp -a texk/xdvik texk/pxdvik

cd texk/pxdvik
%patch1002 -p3
cd -
%patch1003 -p1 -b .pxdvi
mv texk/pxdvik/vfontmap.sample texk/pxdvik/vfontmap.sample.orig
install -p -m 644 %{SOURCE1003} texk/pxdvik/vfontmap.sample

# set up mendexk
tar xfz %{SOURCE1002} -C texk
%endif


%build
set -x
# define CCACHE_DIR to let the build pass with ccache enabled.
export CCACHE_DIR=$HOME/.ccache
unset TEXINPUTS ||:
unset HOME ||:

%{__rm} -r libs/{teckit,obsdcompat}

# Japanese pTeX
%if %{enable_japanese}
for i in texk/xdvik texk/pxdvik texk ; do
  ( cd ${i} ; $RPM_BUILD_DIR/%{name}-%{version}/texk/autoconf2.13 -m $RPM_BUILD_DIR/%{name}-%{version}/texk/etc/autoconf )
done
%endif

%configure \
%if %{default_letter_paper}
        --disable-a4 \
%endif
	--enable-shared=yes \
        --with-system-ncurses \
        --with-system-zlib \
        --with-system-pnglib \
        --with-system-gd \
        --without-system-icu \
	--with-icu-include=%{_includedir}/unicode \
        --with-system-freetype \
	--with-freetype-include=%{_includedir}/freetype \
        --with-system-freetype2 \
	--with-freetype2-include=%{_includedir}/freetype2 \
	--with-system-t1lib \
        --without-texlive \
        --without-t1utils \
        --without-psutils \
        --without-ps2eps \
	--without-pdfopen \
	--without-ttf2pk \
        --disable-multiplatform \
        --without-dialog --without-texinfo --without-texi2html \
        --without-tex4htk \
        --without-detex --without-dvi2tty \
%if %{disable_lcdf_typetools}
        --with-lcdf-typetools=no \
%endif
        --with-mf-x-toolkit=yes \
        --with-xdvi-x-toolkit=xaw3d \
	--without-cxx-runtime-hack

# Remove everything except:
# icu: includes some changes
# md5: the aladdin md5 code (not a library)
%{__rm} -r libs/{curl,expat,freetype,freetype2,gd,howto,jpeg,libgnuw32,libgsw32,libpng,libttf,ncurses,regex,unzip,zlib,type1,t1lib,xpdf}/

# Japanese pTeX
# configure pxdvi with more options
%if %{enable_japanese}
cd texk/pxdvik
sh `grep "# ./con" config.status |sed -e s/^#\ //` --program-prefix=p --with-default-dvips-path=pdvips
cd -
%endif

# %%{?_smp_mflags} does not work in texlive-2007/libs/icu-xetex/common
make

%if %{enable_japanese}
cd texk/web2c/ptex-src-%{ptex_src_ver}
./configure EUC
make
cd -

# mendexk build
cd texk/mendexk%{mendexk_ver}
./configure EUC
make
cd -
%endif


%install
rm -rf %{buildroot}
export CCACHE_DIR=$HOME/.ccache
unset TEXINPUTS || :
unset HOME || :

mkdir -p %{buildroot}%{_texmf_main}
mkdir -p %{buildroot}%{_texmf_var}/web2c
mkdir -p %{buildroot}%{_texmf_conf}

export LD_LIBRARY_PATH=`pwd`/texk/kpathsea/.libs

%makeinstall \
        texmf=%{buildroot}%{_texmf_main} \
        texmfmain=%{buildroot}%{_texmf_main}

# desktop entry things
cat > xdvi.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=DVI Viewer
Type=Application
Comment=DVI viewer for TeX DVI files
Icon=xdvi
MiniIcon=mini-doc1.xpm
Exec=%{_bindir}/xdvi
MimeType=application/x-dvi
NoDisplay=true
EOF

# remove all .la files
rm -f %{buildroot}%{_infodir}/dir
find %{buildroot} | grep -e "\\.la$" | xargs rm -f

# set executable bit for the library for debuginfo creation
chmod a+x %{buildroot}%{_libdir}/libkpathsea.so.*.*

## remove what is packages in other Fedora packages
# jadetex
rm -f %{buildroot}%{_bindir}/jadetex
rm -f %{buildroot}%{_bindir}/pdfjadetex
# xmltex
rm -f %{buildroot}%{_bindir}/xmltex
rm -f %{buildroot}%{_bindir}/pdfxmltex
# octave-forge
### looks to me like a name clash ?? Octave mex looks like it has nada to
### to with TeX
rm -f %{buildroot}%{_bindir}/mex
### not in octave-forge, nuking anyway
rm -f %{buildroot}%{_bindir}/pdfmex
rm -f %{buildroot}%{_bindir}/utf8mex

# these are owned by texmf-fonts package
rm -f %{buildroot}%{_texmf_main}/ls-R

# keep fmtutil.cnf used for the initial configuration in doc
rm -rf __fedora_kpathsea
mkdir -p __fedora_kpathsea/
mv %{buildroot}%{_texmf_main}/web2c/fmtutil.cnf __fedora_kpathsea/fmtutil.cnf-init

# this file is different from the one in texmf-fonts, since it is 
# the one from kpathsea which isn't specific of texlive. It is only 
# used during build and to set the kpathsea default paths, however.
# Kept as documentation together with paths.h since they describe
# what the kpathsea default paths are
mkdir -p __fedora_kpathsea/kpathsea_defaults
mv %{buildroot}%{_texmf_main}/web2c/texmf.cnf __fedora_kpathsea/kpathsea_defaults/texmf-kpathsea-defaults.cnf
cp texk/kpathsea/paths.h __fedora_kpathsea/kpathsea_defaults

# these are owned by texmf-doc package
rm -rf %{buildroot}%{_texmf_main}/doc/tetex

# install cron file
install -p -D -m755 %{SOURCE10} %{buildroot}%{_sysconfdir}/cron.daily/texlive.cron

# install the xdvi desktop file
mkdir -p %{buildroot}%{_datadir}/{applications,pixmaps}
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/

install -p  -m644 %{SOURCE30} %{buildroot}%{_datadir}/pixmaps/
install -p  -m644 %{SOURCE30} %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/xdvi.png
desktop-file-install --vendor tetex --delete-original  \
  --dir %{buildroot}%{_datadir}/applications           \
  --add-category Graphics                              \
  xdvi.desktop

# remove pool files, they belong to texlive-texmf
rm -rf %{buildroot}%{_texmf_main}/web2c/*.pool
# ptex pool file is added later, and therefore kept

# Japanese pTeX
%if %{enable_japanese}
# remove %{buildroot}%{_bindir}/platex
rm -f %{buildroot}%{_bindir}/platex
# Convert documents to UTF-8
mkdir -p %{buildroot}%{_texmf_main}/doc/ptex/ptex-src-%{name} \
         %{buildroot}%{_texmf_main}/doc/pdvipsk \
         %{buildroot}%{_texmf_main}/doc/pxdvik/READMEs
cd texk/web2c/ptex-src-%{ptex_src_ver}
iconv -f ISO-2022-JP -t UTF-8 \
      COPYRIGHT.jis \
      -o %{buildroot}%{_texmf_main}/doc/ptex/ptex-src-%{name}/COPYRIGHT-ja
for i in README.txt Changes.txt ; do
  iconv -f EUC-JP -t UTF-8 ${i} \
        -o %{buildroot}%{_texmf_main}/doc/ptex/ptex-src-%{name}/${i}
done
cd -
cd pdvipsk
for i in ChangeLog.jpatch README.jpatch ; do
  iconv -f EUC-JP -t UTF-8 ${i} -o %{buildroot}%{_texmf_main}/doc/pdvipsk/${i}
done
cd -
cd texk/pxdvik
for i in CHANGES.xdvik-jp README.xdvik-jp READMEs/* ; do
  iconv -f EUC-JP -t UTF-8 ${i} \
        -o  %{buildroot}%{_texmf_main}/doc/pxdvik/${i}
done
cd -

cd texk/web2c/ptex-src-%{ptex_src_ver}
%makeinstall INSTALL="install -p" prefix=%{buildroot}%{_prefix} \
        texmf=%{buildroot}%{_texmf_main} \
        texmfmain=%{buildroot}%{_texmf_main}
# texmf.cnf is prepared by texlive-texmf package.
rm %{buildroot}%{_texmf_main}/web2c/texmf.cnf
cd -

install -p -m 644 texk/pxdvik/vfontmap.sample.orig %{buildroot}%{_datadir}/texmf/doc/pxdvik/vfontmap.sample

# mendexk install
cd texk/mendexk%{mendexk_ver}
install -p -m 755 mendex %{buildroot}%{_bindir}

mkdir -p %{buildroot}%{_mandir}/ja/man1
iconv -f EUC-JP -t UTF-8 mendex.1 -o %{buildroot}%{_mandir}/ja/man1/mendex.1
mkdir -p %{buildroot}%{_datadir}/texmf/doc/mendexk-%{name}
install -p -m 644 COPYRIGHT ChangeLog %{buildroot}%{_datadir}/texmf/doc/mendexk-%{name}
iconv -f EUC-JP -t UTF-8 README -o %{buildroot}%{_datadir}/texmf/doc/mendexk-%{name}/README
iconv -f ISO-2022-JP -t UTF-8 COPYRIGHT.jis -o %{buildroot}%{_datadir}/texmf/doc/mendexk-%{name}/COPYRIGHT.jis
cd -
%endif

# remove useless files in texconfig
rm -rf %{buildroot}%{_texmf_main}/texconfig/{g,v,x,README,generic}

# move the configuration files that should be under user control
mkdir -p %{buildroot}%{_texmf_conf}/{web2c/,dvipdfm/}
mv %{buildroot}%{_texmf_main}/web2c/mktexdir.opt %{buildroot}%{_texmf_conf}/web2c/
mv %{buildroot}%{_texmf_main}/dvipdfm/cid-x.map %{buildroot}%{_texmf_conf}/dvipdfm/

# separated projects
rm %{buildroot}%{_bindir}/devnag
rm %{buildroot}%{_bindir}/afm2pl %{buildroot}%{_mandir}/man1/afm2pl.1*

%clean
rm -rf %{buildroot}

%post
%{_bindir}/texconfig-sys rehash 2> /dev/null || :
[ -x /sbin/install-info ] && /sbin/install-info %{_infodir}/web2c.info.gz %{_infodir}/dir || :
%{_bindir}/fmtutil-sys --all > /dev/null 2>&1 || :
%{_bindir}/updmap-sys --syncwithtrees > /dev/null 2>&1 || :

%post afm
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%post dvips
[ -x /sbin/install-info ] && /sbin/install-info %{_infodir}/dvips.info.gz %{_infodir}/dir || :
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%post dviutils
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%post latex
[ -x /sbin/install-info ] && /sbin/install-info %{_infodir}/latex.info.gz %{_infodir}/dir || :
%{_bindir}/texconfig-sys init >/dev/null 2>&1 || :
%{_bindir}/texconfig-sys rehash 2> /dev/null || :
%{_bindir}/fmtutil-sys --all > /dev/null 2>&1 || :

%post -n xdvi
%{_bindir}/texconfig-sys rehash 2> /dev/null || :
%{_bindir}/update-desktop-database %{_datadir}/applications || :
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%post -n kpathsea
/sbin/ldconfig
[ -x /sbin/install-info ] && /sbin/install-info %{_infodir}/kpathsea.info.gz %{_infodir}/dir || :

%post -n dvipng
[ -x /sbin/install-info ] && /sbin/install-info %{_infodir}/dvipng.info.gz %{_infodir}/dir || :


%preun
if [ "$1" = 0 ]; then
  [ -x /sbin/install-info ] && /sbin/install-info --delete %{_infodir}/web2c.info.gz %{_infodir}/dir || :
fi

%preun dvips
if [ "$1" = 0 ]; then
  [ -x /sbin/install-info ] && /sbin/install-info --delete %{_infodir}/dvips.info.gz %{_infodir}/dir || :
fi

%preun -n dvipng
if [ "$1" = 0 ]; then
  [ -x /sbin/install-info ] && /sbin/install-info --delete %{_infodir}/dvipng.info.gz %{_infodir}/dir || :
fi

%preun latex
if [ "$1" = 0 ]; then
  [ -x /sbin/install-info ] && /sbin/install-info --delete %{_infodir}/latex.info.gz %{_infodir}/dir || :
fi

%preun -n kpathsea
/sbin/ldconfig
if [ "$1" = 0 ]; then
  [ -x /sbin/install-info ] && /sbin/install-info --delete %{_infodir}/kpathsea.info.gz %{_infodir}/dir || :
fi

%postun
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%postun afm
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%postun dvips
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%postun latex
%{_bindir}/texconfig-sys rehash 2> /dev/null || :

%postun -n xdvi
%{_bindir}/texconfig-sys rehash 2> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
  %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi

%postun -n kpathsea
/sbin/ldconfig


%files
%defattr(-,root,root,-)
# config files
%dir %{_texmf_conf}
%dir %{_texmf_conf}/web2c
%config(noreplace) %{_texmf_conf}/web2c/mktexdir.opt
%{_bindir}/a2ping
%{_bindir}/aleph
%{_bindir}/amstex
%{_bindir}/bibtex
%{_bindir}/ctangle
%{_bindir}/ctie
%{_bindir}/cweave
# used by makempx
%{_bindir}/dvitomp
%{_bindir}/dmp
%{_bindir}/e2pall
%{_bindir}/epstopdf
%{_bindir}/etex
%{_bindir}/fmtutil
%{_bindir}/fmtutil-sys
%{_bindir}/fontinst
%{_bindir}/kpsewhere
%{_bindir}/lambda
%{_bindir}/lamed
%{_bindir}/makeindex
%{_bindir}/makempx
%{_bindir}/makempy
%{_bindir}/mkindex
%{_bindir}/mkocp
%{_bindir}/mktexfmt
%{_bindir}/mpost
%{_bindir}/mpto
%{_bindir}/mptopdf
%{_bindir}/newer
%{_bindir}/omega
%{_bindir}/otangle
%{_bindir}/patgen
%{_bindir}/pdfcrop
%{_bindir}/pdfetex
%{_bindir}/pdftex
%{_bindir}/pooltype
%{_bindir}/ps2frag
%{_bindir}/ps4pdf
%{_bindir}/rubibtex
%{_bindir}/rumakeindex
%{_bindir}/tangle
%{_bindir}/tex
%{_bindir}/texconfig
%{_bindir}/texconfig-dialog
%{_bindir}/texconfig-sys
%{_bindir}/texdoc
%{_bindir}/texdoctk
%{_bindir}/texexec
%{_bindir}/texfont
%{_bindir}/texlinks
%{_bindir}/texutil
%{_bindir}/thumbpdf
%{_bindir}/tie
%{_bindir}/updmap
%{_bindir}/updmap-sys
%{_bindir}/weave
# new files not in Fedora tetex
%{_bindir}/bibtex8
%{_bindir}/csplain
# separated project
#%{_bindir}/detex
%{_bindir}/mltex
%{_bindir}/pdfcsplain
# not positive these belong here
%{_bindir}/bg5conv
%{_bindir}/cef5conv
%{_bindir}/cefconv
%{_bindir}/cefsconv
# separated project
# %{_bindir}/devnag
%{_bindir}/eplain
%{_bindir}/extconv
%{_bindir}/musixflx
%{_bindir}/physe
%{_bindir}/phyzzx
%{_bindir}/sjisconv
%{_bindir}/texsis
# other utilities
%{_bindir}/ctxtools
%{_bindir}/exatools
%{_bindir}/luatools
%{_bindir}/mpstools
%{_bindir}/mtxtools
%{_bindir}/pdftools
%{_bindir}/pdftosrc
%{_bindir}/pstopdf
%{_bindir}/rlxtools
%{_bindir}/runtools
%{_bindir}/texmfstart
%{_bindir}/textools
%{_bindir}/tmftools
%{_bindir}/xdvipdfmx
%{_bindir}/xetex
%{_bindir}/xmltools
# Japanese pTeX
%if %{enable_japanese}
%{_bindir}/jbibtex
%{_bindir}/ptex
%endif
# man pages
%{_mandir}/man1/amstex.1*
%{_mandir}/man1/bibtex.1*
%{_mandir}/man1/ctangle.1*
%{_mandir}/man1/ctie.1*
%{_mandir}/man1/cweave.1*
%{_mandir}/man1/cweb.1*
%{_mandir}/man1/dvitomp.1*
%{_mandir}/man1/dmp.1*
%{_mandir}/man1/e2pall.1*
%{_mandir}/man1/eplain.1*
%{_mandir}/man1/epstopdf.1*
%{_mandir}/man1/etex.1*
%{_mandir}/man1/fdf2tex.1*
%{_mandir}/man1/fmtutil.1*
%{_mandir}/man1/fmtutil-sys.1*
%{_mandir}/man1/fontinst.1*
%{_mandir}/man1/kpsewhere.1*
%{_mandir}/man1/lambda.1*
%{_mandir}/man1/makeindex.1*
%{_mandir}/man1/makempx.1*
%{_mandir}/man1/makempy.1*
%{_mandir}/man1/mf.1*
%{_mandir}/man1/mf-nowin.1*
%{_mandir}/man1/mkindex.1*
%{_mandir}/man1/mkocp.1*
%{_mandir}/man1/mktexfmt.1*
%{_mandir}/man1/mpost.1*
%{_mandir}/man1/mpto.1*
%{_mandir}/man1/newer.1*
%{_mandir}/man1/omega.1*
%{_mandir}/man1/patgen.1*
%{_mandir}/man1/pdfetex.1*
%{_mandir}/man1/pdftex.1*
%{_mandir}/man1/pooltype.1*
%{_mandir}/man1/ps2frag.1*
%{_mandir}/man1/rubibtex.1*
%{_mandir}/man1/rumakeindex.1*
%{_mandir}/man1/tangle.1*
%{_mandir}/man1/tex.1*
%{_mandir}/man1/texconfig.1*
%{_mandir}/man1/texconfig-sys.1*
%{_mandir}/man1/texdoc.1*
%{_mandir}/man1/texdoctk.1*
%{_mandir}/man1/texexec.1*
%{_mandir}/man1/texfind.1*
%{_mandir}/man1/texfont.1*
%{_mandir}/man1/texlinks.1*
%{_mandir}/man1/texutil.1*
%{_mandir}/man1/thumbpdf.1*
%{_mandir}/man1/tie.1*
%{_mandir}/man1/updmap.1*
%{_mandir}/man1/updmap-sys.1*
%{_mandir}/man1/weave.1*
# new files not in Fedora tetex
# separated project
#%{_mandir}/man1/detex.1*
%{_mandir}/man5/updmap.cfg.*
# man pages for other utilities
%{_mandir}/man1/ctxtools.1*
%{_mandir}/man1/mptopdf.1*
%{_mandir}/man1/pdftools.1*
%{_mandir}/man1/pdftosrc.1*
%{_mandir}/man1/pstopdf.1*
%{_mandir}/man1/texmfstart.1*
%{_mandir}/man1/textools.1*
# Japanese pTeX
%dir %{_texmf_main}/web2c
%{_texmf_main}/texconfig/tcfmgr*
%{_texmf_main}/bibtex/
# Japanese pTeX
%if %{enable_japanese}
%{_texmf_main}/web2c/ptex.pool
%endif
%dir %{_texmf_main}/doc
%doc %{_texmf_main}/doc/bibtex8/
# Japanese pTeX
%if %{enable_japanese}
%doc %{_texmf_main}/doc/ptex/
%endif
%dir %{_texmf_var}/web2c/
%doc __fedora_kpathsea/fmtutil.cnf-init
%{_bindir}/allcm
%{_bindir}/allec
%{_bindir}/allneeded
%{_bindir}/gftodvi
%{_bindir}/gftopk
%{_bindir}/gftype
%{_bindir}/gsftopk
%{_bindir}/kpseaccess
%{_bindir}/kpsepath
%{_bindir}/kpsereadlink
%{_bindir}/kpsestat
%{_bindir}/kpsewhich
%{_bindir}/kpsexpand
%{_bindir}/kpsetool
%{_bindir}/mag
%{_bindir}/mf
%{_bindir}/mf-nowin
%{_bindir}/mft
%{_bindir}/mkofm
%{_bindir}/mktexlsr
%{_bindir}/mktexmf
%{_bindir}/mktexpk
%{_bindir}/mktextfm
%{_bindir}/ofm2opl
%{_bindir}/omfonts
%{_bindir}/opl2ofm
%{_bindir}/otp2ocp
%{_bindir}/outocp
%{_bindir}/ovf2ovp
%{_bindir}/ovp2ovf
%{_bindir}/pfb2pfa
%{_bindir}/pk2bm
%{_bindir}/pktogf
%{_bindir}/pktype
%{_bindir}/pltotf
%{_bindir}/ps2pk
%{_bindir}/texhash
%{_bindir}/tftopl
%{_bindir}/vftovp
%{_bindir}/vptovf
# new files (not in fedora tetex)
%{_bindir}/hbf2gf
# man pages
%{_mandir}/man1/allcm.1*
%{_mandir}/man1/allec.1*
%{_mandir}/man1/allneeded.1*
%{_mandir}/man1/gftodvi.1*
%{_mandir}/man1/gftopk.1*
%{_mandir}/man1/gftype.1*
%{_mandir}/man1/gsftopk.1*
%{_mandir}/man1/kpseaccess.1*
%{_mandir}/man1/kpsepath.1*
%{_mandir}/man1/kpsereadlink.1*
%{_mandir}/man1/kpsestat.1*
%{_mandir}/man1/kpsetool.1*
%{_mandir}/man1/kpsewhich.1*
%{_mandir}/man1/kpsexpand.1*
%{_mandir}/man1/mag.1*
%{_mandir}/man1/mft.1*
%{_mandir}/man1/mkofm.1*
%{_mandir}/man1/mktexlsr.1*
%{_mandir}/man1/mktexmf.1*
%{_mandir}/man1/mktexpk.1*
%{_mandir}/man1/mktextfm.1*
%{_mandir}/man1/ofm2opl.1*
%{_mandir}/man1/opl2ofm.1*
%{_mandir}/man1/otp2ocp.1*
%{_mandir}/man1/outocp.1*
%{_mandir}/man1/ovf2ovp.1*
%{_mandir}/man1/ovp2ovf.1*
%{_mandir}/man1/pfb2pfa.1*
%{_mandir}/man1/pk2bm.1*
%{_mandir}/man1/pktogf.1*
%{_mandir}/man1/pktype.1*
%{_mandir}/man1/pltotf.1*
%{_mandir}/man1/ps2pk.1*
%{_mandir}/man1/texhash.1*
%{_mandir}/man1/tftopl.1*
%{_mandir}/man1/vftovp.1*
%{_mandir}/man1/vptovf.1*
%{_mandir}/man5/fmtutil.cnf.5*
# man pages for new files (not in Fedora tetex)
%{_mandir}/man1/hbf2gf.1*
# other stuff
%{_sysconfdir}/cron.daily/texlive.cron
%{_infodir}/web2c.info.*
%{_texmf_main}/web2c/*.opt
%{_texmf_main}/web2c/mktexdir
%{_texmf_main}/web2c/mktexnam
%{_texmf_main}/web2c/mktexupd

%files afm
%defattr(-,root,root,-)
%{_bindir}/afm2tfm
%{_bindir}/ttf2afm
%{_mandir}/man1/afm2tfm.1*
%{_mandir}/man1/ttf2afm.1*
# not in fedora tetex, but a separate project
#%{_bindir}/afm2pl
#%{_mandir}/man1/afm2pl.1*

%files dvips
%defattr(-,root,root,-)
%{_bindir}/dvi2fax
%{_bindir}/dvips
%{_bindir}/dvired
%{_bindir}/odvips
%{_texmf_main}/dvips/
%{_mandir}/man1/dvi2fax.1*
%{_mandir}/man1/dvips.1*
%{_mandir}/man1/dvired.1*
%{_mandir}/man1/odvips.1*
%{_infodir}/dvips.info.*
# Japanese pTeX
%if %{enable_japanese}
%{_bindir}/pdvips
%{_bindir}/opdvips
%{_bindir}/pdvitype
%{_texmf_main}/pdvips/
%{_texmf_main}/fonts/map/pdvips/
%{_mandir}/man1/pdvips.1*
%{_mandir}/man1/opdvips.1*
%doc %{_texmf_main}/doc/pdvipsk/
%endif

%files dviutils
%defattr(-,root,root,-)
# separated project (dvi2tty)
#%{_bindir}/disdvi
%{_bindir}/dt2dv
%{_bindir}/dv2dt
# separated project (dvi2tty)
#%{_bindir}/dvi2tty
%{_bindir}/dvicopy
%{_bindir}/dvihp
%{_bindir}/dvitype
%{_bindir}/dvibook
%{_bindir}/dviconcat
%{_bindir}/dvidvi
%{_bindir}/dvilj
%{_bindir}/dvilj2p
%{_bindir}/dvilj4
%{_bindir}/dvilj4l
%{_bindir}/dvilj6
%{_bindir}/dvipos
%{_bindir}/dviselect
%{_bindir}/dvitodvi
%{_bindir}/odvicopy
%{_bindir}/odvitype
%{_mandir}/man1/dvicopy.1*
%{_mandir}/man1/dvihp.1*
%{_mandir}/man1/dvitype.1*
%{_mandir}/man1/dt2dv.1*
%{_mandir}/man1/dv2dt.1*
# separated project (dvi2tty)
#%{_mandir}/man1/dvi2tty.1*
%{_mandir}/man1/dvibook.1*
%{_mandir}/man1/dviconcat.1*
%{_mandir}/man1/dvidvi.1*
%{_mandir}/man1/dvilj.1*
%{_mandir}/man1/dvilj2p.1*
%{_mandir}/man1/dvilj4.1*
%{_mandir}/man1/dvilj4l.1*
%{_mandir}/man1/dvilj6.1*
%{_mandir}/man1/dvipos.1*
%{_mandir}/man1/dviselect.1*
%{_mandir}/man1/dvitodvi.1*
%{_mandir}/man1/odvicopy.1*
%{_mandir}/man1/odvitype.1*

%files latex
%defattr(-,root,root,-)
%{_bindir}/latex
%{_bindir}/pdflatex
%{_bindir}/xelatex
%if %{enable_japanese}
%{_bindir}/platex-pl
%else
%{_bindir}/platex
%endif
%{_bindir}/pslatex
%{_mandir}/man1/latex.1*
%{_mandir}/man1/pdflatex.1*
%{_mandir}/man1/pslatex.1*
%{_infodir}/latex.info.*
# not in fedora tetex
%{_bindir}/bg5+latex
%{_bindir}/bg5+pdflatex
%{_bindir}/bg5latex
%{_bindir}/bg5pdflatex
%{_bindir}/cef5latex
%{_bindir}/cef5pdflatex
%{_bindir}/ceflatex
%{_bindir}/cefpdflatex
%{_bindir}/cefslatex
%{_bindir}/cefspdflatex
%{_bindir}/cslatex
%{_bindir}/gbklatex
%{_bindir}/gbkpdflatex
%{_bindir}/lacheck
%{_bindir}/mllatex
%{_bindir}/pdfcslatex
%if %{enable_japanese}
%{_bindir}/pdfplatex-pl
%else
%{_bindir}/pdfplatex
%endif
%{_bindir}/sjislatex
%{_bindir}/sjispdflatex
%{_mandir}/man1/lacheck.1*
# Japanese pTeX
%if %{enable_japanese}
%{_bindir}/platex
%{_bindir}/platex209
%endif

%files -n xdvi
%defattr(-,root,root,-)
%{_bindir}/oxdvi
%{_bindir}/xdvi
%{_bindir}/xdvizilla
%{_bindir}/xdvi-xaw3d.bin
%{_texmf_main}/xdvi/
%{_mandir}/man1/oxdvi.1*
%{_mandir}/man1/xdvi.1*
%{_mandir}/man1/xdvizilla.1*
%{_datadir}/pixmaps/xdvi48x48.png
%{_datadir}/icons/hicolor/48x48/apps/xdvi.png
%{_datadir}/applications/tetex-xdvi.desktop
# Japanese pTeX
%if %{enable_japanese}
%{_bindir}/opxdvi
%{_bindir}/pxdvi
%{_bindir}/pxdvizilla
%{_bindir}/pxdvi-xaw3d.bin
%{_texmf_main}/pxdvi/
%doc %{_texmf_main}/doc/pxdvik/
%endif

%files -n kpathsea
%defattr(-,root,root,-)
%{_libdir}/libkpathsea.so.*
%{_infodir}/kpathsea.info.*
%doc __fedora_kpathsea/kpathsea_defaults/

%files -n kpathsea-devel
%defattr(-,root,root,-)
%{_includedir}/kpathsea/
%{_libdir}/libkpathsea.so
# yes - packaging the static too. Some programs apparently can't link
#  against the shared. I can't name any, but so i hear.
%{_libdir}/libkpathsea.a

%files -n dvipng
%defattr(-,root,root,-)
%{_bindir}/dvipng
%{_mandir}/man1/dvipng.1*
%{_infodir}/dvipng.info*

%files -n mendexk
%defattr(-,root,root,-)
%if %{enable_japanese}
%{_bindir}/mendex
%{_mandir}/ja/man1/mendex.1*
%doc %{_texmf_main}/doc/mendexk-%{name}/
%endif

%files -n dvipdfm
%defattr(-,root,root,-)
%{_bindir}/ebb
%{_bindir}/dvipdfm
%{_bindir}/dvipdft
%{_mandir}/man1/ebb.1*
%{_mandir}/man1/dvipdfm.1*
%{_mandir}/man1/dvipdft.1*

%files -n dvipdfmx
%doc texk/dvipdfmx/AUTHORS texk/dvipdfmx/ChangeLog 
%doc texk/dvipdfmx/COPYING texk/dvipdfmx/README
%dir %{_texmf_conf}/dvipdfm/
%config(noreplace) %{_texmf_conf}/dvipdfm/cid-x.map
%{_bindir}/dvipdfmx
%{_texmf_main}/dvipdfm/

%changelog
* Wed Jan 02 2008 Jindrich Novy <jnovy@redhat.com> - 2007-6
- unify texlive and texlive-fonts packages and obsolete
  texlive-fonts (related: #426388)
- move subpackages versions to the top of spec file
- changes from Patruce Dumas:
  * remove BuildRequires on texmf packages
  * don't create .fmt files during the build
  * ship the ptex.pool file

* Mon Dec 17 2007 Jindrich Novy <jnovy@redhat.com> - 2007-5
- add tex virtual provide
- BuildRequire texlive-fonts for kpathsea (thanks to Patrice Dumas)

* Mon Dec 10 2007 Jindrich Novy <jnovy@redhat.com> - 2007-4
- update japanese, chinese, korean paths to fonts in vfontmap (#418081, #392221)
- create customized cid-x.map for dvipdfmx (#418091)

* Tue Dec 04 2007 Jindrich Novy <jnovy@redhat.com> - 2007-3
- try to obsolete tetex correctly

* Tue Dec 04 2007 Jindrich Novy <jnovy@redhat.com> - 2007-2
- avoid conflicts with tetex-doc package

* Sun Dec 02 2007 Jindrich Novy <jnovy@redhat.com> - 2007-1
- buildrequire texlive-texmf-fonts and texlive-texmf-latex for ptex
- drop BR gawk

* Fri Nov 30 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.17
- add .gz suffix to info pages so that they gets successfully
  removed in preun phase

* Thu Nov 29 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.16
- drop Requires: poppler
- require texlive-fonts in kpathsea
- replace htmlview by xdg-open

* Fri Nov 16 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.15
- fix t1lib flaw CVE-2007-4033 (#352271)
- fix CVE-2007-4352 CVE-2007-5392 CVE-2007-5393, various xpdf flaws (#345121)
- xdvi won't segfault if DVI file contains character which
  is not present in font (#243630)
- fix dvips -z buffer overflow with long href (#368591)
- fix insecure usage of temporary file in dviljk (#368611, #368641)
- link against poppler, not internal xpdf
- include arabtex

* Tue Oct 16 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.14
- xdvi won't segfault if DVI file contains character which
  is not present in font (#243630)

* Wed Sep 19 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.13
- update ls-Rs to deal with the japanese support
- update ptex to 3.1.10 and mendex to 2.6e
- fix install-info in scriptlets

* Tue Sep 18 2007 Patrice Dumas <pertusus@free.fr>
- subpackage packages that have a distinct upstream
- remove non free parts from the archive
- install xdvi icon in hicolor directory

* Thu Aug 30 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.12
- update description
- BR ruby, don't obsolete tetex-tex4ht
- remove license problematic/useless stuff, based on email from Karl Berry
- move vfont.sample to doc
- preserve timestamps
- shuffle binaries between texlive and texlive-fonts, update scriptlets

* Mon Aug 27 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.11
- BR gawk, ghostscript
- incorporate path fixes by Patrice Dumas
- change in the kpathsea default paths
- don't BR the *-texmf
- ship kpathsea defaults as documentation
- disable build of ps2eps at configuration time

* Wed Aug 22 2007 MATSUURA Takanori <t.matsuu at gmail.com> - 2007-0.10.1
- add Japanese pTeX
- Polish platex and pdfplatex are moved to platex-pl and
  pdfplatex respectively

* Sat Aug 18 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.10
- update License tag to licenses used in TeXLive sources
- remove ps2eps, it's a separate package
- don't remove updmap.cfg in post phase
- fix provides/obsoletes
- tetex.cron -> texlive.cron
- review fixes thanks to Patrice Dumas:
- remove .gz from installing info in scriptlets
- remove useless comments, lesstif/lesstif-devel requires
- remove X-Red-Hat-Extra category from xdvi.desktop
- update texlive-texdoc.patch
- require xdg-utils, htmlview, don't require bison, flex, ed

* Tue Aug 14 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.9
- update internal xpdf to 3.02 from upstream to fix CVE-2007-3387
- don't link statically with libstdc++
- put xdvi.xaw3d to texlive-xdvi instead of main package

* Tue Aug 07 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.8
- xdvi now compiles with Xaw3d support on i386

* Tue Jul 24 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.7
- obsolete tetex

* Wed Jul 18 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.6
- bump release to sync with texlive-texmf package changes

* Tue Jul 10 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.5
- separate kpathsea from texlive-fonts
- update filelists
- incorporate fixes from David Walluck (Mandriva, Debian, SuSE patches, etc.)
- link against system freetype2/t1lib
- remove kpathsea library building hacks
- disable ttf2pk, don't link against type1
- fix perl requires

* Tue Jun 26 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.4
- reintroduce the texlive-errata scheme
- update filelist
- cleanup patches

* Mon Jun 04 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.3
- use $TEXMFDOCS instead of $TEXMF/doc in texdoc (#232769)

* Fri Jun 01 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.2
- update to TeXLive 2007 final
- remove texlive-errata dependencies
- don't use dates in upstream tarball names
- fix invalid freetype libraries location
- disable broken parallel build
- move filelists back to the spec

* Mon Feb 12 2007 Jindrich Novy <jnovy@redhat.com> - 2007-0.1
- update to TeXLive 2007 rc

* Wed May 31 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.9
- missing BuildRequires added (desktop-file-utils) - doh!

* Tue May 30 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.8
- fixed some directory ownership issues.
- added icon for xdvi so I can install the desktop file

* Mon May 29 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.7
- first attempt at mock build (in fc5)

* Sun May 28 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.6
- ghost the texmf-var/web2c/*.{log,fmt,mem} files and create them
- during post install

* Sun May 28 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.5
- The main package needs to require the fonts package

* Sat May 27 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.4
- Patch 8 and Patch 19

* Sat May 27 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.3
- renamed to texjive

* Wed May 24 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.2
- apply Fedora/Red Hat patches (except fot japanese)
- port patches as needed
-- Some of the scripts not patched have same tmpdir issue as the
-- badscript patch fixes - so a second badscript patch IS still needed
- build shared libkpathsea

* Wed May 24 2006 Michael A. Peters <mpeters@mac.com> - 2005-0.1
- Initial attempt at something that resembles packaging.
-- Red Hat / Fedora specific patches from tetex not carried over yet
-- probably some regression