tetex/tetex.spec

Fri, 10 Aug 2012 14:15:27 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 10 Aug 2012 14:15:27 +0200
changeset 506
ed99728b62ad
parent 505
0838649dd325
child 515
2f4b17c140a1
permissions
-rw-r--r--

Correct strange redefinitions of getline(3) error and use parallel make. The
redefinition patch code solves "error: conflicting types for 'getline'."

     1 ##
     2 ##  tetex.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##
     5 ##  Permission to use, copy, modify, and distribute this software for
     6 ##  any purpose with or without fee is hereby granted, provided that
     7 ##  the above copyright notice and this permission notice appear in all
     8 ##  copies.
     9 ##
    10 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    11 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    12 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    13 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    14 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    15 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    16 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    17 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    18 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    19 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    20 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    21 ##  SUCH DAMAGE.
    22 ##
    24 #   package versions
    25 %define       V_base       3.0
    26 %define       V_src        3.0
    27 %define       V_texmf      3.0
    28 %define       V_xmltex     20020625
    29 %define       V_passivetex 20031022
    31 #   package information
    32 Name:         tetex
    33 Summary:      The TeX Typesetting System
    34 URL:          http://tug.org/teTeX/
    35 Vendor:       Thomas Esser et al.
    36 Packager:     OpenPKG Foundation e.V.
    37 Distribution: OpenPKG Community
    38 Class:        BASE
    39 Group:        Typesetting
    40 License:      GPL
    41 Version:      %{V_src}
    42 Release:      20120800
    44 #   list of sources
    45 Source0:      ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/%{V_base}/distrib/tetex-src-%{V_src}.tar.gz
    46 Source1:      ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/%{V_base}/distrib/tetex-texmf-%{V_texmf}.tar.gz
    47 Source2:      http://download.openpkg.org/components/versioned/tetex/passivetex-%{V_passivetex}.zip
    48 Source3:      http://download.openpkg.org/components/versioned/tetex/base-%{V_xmltex}.zip
    49 Patch0:       tetex.patch
    51 #   build information
    52 BuildPreReq:  OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes, infozip, flex, bison
    53 PreReq:       OpenPKG, openpkg >= 20100101, perl
    54 BuildPreReq:  png, zlib
    55 PreReq:       png, zlib
    57 %description
    58     teTeX is a complete TeX distribution for Unix compatible systems,
    59     maintained by Thomas Esser. It is based on Karl Berry's original
    60     Web2c distribution. TeX was invented by Donald E. Knuth, and the
    61     most popular TeX macro set (LaTeX) for TeX was invented by Leslie
    62     Lamport. The OpenPKG teTeX package also contains David Carlisle'
    63     xmltex (namespace-aware XML parser written in TeX) and Sebastian
    64     Rahtz' PassiveTeX (XSL-FO rendering engine).
    66 %track
    67     prog tetex:tetex-src = {
    68         version   = %{V_src}
    69         url       = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/
    70         regex     = ((\d+\.)+\d+)
    71         url       = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/__NEWVER__/distrib/
    72         regex     = tetex-src-(__VER__)\.tar\.gz
    73     }
    74     prog tetex:tetex-texmf = {
    75         version   = %{V_texmf}
    76         url       = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/
    77         regex     = ((\d+\.)+\d+)
    78         url       = ftp://tug.ctan.org/tex-archive/systems/unix/teTeX/__NEWVER__/distrib/
    79         regex     = tetex-texmf-(__VER__)\.tar\.gz
    80     }
    82 %prep
    83     %setup -q -n tetex-src-%{V_src}
    84     %patch -p0
    86     #   teTeX requires the texmf stuff to be already in place
    87     #   for building and installing the source parts.
    88     %{l_shtool} mkdir -f -p -m 755 \
    89         $RPM_BUILD_ROOT%{l_prefix}/share/texmf
    90     %{l_gzip} -d -c %{SOURCE tetex-texmf-%{V_texmf}.tar.gz} |\
    91         ( umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf - ) || exit $?
    93     #   add XMLTeX (XML parsing via TeX)
    94     ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex
    95       %{l_prefix}/bin/unzip -q -x %{SOURCE base-%{V_xmltex}.zip}
    96       mv base xmltex
    97     ) || exit $?
    98     ( echo ""
    99       echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]"
   100       echo "xmltex    latex    language.dat xmltex.ini"
   101       echo "pdfxmltex pdflatex language.dat pdfxmltex.ini"
   102       echo ""
   103     ) >>texk/web2c/fmtutil.in
   104     ( echo ""
   105       echo "% XMLTeX (XML parsing via TeX)"
   106       echo "main_memory.xmltex = 2500000"
   107       echo "main_memory.pdfxmltex = 2500000"
   108       echo "param_size.xmltex = 1500"
   109       echo "param_size.pdfxmltex = 1500"
   110       echo "stack_size.xmltex = 1500"
   111       echo "stack_size.pdfxmltex = 1500"
   112       echo "hash_extra.xmltex = 50000"
   113       echo "hash_extra.pdfxmltex = 50000"
   114       echo "string_vacancies.xmltex = 45000"
   115       echo "string_vacancies.pdfxmltex = 45000"
   116       echo "pool_free.xmltex = 47500"
   117       echo "pool_free.pdfxmltex = 47500"
   118       echo "nest_size.xmltex = 500"
   119       echo "nest_size.pdfxmltex = 500"
   120       echo "save_size.xmltex = 10000"
   121       echo "save_size.pdfxmltex = 10000"
   122       echo "pool_size.xmltex = 500000"
   123       echo "pool_size.pdfxmltex = 500000"
   124       echo "max_strings.xmltex = 55000"
   125       echo "max_strings.pdfxmltex = 55000"
   126       echo "buf_size.xmltex = 200000"
   127       echo "buf_size.pdfxmltex = 200000"
   128       echo ""
   129     ) >>texk/kpathsea/texmf.in
   131     #   add PassiveTeX (XSL-FO to DVI/PDF translation via TeX)
   132     ( %{l_shtool} mkdir -f -p -m 755 \
   133          $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
   134       cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
   135       %{l_prefix}/bin/unzip -q -x %{SOURCE passivetex-%{V_passivetex}.zip}
   136       rm -f ChangeLog Makefile README.passivetex send
   137       rm -rf test
   138     ) || exit $?
   140     #   minor fixes to the teTeX sources
   141     %{l_shtool} subst \
   142         -e '1s;/usr/bin/perl;/usr/bin/env perl;' \
   143         texk/*/t1mapper
   144     %{l_shtool} subst \
   145         -e "s;\(\$(scriptdir)/fmtutil-sys --all\);\1 --fmtdir $RPM_BUILD_ROOT%{l_prefix}/share/texmf/web2c;" \
   146         -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;," \
   147         Makefile.in
   149 %build
   150     smpcpu=`echo %{l_mflags -O} | %{l_shtool} subst -e 's;.*\(\-j[1-9][0-9]*\).*;\1'`
   151     #   configure the system by using the (wrong) paths to the temporary
   152     #   installation area, followed by by a step for fixing the paths
   153     #   (to the correct values) inside the kpathsea library (which
   154     #   performs the run-time searches). This way we get all the magic
   155     #   of the teTeX build system without problems, but still make sure
   156     #   that the built-in paths are correct.
   157     %{l_shtool} subst -s -v \
   158         -e 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \
   159         texk/make/paths.mk
   160     CC="%{l_cc}" \
   161     CXX="%{l_cxx}" \
   162     CFLAGS="%{l_cflags -O}" \
   163     CXXFLAGS="%{l_cxxflags -O}" \
   164     CPPFLAGS="%{l_cppflags}" \
   165     LEX="%{l_prefix}/bin/flex" \
   166     ./configure \
   167         --prefix=$RPM_BUILD_ROOT%{l_prefix} \
   168         --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \
   169         --without-xdvik \
   170         --without-oxdvik \
   171         --without-x \
   172         --without-x11 \
   173         --without-x11win \
   174         --without-texinfo \
   175         --disable-multiplatform \
   176         --enable-gf \
   177         --with-system-pnglib \
   178         --with-pnglib-libdir=%{l_prefix}/lib \
   179         --with-pnglib-include=%{l_prefix}/include \
   180         --with-system-zlib \
   181         --with-zlib-libdir=%{l_prefix}/lib \
   182         --with-zlib-include=%{l_prefix}/include
   183     ( cd texk/kpathsea
   184       %{l_shtool} subst -v \
   185           -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \
   186           `find . -type f -print`
   187       eval "make $smpcpu all"
   188     ) || exit $?
   190     #   build the sources
   191     #   (we cannot use %{l_make}, because teTeX dislikes absolute paths
   192     #   for make. Instead we work-around via $PATH. The redundant
   193     #   "eval" around the call is just to shut-up speclint)
   194     eval "make $smpcpu all"
   196 %install
   197     #   reinstall teTeX texmf stuff
   198     #   (because RPM 5 implicitly removes $RPM_BUILD_ROOT at begin of %install)
   199     %{l_shtool} mkdir -f -p -m 755 \
   200         $RPM_BUILD_ROOT%{l_prefix}/share/texmf
   201     %{l_gzip} -d -c %{SOURCE tetex-texmf-%{V_texmf}.tar.gz} |\
   202         ( umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf - ) || exit $?
   204     #   perform the standard installation procdure of teTeX
   205     #   (we cannot use %{l_make}, because teTeX dislikes absolute paths
   206     #   for make. Instead we work-around via $PATH. The redundant
   207     #   "eval" around the call is just to shut-up speclint)
   208     eval "make install"
   210     #   create dynamically generated font directory
   211     %{l_shtool} mkdir -f -p -m 755 \
   212         $RPM_BUILD_ROOT%{l_prefix}/var/tetex
   213     %{l_shtool} mkdir -f -p -m 777 \
   214         $RPM_BUILD_ROOT%{l_prefix}/var/tetex/fonts
   216     #   cleanup the installation
   217     rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
   218     strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   220     #   determine installation files
   221     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   222         %{l_files_std} \
   223         '%config %{l_prefix}/share/texmf/dvipdfm/config/config' \
   224         '%config %{l_prefix}/share/texmf/dvips/config/config.ps' \
   225         '%config %{l_prefix}/share/texmf/metafont/misc/modes.mf' \
   226         '%config %{l_prefix}/share/texmf/web2c/mktex.cnf'
   228 %files -f files
   230 %clean

mercurial