michael@505: ## michael@505: ## tetex.spec -- OpenPKG RPM Package Specification michael@505: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@505: ## michael@505: ## Permission to use, copy, modify, and distribute this software for michael@505: ## any purpose with or without fee is hereby granted, provided that michael@505: ## the above copyright notice and this permission notice appear in all michael@505: ## copies. michael@505: ## michael@505: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@505: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@505: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@505: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@505: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@505: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@505: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@505: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@505: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@505: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@505: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@505: ## SUCH DAMAGE. michael@505: ## michael@505: michael@505: # package versions michael@505: %define V_base 3.0 michael@505: %define V_src 3.0 michael@505: %define V_texmf 3.0 michael@505: %define V_xmltex 20020625 michael@505: %define V_passivetex 20031022 michael@505: michael@505: # package information michael@505: Name: tetex michael@505: Summary: The TeX Typesetting System michael@505: URL: http://tug.org/teTeX/ michael@505: Vendor: Thomas Esser et al. michael@505: Packager: OpenPKG Foundation e.V. michael@505: Distribution: OpenPKG Community michael@505: Class: BASE michael@505: Group: Typesetting michael@505: License: GPL michael@505: Version: %{V_src} michael@506: Release: 20120800 michael@505: michael@505: # list of sources michael@505: Source0: ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/%{V_base}/distrib/tetex-src-%{V_src}.tar.gz michael@505: Source1: ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/%{V_base}/distrib/tetex-texmf-%{V_texmf}.tar.gz michael@505: Source2: http://download.openpkg.org/components/versioned/tetex/passivetex-%{V_passivetex}.zip michael@505: Source3: http://download.openpkg.org/components/versioned/tetex/base-%{V_xmltex}.zip michael@505: Patch0: tetex.patch michael@505: michael@505: # build information michael@505: BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes, infozip, flex, bison michael@505: PreReq: OpenPKG, openpkg >= 20100101, perl michael@505: BuildPreReq: png, zlib michael@505: PreReq: png, zlib michael@505: michael@505: %description michael@505: teTeX is a complete TeX distribution for Unix compatible systems, michael@505: maintained by Thomas Esser. It is based on Karl Berry's original michael@505: Web2c distribution. TeX was invented by Donald E. Knuth, and the michael@505: most popular TeX macro set (LaTeX) for TeX was invented by Leslie michael@505: Lamport. The OpenPKG teTeX package also contains David Carlisle' michael@505: xmltex (namespace-aware XML parser written in TeX) and Sebastian michael@505: Rahtz' PassiveTeX (XSL-FO rendering engine). michael@505: michael@505: %track michael@505: prog tetex:tetex-src = { michael@505: version = %{V_src} michael@505: url = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/ michael@505: regex = ((\d+\.)+\d+) michael@505: url = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/__NEWVER__/distrib/ michael@505: regex = tetex-src-(__VER__)\.tar\.gz michael@505: } michael@505: prog tetex:tetex-texmf = { michael@505: version = %{V_texmf} michael@505: url = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/ michael@505: regex = ((\d+\.)+\d+) michael@505: url = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/__NEWVER__/distrib/ michael@505: regex = tetex-texmf-(__VER__)\.tar\.gz michael@505: } michael@505: michael@505: %prep michael@505: %setup -q -n tetex-src-%{V_src} michael@505: %patch -p0 michael@505: michael@505: # teTeX requires the texmf stuff to be already in place michael@505: # for building and installing the source parts. michael@505: %{l_shtool} mkdir -f -p -m 755 \ michael@505: $RPM_BUILD_ROOT%{l_prefix}/share/texmf michael@505: %{l_gzip} -d -c %{SOURCE tetex-texmf-%{V_texmf}.tar.gz} |\ michael@505: ( umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf - ) || exit $? michael@505: michael@505: # add XMLTeX (XML parsing via TeX) michael@505: ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex michael@505: %{l_prefix}/bin/unzip -q -x %{SOURCE base-%{V_xmltex}.zip} michael@505: mv base xmltex michael@505: ) || exit $? michael@505: ( echo "" michael@505: echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]" michael@505: echo "xmltex latex language.dat xmltex.ini" michael@505: echo "pdfxmltex pdflatex language.dat pdfxmltex.ini" michael@505: echo "" michael@505: ) >>texk/web2c/fmtutil.in michael@505: ( echo "" michael@505: echo "% XMLTeX (XML parsing via TeX)" michael@505: echo "main_memory.xmltex = 2500000" michael@505: echo "main_memory.pdfxmltex = 2500000" michael@505: echo "param_size.xmltex = 1500" michael@505: echo "param_size.pdfxmltex = 1500" michael@505: echo "stack_size.xmltex = 1500" michael@505: echo "stack_size.pdfxmltex = 1500" michael@505: echo "hash_extra.xmltex = 50000" michael@505: echo "hash_extra.pdfxmltex = 50000" michael@505: echo "string_vacancies.xmltex = 45000" michael@505: echo "string_vacancies.pdfxmltex = 45000" michael@505: echo "pool_free.xmltex = 47500" michael@505: echo "pool_free.pdfxmltex = 47500" michael@505: echo "nest_size.xmltex = 500" michael@505: echo "nest_size.pdfxmltex = 500" michael@505: echo "save_size.xmltex = 10000" michael@505: echo "save_size.pdfxmltex = 10000" michael@505: echo "pool_size.xmltex = 500000" michael@505: echo "pool_size.pdfxmltex = 500000" michael@505: echo "max_strings.xmltex = 55000" michael@505: echo "max_strings.pdfxmltex = 55000" michael@505: echo "buf_size.xmltex = 200000" michael@505: echo "buf_size.pdfxmltex = 200000" michael@505: echo "" michael@505: ) >>texk/kpathsea/texmf.in michael@505: michael@505: # add PassiveTeX (XSL-FO to DVI/PDF translation via TeX) michael@505: ( %{l_shtool} mkdir -f -p -m 755 \ michael@505: $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex michael@505: cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex michael@505: %{l_prefix}/bin/unzip -q -x %{SOURCE passivetex-%{V_passivetex}.zip} michael@505: rm -f ChangeLog Makefile README.passivetex send michael@505: rm -rf test michael@505: ) || exit $? michael@505: michael@505: # minor fixes to the teTeX sources michael@505: %{l_shtool} subst \ michael@505: -e '1s;/usr/bin/perl;/usr/bin/env perl;' \ michael@505: texk/*/t1mapper michael@505: %{l_shtool} subst \ michael@505: -e "s;\(\$(scriptdir)/fmtutil-sys --all\);\1 --fmtdir $RPM_BUILD_ROOT%{l_prefix}/share/texmf/web2c;" \ michael@505: -e "s,\(\$(scriptdir)/updmap-sys\);,\1 --dvipsoutputdir $RPM_BUILD_ROOT%{l_prefix}/share/texmf/fonts/map/dvips/updmap --pdftexoutputdir $RPM_BUILD_ROOT%{l_prefix}/share/texmf/fonts/map/dvips/updmap --dvipdfmoutputdir $RPM_BUILD_ROOT%{l_prefix}/share/texmf/fonts/map/dvips/updmap;," \ michael@505: Makefile.in michael@505: michael@505: %build michael@505: # configure the system by using the (wrong) paths to the temporary michael@505: # installation area, followed by by a step for fixing the paths michael@505: # (to the correct values) inside the kpathsea library (which michael@593: # performs the runtime searches). This way we get all the magic michael@505: # of the teTeX build system without problems, but still make sure michael@593: # that the builtin paths are correct. michael@505: %{l_shtool} subst -s -v \ michael@505: -e 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \ michael@505: texk/make/paths.mk michael@505: CC="%{l_cc}" \ michael@505: CXX="%{l_cxx}" \ michael@505: CFLAGS="%{l_cflags -O}" \ michael@505: CXXFLAGS="%{l_cxxflags -O}" \ michael@505: CPPFLAGS="%{l_cppflags}" \ michael@505: LEX="%{l_prefix}/bin/flex" \ michael@505: ./configure \ michael@505: --prefix=$RPM_BUILD_ROOT%{l_prefix} \ michael@505: --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \ michael@505: --without-xdvik \ michael@505: --without-oxdvik \ michael@505: --without-x \ michael@505: --without-x11 \ michael@505: --without-x11win \ michael@505: --without-texinfo \ michael@505: --disable-multiplatform \ michael@505: --enable-gf \ michael@505: --with-system-pnglib \ michael@505: --with-pnglib-libdir=%{l_prefix}/lib \ michael@505: --with-pnglib-include=%{l_prefix}/include \ michael@505: --with-system-zlib \ michael@505: --with-zlib-libdir=%{l_prefix}/lib \ michael@505: --with-zlib-include=%{l_prefix}/include michael@505: ( cd texk/kpathsea michael@505: %{l_shtool} subst -v \ michael@505: -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \ michael@505: `find . -type f -print` michael@515: eval "make all" michael@505: ) || exit $? michael@505: michael@505: # build the sources michael@505: # (we cannot use %{l_make}, because teTeX dislikes absolute paths michael@593: # for make. Instead we work around via $PATH. The redundant michael@593: # "eval" around the call is just to shut up speclint) michael@515: eval "make all" michael@505: michael@505: %install michael@505: # reinstall teTeX texmf stuff michael@505: # (because RPM 5 implicitly removes $RPM_BUILD_ROOT at begin of %install) michael@505: %{l_shtool} mkdir -f -p -m 755 \ michael@505: $RPM_BUILD_ROOT%{l_prefix}/share/texmf michael@505: %{l_gzip} -d -c %{SOURCE tetex-texmf-%{V_texmf}.tar.gz} |\ michael@505: ( umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf - ) || exit $? michael@505: michael@505: # perform the standard installation procdure of teTeX michael@505: # (we cannot use %{l_make}, because teTeX dislikes absolute paths michael@593: # for make. Instead we work around via $PATH. The redundant michael@593: # "eval" around the call is just to shut up speclint) michael@505: eval "make install" michael@505: michael@505: # create dynamically generated font directory michael@505: %{l_shtool} mkdir -f -p -m 755 \ michael@505: $RPM_BUILD_ROOT%{l_prefix}/var/tetex michael@505: %{l_shtool} mkdir -f -p -m 777 \ michael@505: $RPM_BUILD_ROOT%{l_prefix}/var/tetex/fonts michael@505: michael@505: # cleanup the installation michael@505: rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir michael@505: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@505: michael@505: # determine installation files michael@505: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ michael@505: %{l_files_std} \ michael@505: '%config %{l_prefix}/share/texmf/dvipdfm/config/config' \ michael@505: '%config %{l_prefix}/share/texmf/dvips/config/config.ps' \ michael@505: '%config %{l_prefix}/share/texmf/metafont/misc/modes.mf' \ michael@505: '%config %{l_prefix}/share/texmf/web2c/mktex.cnf' michael@505: michael@505: %files -f files michael@505: michael@505: %clean michael@505: