tetex.spec 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. ##
  2. ## tetex.spec -- Portable RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package versions
  26. %define V_base 1.0
  27. %define V_src 1.0.7
  28. %define V_texmf 1.0.2
  29. # package information
  30. Name: tetex
  31. Summary: The TeX Typesetting System
  32. URL: http://www.tug.org/teTeX/
  33. Vendor: Thomas Esser et al.
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [BASE]
  36. Group: Text
  37. License: GPL
  38. Version: %{V_src}
  39. Release: 20030113
  40. # package options
  41. %option with_x11 %{l_test -p x11}
  42. # list of sources
  43. Source0: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-src-%{V_src}.tar.gz
  44. Source1: ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/1.0/distrib/sources/teTeX-texmf-%{V_texmf}.tar.gz
  45. Source2: http://www.tei-c.org.uk/Software/passivetex/passivetex.zip
  46. Source3: ftp://ftp.tex.ac.uk/tex-archive/macros/xmltex/base.zip
  47. Patch0: tetex.patch
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20030103, make, infozip, flex, bison
  52. PreReq: OpenPKG, openpkg >= 20030103
  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. %patch -p0
  70. # teTeX requires the texmf stuff to be already in place
  71. # for building and installing the source parts.
  72. rm -rf $RPM_BUILD_ROOT
  73. %{l_shtool} mkdir -f -p -m 755 \
  74. $RPM_BUILD_ROOT%{l_prefix}/share/texmf
  75. %{l_gzip} -d -c %{SOURCE teTeX-texmf-%{V_texmf}.tar.gz} |\
  76. (umask 0 && cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf && %{l_tar} xf -)
  77. # add XMLTeX (XML parsing via TeX)
  78. ( cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex
  79. %{l_prefix}/bin/unzip -x %{SOURCE base.zip}
  80. mv base xmltex
  81. )
  82. ( echo ""
  83. echo "# XMLTeX (XML parsing via TeX) [does not work as expected here]"
  84. echo "# xmltex latex language.dat xmltex.ini"
  85. echo "# pdfxmltex pdflatex language.dat pdfxmltex.ini"
  86. echo ""
  87. ) >>texk/web2c/fmtutil.in
  88. ( echo ""
  89. echo "% XMLTeX (XML parsing via TeX)"
  90. echo "main_memory.xmltex = 2500000"
  91. echo "main_memory.pdfxmltex = 2500000"
  92. echo "param_size.xmltex = 1500"
  93. echo "param_size.pdfxmltex = 1500"
  94. echo "stack_size.xmltex = 1500"
  95. echo "stack_size.pdfxmltex = 1500"
  96. echo "hash_extra.xmltex = 50000"
  97. echo "hash_extra.pdfxmltex = 50000"
  98. echo "string_vacancies.xmltex = 45000"
  99. echo "string_vacancies.pdfxmltex = 45000"
  100. echo "pool_free.xmltex = 47500"
  101. echo "pool_free.pdfxmltex = 47500"
  102. echo "nest_size.xmltex = 500"
  103. echo "nest_size.pdfxmltex = 500"
  104. echo "save_size.xmltex = 10000"
  105. echo "save_size.pdfxmltex = 10000"
  106. echo "pool_size.xmltex = 500000"
  107. echo "pool_size.pdfxmltex = 500000"
  108. echo "max_strings.xmltex = 55000"
  109. echo "max_strings.pdfxmltex = 55000"
  110. echo "buf_size.xmltex = 200000"
  111. echo "buf_size.pdfxmltex = 200000"
  112. echo ""
  113. ) >>texk/kpathsea/texmf.in
  114. # add PassiveTeX (XML-FO to DVI/PDF translation via TeX)
  115. ( %{l_shtool} mkdir -f -p -m 755 \
  116. $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  117. cd $RPM_BUILD_ROOT%{l_prefix}/share/texmf/tex/latex/passivetex
  118. %{l_prefix}/bin/unzip -x %{SOURCE passivetex.zip}
  119. rm -f ChangeLog Makefile README.passivetex send
  120. rm -rf test
  121. )
  122. # minor fixes to the teTeX sources
  123. %{l_shtool} subst -e "s;\|O_SYNC;;g" libs/libwww/HTMemLog.c
  124. %{l_shtool} subst -e "s;strnstr;my_strnstr;g" libs/libwww/HTReader.c
  125. %build
  126. # configure the system by using the (wrong) paths to the temporary
  127. # installation area, followed by by a step for fixing the paths
  128. # (to the correct values) inside the kpathsea library (which
  129. # performs the run-time searches). This way we get all the magic
  130. # of the teTeX build system without problems, but still make sure
  131. # that the built-in paths are correct.
  132. %{l_shtool} subst -s -v \
  133. -e 's;^vartexfonts =.*;vartexfonts = %{l_prefix}/var/tetex/fonts;' \
  134. texk/make/paths.mk
  135. CC="%{l_cc}" \
  136. CXX="%{l_cxx}" \
  137. CFLAGS="%{l_cflags -O}" \
  138. CXXFLAGS="%{l_cxxflags -O}" \
  139. ./configure \
  140. --prefix=$RPM_BUILD_ROOT%{l_prefix} \
  141. --datadir=$RPM_BUILD_ROOT%{l_prefix}/share \
  142. %if "%{with_x11}" == "yes"
  143. --with-xdvik \
  144. --with-oxdvik \
  145. --with-x \
  146. --with-x11 \
  147. --with-x11win \
  148. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  149. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  150. %else
  151. --without-xdvik \
  152. --without-oxdvik \
  153. --without-x \
  154. --without-x11 \
  155. --without-x11win \
  156. %endif
  157. --disable-multiplatform \
  158. --enable-gf
  159. ( cd texk/kpathsea
  160. %{l_shtool} subst -v \
  161. -e "s;$RPM_BUILD_ROOT%{l_prefix};%{l_prefix};" \
  162. `find . -type f -print`
  163. make %{l_mflags} all
  164. )
  165. # build the sources
  166. # (we cannot use %{l_make}, because teTeX dislikes absolute
  167. # paths for make. Instead we work-around via $PATH)
  168. make %{l_mflags} all
  169. %install
  170. # perform the standard installation procdure of teTeX
  171. # (we cannot use %{l_make}, because teTeX dislikes absolute
  172. # paths for make. Instead we work-around via $PATH)
  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