tetex.spec 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. ##
  2. ## tetex.spec -- Portable RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless ECRC GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. %define V_base 1.0
  25. %define V_src 1.0.7
  26. %define V_texmf 1.0.2
  27. # package information
  28. Name: tetex
  29. Summary: The TeX Typesetting System
  30. URL: http://www.tug.org/teTeX/
  31. Vendor: Thomas Esser et al.
  32. Packager: The OpenPKG Project
  33. Distribution: OpenPKG [EXP]
  34. Group: Text
  35. License: GPL
  36. Version: %{V_src}
  37. Release: 2
  38. # list of sources
  39. Source0: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-src-%{V_src}.tar.gz
  40. Source1: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-texmf-%{V_texmf}.tar.gz
  41. Source2: http://users.ox.ac.uk/~rahtz/passivetex/passivetex.zip
  42. Source3: ftp://ftp.tex.ac.uk/tex-archive/macros/xmltex/base.zip
  43. # build information
  44. Prefix: %{l_prefix}
  45. BuildRoot: %{l_buildroot}
  46. BuildPreReq: OpenPKG, openpkg >= 0.9-33, make, gzip, infozip
  47. PreReq: OpenPKG, openpkg >= 0.9-33
  48. AutoReq: no
  49. AutoReqProv: no
  50. %description
  51. teTeX is a complete TeX distribution for Unix compatible systems,
  52. maintained by Thomas Esser. It is based on Karl Berry's original
  53. Web2c distribution. TeX was invented by Donald E. Knuth, and the
  54. most popular TeX macro set (LaTeX) for TeX was invented by Leslie
  55. Lamport. The OpenPKG teTeX package also contains David Carlisle'
  56. xmltex (namespace-aware XML parser written in TeX) and Sebastian
  57. Rahtz' PassiveTeX (XML-FO rendering engine).
  58. %prep
  59. %setup -q -n teTeX-%{V_base}
  60. # teTeX requires the texmf stuff to be already in place
  61. # for building and installing the source parts.
  62. rm -rf $RPM_BUILD_ROOT
  63. %{l_shtool} mkdir -f -p -m 755 \
  64. $RPM_BUILD_ROOT%{l_prefix}/share/texmf
  65. %{l_gzip} -d -c %{SOURCE teTeX-texmf-%{V_texmf}.tar.gz} |\
  66. (umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf -)
  67. # add XMLTeX (XML parsing via TeX)
  68. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex
  69. %{l_prefix}/bin/unzip -x %{SOURCE base.zip}
  70. mv base xmltex
  71. )
  72. ( echo ""
  73. echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]"
  74. echo "# xmltex latex language.dat xmltex.ini"
  75. echo "# pdfxmltex pdflatex language.dat pdfxmltex.ini"
  76. echo ""
  77. ) >>texk/web2c/fmtutil.in
  78. ( echo ""
  79. echo "% XMLTeX (XML parsing via TeX)"
  80. echo "main_memory.xmltex = 2500000"
  81. echo "main_memory.pdfxmltex = 2500000"
  82. echo "param_size.xmltex = 1500"
  83. echo "param_size.pdfxmltex = 1500"
  84. echo "stack_size.xmltex = 1500"
  85. echo "stack_size.pdfxmltex = 1500"
  86. echo "hash_extra.xmltex = 50000"
  87. echo "hash_extra.pdfxmltex = 50000"
  88. echo "string_vacancies.xmltex = 45000"
  89. echo "string_vacancies.pdfxmltex = 45000"
  90. echo "pool_free.xmltex = 47500"
  91. echo "pool_free.pdfxmltex = 47500"
  92. echo "nest_size.xmltex = 500"
  93. echo "nest_size.pdfxmltex = 500"
  94. echo "save_size.xmltex = 10000"
  95. echo "save_size.pdfxmltex = 10000"
  96. echo "pool_size.xmltex = 500000"
  97. echo "pool_size.pdfxmltex = 500000"
  98. echo "max_strings.xmltex = 55000"
  99. echo "max_strings.pdfxmltex = 55000"
  100. echo "buf_size.xmltex = 200000"
  101. echo "buf_size.pdfxmltex = 200000"
  102. echo ""
  103. ) >>texk/kpathsea/texmf.in
  104. # add PassiveTeX (XML-FO to DVI/PDF translation via TeX)
  105. ( %{l_shtool} mkdir -f -p -m 755 \
  106. $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  107. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  108. %{l_prefix}/bin/unzip -x %{SOURCE passivetex.zip}
  109. rm -f ChangeLog Makefile README.passivetex send
  110. rm -rf test
  111. )
  112. # minor fixes to the teTeX sources
  113. %{l_rpmtool} subst "s;\|O_SYNC;;g" -- libs/libwww/HTMemLog.c
  114. %build
  115. # we cannot use %{l_make}, because teTeX dislikes absolute
  116. # paths for make. Instead we work-around via $PATH.
  117. PATH="%{l_prefix}/bin:$PATH"; export PATH
  118. # configure the system by using the (wrong) paths to the temporary
  119. # installation area, followed by by a step for fixing the paths
  120. # (to the correct values) inside the kpathsea library (which
  121. # performs the run-time searches). This way we get all the magic
  122. # of the teTeX build system without problems, but still make sure
  123. # that the built-in paths are correct.
  124. %{l_rpmtool} subst -s -v \
  125. 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \
  126. -- texk/make/paths.mk
  127. CC="%{l_cc}" \
  128. CXX="%{l_cxx}" \
  129. CFLAGS="%{l_cflags -O}" \
  130. CXXFLAGS="%{l_cflags -O}" \
  131. ./configure \
  132. --prefix=$RPM_BUILD_ROOT%{l_prefix} \
  133. --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \
  134. --disable-multiplatform \
  135. --enable-gf
  136. ( cd texk/kpathsea
  137. %{l_rpmtool} subst -v \
  138. "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \
  139. -- `find . -type f -print`
  140. make %{l_mflags} all
  141. )
  142. # build the sources
  143. make %{l_mflags} all
  144. %install
  145. # again same $PATH trick as above.
  146. PATH="%{l_prefix}/bin:$PATH"; export PATH
  147. # perform the standard installation procdure of teTeX
  148. make %{l_mflags} install
  149. # perform manual steps for installing XMLTeX
  150. ( TEXMFMAIN="$RPM_BUILD_ROOT%{l_prefix}/share/texmf"
  151. export TEXMFMAIN
  152. PATH="$RPM_BUILD_ROOT%{l_prefix}/bin:$PATH"
  153. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/web2c
  154. $RPM_BUILD_ROOT%{l_prefix}/bin/tex -ini "&latex" xmltex.ini
  155. $RPM_BUILD_ROOT%{l_prefix}/bin/pdftex -ini "&pdflatex" pdfxmltex.ini
  156. $RPM_BUILD_ROOT%{l_prefix}/bin/mktexlsr
  157. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  158. ln -s tex xmltex
  159. ln -s pdftex pdfxmltex
  160. )
  161. )
  162. # create dynamically generated font directory
  163. %{l_shtool} mkdir -f -p -m 777 \
  164. $RPM_BUILD_ROOT%{l_prefix}/var/tetex/fonts
  165. # adjust paths in manual pages
  166. %{l_rpmtool} subst -s -v \
  167. "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};g" \
  168. -- $RPM_BUILD_ROOT%{l_prefix}/man/man1/*.1
  169. # cleanup the installation
  170. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  171. # determine installation files
  172. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  173. %files -f files
  174. %clean
  175. rm -rf $RPM_BUILD_ROOT