tetex.spec 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. %define with_x11 no
  28. # package information
  29. Name: tetex
  30. Summary: The TeX Typesetting System
  31. URL: http://www.tug.org/teTeX/
  32. Vendor: Thomas Esser et al.
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG [REL]
  35. Group: Text
  36. License: GPL
  37. Version: %{V_src}
  38. Release: 20011201
  39. # list of sources
  40. Source0: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-src-%{V_src}.tar.gz
  41. Source1: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-texmf-%{V_texmf}.tar.gz
  42. Source2: http://users.ox.ac.uk/~rahtz/passivetex/passivetex.zip
  43. Source3: ftp://ftp.tex.ac.uk/tex-archive/macros/xmltex/base.zip
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20011126.0, make, gzip, infozip, flex, bison
  48. PreReq: OpenPKG, openpkg >= 20011126.0
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. teTeX is a complete TeX distribution for Unix compatible systems,
  53. maintained by Thomas Esser. It is based on Karl Berry's original
  54. Web2c distribution. TeX was invented by Donald E. Knuth, and the
  55. most popular TeX macro set (LaTeX) for TeX was invented by Leslie
  56. Lamport. The OpenPKG teTeX package also contains David Carlisle'
  57. xmltex (namespace-aware XML parser written in TeX) and Sebastian
  58. Rahtz' PassiveTeX (XML-FO rendering engine).
  59. %prep
  60. %setup -q -n teTeX-%{V_base}
  61. # teTeX requires the texmf stuff to be already in place
  62. # for building and installing the source parts.
  63. rm -rf $RPM_BUILD_ROOT
  64. %{l_shtool} mkdir -f -p -m 755 \
  65. $RPM_BUILD_ROOT%{l_prefix}/share/texmf
  66. %{l_gzip} -d -c %{SOURCE teTeX-texmf-%{V_texmf}.tar.gz} |\
  67. (umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf -)
  68. # add XMLTeX (XML parsing via TeX)
  69. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex
  70. %{l_prefix}/bin/unzip -x %{SOURCE base.zip}
  71. mv base xmltex
  72. )
  73. ( echo ""
  74. echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]"
  75. echo "# xmltex latex language.dat xmltex.ini"
  76. echo "# pdfxmltex pdflatex language.dat pdfxmltex.ini"
  77. echo ""
  78. ) >>texk/web2c/fmtutil.in
  79. ( echo ""
  80. echo "% XMLTeX (XML parsing via TeX)"
  81. echo "main_memory.xmltex = 2500000"
  82. echo "main_memory.pdfxmltex = 2500000"
  83. echo "param_size.xmltex = 1500"
  84. echo "param_size.pdfxmltex = 1500"
  85. echo "stack_size.xmltex = 1500"
  86. echo "stack_size.pdfxmltex = 1500"
  87. echo "hash_extra.xmltex = 50000"
  88. echo "hash_extra.pdfxmltex = 50000"
  89. echo "string_vacancies.xmltex = 45000"
  90. echo "string_vacancies.pdfxmltex = 45000"
  91. echo "pool_free.xmltex = 47500"
  92. echo "pool_free.pdfxmltex = 47500"
  93. echo "nest_size.xmltex = 500"
  94. echo "nest_size.pdfxmltex = 500"
  95. echo "save_size.xmltex = 10000"
  96. echo "save_size.pdfxmltex = 10000"
  97. echo "pool_size.xmltex = 500000"
  98. echo "pool_size.pdfxmltex = 500000"
  99. echo "max_strings.xmltex = 55000"
  100. echo "max_strings.pdfxmltex = 55000"
  101. echo "buf_size.xmltex = 200000"
  102. echo "buf_size.pdfxmltex = 200000"
  103. echo ""
  104. ) >>texk/kpathsea/texmf.in
  105. # add PassiveTeX (XML-FO to DVI/PDF translation via TeX)
  106. ( %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  108. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  109. %{l_prefix}/bin/unzip -x %{SOURCE passivetex.zip}
  110. rm -f ChangeLog Makefile README.passivetex send
  111. rm -rf test
  112. )
  113. # minor fixes to the teTeX sources
  114. %{l_rpmtool} subst "s;\|O_SYNC;;g" -- libs/libwww/HTMemLog.c
  115. %build
  116. # we cannot use %{l_make}, because teTeX dislikes absolute
  117. # paths for make. Instead we work-around via $PATH.
  118. PATH="%{l_prefix}/bin:$PATH"; export PATH
  119. # configure the system by using the (wrong) paths to the temporary
  120. # installation area, followed by by a step for fixing the paths
  121. # (to the correct values) inside the kpathsea library (which
  122. # performs the run-time searches). This way we get all the magic
  123. # of the teTeX build system without problems, but still make sure
  124. # that the built-in paths are correct.
  125. %{l_rpmtool} subst -s -v \
  126. 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \
  127. -- texk/make/paths.mk
  128. CC="%{l_cc}" \
  129. CXX="%{l_cxx}" \
  130. CFLAGS="%{l_cflags -O}" \
  131. CXXFLAGS="%{l_cflags -O}" \
  132. ./configure \
  133. --prefix=$RPM_BUILD_ROOT%{l_prefix} \
  134. --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \
  135. %if "%{with_x11}" == "no"
  136. --without-xdvik \
  137. --without-oxdvik \
  138. --without-x \
  139. --without-x11 \
  140. --without-x11win \
  141. %endif
  142. --disable-multiplatform \
  143. --enable-gf
  144. ( cd texk/kpathsea
  145. %{l_rpmtool} subst -v \
  146. "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \
  147. -- `find . -type f -print`
  148. make %{l_mflags} all
  149. )
  150. # build the sources
  151. make %{l_mflags} all
  152. %install
  153. # again same $PATH trick as above.
  154. PATH="%{l_prefix}/bin:$PATH"; export PATH
  155. # perform the standard installation procdure of teTeX
  156. make %{l_mflags} install
  157. # perform manual steps for installing XMLTeX
  158. ( TEXMFMAIN="$RPM_BUILD_ROOT%{l_prefix}/share/texmf"
  159. export TEXMFMAIN
  160. PATH="$RPM_BUILD_ROOT%{l_prefix}/bin:$PATH"
  161. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/web2c
  162. $RPM_BUILD_ROOT%{l_prefix}/bin/tex -ini "&latex" xmltex.ini
  163. $RPM_BUILD_ROOT%{l_prefix}/bin/pdftex -ini "&pdflatex" pdfxmltex.ini
  164. $RPM_BUILD_ROOT%{l_prefix}/bin/mktexlsr
  165. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  166. ln -s tex xmltex
  167. ln -s pdftex pdfxmltex
  168. )
  169. )
  170. # create dynamically generated font directory
  171. %{l_shtool} mkdir -f -p -m 777 \
  172. $RPM_BUILD_ROOT%{l_prefix}/var/tetex/fonts
  173. # adjust paths in manual pages
  174. %{l_rpmtool} subst -s -v \
  175. "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};g" \
  176. -- $RPM_BUILD_ROOT%{l_prefix}/man/man1/*.1
  177. # cleanup the installation
  178. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  179. # determine installation files
  180. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  181. %files -f files
  182. %clean
  183. rm -rf $RPM_BUILD_ROOT