tetex.spec 8.2 KB

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